##// END OF EJS Templates
histedit: refuse to edit public changeset...
Pierre-Yves David -
r17762:57f27cbf default
parent child Browse files
Show More
@@ -588,8 +588,12 b' def between(repo, old, new, keep):'
588
588
589 When keep is false, the specified set can't have children."""
589 When keep is false, the specified set can't have children."""
590 revs = list(repo.set('%n::%n', old, new))
590 revs = list(repo.set('%n::%n', old, new))
591 if not keep and repo.revs('(%ld::) - (%ld + hidden())', revs, revs):
591 if not keep:
592 if repo.revs('(%ld::) - (%ld + hidden())', revs, revs):
592 raise util.Abort(_('cannot edit history that would orphan nodes'))
593 raise util.Abort(_('cannot edit history that would orphan nodes'))
594 root = min(revs)
595 if not root.phase():
596 raise util.Abort(_('cannot edit immutable changeset: %s') % root)
593 return [c.node() for c in revs]
597 return [c.node() for c in revs]
594
598
595
599
@@ -121,3 +121,22 b' check hidden revision are ignored (6 hav'
121 > EOF
121 > EOF
122 $ hg histedit 6 --commands commands.txt
122 $ hg histedit 6 --commands commands.txt
123 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
124
125
126 Check that histedit respect phases
127 =========================================
128
129 (not directly related to the test file but doesn't deserve it's own test case)
130
131 $ hg log -G
132 @ 9:7c044e3e33a9 f
133 |
134 o 6:d36c0562f908 c
135 |
136 o 0:cb9a9f314b8b a
137
138 $ hg ph -pv '.^'
139 phase changed for 2 changesets
140 $ hg histedit -r '.~2'
141 abort: cannot edit immutable changeset: cb9a9f314b8b
142 [255]
General Comments 0
You need to be logged in to leave comments. Login now