changeset 25303:b7876b8fa063

patch: add 'extra' argument to makememctx The uncommit command in evolve needs to create memory context with given extra parameters. This patch allows us to do that instead of always giving them an empty value and having to override it afterwards.
author Laurent Charignon <lcharignon@fb.com>
date Fri, 22 May 2015 13:06:45 -0700
parents bcb17d7dbec2
children 9bc11716bc86
files mercurial/context.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Wed May 27 17:41:42 2015 -0500
+++ b/mercurial/context.py	Fri May 22 13:06:45 2015 -0700
@@ -340,7 +340,7 @@
 
 
 def makememctx(repo, parents, text, user, date, branch, files, store,
-               editor=None):
+               editor=None, extra=None):
     def getfilectx(repo, memctx, path):
         data, mode, copied = store.getfile(path)
         if data is None:
@@ -348,7 +348,8 @@
         islink, isexec = mode
         return memfilectx(repo, path, data, islink=islink, isexec=isexec,
                                   copied=copied, memctx=memctx)
-    extra = {}
+    if extra is None:
+        extra = {}
     if branch:
         extra['branch'] = encoding.fromlocal(branch)
     ctx =  memctx(repo, parents, text, files, getfilectx, user,