changeset 41656:dadbfcc63b3e

match: delete unused uipath() and _uipathrelative (API) Differential Revision: https://phab.mercurial-scm.org/D5906
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 08 Feb 2019 12:00:44 -0800
parents df59b1078983
children e41449818bee
files mercurial/match.py
diffstat 1 files changed, 4 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/match.py	Fri Feb 08 11:56:39 2019 -0800
+++ b/mercurial/match.py	Fri Feb 08 12:00:44 2019 -0800
@@ -170,7 +170,7 @@
     if patterns:
         kindpats = normalize(patterns, default, root, cwd, auditor, warn)
         if _kindpatsalwaysmatch(kindpats):
-            m = alwaysmatcher(root, cwd, badfn, relativeuipath=True)
+            m = alwaysmatcher(root, cwd, badfn)
         else:
             m = _buildkindpatsmatcher(patternmatcher, root, cwd, kindpats,
                                       ctx=ctx, listsubrepos=listsubrepos,
@@ -252,12 +252,11 @@
 
 class basematcher(object):
 
-    def __init__(self, root, cwd, badfn=None, relativeuipath=True):
+    def __init__(self, root, cwd, badfn=None):
         self._root = root
         self._cwd = cwd
         if badfn is not None:
             self.bad = badfn
-        self._relativeuipath = relativeuipath
 
     def __call__(self, fn):
         return self.matchfn(fn)
@@ -287,12 +286,6 @@
         '''Convert repo path back to path that is relative to cwd of matcher.'''
         return util.pathto(self._root, self._cwd, f)
 
-    def uipath(self, f):
-        '''Convert repo path to a display path.  If patterns or -I/-X were used
-        to create this matcher, the display path will be relative to cwd.
-        Otherwise it is relative to the root of the repo.'''
-        return (self._relativeuipath and self.rel(f)) or self.abs(f)
-
     @propertycache
     def _files(self):
         return []
@@ -393,9 +386,8 @@
 class alwaysmatcher(basematcher):
     '''Matches everything.'''
 
-    def __init__(self, root, cwd, badfn=None, relativeuipath=False):
-        super(alwaysmatcher, self).__init__(root, cwd, badfn,
-                                            relativeuipath=relativeuipath)
+    def __init__(self, root, cwd, badfn=None):
+        super(alwaysmatcher, self).__init__(root, cwd, badfn)
 
     def always(self):
         return True
@@ -725,11 +717,9 @@
         m.traversedir = m1.traversedir
         m.abs = m1.abs
         m.rel = m1.rel
-        m._relativeuipath |= m1._relativeuipath
         return m
     if m2.always():
         m = copy.copy(m1)
-        m._relativeuipath |= m2._relativeuipath
         return m
     return intersectionmatcher(m1, m2)
 
@@ -848,9 +838,6 @@
     def rel(self, f):
         return self._matcher.rel(self._path + "/" + f)
 
-    def uipath(self, f):
-        return self._matcher.uipath(self._path + "/" + f)
-
     def matchfn(self, f):
         # Some information is lost in the superclass's constructor, so we
         # can not accurately create the matching function for the subdirectory