Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

hglib: isolate scmutil knowledge to hglib.py until thg 2.1

Changeset 6442338a58b6

Parent c8e1bd3a14ec

by Steve Borho

Changes to 6 files · Browse files at 6442338a58b6 Showing diff from parent c8e1bd3a14ec Diff from another changeset...

 
7
8
9
10
 
11
12
13
 
820
821
822
823
 
824
825
826
 
7
8
9
 
10
11
12
13
 
820
821
822
 
823
824
825
826
@@ -7,7 +7,7 @@
   import os   -from mercurial import ui, scmutil, util, error +from mercurial import ui, util, error    from PyQt4.QtCore import *  from PyQt4.QtGui import * @@ -820,7 +820,7 @@
  self.saveToPath([fn])     def saveGlobal(self): - self.saveToPath(scmutil.user_rcpath()) + self.saveToPath(hglib.user_rcpath())     def saveToPath(self, path):   fn, cfg = qtlib.loadIniFile(path, self)
 
46
47
48
49
50
 
 
51
52
53
 
278
279
280
281
 
282
283
284
 
46
47
48
 
 
49
50
51
52
53
 
278
279
280
 
281
282
283
284
@@ -46,8 +46,8 @@
  'from folder<p>%s</p>' % cwd))   return ('', '')   try: - fname = util.canonpath(self.root, cwd, pats[0]) - target = util.canonpath(self.root, cwd, pats[1]) + fname = hglib.canonpath(self.root, cwd, pats[0]) + target = hglib.canonpath(self.root, cwd, pats[1])   except:   pass   os.chdir(self.root) @@ -278,7 +278,7 @@
    cmdline, vcl = self.compose_command(src, dest)   self.show_command((cmdline, vcl)) - new_name = util.canonpath(self.root, self.root, new_name) + new_name = hglib.canonpath(self.root, self.root, new_name)   if self.isCaseFoldingOnWin():   # We do the rename ourselves if it's a pure casefolding   # action on Windows. Because there is no way to make Hg
 
22
23
24
25
 
26
27
28
 
168
169
170
171
 
172
173
174
 
22
23
24
 
25
26
27
28
 
168
169
170
 
171
172
173
174
@@ -22,7 +22,7 @@
 from PyQt4.QtGui import *    import mercurial.ui as uimod -from mercurial import hg, scmutil, util, fancyopts, cmdutil, extensions, error +from mercurial import hg, util, fancyopts, cmdutil, extensions, error    from tortoisehg.hgqt.i18n import agettext as _  from tortoisehg.util import hglib, paths, shlib, i18n @@ -168,7 +168,7 @@
  files = []   for f in lines:   try: - cpath = scmutil.canonpath(root, cwd, f) + cpath = hglib.canonpath(root, cwd, f)   # canonpath will abort on .hg/ paths   except util.Abort:   continue
 
7
8
9
10
 
11
12
13
 
703
704
705
706
 
707
708
709
 
974
975
976
977
 
978
979
980
 
7
8
9
 
10
11
12
13
 
703
704
705
 
706
707
708
709
 
974
975
976
 
977
978
979
980
@@ -7,7 +7,7 @@
   import os   -from mercurial import ui, scmutil, util, error +from mercurial import ui, util, error    from tortoisehg.util import hglib, settings, paths, wconfig, i18n, bugtraq  from tortoisehg.hgqt.i18n import _ @@ -703,7 +703,7 @@
    self.conftabs = QTabWidget()   layout.addWidget(self.conftabs) - utab = SettingsForm(rcpath=scmutil.user_rcpath(), focus=focus) + utab = SettingsForm(rcpath=hglib.user_rcpath(), focus=focus)   self.conftabs.addTab(utab, qtlib.geticon('settings_user'),   _("%s's global settings") % username())   utab.restartRequested.connect(self._pushRestartRequest) @@ -974,7 +974,7 @@
  w = func(opts)   w.installEventFilter(self)   if e.globalonly: - w.setEnabled(self.rcpath == scmutil.user_rcpath()) + w.setEnabled(self.rcpath == hglib.user_rcpath())   lbl = QLabel(e.label)   lbl.installEventFilter(self)   lbl.setToolTip(e.tooltip)
 
14
15
16
17
 
18
19
20
 
1232
1233
1234
1235
 
1236
1237
1238
 
14
15
16
 
17
18
19
20
 
1232
1233
1234
 
1235
1236
1237
1238
@@ -14,7 +14,7 @@
 from PyQt4.QtCore import *  from PyQt4.QtGui import *   -from mercurial import hg, ui, url, scmutil, util, error, demandimport +from mercurial import hg, ui, url, util, error, demandimport  from mercurial import merge as mergemod    from tortoisehg.util import hglib, wconfig @@ -1232,7 +1232,7 @@
  qtlib.openhelpcontents('sync.html#security')     def accept(self): - path = scmutil.user_rcpath() + path = hglib.user_rcpath()   fn, cfg = qtlib.loadIniFile(path, self)   if not hasattr(cfg, 'write'):   qtlib.WarningMsgBox(_('Unable to save authentication'),
 
12
13
14
15
 
 
 
 
 
 
 
 
 
 
16
17
18
 
321
322
323
324
 
325
326
327
328
329
330
 
331
332
333
 
12
13
14
 
15
16
17
18
19
20
21
22
23
24
25
26
27
 
330
331
332
 
333
334
335
336
337
338
 
339
340
341
342
@@ -12,7 +12,16 @@
   from mercurial import ui, util, extensions, match, bundlerepo, url, cmdutil  from mercurial import dispatch, encoding, templatefilters, filemerge, error -from mercurial import scmutil +from mercurial import demandimport + +demandimport.disable() +try: + # hg >= 1.9 + from mercurial.scmutil import canonpath, user_rcpath +except (ImportError, AttributeError): + # hg <= 1.8 + from mercurial.util import canonpath, user_rcpath +demandimport.enable()    _encoding = encoding.encoding  _encodingmode = encoding.encodingmode @@ -321,13 +330,13 @@
  root = paths.find_root(cwd)   for f in list:   try: - canonpats.append(scmutil.canonpath(root, cwd, f)) + canonpats.append(canonpath(root, cwd, f))   except util.Abort:   # Attempt to resolve case folding conflicts.   fu = f.upper()   cwdu = cwd.upper()   if fu.startswith(cwdu): - canonpats.append(scmutil.canonpath(root, cwd, f[len(cwd+os.sep):])) + canonpats.append(canonpath(root, cwd, f[len(cwd+os.sep):]))   else:   # May already be canonical   canonpats.append(f)