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