##// END OF EJS Templates
errors: introduce StateError and use it from commands and cmdutil...
Martin von Zweigbergk -
r46444:527ce85c default
parent child Browse files
Show More
@@ -804,10 +804,10 b' def _dotransplant(ui, repo, *revs, **opt'
804 raise error.Abort(_(b'no revision checked out'))
804 raise error.Abort(_(b'no revision checked out'))
805 if opts.get(b'continue'):
805 if opts.get(b'continue'):
806 if not tp.canresume():
806 if not tp.canresume():
807 raise error.Abort(_(b'no transplant to continue'))
807 raise error.StateError(_(b'no transplant to continue'))
808 elif opts.get(b'stop'):
808 elif opts.get(b'stop'):
809 if not tp.canresume():
809 if not tp.canresume():
810 raise error.Abort(_(b'no interrupted transplant found'))
810 raise error.StateError(_(b'no interrupted transplant found'))
811 return tp.stop(ui, repo)
811 return tp.stop(ui, repo)
812 else:
812 else:
813 cmdutil.checkunfinished(repo)
813 cmdutil.checkunfinished(repo)
@@ -1087,10 +1087,10 b' def bailifchanged(repo, merge=True, hint'
1087 """
1087 """
1088
1088
1089 if merge and repo.dirstate.p2() != nullid:
1089 if merge and repo.dirstate.p2() != nullid:
1090 raise error.Abort(_(b'outstanding uncommitted merge'), hint=hint)
1090 raise error.StateError(_(b'outstanding uncommitted merge'), hint=hint)
1091 st = repo.status()
1091 st = repo.status()
1092 if st.modified or st.added or st.removed or st.deleted:
1092 if st.modified or st.added or st.removed or st.deleted:
1093 raise error.Abort(_(b'uncommitted changes'), hint=hint)
1093 raise error.StateError(_(b'uncommitted changes'), hint=hint)
1094 ctx = repo[None]
1094 ctx = repo[None]
1095 for s in sorted(ctx.substate):
1095 for s in sorted(ctx.substate):
1096 ctx.sub(s).bailifchanged(hint=hint)
1096 ctx.sub(s).bailifchanged(hint=hint)
@@ -3738,7 +3738,7 b' def checkunfinished(repo, commit=False, '
3738 ):
3738 ):
3739 continue
3739 continue
3740 if state.isunfinished(repo):
3740 if state.isunfinished(repo):
3741 raise error.Abort(state.msg(), hint=state.hint())
3741 raise error.StateError(state.msg(), hint=state.hint())
3742
3742
3743 for s in statemod._unfinishedstates:
3743 for s in statemod._unfinishedstates:
3744 if (
3744 if (
@@ -3749,7 +3749,7 b' def checkunfinished(repo, commit=False, '
3749 ):
3749 ):
3750 continue
3750 continue
3751 if s.isunfinished(repo):
3751 if s.isunfinished(repo):
3752 raise error.Abort(s.msg(), hint=s.hint())
3752 raise error.StateError(s.msg(), hint=s.hint())
3753
3753
3754
3754
3755 def clearunfinished(repo):
3755 def clearunfinished(repo):
@@ -3760,7 +3760,7 b' def clearunfinished(repo):'
3760 if state._reportonly:
3760 if state._reportonly:
3761 continue
3761 continue
3762 if not state._clearable and state.isunfinished(repo):
3762 if not state._clearable and state.isunfinished(repo):
3763 raise error.Abort(state.msg(), hint=state.hint())
3763 raise error.StateError(state.msg(), hint=state.hint())
3764
3764
3765 for s in statemod._unfinishedstates:
3765 for s in statemod._unfinishedstates:
3766 if s._opname == b'merge' or state._reportonly:
3766 if s._opname == b'merge' or state._reportonly:
@@ -3829,14 +3829,14 b' def wrongtooltocontinue(repo, task):'
3829 hint = None
3829 hint = None
3830 if after[1]:
3830 if after[1]:
3831 hint = after[0]
3831 hint = after[0]
3832 raise error.Abort(_(b'no %s in progress') % task, hint=hint)
3832 raise error.StateError(_(b'no %s in progress') % task, hint=hint)
3833
3833
3834
3834
3835 def abortgraft(ui, repo, graftstate):
3835 def abortgraft(ui, repo, graftstate):
3836 """abort the interrupted graft and rollbacks to the state before interrupted
3836 """abort the interrupted graft and rollbacks to the state before interrupted
3837 graft"""
3837 graft"""
3838 if not graftstate.exists():
3838 if not graftstate.exists():
3839 raise error.Abort(_(b"no interrupted graft to abort"))
3839 raise error.StateError(_(b"no interrupted graft to abort"))
3840 statedata = readgraftstate(repo, graftstate)
3840 statedata = readgraftstate(repo, graftstate)
3841 newnodes = statedata.get(b'newnodes')
3841 newnodes = statedata.get(b'newnodes')
3842 if newnodes is None:
3842 if newnodes is None:
@@ -187,7 +187,7 b' def abort(ui, repo, **opts):'
187 dryrun = opts.get('dry_run')
187 dryrun = opts.get('dry_run')
188 abortstate = cmdutil.getunfinishedstate(repo)
188 abortstate = cmdutil.getunfinishedstate(repo)
189 if not abortstate:
189 if not abortstate:
190 raise error.Abort(_(b'no operation in progress'))
190 raise error.StateError(_(b'no operation in progress'))
191 if not abortstate.abortfunc:
191 if not abortstate.abortfunc:
192 raise error.InputError(
192 raise error.InputError(
193 (
193 (
@@ -1065,7 +1065,7 b' def bisect('
1065 try:
1065 try:
1066 node = state[b'current'][0]
1066 node = state[b'current'][0]
1067 except LookupError:
1067 except LookupError:
1068 raise error.Abort(
1068 raise error.StateError(
1069 _(
1069 _(
1070 b'current bisect revision is unknown - '
1070 b'current bisect revision is unknown - '
1071 b'start a new bisect to fix'
1071 b'start a new bisect to fix'
@@ -1074,7 +1074,7 b' def bisect('
1074 else:
1074 else:
1075 node, p2 = repo.dirstate.parents()
1075 node, p2 = repo.dirstate.parents()
1076 if p2 != nullid:
1076 if p2 != nullid:
1077 raise error.Abort(_(b'current bisect revision is a merge'))
1077 raise error.StateError(_(b'current bisect revision is a merge'))
1078 if rev:
1078 if rev:
1079 node = repo[scmutil.revsingle(repo, rev, node)].node()
1079 node = repo[scmutil.revsingle(repo, rev, node)].node()
1080 with hbisect.restore_state(repo, state, node):
1080 with hbisect.restore_state(repo, state, node):
@@ -1127,7 +1127,7 b' def bisect('
1127 state[b'current'] = [extendnode.node()]
1127 state[b'current'] = [extendnode.node()]
1128 hbisect.save_state(repo, state)
1128 hbisect.save_state(repo, state)
1129 return mayupdate(repo, extendnode.node())
1129 return mayupdate(repo, extendnode.node())
1130 raise error.Abort(_(b"nothing to extend"))
1130 raise error.StateError(_(b"nothing to extend"))
1131
1131
1132 if changesets == 0:
1132 if changesets == 0:
1133 hbisect.printresult(ui, repo, state, displayer, nodes, good)
1133 hbisect.printresult(ui, repo, state, displayer, nodes, good)
@@ -2335,9 +2335,9 b' def continuecmd(ui, repo, **opts):'
2335 dryrun = opts.get('dry_run')
2335 dryrun = opts.get('dry_run')
2336 contstate = cmdutil.getunfinishedstate(repo)
2336 contstate = cmdutil.getunfinishedstate(repo)
2337 if not contstate:
2337 if not contstate:
2338 raise error.Abort(_(b'no operation in progress'))
2338 raise error.StateError(_(b'no operation in progress'))
2339 if not contstate.continuefunc:
2339 if not contstate.continuefunc:
2340 raise error.Abort(
2340 raise error.StateError(
2341 (
2341 (
2342 _(b"%s in progress but does not support 'hg continue'")
2342 _(b"%s in progress but does not support 'hg continue'")
2343 % (contstate._opname)
2343 % (contstate._opname)
@@ -3270,7 +3270,7 b' def _dograft(ui, repo, *revs, **opts):'
3270 def _stopgraft(ui, repo, graftstate):
3270 def _stopgraft(ui, repo, graftstate):
3271 """stop the interrupted graft"""
3271 """stop the interrupted graft"""
3272 if not graftstate.exists():
3272 if not graftstate.exists():
3273 raise error.Abort(_(b"no interrupted graft found"))
3273 raise error.StateError(_(b"no interrupted graft found"))
3274 pctx = repo[b'.']
3274 pctx = repo[b'.']
3275 mergemod.clean_update(pctx)
3275 mergemod.clean_update(pctx)
3276 graftstate.delete()
3276 graftstate.delete()
@@ -4767,7 +4767,7 b' def merge(ui, repo, node=None, **opts):'
4767 if abort:
4767 if abort:
4768 state = cmdutil.getunfinishedstate(repo)
4768 state = cmdutil.getunfinishedstate(repo)
4769 if state and state._opname != b'merge':
4769 if state and state._opname != b'merge':
4770 raise error.Abort(
4770 raise error.StateError(
4771 _(b'cannot abort merge with %s in progress') % (state._opname),
4771 _(b'cannot abort merge with %s in progress') % (state._opname),
4772 hint=state.hint(),
4772 hint=state.hint(),
4773 )
4773 )
@@ -5893,7 +5893,7 b' def resolve(ui, repo, *pats, **opts):'
5893 ms = mergestatemod.mergestate.read(repo)
5893 ms = mergestatemod.mergestate.read(repo)
5894
5894
5895 if not (ms.active() or repo.dirstate.p2() != nullid):
5895 if not (ms.active() or repo.dirstate.p2() != nullid):
5896 raise error.Abort(
5896 raise error.StateError(
5897 _(b'resolve command not applicable when not merging')
5897 _(b'resolve command not applicable when not merging')
5898 )
5898 )
5899
5899
@@ -5985,7 +5985,7 b' def resolve(ui, repo, *pats, **opts):'
5985 )
5985 )
5986 )
5986 )
5987 if markcheck == b'abort' and not all and not pats:
5987 if markcheck == b'abort' and not all and not pats:
5988 raise error.Abort(
5988 raise error.StateError(
5989 _(b'conflict markers detected'),
5989 _(b'conflict markers detected'),
5990 hint=_(b'use --all to mark anyway'),
5990 hint=_(b'use --all to mark anyway'),
5991 )
5991 )
@@ -7185,7 +7185,7 b' def tag(ui, repo, name1, *names, **opts)'
7185 if not opts.get(b'local'):
7185 if not opts.get(b'local'):
7186 p1, p2 = repo.dirstate.parents()
7186 p1, p2 = repo.dirstate.parents()
7187 if p2 != nullid:
7187 if p2 != nullid:
7188 raise error.Abort(_(b'uncommitted merge'))
7188 raise error.StateError(_(b'uncommitted merge'))
7189 bheads = repo.branchheads()
7189 bheads = repo.branchheads()
7190 if not opts.get(b'force') and bheads and p1 not in bheads:
7190 if not opts.get(b'force') and bheads and p1 not in bheads:
7191 raise error.InputError(
7191 raise error.InputError(
@@ -188,6 +188,13 b' class InputError(Abort):'
188 """
188 """
189
189
190
190
191 class StateError(Abort):
192 """Indicates that the operation might work if retried in a different state.
193
194 Examples: Unresolved merge conflicts, unfinished operations.
195 """
196
197
191 class HookLoadError(Abort):
198 class HookLoadError(Abort):
192 """raised when loading a hook fails, aborting an operation
199 """raised when loading a hook fails, aborting an operation
193
200
@@ -224,6 +224,8 b' def callcatch(ui, func):'
224 except error.Abort as inst:
224 except error.Abort as inst:
225 if isinstance(inst, error.InputError):
225 if isinstance(inst, error.InputError):
226 detailed_exit_code = 10
226 detailed_exit_code = 10
227 elif isinstance(inst, error.StateError):
228 detailed_exit_code = 20
227 ui.error(_(b"abort: %s\n") % inst.message)
229 ui.error(_(b"abort: %s\n") % inst.message)
228 if inst.hint:
230 if inst.hint:
229 ui.error(_(b"(%s)\n") % inst.hint)
231 ui.error(_(b"(%s)\n") % inst.hint)
@@ -26,5 +26,5 b' Abort absorb if there is an unfinished o'
26 $ hg --config extensions.rebase= absorb
26 $ hg --config extensions.rebase= absorb
27 abort: rebase in progress
27 abort: rebase in progress
28 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
28 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
29 [255]
29 [20]
30
30
@@ -65,7 +65,7 b' Change with dirty working directory'
65 $ echo bar > a
65 $ echo bar > a
66 $ hg branch -r . foo
66 $ hg branch -r . foo
67 abort: uncommitted changes
67 abort: uncommitted changes
68 [255]
68 [20]
69
69
70 $ hg revert --all
70 $ hg revert --all
71 reverting a
71 reverting a
@@ -331,7 +331,7 b' Changing branch of a merge commit'
331 (branch merge, don't forget to commit)
331 (branch merge, don't forget to commit)
332 $ hg branch -r . abcd
332 $ hg branch -r . abcd
333 abort: outstanding uncommitted merge
333 abort: outstanding uncommitted merge
334 [255]
334 [20]
335
335
336 $ hg ci -m "Merge commit"
336 $ hg ci -m "Merge commit"
337 $ hg glog -r 'parents(.)::'
337 $ hg glog -r 'parents(.)::'
@@ -47,7 +47,7 b' Testing the abort functionality first in'
47 $ hg abort
47 $ hg abort
48 abort: no merge in progress (abortflag !)
48 abort: no merge in progress (abortflag !)
49 abort: no operation in progress (abortcommand !)
49 abort: no operation in progress (abortcommand !)
50 [255]
50 [20]
51
51
52 $ hg merge
52 $ hg merge
53 merging A
53 merging A
@@ -157,7 +157,7 b' should abort, because i is modified'
157
157
158 $ hg --cwd i fetch ../h
158 $ hg --cwd i fetch ../h
159 abort: uncommitted changes
159 abort: uncommitted changes
160 [255]
160 [20]
161
161
162 test fetch with named branches
162 test fetch with named branches
163
163
@@ -879,7 +879,7 b' fixing the working directory if there ar'
879 $ hg --config extensions.rebase= fix -r .
879 $ hg --config extensions.rebase= fix -r .
880 abort: rebase in progress
880 abort: rebase in progress
881 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
881 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
882 [255]
882 [20]
883
883
884 $ cd ..
884 $ cd ..
885
885
@@ -238,7 +238,7 b' Testing the --stop flag of `hg graft` wh'
238
238
239 $ hg graft --stop
239 $ hg graft --stop
240 abort: no interrupted graft found
240 abort: no interrupted graft found
241 [255]
241 [20]
242
242
243 $ hg graft -r 3
243 $ hg graft -r 3
244 grafting 3:9150fe93bec6 "added d"
244 grafting 3:9150fe93bec6 "added d"
@@ -342,7 +342,7 b' before the graft'
342 $ hg abort
342 $ hg abort
343 abort: no interrupted graft to abort (abortflag !)
343 abort: no interrupted graft to abort (abortflag !)
344 abort: no operation in progress (abortcommand !)
344 abort: no operation in progress (abortcommand !)
345 [255]
345 [20]
346
346
347 when stripping is required
347 when stripping is required
348 $ hg graft -r 4 -r 5
348 $ hg graft -r 4 -r 5
@@ -85,7 +85,7 b" Can't continue without starting:"
85 $ hg rm -q e
85 $ hg rm -q e
86 $ hg graft --continue
86 $ hg graft --continue
87 abort: no graft in progress
87 abort: no graft in progress
88 [255]
88 [20]
89 $ hg revert -r . -q e
89 $ hg revert -r . -q e
90
90
91 Need to specify a rev:
91 Need to specify a rev:
@@ -130,7 +130,7 b" Can't graft with dirty wd:"
130 $ echo foo > a
130 $ echo foo > a
131 $ hg graft 1
131 $ hg graft 1
132 abort: uncommitted changes
132 abort: uncommitted changes
133 [255]
133 [20]
134 $ hg revert a
134 $ hg revert a
135
135
136 Graft a rename:
136 Graft a rename:
@@ -292,7 +292,7 b' Commit while interrupted should fail:'
292 $ hg ci -m 'commit interrupted graft'
292 $ hg ci -m 'commit interrupted graft'
293 abort: graft in progress
293 abort: graft in progress
294 (use 'hg graft --continue' or 'hg graft --stop' to stop)
294 (use 'hg graft --continue' or 'hg graft --stop' to stop)
295 [255]
295 [20]
296
296
297 Abort the graft and try committing:
297 Abort the graft and try committing:
298
298
@@ -55,11 +55,11 b' histedit --continue/--abort with no exis'
55
55
56 $ hg histedit --continue
56 $ hg histedit --continue
57 abort: no histedit in progress
57 abort: no histedit in progress
58 [255]
58 [20]
59 $ hg abort
59 $ hg abort
60 abort: no histedit in progress (abortflag !)
60 abort: no histedit in progress (abortflag !)
61 abort: no operation in progress (abortcommand !)
61 abort: no operation in progress (abortcommand !)
62 [255]
62 [20]
63
63
64 Run a dummy edit to make sure we get tip^^ correctly via revsingle.
64 Run a dummy edit to make sure we get tip^^ correctly via revsingle.
65 --------------------------------------------------------------------
65 --------------------------------------------------------------------
@@ -156,7 +156,7 b' temporarily.'
156 $ hg graft --continue
156 $ hg graft --continue
157 abort: no graft in progress
157 abort: no graft in progress
158 (continue: hg histedit --continue)
158 (continue: hg histedit --continue)
159 [255]
159 [20]
160
160
161 $ mv .hg/histedit-state .hg/histedit-state.back
161 $ mv .hg/histedit-state .hg/histedit-state.back
162 $ hg update --quiet --clean 2
162 $ hg update --quiet --clean 2
@@ -505,7 +505,7 b' in which case this test should be revisi'
505 $ hg commit --amend -m 'reject this fold'
505 $ hg commit --amend -m 'reject this fold'
506 abort: histedit in progress
506 abort: histedit in progress
507 (use 'hg histedit --continue' or 'hg histedit --abort')
507 (use 'hg histedit --continue' or 'hg histedit --abort')
508 [255]
508 [20]
509
509
510 With markers enabled, histedit does not get confused, and
510 With markers enabled, histedit does not get confused, and
511 amend should not be blocked by the ongoing histedit.
511 amend should not be blocked by the ongoing histedit.
@@ -63,7 +63,7 b' dirty a file'
63 $ hg histedit 177f92b77385 --commands - 2>&1 << EOF
63 $ hg histedit 177f92b77385 --commands - 2>&1 << EOF
64 > EOF
64 > EOF
65 abort: uncommitted changes
65 abort: uncommitted changes
66 [255]
66 [20]
67 $ echo g > g
67 $ echo g > g
68
68
69 edit the history
69 edit the history
@@ -82,7 +82,7 b' try to update and get an error'
82 $ hg update tip
82 $ hg update tip
83 abort: histedit in progress
83 abort: histedit in progress
84 (use 'hg histedit --continue' or 'hg histedit --abort')
84 (use 'hg histedit --continue' or 'hg histedit --abort')
85 [255]
85 [20]
86
86
87 edit the plan via the editor
87 edit the plan via the editor
88 $ cat >> $TESTTMP/editplan.sh <<EOF
88 $ cat >> $TESTTMP/editplan.sh <<EOF
@@ -136,7 +136,7 b' Go at a random point and try to continue'
136 $ hg up 0
136 $ hg up 0
137 abort: histedit in progress
137 abort: histedit in progress
138 (use 'hg histedit --continue' or 'hg histedit --abort')
138 (use 'hg histedit --continue' or 'hg histedit --abort')
139 [255]
139 [20]
140
140
141 Try to delete necessary commit
141 Try to delete necessary commit
142 $ hg strip -r 652413b
142 $ hg strip -r 652413b
@@ -153,7 +153,7 b" qnew should fail while we're in the midd"
153 $ hg --config extensions.mq= qnew please-fail
153 $ hg --config extensions.mq= qnew please-fail
154 abort: histedit in progress
154 abort: histedit in progress
155 (use 'hg histedit --continue' or 'hg histedit --abort')
155 (use 'hg histedit --continue' or 'hg histedit --abort')
156 [255]
156 [20]
157 $ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle
157 $ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle
158
158
159 $ hg log --graph
159 $ hg log --graph
@@ -60,7 +60,7 b' Invert the order of the commits, and pre'
60 7181f42b8fca: skipping changeset (no changes)
60 7181f42b8fca: skipping changeset (no changes)
61 $ hg histedit --abort
61 $ hg histedit --abort
62 abort: no histedit in progress
62 abort: no histedit in progress
63 [255]
63 [20]
64 $ cd ..
64 $ cd ..
65
65
66 Test legacy config name
66 Test legacy config name
@@ -169,7 +169,7 b' abort editing session, after first forci'
169 $ hg up 0
169 $ hg up 0
170 abort: histedit in progress
170 abort: histedit in progress
171 (use 'hg histedit --continue' or 'hg histedit --abort')
171 (use 'hg histedit --continue' or 'hg histedit --abort')
172 [255]
172 [20]
173 $ mv .hg/histedit-state .hg/histedit-state-ignore
173 $ mv .hg/histedit-state .hg/histedit-state-ignore
174 $ hg up 0
174 $ hg up 0
175 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
175 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
@@ -125,7 +125,7 b' TODO: Ideally, this should mention the l'
125 $ hg clone -q . ../fetch
125 $ hg clone -q . ../fetch
126 $ hg --config extensions.fetch= fetch ../fetch
126 $ hg --config extensions.fetch= fetch ../fetch
127 abort: uncommitted changes
127 abort: uncommitted changes
128 [255]
128 [20]
129 $ hg up -qC
129 $ hg up -qC
130 $ cd ..
130 $ cd ..
131
131
@@ -46,7 +46,7 b' noticed by `update --check` in the top l'
46
46
47 $ hg up --check -r '.^'
47 $ hg up --check -r '.^'
48 abort: uncommitted changes
48 abort: uncommitted changes
49 [255]
49 [20]
50 $ hg st -S
50 $ hg st -S
51 ! a
51 ! a
52 $ hg up -Cq .
52 $ hg up -Cq .
@@ -36,7 +36,7 b" of the files in a commit we're updating "
36 $ hg ci
36 $ hg ci
37 abort: last update was interrupted
37 abort: last update was interrupted
38 (use 'hg update' to get a consistent checkout)
38 (use 'hg update' to get a consistent checkout)
39 [255]
39 [20]
40 $ hg sum
40 $ hg sum
41 parent: 0:538afb845929
41 parent: 0:538afb845929
42 commit #0
42 commit #0
@@ -16,7 +16,7 b''
16 $ rm b
16 $ rm b
17 $ hg update -c 2
17 $ hg update -c 2
18 abort: uncommitted changes
18 abort: uncommitted changes
19 [255]
19 [20]
20 $ hg revert b
20 $ hg revert b
21 $ hg update -c 2
21 $ hg update -c 2
22 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
22 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -812,7 +812,7 b' strip with local changes, should complai'
812 $ hg add y
812 $ hg add y
813 $ hg strip tip
813 $ hg strip tip
814 abort: uncommitted changes
814 abort: uncommitted changes
815 [255]
815 [20]
816
816
817 --force strip with local changes
817 --force strip with local changes
818
818
@@ -129,7 +129,7 b' Update - local renamed file conflicts wi'
129 R base
129 R base
130 $ hg up --check dir
130 $ hg up --check dir
131 abort: uncommitted changes
131 abort: uncommitted changes
132 [255]
132 [20]
133 $ hg up dir
133 $ hg up dir
134 a: path conflict - a file or link has the same name as a directory
134 a: path conflict - a file or link has the same name as a directory
135 the local file has been renamed to a~d20a80d4def3
135 the local file has been renamed to a~d20a80d4def3
@@ -154,7 +154,7 b' Update clean - local directory conflicts'
154 $ echo 9 > a/b/c
154 $ echo 9 > a/b/c
155 $ hg up file2 --check --config merge.checkunknown=warn
155 $ hg up file2 --check --config merge.checkunknown=warn
156 abort: uncommitted changes
156 abort: uncommitted changes
157 [255]
157 [20]
158 $ hg up file2 --clean
158 $ hg up file2 --clean
159 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 (activating bookmark file2)
160 (activating bookmark file2)
@@ -29,7 +29,7 b' Should respect config to disable dirty u'
29 new changesets 107cefe13e42
29 new changesets 107cefe13e42
30 1 local changesets published
30 1 local changesets published
31 abort: uncommitted changes
31 abort: uncommitted changes
32 [255]
32 [20]
33 $ hg --config extensions.strip= strip --no-backup tip
33 $ hg --config extensions.strip= strip --no-backup tip
34 $ hg co -qC tip
34 $ hg co -qC tip
35
35
@@ -470,4 +470,4 b' qrecord should throw an error when histe'
470 > EOF
470 > EOF
471 abort: histedit in progress
471 abort: histedit in progress
472 (use 'hg histedit --continue' or 'hg histedit --abort')
472 (use 'hg histedit --continue' or 'hg histedit --abort')
473 [255]
473 [20]
@@ -328,7 +328,7 b' user has somehow managed to update to a '
328 $ hg up 1 # user gets an error saying to run hg rebase --abort
328 $ hg up 1 # user gets an error saying to run hg rebase --abort
329 abort: rebase in progress
329 abort: rebase in progress
330 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
330 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
331 [255]
331 [20]
332
332
333 $ cat a
333 $ cat a
334 new
334 new
@@ -398,20 +398,20 b' New operations are blocked with the corr'
398 $ hg rebase -s 3 -d tip
398 $ hg rebase -s 3 -d tip
399 abort: rebase in progress
399 abort: rebase in progress
400 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
400 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
401 [255]
401 [20]
402 $ hg up .
402 $ hg up .
403 abort: rebase in progress
403 abort: rebase in progress
404 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
404 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
405 [255]
405 [20]
406 $ hg up -C .
406 $ hg up -C .
407 abort: rebase in progress
407 abort: rebase in progress
408 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
408 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
409 [255]
409 [20]
410
410
411 $ hg graft 3
411 $ hg graft 3
412 abort: rebase in progress
412 abort: rebase in progress
413 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
413 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
414 [255]
414 [20]
415
415
416 $ hg abort
416 $ hg abort
417 saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/3d8812cf300d-93041a90-backup.hg
417 saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/3d8812cf300d-93041a90-backup.hg
@@ -57,7 +57,7 b' Try to call --continue:'
57
57
58 $ hg rebase --continue
58 $ hg rebase --continue
59 abort: no rebase in progress
59 abort: no rebase in progress
60 [255]
60 [20]
61
61
62 Conflicting rebase:
62 Conflicting rebase:
63
63
@@ -484,7 +484,7 b" Retrying without in-memory merge won't l"
484 transaction abort!
484 transaction abort!
485 rollback completed
485 rollback completed
486 abort: uncommitted changes
486 abort: uncommitted changes
487 [255]
487 [20]
488 $ cat a
488 $ cat a
489 dirty
489 dirty
490
490
@@ -503,7 +503,7 b" Retrying without in-memory merge won't l"
503 $ hg rebase -s 2 -d 7
503 $ hg rebase -s 2 -d 7
504 abort: outstanding uncommitted merge
504 abort: outstanding uncommitted merge
505 (use 'hg commit' or 'hg merge --abort')
505 (use 'hg commit' or 'hg merge --abort')
506 [255]
506 [20]
507 $ hg resolve -l
507 $ hg resolve -l
508 U e
508 U e
509
509
@@ -893,7 +893,7 b" Test rebasing when we're in the middle o"
893 $ hg rebase -r 3 -d 1 -t:merge3
893 $ hg rebase -r 3 -d 1 -t:merge3
894 abort: rebase in progress
894 abort: rebase in progress
895 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
895 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
896 [255]
896 [20]
897 $ hg resolve --list
897 $ hg resolve --list
898 U foo
898 U foo
899 $ hg resolve --all --re-merge -t:other
899 $ hg resolve --all --re-merge -t:other
@@ -392,7 +392,7 b' mangling the working directory...'
392 $ hg rebase -s 5 -d 4 --dry-run
392 $ hg rebase -s 5 -d 4 --dry-run
393 starting dry-run rebase; repository will not be changed
393 starting dry-run rebase; repository will not be changed
394 abort: uncommitted changes
394 abort: uncommitted changes
395 [255]
395 [20]
396 $ hg diff
396 $ hg diff
397 diff -r 2b586e70108d A
397 diff -r 2b586e70108d A
398 --- a/A Thu Jan 01 00:00:00 1970 +0000
398 --- a/A Thu Jan 01 00:00:00 1970 +0000
@@ -406,7 +406,7 b' mangling the working directory...'
406 $ echo n | hg rebase -s 5 -d 4 --confirm --config ui.interactive=True
406 $ echo n | hg rebase -s 5 -d 4 --confirm --config ui.interactive=True
407 starting in-memory rebase
407 starting in-memory rebase
408 abort: uncommitted changes
408 abort: uncommitted changes
409 [255]
409 [20]
410 $ hg diff
410 $ hg diff
411 diff -r 2b586e70108d A
411 diff -r 2b586e70108d A
412 --- a/A Thu Jan 01 00:00:00 1970 +0000
412 --- a/A Thu Jan 01 00:00:00 1970 +0000
@@ -417,7 +417,7 b' mangling the working directory...'
417 $ hg rebase -s 5 -d 4 --confirm
417 $ hg rebase -s 5 -d 4 --confirm
418 starting in-memory rebase
418 starting in-memory rebase
419 abort: uncommitted changes
419 abort: uncommitted changes
420 [255]
420 [20]
421 $ hg diff
421 $ hg diff
422 diff -r 2b586e70108d A
422 diff -r 2b586e70108d A
423 --- a/A Thu Jan 01 00:00:00 1970 +0000
423 --- a/A Thu Jan 01 00:00:00 1970 +0000
@@ -2058,7 +2058,7 b' Test --stop raise errors with conflictin'
2058 $ hg rebase -s 3 -d 5
2058 $ hg rebase -s 3 -d 5
2059 abort: rebase in progress
2059 abort: rebase in progress
2060 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
2060 (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop')
2061 [255]
2061 [20]
2062 $ hg rebase --stop --continue
2062 $ hg rebase --stop --continue
2063 abort: cannot specify both --stop and --continue
2063 abort: cannot specify both --stop and --continue
2064 [10]
2064 [10]
@@ -500,7 +500,7 b' Test --tool parameter:'
500 $ hg graft --continue
500 $ hg graft --continue
501 abort: no graft in progress
501 abort: no graft in progress
502 (continue: hg rebase --continue)
502 (continue: hg rebase --continue)
503 [255]
503 [20]
504 $ hg rebase -c --tool internal:fail
504 $ hg rebase -c --tool internal:fail
505 rebasing 2:e4e3f3546619 tip "c2b"
505 rebasing 2:e4e3f3546619 tip "c2b"
506 note: not rebasing 2:e4e3f3546619 tip "c2b", its destination already has all its changes
506 note: not rebasing 2:e4e3f3546619 tip "c2b", its destination already has all its changes
@@ -80,7 +80,7 b' Abort pull early if working dir is not c'
80 $ hg pull --rebase
80 $ hg pull --rebase
81 abort: uncommitted changes
81 abort: uncommitted changes
82 (cannot pull with rebase: please commit or shelve your changes first)
82 (cannot pull with rebase: please commit or shelve your changes first)
83 [255]
83 [20]
84 $ hg update --clean --quiet
84 $ hg update --clean --quiet
85
85
86 Abort pull early if another operation (histedit) is in progress:
86 Abort pull early if another operation (histedit) is in progress:
@@ -94,7 +94,7 b' Abort pull early if another operation (h'
94 $ hg pull --rebase
94 $ hg pull --rebase
95 abort: histedit in progress
95 abort: histedit in progress
96 (use 'hg histedit --continue' or 'hg histedit --abort')
96 (use 'hg histedit --continue' or 'hg histedit --abort')
97 [255]
97 [20]
98 $ hg histedit --abort --quiet
98 $ hg histedit --abort --quiet
99
99
100 Abort pull early with pending uncommitted merge:
100 Abort pull early with pending uncommitted merge:
@@ -117,7 +117,7 b' Abort pull early with pending uncommitte'
117 $ hg pull --rebase
117 $ hg pull --rebase
118 abort: outstanding uncommitted merge
118 abort: outstanding uncommitted merge
119 (cannot pull with rebase: please commit or shelve your changes first)
119 (cannot pull with rebase: please commit or shelve your changes first)
120 [255]
120 [20]
121 $ hg update --clean --quiet
121 $ hg update --clean --quiet
122
122
123 Abort pull early with unclean subrepo:
123 Abort pull early with unclean subrepo:
@@ -132,13 +132,13 b' resolve --all should abort when no merge'
132
132
133 $ hg resolve --all
133 $ hg resolve --all
134 abort: resolve command not applicable when not merging
134 abort: resolve command not applicable when not merging
135 [255]
135 [20]
136
136
137 resolve -m should abort when no merge in progress
137 resolve -m should abort when no merge in progress
138
138
139 $ hg resolve -m
139 $ hg resolve -m
140 abort: resolve command not applicable when not merging
140 abort: resolve command not applicable when not merging
141 [255]
141 [20]
142
142
143 can not update or merge when there are unresolved conflicts
143 can not update or merge when there are unresolved conflicts
144
144
@@ -332,7 +332,7 b' resolve -m can be configured to look for'
332 file2
332 file2
333 abort: conflict markers detected
333 abort: conflict markers detected
334 (use --all to mark anyway)
334 (use --all to mark anyway)
335 [255]
335 [20]
336 $ hg resolve -l
336 $ hg resolve -l
337 U file1
337 U file1
338 U file2
338 U file2
@@ -442,7 +442,7 b' ensure that we have a merge with unresol'
442 $ hg shelve
442 $ hg shelve
443 abort: unshelve already in progress
443 abort: unshelve already in progress
444 (use 'hg unshelve --continue' or 'hg unshelve --abort')
444 (use 'hg unshelve --continue' or 'hg unshelve --abort')
445 [255]
445 [20]
446
446
447 abort the unshelve and be happy
447 abort the unshelve and be happy
448
448
@@ -474,7 +474,7 b' try to continue with no unshelve underwa'
474
474
475 $ hg unshelve -c
475 $ hg unshelve -c
476 abort: no unshelve in progress
476 abort: no unshelve in progress
477 [255]
477 [20]
478 $ hg status
478 $ hg status
479 A foo/foo
479 A foo/foo
480 ? a/a.orig
480 ? a/a.orig
@@ -501,12 +501,12 b' attempt to continue'
501 $ hg commit -m 'commit while unshelve in progress'
501 $ hg commit -m 'commit while unshelve in progress'
502 abort: unshelve already in progress
502 abort: unshelve already in progress
503 (use 'hg unshelve --continue' or 'hg unshelve --abort')
503 (use 'hg unshelve --continue' or 'hg unshelve --abort')
504 [255]
504 [20]
505
505
506 $ hg graft --continue
506 $ hg graft --continue
507 abort: no graft in progress
507 abort: no graft in progress
508 (continue: hg unshelve --continue)
508 (continue: hg unshelve --continue)
509 [255]
509 [20]
510 $ hg unshelve -c
510 $ hg unshelve -c
511 unshelve of 'default' complete
511 unshelve of 'default' complete
512
512
@@ -1184,7 +1184,7 b' Abort unshelve while merging (issue5123)'
1184 $ hg unshelve
1184 $ hg unshelve
1185 abort: outstanding uncommitted merge
1185 abort: outstanding uncommitted merge
1186 (use 'hg commit' or 'hg merge --abort')
1186 (use 'hg commit' or 'hg merge --abort')
1187 [255]
1187 [20]
1188
1188
1189 $ cd ..
1189 $ cd ..
1190
1190
@@ -1483,7 +1483,7 b' Abort unshelve while merging (issue5123)'
1483
1483
1484 $ hg unshelve --continue
1484 $ hg unshelve --continue
1485 abort: no unshelve in progress
1485 abort: no unshelve in progress
1486 [255]
1486 [20]
1487
1487
1488 $ hg shelve --list
1488 $ hg shelve --list
1489 default-01 (*)* changes to: add A to bars (glob)
1489 default-01 (*)* changes to: add A to bars (glob)
@@ -737,7 +737,7 b' progress'
737 #if abortflag
737 #if abortflag
738 $ hg unshelve --abort
738 $ hg unshelve --abort
739 abort: no unshelve in progress
739 abort: no unshelve in progress
740 [255]
740 [20]
741 #else
741 #else
742 $ hg abort
742 $ hg abort
743 aborting the merge, updating back to 9451eaa6eee3
743 aborting the merge, updating back to 9451eaa6eee3
@@ -912,7 +912,7 b' Block merge abort when unshelve in progr'
912 $ hg merge --abort
912 $ hg merge --abort
913 abort: cannot abort merge with unshelve in progress
913 abort: cannot abort merge with unshelve in progress
914 (use 'hg unshelve --continue' or 'hg unshelve --abort')
914 (use 'hg unshelve --continue' or 'hg unshelve --abort')
915 [255]
915 [20]
916
916
917 $ hg unshelve --abort
917 $ hg unshelve --abort
918 unshelve of 'default' aborted
918 unshelve of 'default' aborted
@@ -89,7 +89,7 b' Cannot split while working directory is '
89 $ hg add dirty
89 $ hg add dirty
90 $ hg split .
90 $ hg split .
91 abort: uncommitted changes
91 abort: uncommitted changes
92 [255]
92 [20]
93 $ hg forget dirty
93 $ hg forget dirty
94 $ rm dirty
94 $ rm dirty
95
95
@@ -317,7 +317,7 b' before strip of merge parent'
317 $ hg strip 4
317 $ hg strip 4
318 abort: outstanding uncommitted merge
318 abort: outstanding uncommitted merge
319 (use 'hg commit' or 'hg merge --abort')
319 (use 'hg commit' or 'hg merge --abort')
320 [255]
320 [20]
321 ##strip allowed --force with merge in progress
321 ##strip allowed --force with merge in progress
322 $ hg strip 4 --force
322 $ hg strip 4 --force
323 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -606,7 +606,7 b' Verify strip protects against stripping '
606 $ echo c > b
606 $ echo c > b
607 $ hg strip tip
607 $ hg strip tip
608 abort: uncommitted changes
608 abort: uncommitted changes
609 [255]
609 [20]
610 $ hg strip tip --keep
610 $ hg strip tip --keep
611 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
611 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
612 $ hg log --graph
612 $ hg log --graph
@@ -758,7 +758,7 b' test hg strip -B bookmark'
758 $ hg add a
758 $ hg add a
759 $ hg strip -B B
759 $ hg strip -B B
760 abort: uncommitted changes
760 abort: uncommitted changes
761 [255]
761 [20]
762 $ hg bookmarks
762 $ hg bookmarks
763 * B 6:ff43616e5d0f
763 * B 6:ff43616e5d0f
764
764
@@ -492,11 +492,11 b' tagging on an uncommitted merge (issue25'
492
492
493 $ hg tag t1
493 $ hg tag t1
494 abort: uncommitted merge
494 abort: uncommitted merge
495 [255]
495 [20]
496 $ hg status
496 $ hg status
497 $ hg tag --rev 1 t2
497 $ hg tag --rev 1 t2
498 abort: uncommitted merge
498 abort: uncommitted merge
499 [255]
499 [20]
500 $ hg tag --rev 1 --local t3
500 $ hg tag --rev 1 --local t3
501 $ hg tags -v
501 $ hg tags -v
502 tip 2:2a156e8887cc
502 tip 2:2a156e8887cc
@@ -53,12 +53,12 b''
53 $ hg transplant 1
53 $ hg transplant 1
54 abort: outstanding uncommitted merge
54 abort: outstanding uncommitted merge
55 (use 'hg commit' or 'hg merge --abort')
55 (use 'hg commit' or 'hg merge --abort')
56 [255]
56 [20]
57 $ hg up -qC tip
57 $ hg up -qC tip
58 $ echo b0 > b1
58 $ echo b0 > b1
59 $ hg transplant 1
59 $ hg transplant 1
60 abort: uncommitted changes
60 abort: uncommitted changes
61 [255]
61 [20]
62 $ hg up -qC tip
62 $ hg up -qC tip
63 $ echo b2 > b2
63 $ echo b2 > b2
64 $ hg ci -Amb2 -d '1 0'
64 $ hg ci -Amb2 -d '1 0'
@@ -513,10 +513,10 b" transplant -c shouldn't use an old chang"
513 $ hg continue
513 $ hg continue
514 abort: no transplant to continue (continueflag !)
514 abort: no transplant to continue (continueflag !)
515 abort: no operation in progress (no-continueflag !)
515 abort: no operation in progress (no-continueflag !)
516 [255]
516 [20]
517 $ hg transplant --stop
517 $ hg transplant --stop
518 abort: no interrupted transplant found
518 abort: no interrupted transplant found
519 [255]
519 [20]
520 $ hg transplant 1
520 $ hg transplant 1
521 applying 46ae92138f3c
521 applying 46ae92138f3c
522 patching file foo
522 patching file foo
@@ -571,7 +571,7 b' test multiple revisions, --continue and '
571 $ hg transplant 1:3
571 $ hg transplant 1:3
572 abort: transplant in progress
572 abort: transplant in progress
573 (use 'hg transplant --continue' or 'hg transplant --stop')
573 (use 'hg transplant --continue' or 'hg transplant --stop')
574 [255]
574 [20]
575 $ hg status -v
575 $ hg status -v
576 A bar
576 A bar
577 ? added.rej
577 ? added.rej
@@ -168,11 +168,11 b' Uncommit with dirty state'
168 $ hg uncommit
168 $ hg uncommit
169 abort: uncommitted changes
169 abort: uncommitted changes
170 (requires --allow-dirty-working-copy to uncommit)
170 (requires --allow-dirty-working-copy to uncommit)
171 [255]
171 [20]
172 $ hg uncommit files
172 $ hg uncommit files
173 abort: uncommitted changes
173 abort: uncommitted changes
174 (requires --allow-dirty-working-copy to uncommit)
174 (requires --allow-dirty-working-copy to uncommit)
175 [255]
175 [20]
176 $ cat files
176 $ cat files
177 abcde
177 abcde
178 foo
178 foo
@@ -184,7 +184,7 b" Testing the 'experimental.uncommitondirt"
184 $ hg uncommit
184 $ hg uncommit
185 abort: uncommitted changes
185 abort: uncommitted changes
186 (requires --allow-dirty-working-copy to uncommit)
186 (requires --allow-dirty-working-copy to uncommit)
187 [255]
187 [20]
188 $ hg uncommit --config experimental.uncommitondirtywdir=True
188 $ hg uncommit --config experimental.uncommitondirtywdir=True
189 $ hg commit -m "files abcde + foo"
189 $ hg commit -m "files abcde + foo"
190
190
@@ -407,7 +407,7 b' Add and expect uncommit to fail on both '
407 $ hg uncommit
407 $ hg uncommit
408 abort: outstanding uncommitted merge
408 abort: outstanding uncommitted merge
409 (requires --allow-dirty-working-copy to uncommit)
409 (requires --allow-dirty-working-copy to uncommit)
410 [255]
410 [20]
411
411
412 $ hg uncommit --config experimental.uncommitondirtywdir=True
412 $ hg uncommit --config experimental.uncommitondirtywdir=True
413 abort: cannot uncommit while merging
413 abort: cannot uncommit while merging
@@ -507,7 +507,7 b' Copy a->b1 and a->b2, then rename b1->c '
507 $ hg uncommit b
507 $ hg uncommit b
508 abort: uncommitted changes
508 abort: uncommitted changes
509 (requires --allow-dirty-working-copy to uncommit)
509 (requires --allow-dirty-working-copy to uncommit)
510 [255]
510 [20]
511 $ hg uncommit --allow-dirty-working-copy b
511 $ hg uncommit --allow-dirty-working-copy b
512 $ hg log
512 $ hg log
513 changeset: 3:30fa958635b2
513 changeset: 3:30fa958635b2
@@ -701,6 +701,6 b' Test that boolean flags allow --no-flag '
701 > EOF
701 > EOF
702 $ hg co 2
702 $ hg co 2
703 abort: uncommitted changes
703 abort: uncommitted changes
704 [255]
704 [20]
705 $ hg co --no-check 2
705 $ hg co --no-check 2
706 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
706 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -19,7 +19,7 b' Test that local removed/deleted, remote '
19 $ echo dirty > foo
19 $ echo dirty > foo
20 $ hg up -c
20 $ hg up -c
21 abort: uncommitted changes
21 abort: uncommitted changes
22 [255]
22 [20]
23 $ hg up -q
23 $ hg up -q
24 $ cat foo
24 $ cat foo
25 dirty
25 dirty
General Comments 0
You need to be logged in to leave comments. Login now