##// END OF EJS Templates
rebase: pass in "extra" itself into conclude[memory]node()...
Martin von Zweigbergk -
r37054:0ab0d94e default
parent child Browse files
Show More
@@ -457,10 +457,14 b' class rebaseruntime(object):'
457 ctx = repo[rev]
457 ctx = repo[rev]
458 if commitmsg is None:
458 if commitmsg is None:
459 commitmsg = ctx.description()
459 commitmsg = ctx.description()
460 extrafn = _makeextrafn(self.extrafns)
461 extra = {'rebase_source': ctx.hex()}
462 if extrafn:
463 extrafn(ctx, extra)
460 if self.inmemory:
464 if self.inmemory:
461 newnode = concludememorynode(repo, ctx, p1, p2,
465 newnode = concludememorynode(repo, ctx, p1, p2,
462 wctx=self.wctx,
466 wctx=self.wctx,
463 extrafn=_makeextrafn(self.extrafns),
467 extra=extra,
464 commitmsg=commitmsg,
468 commitmsg=commitmsg,
465 editor=editor,
469 editor=editor,
466 keepbranches=self.keepbranchesf,
470 keepbranches=self.keepbranchesf,
@@ -468,7 +472,7 b' class rebaseruntime(object):'
468 mergemod.mergestate.clean(repo)
472 mergemod.mergestate.clean(repo)
469 else:
473 else:
470 newnode = concludenode(repo, ctx, p1, p2,
474 newnode = concludenode(repo, ctx, p1, p2,
471 extrafn=_makeextrafn(self.extrafns),
475 extra=extra,
472 commitmsg=commitmsg,
476 commitmsg=commitmsg,
473 editor=editor,
477 editor=editor,
474 keepbranches=self.keepbranchesf,
478 keepbranches=self.keepbranchesf,
@@ -1031,15 +1035,12 b' def externalparent(repo, state, destance'
1031 (max(destancestors),
1035 (max(destancestors),
1032 ', '.join("%d" % p for p in sorted(parents))))
1036 ', '.join("%d" % p for p in sorted(parents))))
1033
1037
1034 def concludememorynode(repo, ctx, p1, p2, wctx, editor, extrafn, keepbranches,
1038 def concludememorynode(repo, ctx, p1, p2, wctx, editor, extra, keepbranches,
1035 date, commitmsg):
1039 date, commitmsg):
1036 '''Commit the memory changes with parents p1 and p2. Reuse commit info from
1040 '''Commit the memory changes with parents p1 and p2. Reuse commit info from
1037 ctx but also store useful information in extra.
1041 ctx.
1038 Return node of committed revision.'''
1042 Return node of committed revision.'''
1039 keepbranch = keepbranches and repo[p1].branch() != ctx.branch()
1043 keepbranch = keepbranches and repo[p1].branch() != ctx.branch()
1040 extra = {'rebase_source': ctx.hex()}
1041 if extrafn:
1042 extrafn(ctx, extra)
1043
1044
1044 destphase = max(ctx.phase(), phases.draft)
1045 destphase = max(ctx.phase(), phases.draft)
1045 overrides = {('phases', 'new-commit'): destphase}
1046 overrides = {('phases', 'new-commit'): destphase}
@@ -1065,10 +1066,9 b' def concludememorynode(repo, ctx, p1, p2'
1065 wctx.clean() # Might be reused
1066 wctx.clean() # Might be reused
1066 return commitres
1067 return commitres
1067
1068
1068 def concludenode(repo, ctx, p1, p2, editor, extrafn, keepbranches, date,
1069 def concludenode(repo, ctx, p1, p2, editor, extra, keepbranches, date,
1069 commitmsg):
1070 commitmsg):
1070 '''Commit the wd changes with parents p1 and p2. Reuse commit info from ctx
1071 '''Commit the wd changes with parents p1 and p2. Reuse commit info from ctx.
1071 but also store useful information in extra.
1072 Return node of committed revision.'''
1072 Return node of committed revision.'''
1073 dsguard = util.nullcontextmanager()
1073 dsguard = util.nullcontextmanager()
1074 if not repo.ui.configbool('rebase', 'singletransaction'):
1074 if not repo.ui.configbool('rebase', 'singletransaction'):
@@ -1076,9 +1076,6 b' def concludenode(repo, ctx, p1, p2, edit'
1076 with dsguard:
1076 with dsguard:
1077 repo.setparents(repo[p1].node(), repo[p2].node())
1077 repo.setparents(repo[p1].node(), repo[p2].node())
1078 keepbranch = keepbranches and repo[p1].branch() != ctx.branch()
1078 keepbranch = keepbranches and repo[p1].branch() != ctx.branch()
1079 extra = {'rebase_source': ctx.hex()}
1080 if extrafn:
1081 extrafn(ctx, extra)
1082
1079
1083 destphase = max(ctx.phase(), phases.draft)
1080 destphase = max(ctx.phase(), phases.draft)
1084 overrides = {('phases', 'new-commit'): destphase}
1081 overrides = {('phases', 'new-commit'): destphase}
General Comments 0
You need to be logged in to leave comments. Login now