##// END OF EJS Templates
rebase: pass in "user" instead of "ctx" to conclude[memory]node()...
Martin von Zweigbergk -
r37060:8ff57727 default
parent child Browse files
Show More
@@ -459,18 +459,20 b' class rebaseruntime(object):'
459 overrides[('ui', 'allowemptycommit')] = True
459 overrides[('ui', 'allowemptycommit')] = True
460 with repo.ui.configoverride(overrides, 'rebase'):
460 with repo.ui.configoverride(overrides, 'rebase'):
461 if self.inmemory:
461 if self.inmemory:
462 newnode = concludememorynode(repo, ctx, p1, p2,
462 newnode = concludememorynode(repo, p1, p2,
463 wctx=self.wctx,
463 wctx=self.wctx,
464 extra=extra,
464 extra=extra,
465 commitmsg=commitmsg,
465 commitmsg=commitmsg,
466 editor=editor,
466 editor=editor,
467 user=ctx.user(),
467 date=date)
468 date=date)
468 mergemod.mergestate.clean(repo)
469 mergemod.mergestate.clean(repo)
469 else:
470 else:
470 newnode = concludenode(repo, ctx, p1, p2,
471 newnode = concludenode(repo, p1, p2,
471 extra=extra,
472 extra=extra,
472 commitmsg=commitmsg,
473 commitmsg=commitmsg,
473 editor=editor,
474 editor=editor,
475 user=ctx.user(),
474 date=date)
476 date=date)
475
477
476 if newnode is None:
478 if newnode is None:
@@ -1030,9 +1032,9 b' def externalparent(repo, state, destance'
1030 (max(destancestors),
1032 (max(destancestors),
1031 ', '.join("%d" % p for p in sorted(parents))))
1033 ', '.join("%d" % p for p in sorted(parents))))
1032
1034
1033 def concludememorynode(repo, ctx, p1, p2, wctx, editor, extra, date, commitmsg):
1035 def concludememorynode(repo, p1, p2, wctx, editor, extra, user, date,
1034 '''Commit the memory changes with parents p1 and p2. Reuse commit info from
1036 commitmsg):
1035 ctx.
1037 '''Commit the memory changes with parents p1 and p2.
1036 Return node of committed revision.'''
1038 Return node of committed revision.'''
1037 # Replicates the empty check in ``repo.commit``.
1039 # Replicates the empty check in ``repo.commit``.
1038 if wctx.isempty() and not repo.ui.configbool('ui', 'allowemptycommit'):
1040 if wctx.isempty() and not repo.ui.configbool('ui', 'allowemptycommit'):
@@ -1045,13 +1047,13 b' def concludememorynode(repo, ctx, p1, p2'
1045 branch = extra['branch']
1047 branch = extra['branch']
1046
1048
1047 memctx = wctx.tomemctx(commitmsg, parents=(p1, p2), date=date,
1049 memctx = wctx.tomemctx(commitmsg, parents=(p1, p2), date=date,
1048 extra=extra, user=ctx.user(), branch=branch, editor=editor)
1050 extra=extra, user=user, branch=branch, editor=editor)
1049 commitres = repo.commitctx(memctx)
1051 commitres = repo.commitctx(memctx)
1050 wctx.clean() # Might be reused
1052 wctx.clean() # Might be reused
1051 return commitres
1053 return commitres
1052
1054
1053 def concludenode(repo, ctx, p1, p2, editor, extra, date, commitmsg):
1055 def concludenode(repo, p1, p2, editor, extra, user, date, commitmsg):
1054 '''Commit the wd changes with parents p1 and p2. Reuse commit info from ctx.
1056 '''Commit the wd changes with parents p1 and p2.
1055 Return node of committed revision.'''
1057 Return node of committed revision.'''
1056 dsguard = util.nullcontextmanager()
1058 dsguard = util.nullcontextmanager()
1057 if not repo.ui.configbool('rebase', 'singletransaction'):
1059 if not repo.ui.configbool('rebase', 'singletransaction'):
@@ -1060,8 +1062,8 b' def concludenode(repo, ctx, p1, p2, edit'
1060 repo.setparents(repo[p1].node(), repo[p2].node())
1062 repo.setparents(repo[p1].node(), repo[p2].node())
1061
1063
1062 # Commit might fail if unresolved files exist
1064 # Commit might fail if unresolved files exist
1063 newnode = repo.commit(text=commitmsg, user=ctx.user(),
1065 newnode = repo.commit(text=commitmsg, user=user, date=date,
1064 date=date, extra=extra, editor=editor)
1066 extra=extra, editor=editor)
1065
1067
1066 repo.dirstate.setbranch(repo[newnode].branch())
1068 repo.dirstate.setbranch(repo[newnode].branch())
1067 return newnode
1069 return newnode
General Comments 0
You need to be logged in to leave comments. Login now