Mercurial > hg
comparison hgext/histedit.py @ 18913:79580b3140cd
histedit: support editing of the first commit (issue3767)
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 12 Apr 2013 16:01:18 -0700 |
parents | 3e92772d5383 |
children | 93f3a06b2035 |
comparison
equal
deleted
inserted
replaced
18912:4e1ae55e63ef | 18913:79580b3140cd |
---|---|
578 # is there any new commit between the expected parent and "." | 578 # is there any new commit between the expected parent and "." |
579 # | 579 # |
580 # note: does not take non linear new change in account (but previous | 580 # note: does not take non linear new change in account (but previous |
581 # implementation didn't used them anyway (issue3655) | 581 # implementation didn't used them anyway (issue3655) |
582 newchildren = [c.node() for c in repo.set('(%d::.)', parentctx)] | 582 newchildren = [c.node() for c in repo.set('(%d::.)', parentctx)] |
583 if not newchildren: | 583 if parentctx.node() != node.nullid: |
584 # `parentctxnode` should match but no result. This means that | 584 if not newchildren: |
585 # currentnode is not a descendant from parentctxnode. | 585 # `parentctxnode` should match but no result. This means that |
586 msg = _('%s is not an ancestor of working directory') | 586 # currentnode is not a descendant from parentctxnode. |
587 hint = _('update to %s or descendant and run "hg histedit ' | 587 msg = _('%s is not an ancestor of working directory') |
588 '--continue" again') % parentctx | 588 hint = _('update to %s or descendant and run "hg histedit ' |
589 raise util.Abort(msg % parentctx, hint=hint) | 589 '--continue" again') % parentctx |
590 newchildren.pop(0) # remove parentctxnode | 590 raise util.Abort(msg % parentctx, hint=hint) |
591 newchildren.pop(0) # remove parentctxnode | |
591 # Commit dirty working directory if necessary | 592 # Commit dirty working directory if necessary |
592 new = None | 593 new = None |
593 m, a, r, d = repo.status()[:4] | 594 m, a, r, d = repo.status()[:4] |
594 if m or a or r or d: | 595 if m or a or r or d: |
595 # prepare the message for the commit to comes | 596 # prepare the message for the commit to comes |