Changeset df219753eb05…
Parent 45ac7a754d90…
by
Changes to 3 files · Browse files at df219753eb05 Showing diff from parent 45ac7a754d90 Diff from another changeset...
@@ -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)
|
@@ -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)
|
@@ -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
|
Loading...