##// 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 if os.path.exists(repo.sjoin('undo')):
646 if os.path.exists(repo.sjoin('undo')):
647 os.unlink(repo.sjoin('undo'))
647 os.unlink(repo.sjoin('undo'))
648
648
649
649 def gatherchildren(repo, ctx):
650 def bootstrapcontinue(ui, repo, parentctx, rules, opts):
651 action, currentnode = rules.pop(0)
652 ctx = repo[currentnode]
653 # is there any new commit between the expected parent and "."
650 # is there any new commit between the expected parent and "."
654 #
651 #
655 # note: does not take non linear new change in account (but previous
652 # note: does not take non linear new change in account (but previous
656 # implementation didn't used them anyway (issue3655)
653 # implementation didn't used them anyway (issue3655)
657 newchildren = [c.node() for c in repo.set('(%d::.)', parentctx)]
654 newchildren = [c.node() for c in repo.set('(%d::.)', ctx)]
658 if parentctx.node() != node.nullid:
655 if ctx.node() != node.nullid:
659 if not newchildren:
656 if not newchildren:
660 # `parentctxnode` should match but no result. This means that
657 # `ctx` should match but no result. This means that
661 # currentnode is not a descendant from parentctxnode.
658 # currentnode is not a descendant from ctx.
662 msg = _('%s is not an ancestor of working directory')
659 msg = _('%s is not an ancestor of working directory')
663 hint = _('use "histedit --abort" to clear broken state')
660 hint = _('use "histedit --abort" to clear broken state')
664 raise util.Abort(msg % parentctx, hint=hint)
661 raise util.Abort(msg % ctx, hint=hint)
665 newchildren.pop(0) # remove parentctxnode
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 # Commit dirty working directory if necessary
671 # Commit dirty working directory if necessary
667 new = None
672 new = None
668 m, a, r, d = repo.status()[:4]
673 m, a, r, d = repo.status()[:4]
General Comments 0
You need to be logged in to leave comments. Login now