# HG changeset patch # User Martin von Zweigbergk # Date 1521609070 25200 # Node ID 8ff5772711faf20f449a26fd6be3f4913f5dbafa # Parent 0b1230a5a9586bd9e0eaf3451ae8ceab8ee00228 rebase: pass in "user" instead of "ctx" to conclude[memory]node() This was the only remaining part of the context object that was needed. Differential Revision: https://phab.mercurial-scm.org/D2923 diff -r 0b1230a5a958 -r 8ff5772711fa hgext/rebase.py --- a/hgext/rebase.py Tue Mar 20 21:59:04 2018 -0700 +++ b/hgext/rebase.py Tue Mar 20 22:11:10 2018 -0700 @@ -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,13 +1047,13 @@ 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'): @@ -1060,8 +1062,8 @@ 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