branchmap: drop branchcache.setdefault() (API)
authorPulkit Goyal <pulkit@yandex-team.ru>
Mon, 18 Mar 2019 19:11:55 +0300
changeset 42003 7546bf46bfcd
parent 42002 662ffdde5adf
child 42004 0bd730fbcc2b
branchmap: drop branchcache.setdefault() (API) All the callers are updated to call setdefault of branchcache.entries Differential Revision: https://phab.mercurial-scm.org/D6153
mercurial/branchmap.py
--- a/mercurial/branchmap.py	Mon Mar 18 19:01:29 2019 +0300
+++ b/mercurial/branchmap.py	Mon Mar 18 19:11:55 2019 +0300
@@ -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.