##// END OF EJS Templates
histedit: check fold of public change during verify
timeless -
r27542:bf0900d3 default
parent child Browse files
Show More
@@ -621,6 +621,22 b' class edit(histeditaction):'
621
621
622 @addhisteditaction(['fold', 'f'])
622 @addhisteditaction(['fold', 'f'])
623 class fold(histeditaction):
623 class fold(histeditaction):
624 def verify(self, prev):
625 """ Verifies semantic correctness of the fold rule"""
626 super(fold, self).verify(prev)
627 repo = self.repo
628 state = self.state
629 if not prev:
630 c = repo[self.node].parents()[0]
631 elif not prev.verb in ('pick', 'base'):
632 return
633 else:
634 c = repo[prev.node]
635 if not c.mutable():
636 raise error.Abort(
637 _("cannot fold into public change %s") % node.short(c.node()))
638
639
624 def continuedirty(self):
640 def continuedirty(self):
625 repo = self.repo
641 repo = self.repo
626 rulectx = repo[self.node]
642 rulectx = repo[self.node]
@@ -451,9 +451,6 b' Attempting to fold a change into a publi'
451 > mv tmp "\$1"
451 > mv tmp "\$1"
452 > EOF
452 > EOF
453 $ HGEDITOR="sh ../edit.sh" hg histedit 2
453 $ HGEDITOR="sh ../edit.sh" hg histedit 2
454 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
455 reverting a
456 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
457 warning: histedit rules saved to: .hg/histedit-last-edit.txt
454 warning: histedit rules saved to: .hg/histedit-last-edit.txt
458 abort: cannot fold into public change 18aa70c8ad22
455 abort: cannot fold into public change 18aa70c8ad22
459 [255]
456 [255]
@@ -472,6 +469,3 b' Attempting to fold a change into a publi'
472 # d, drop = remove commit from history
469 # d, drop = remove commit from history
473 # m, mess = edit commit message without changing commit content
470 # m, mess = edit commit message without changing commit content
474 #
471 #
475 TODO: this abort shouldn't be required, but it is for now to leave the repo in
476 a clean state.
477 $ hg histedit --abort
General Comments 0
You need to be logged in to leave comments. Login now