Patchwork D8069: manifest: remove optional default= argument on flags(path)

login
register
mail settings
Submitter phabricator
Date Feb. 4, 2020, 4:48 a.m.
Message ID <differential-rev-PHID-DREV-v6sbgnxckys4r5trub2i-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44913/
State Superseded
Headers show

Comments

phabricator - Feb. 4, 2020, 4:48 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It had only one caller inside manifest.py, and treemanifest was
  actually incorrectly implemented. treemanifest is still missing the
  fastdelta() method from the interface (and so doesn't yet conform),
  but this is at least progress.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8069

AFFECTED FILES
  mercurial/interfaces/repository.py
  mercurial/manifest.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -460,7 +460,7 @@ 
     __bool__ = __nonzero__
 
     def __setitem__(self, key, node):
-        self._lm[key] = node, self.flags(key, b'')
+        self._lm[key] = node, self.flags(key)
 
     def __contains__(self, key):
         if key is None:
@@ -595,11 +595,11 @@ 
         except KeyError:
             return default
 
-    def flags(self, key, default=b''):
+    def flags(self, key):
         try:
             return self._lm[key][1]
         except KeyError:
-            return default
+            return b''
 
     def copy(self):
         c = manifestdict()
diff --git a/mercurial/interfaces/repository.py b/mercurial/interfaces/repository.py
--- a/mercurial/interfaces/repository.py
+++ b/mercurial/interfaces/repository.py
@@ -1027,8 +1027,8 @@ 
     def get(path, default=None):
         """Obtain the node value for a path or a default value if missing."""
 
-    def flags(path, default=b''):
-        """Return the flags value for a path or a default value if missing."""
+    def flags(path):
+        """Return the flags value for a path (default: empty bytestring)."""
 
     def copy():
         """Return a copy of this manifest."""