D6153: branchmap: drop branchcache.setdefault() (API)

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sat Mar 23 11:40:04 EDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7546bf46bfcd: branchmap: drop branchcache.setdefault() (API) (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6153?vs=14554&id=14585

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

AFFECTED FILES
  mercurial/branchmap.py

CHANGE DETAILS

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -172,9 +172,6 @@
     def __getitem__(self, key):
         return self.entries[key]
 
-    def setdefault(self, *args):
-        return self.entries.setdefault(*args)
-
     def iteritems(self):
         return self.entries.iteritems()
 
@@ -229,7 +226,7 @@
             if not cl.hasnode(node):
                 raise ValueError(
                     r'node %s does not exist' % pycompat.sysstr(hex(node)))
-            self.setdefault(label, []).append(node)
+            self.entries.setdefault(label, []).append(node)
             if state == 'c':
                 self._closednodes.add(node)
 
@@ -343,7 +340,7 @@
         # really branchheads. Note checking parents is insufficient:
         # 1 (branch a) -> 2 (branch b) -> 3 (branch a)
         for branch, newheadrevs in newbranches.iteritems():
-            bheads = self.setdefault(branch, [])
+            bheads = self.entries.setdefault(branch, [])
             bheadset = set(cl.rev(node) for node in bheads)
 
             # This have been tested True on all internal usage of this function.



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


More information about the Mercurial-devel mailing list