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

login
register
mail settings
Submitter phabricator
Date March 23, 2019, 3:40 p.m.
Message ID <080ad3e955716a0f6502034559c5cf35@localhost.localdomain>
Download mbox | patch
Permalink /patch/39367/
State Not Applicable
Headers show

Comments

phabricator - March 23, 2019, 3:40 p.m.
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




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

Patch

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.