Show More
@@ -208,8 +208,7 b' def unamend(ui, repo, **opts):' | |||||
208 | # identify the commit from which to unamend |
|
208 | # identify the commit from which to unamend | |
209 | curctx = repo['.'] |
|
209 | curctx = repo['.'] | |
210 |
|
210 | |||
211 | if not curctx.mutable(): |
|
211 | rewriteutil.precheck(repo, [curctx.rev()], 'unamend') | |
212 | raise error.Abort(_('cannot unamend public changesets')) |
|
|||
213 |
|
212 | |||
214 | # identify the commit to which to unamend |
|
213 | # identify the commit to which to unamend | |
215 | markers = list(predecessormarkers(curctx)) |
|
214 | markers = list(predecessormarkers(curctx)) | |
@@ -220,9 +219,6 b' def unamend(ui, repo, **opts):' | |||||
220 | prednode = markers[0].prednode() |
|
219 | prednode = markers[0].prednode() | |
221 | predctx = unfi[prednode] |
|
220 | predctx = unfi[prednode] | |
222 |
|
221 | |||
223 | if curctx.children(): |
|
|||
224 | raise error.Abort(_("cannot unamend a changeset with children")) |
|
|||
225 |
|
||||
226 | # add an extra so that we get a new hash |
|
222 | # add an extra so that we get a new hash | |
227 | # note: allowing unamend to undo an unamend is an intentional feature |
|
223 | # note: allowing unamend to undo an unamend is an intentional feature | |
228 | extras = predctx.extra() |
|
224 | extras = predctx.extra() |
@@ -280,17 +280,20 b' Unamending in middle of a stack' | |||||
280 | o 0:18d04c59bb5d Added a |
|
280 | o 0:18d04c59bb5d Added a | |
281 |
|
281 | |||
282 |
|
282 | |||
|
283 | $ hg --config experimental.evolution=createmarkers unamend | |||
|
284 | abort: cannot unamend changeset with children | |||
|
285 | [255] | |||
|
286 | ||||
283 | $ hg unamend |
|
287 | $ hg unamend | |
284 | abort: cannot unamend a changeset with children |
|
|||
285 | [255] |
|
|||
286 |
|
288 | |||
287 | Trying to unamend a public changeset |
|
289 | Trying to unamend a public changeset | |
288 |
|
290 | |||
289 | $ hg up |
|
291 | $ hg up -C 23 | |
290 |
|
|
292 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
291 | $ hg phase -r . -p |
|
293 | $ hg phase -r . -p | |
292 | $ hg unamend |
|
294 | $ hg unamend | |
293 | abort: cannot unamend public changesets |
|
295 | abort: cannot unamend public changesets | |
|
296 | (see 'hg help phases' for details) | |||
294 | [255] |
|
297 | [255] | |
295 |
|
298 | |||
296 | Testing whether unamend retains copies or not |
|
299 | Testing whether unamend retains copies or not |
General Comments 0
You need to be logged in to leave comments.
Login now