committablectx: extra is already normalized by committablectx.__init__
authorSean Farley <sean@farley.io>
Thu, 11 May 2017 13:51:10 -0700
changeset 32609 c0b16b801687
parent 32605 e6ff007e107e
child 32610 bf728e72a219
committablectx: extra is already normalized by committablectx.__init__ Avoid doing the same work again. Based on work done by Mads Kiilerix.
mercurial/context.py
--- a/mercurial/context.py	Thu Jun 01 00:40:52 2017 -0700
+++ b/mercurial/context.py	Thu May 11 13:51:10 2017 -0700
@@ -2079,14 +2079,6 @@
             # memoizing increases performance for e.g. vcs convert scenarios.
             self._filectxfn = makecachingfilectxfn(filectxfn)
 
-        if extra:
-            self._extra = extra.copy()
-        else:
-            self._extra = {}
-
-        if self._extra.get('branch', '') == '':
-            self._extra['branch'] = 'default'
-
         if editor:
             self._text = editor(self._repo, self, [])
             self._repo.savecommitmessage(self._text)
@@ -2299,14 +2291,6 @@
         self._files = originalctx.files()
         self.substate = {}
 
-        if extra:
-            self._extra = extra.copy()
-        else:
-            self._extra = {}
-
-        if self._extra.get('branch', '') == '':
-            self._extra['branch'] = 'default'
-
         if editor:
             self._text = editor(self._repo, self, [])
             self._repo.savecommitmessage(self._text)