##// END OF EJS Templates
histedit: move logic for finding child nodes to new function...
Olle Lundberg -
r20648:0838bd2f default
parent child Browse files
Show More
@@ -646,23 +646,28 b' def _histedit(ui, repo, *freeargs, **opt'
646 646 if os.path.exists(repo.sjoin('undo')):
647 647 os.unlink(repo.sjoin('undo'))
648 648
649
650 def bootstrapcontinue(ui, repo, parentctx, rules, opts):
651 action, currentnode = rules.pop(0)
652 ctx = repo[currentnode]
649 def gatherchildren(repo, ctx):
653 650 # is there any new commit between the expected parent and "."
654 651 #
655 652 # note: does not take non linear new change in account (but previous
656 653 # implementation didn't used them anyway (issue3655)
657 newchildren = [c.node() for c in repo.set('(%d::.)', parentctx)]
658 if parentctx.node() != node.nullid:
654 newchildren = [c.node() for c in repo.set('(%d::.)', ctx)]
655 if ctx.node() != node.nullid:
659 656 if not newchildren:
660 # `parentctxnode` should match but no result. This means that
661 # currentnode is not a descendant from parentctxnode.
657 # `ctx` should match but no result. This means that
658 # currentnode is not a descendant from ctx.
662 659 msg = _('%s is not an ancestor of working directory')
663 660 hint = _('use "histedit --abort" to clear broken state')
664 raise util.Abort(msg % parentctx, hint=hint)
665 newchildren.pop(0) # remove parentctxnode
661 raise util.Abort(msg % ctx, hint=hint)
662 newchildren.pop(0) # remove ctx
663 return newchildren
664
665 def bootstrapcontinue(ui, repo, parentctx, rules, opts):
666 action, currentnode = rules.pop(0)
667 ctx = repo[currentnode]
668
669 newchildren = gatherchildren(repo, parentctx)
670
666 671 # Commit dirty working directory if necessary
667 672 new = None
668 673 m, a, r, d = repo.status()[:4]
General Comments 0
You need to be logged in to leave comments. Login now