mercurial/scmutil.py
changeset 41650 f8b18583049f
parent 41649 799e156785f7
child 41652 6a447a3d1bd0
--- a/mercurial/scmutil.py	Fri Feb 08 10:32:48 2019 -0800
+++ b/mercurial/scmutil.py	Thu Feb 07 11:15:30 2019 -0800
@@ -11,6 +11,7 @@
 import glob
 import hashlib
 import os
+import posixpath
 import re
 import subprocess
 import weakref
@@ -758,6 +759,10 @@
     else:
         return lambda f: f
 
+def subdiruipathfn(subpath, uipathfn):
+    '''Create a new uipathfn that treats the file as relative to subpath.'''
+    return lambda f: uipathfn(posixpath.join(subpath, f))
+
 def expandpats(pats):
     '''Expand bare globs when running on windows.
     On posix we assume it already has already been done by sh.'''