Patchwork D2923: rebase: pass in "user" instead of "ctx" to conclude[memory]node()

login
register
mail settings
Submitter phabricator
Date March 21, 2018, 11:49 p.m.
Message ID <e778adf1be0e8713ebea1d4b5ab85e5a@localhost.localdomain>
Download mbox | patch
Permalink /patch/29742/
State Not Applicable
Headers show

Comments

phabricator - March 21, 2018, 11:49 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG8ff5772711fa: rebase: pass in &quot;user&quot; instead of &quot;ctx&quot; to conclude[memory]node() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2923?vs=7186&id=7215

REVISION DETAIL
  https://phab.mercurial-scm.org/D2923

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: martinvonz, phillco, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -459,18 +459,20 @@ 
             overrides[('ui', 'allowemptycommit')] = True
         with repo.ui.configoverride(overrides, 'rebase'):
             if self.inmemory:
-                newnode = concludememorynode(repo, ctx, p1, p2,
+                newnode = concludememorynode(repo, p1, p2,
                     wctx=self.wctx,
                     extra=extra,
                     commitmsg=commitmsg,
                     editor=editor,
+                    user=ctx.user(),
                     date=date)
                 mergemod.mergestate.clean(repo)
             else:
-                newnode = concludenode(repo, ctx, p1, p2,
+                newnode = concludenode(repo, p1, p2,
                     extra=extra,
                     commitmsg=commitmsg,
                     editor=editor,
+                    user=ctx.user(),
                     date=date)
 
             if newnode is None:
@@ -1030,9 +1032,9 @@ 
                      (max(destancestors),
                       ', '.join("%d" % p for p in sorted(parents))))
 
-def concludememorynode(repo, ctx, p1, p2, wctx, editor, extra, date, commitmsg):
-    '''Commit the memory changes with parents p1 and p2. Reuse commit info from
-    ctx.
+def concludememorynode(repo, p1, p2, wctx, editor, extra, user, date,
+                       commitmsg):
+    '''Commit the memory changes with parents p1 and p2.
     Return node of committed revision.'''
     # Replicates the empty check in ``repo.commit``.
     if wctx.isempty() and not repo.ui.configbool('ui', 'allowemptycommit'):
@@ -1045,23 +1047,23 @@ 
         branch = extra['branch']
 
     memctx = wctx.tomemctx(commitmsg, parents=(p1, p2), date=date,
-        extra=extra, user=ctx.user(), branch=branch, editor=editor)
+        extra=extra, user=user, branch=branch, editor=editor)
     commitres = repo.commitctx(memctx)
     wctx.clean() # Might be reused
     return commitres
 
-def concludenode(repo, ctx, p1, p2, editor, extra, date, commitmsg):
-    '''Commit the wd changes with parents p1 and p2. Reuse commit info from ctx.
+def concludenode(repo, p1, p2, editor, extra, user, date, commitmsg):
+    '''Commit the wd changes with parents p1 and p2.
     Return node of committed revision.'''
     dsguard = util.nullcontextmanager()
     if not repo.ui.configbool('rebase', 'singletransaction'):
         dsguard = dirstateguard.dirstateguard(repo, 'rebase')
     with dsguard:
         repo.setparents(repo[p1].node(), repo[p2].node())
 
         # Commit might fail if unresolved files exist
-        newnode = repo.commit(text=commitmsg, user=ctx.user(),
-                              date=date, extra=extra, editor=editor)
+        newnode = repo.commit(text=commitmsg, user=user, date=date,
+                              extra=extra, editor=editor)
 
         repo.dirstate.setbranch(repo[newnode].branch())
         return newnode