Mercurial > public > mercurial-scm > hg
comparison mercurial/scmutil.py @ 41650:f8b18583049f
add: pass around uipathfn and use instead of m.rel() (API)
For now, the uipathfn we pass around always prints relative paths just
like before, so this should have no effect. Well, there's one little
change: I also made the "skipping missing subrepository: %s\n" message
relative.
Differential Revision: https://phab.mercurial-scm.org/D5901
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 07 Feb 2019 11:15:30 -0800 |
parents | 799e156785f7 |
children | 6a447a3d1bd0 |
comparison
equal
deleted
inserted
replaced
41649:799e156785f7 | 41650:f8b18583049f |
---|---|
9 | 9 |
10 import errno | 10 import errno |
11 import glob | 11 import glob |
12 import hashlib | 12 import hashlib |
13 import os | 13 import os |
14 import posixpath | |
14 import re | 15 import re |
15 import subprocess | 16 import subprocess |
16 import weakref | 17 import weakref |
17 | 18 |
18 from .i18n import _ | 19 from .i18n import _ |
756 pathto = repo.pathto | 757 pathto = repo.pathto |
757 return lambda f: pathto(f, cwd) | 758 return lambda f: pathto(f, cwd) |
758 else: | 759 else: |
759 return lambda f: f | 760 return lambda f: f |
760 | 761 |
762 def subdiruipathfn(subpath, uipathfn): | |
763 '''Create a new uipathfn that treats the file as relative to subpath.''' | |
764 return lambda f: uipathfn(posixpath.join(subpath, f)) | |
765 | |
761 def expandpats(pats): | 766 def expandpats(pats): |
762 '''Expand bare globs when running on windows. | 767 '''Expand bare globs when running on windows. |
763 On posix we assume it already has already been done by sh.''' | 768 On posix we assume it already has already been done by sh.''' |
764 if not util.expandglobs: | 769 if not util.expandglobs: |
765 return list(pats) | 770 return list(pats) |