##// END OF EJS Templates
errors: use InputError in uncommit extension...
Martin von Zweigbergk -
r47192:0e2becd1 default
parent child Browse files
Show More
@@ -175,7 +175,7 def uncommit(ui, repo, *pats, **opts):
175 175 old = repo[b'.']
176 176 rewriteutil.precheck(repo, [old.rev()], b'uncommit')
177 177 if len(old.parents()) > 1:
178 raise error.Abort(_(b"cannot uncommit merge changeset"))
178 raise error.InputError(_(b"cannot uncommit merge changeset"))
179 179
180 180 match = scmutil.match(old, pats, opts)
181 181
@@ -202,7 +202,7 def uncommit(ui, repo, *pats, **opts):
202 202 else:
203 203 hint = _(b"file does not exist")
204 204
205 raise error.Abort(
205 raise error.InputError(
206 206 _(b'cannot uncommit "%s"') % scmutil.getuipathfn(repo)(f),
207 207 hint=hint,
208 208 )
@@ -280,7 +280,7 def unamend(ui, repo, **opts):
280 280 markers = list(predecessormarkers(curctx))
281 281 if len(markers) != 1:
282 282 e = _(b"changeset must have one predecessor, found %i predecessors")
283 raise error.Abort(e % len(markers))
283 raise error.InputError(e % len(markers))
284 284
285 285 prednode = markers[0].prednode()
286 286 predctx = unfi[prednode]
@@ -39,7 +39,7 Trying to unamend when there was no amen
39 39
40 40 $ hg unamend
41 41 abort: changeset must have one predecessor, found 0 predecessors
42 [255]
42 [10]
43 43
44 44 Unamend on clean wdir and tip
45 45
@@ -114,12 +114,12 Uncommit of non-existent and unchanged f
114 114 $ hg uncommit nothinghere
115 115 abort: cannot uncommit "nothinghere"
116 116 (file does not exist)
117 [255]
117 [10]
118 118 $ hg status
119 119 $ hg uncommit file-abc
120 120 abort: cannot uncommit "file-abc"
121 121 (file was not changed in working directory parent)
122 [255]
122 [10]
123 123 $ hg status
124 124
125 125 Try partial uncommit, also moves bookmark
@@ -419,7 +419,7 Add and expect uncommit to fail on both
419 419
420 420 $ hg uncommit
421 421 abort: cannot uncommit merge changeset
422 [255]
422 [10]
423 423
424 424 $ hg status
425 425 $ hg log -G -T '{rev}:{node} {desc}' --hidden
@@ -585,12 +585,12 Bad option combinations
585 585 $ hg uncommit emptydir
586 586 abort: cannot uncommit "emptydir"
587 587 (file was untracked in working directory parent)
588 [255]
588 [10]
589 589
590 590 $ cd emptydir
591 591 $ hg uncommit .
592 592 abort: cannot uncommit "emptydir"
593 593 (file was untracked in working directory parent)
594 [255]
594 [10]
595 595 $ hg status
596 596 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now