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

login
register
mail settings
Submitter phabricator
Date March 19, 2019, 11:30 a.m.
Message ID <differential-rev-PHID-DREV-ot27pao7nmcmo5qjlbhf-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39328/
State Superseded
Headers show

Comments

phabricator - March 19, 2019, 11:30 a.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  All the callers are updated to call setdefault of branchcache.entries

REPOSITORY
  rHG Mercurial

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.