Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8.1, 0.8.2, and 0.8.3

hglib: resolve case folding issues during canonical path finding

Fixes #413

Changeset df219753eb05

Parent 45ac7a754d90

by Steve Borho

Changes to 3 files · Browse files at df219753eb05 Showing diff from parent 45ac7a754d90 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​history.py Stacked
 
831
832
833
834
835
836
837
838
 
 
 
831
832
833
 
 
 
 
 
834
835
@@ -831,8 +831,5 @@
  'date':None, 'only_merges':None, 'prune':[], 'git':False,   'verbose':False, 'include':[], 'exclude':[]   } - root = paths.find_root() - canonpats = [] - for f in pats: - canonpats.append(util.canonpath(root, os.getcwd(), f)) - return GLog(ui, None, None, canonpats, cmdoptions) + pats = hglib.canonpaths(pats) + return GLog(ui, None, None, pats, cmdoptions)
Change 1 of 1 Show Entire File hggtk/​visdiff.py Stacked
 
276
277
278
279
280
281
282
283
 
 
276
277
278
 
 
 
 
 
279
@@ -276,8 +276,4 @@
  return tools    def run(ui, *pats, **opts): - root = paths.find_root() - canonpats = [] - for f in pats: - canonpats.append(util.canonpath(root, os.getcwd(), f)) - return FileSelectionDialog(canonpats, opts) + return FileSelectionDialog(hglib.canonpaths(pats), opts)
Change 1 of 1 Show Entire File thgutil/​hglib.py Stacked
 
148
149
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
152
153
 
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
@@ -148,6 +148,25 @@
  repo.mq = mqclass(mq.ui, mq.basepath, mq.path)     +def canonpaths(list): + 'Get canonical paths (relative to root) for list of files' + canonpats = [] + cwd = os.getcwd() + root = paths.find_root(cwd) + for f in list: + try: + canonpats.append(util.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(util.canonpath(root, cwd, f[len(cwd+os.sep):])) + else: + # May already be canonical + canonpats.append(f) + return canonpats +  def hgcmd_toq(path, q, *args):   '''   Run an hg command in a background thread, pipe all output to a Queue