This very similar to an earlier patch (which was for InputError).
In this patch, I also updated the transplant extension only because
test-transplant.t would otherwise have needed a #if continueflag.
( )
durin42 | |
mharbison72 |
hg-reviewers |
This very similar to an earlier patch (which was for InputError).
In this patch, I also updated the transplant extension only because
test-transplant.t would otherwise have needed a #if continueflag.
No Linters Available |
No Unit Test Coverage |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
4a5c1208c268 | e305e2b8b908 | Martin von Zweigbergk | Oct 12 2020, 3:44 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
tp = transplanter(ui, repo, opts) | tp = transplanter(ui, repo, opts) | ||||
p1 = repo.dirstate.p1() | p1 = repo.dirstate.p1() | ||||
if len(repo) > 0 and p1 == revlog.nullid: | if len(repo) > 0 and p1 == revlog.nullid: | ||||
raise error.Abort(_(b'no revision checked out')) | raise error.Abort(_(b'no revision checked out')) | ||||
if opts.get(b'continue'): | if opts.get(b'continue'): | ||||
if not tp.canresume(): | if not tp.canresume(): | ||||
raise error.Abort(_(b'no transplant to continue')) | raise error.StateError(_(b'no transplant to continue')) | ||||
elif opts.get(b'stop'): | elif opts.get(b'stop'): | ||||
if not tp.canresume(): | if not tp.canresume(): | ||||
raise error.Abort(_(b'no interrupted transplant found')) | raise error.StateError(_(b'no interrupted transplant found')) | ||||
return tp.stop(ui, repo) | return tp.stop(ui, repo) | ||||
else: | else: | ||||
cmdutil.checkunfinished(repo) | cmdutil.checkunfinished(repo) | ||||
cmdutil.bailifchanged(repo) | cmdutil.bailifchanged(repo) | ||||
sourcerepo = opts.get(b'source') | sourcerepo = opts.get(b'source') | ||||
if sourcerepo: | if sourcerepo: | ||||
peer = hg.peer(repo, opts, ui.expandpath(sourcerepo)) | peer = hg.peer(repo, opts, ui.expandpath(sourcerepo)) |
'merge' can be set to false if a pending uncommitted merge should be | 'merge' can be set to false if a pending uncommitted merge should be | ||||
ignored (such as when 'update --check' runs). | ignored (such as when 'update --check' runs). | ||||
'hint' is the usual hint given to Abort exception. | 'hint' is the usual hint given to Abort exception. | ||||
""" | """ | ||||
if merge and repo.dirstate.p2() != nullid: | if merge and repo.dirstate.p2() != nullid: | ||||
raise error.Abort(_(b'outstanding uncommitted merge'), hint=hint) | raise error.StateError(_(b'outstanding uncommitted merge'), hint=hint) | ||||
st = repo.status() | st = repo.status() | ||||
if st.modified or st.added or st.removed or st.deleted: | if st.modified or st.added or st.removed or st.deleted: | ||||
raise error.Abort(_(b'uncommitted changes'), hint=hint) | raise error.StateError(_(b'uncommitted changes'), hint=hint) | ||||
ctx = repo[None] | ctx = repo[None] | ||||
for s in sorted(ctx.substate): | for s in sorted(ctx.substate): | ||||
ctx.sub(s).bailifchanged(hint=hint) | ctx.sub(s).bailifchanged(hint=hint) | ||||
def logmessage(ui, opts): | def logmessage(ui, opts): | ||||
""" get the log message according to -m and -l option """ | """ get the log message according to -m and -l option """ | ||||
for state in statemod._unfinishedstates: | for state in statemod._unfinishedstates: | ||||
if ( | if ( | ||||
state._clearable | state._clearable | ||||
or (commit and state._allowcommit) | or (commit and state._allowcommit) | ||||
or state._reportonly | or state._reportonly | ||||
): | ): | ||||
continue | continue | ||||
if state.isunfinished(repo): | if state.isunfinished(repo): | ||||
raise error.Abort(state.msg(), hint=state.hint()) | raise error.StateError(state.msg(), hint=state.hint()) | ||||
for s in statemod._unfinishedstates: | for s in statemod._unfinishedstates: | ||||
if ( | if ( | ||||
not s._clearable | not s._clearable | ||||
or (commit and s._allowcommit) | or (commit and s._allowcommit) | ||||
or (s._opname == b'merge' and skipmerge) | or (s._opname == b'merge' and skipmerge) | ||||
or s._reportonly | or s._reportonly | ||||
): | ): | ||||
continue | continue | ||||
if s.isunfinished(repo): | if s.isunfinished(repo): | ||||
raise error.Abort(s.msg(), hint=s.hint()) | raise error.StateError(s.msg(), hint=s.hint()) | ||||
def clearunfinished(repo): | def clearunfinished(repo): | ||||
'''Check for unfinished operations (as above), and clear the ones | '''Check for unfinished operations (as above), and clear the ones | ||||
that are clearable. | that are clearable. | ||||
''' | ''' | ||||
for state in statemod._unfinishedstates: | for state in statemod._unfinishedstates: | ||||
if state._reportonly: | if state._reportonly: | ||||
continue | continue | ||||
if not state._clearable and state.isunfinished(repo): | if not state._clearable and state.isunfinished(repo): | ||||
raise error.Abort(state.msg(), hint=state.hint()) | raise error.StateError(state.msg(), hint=state.hint()) | ||||
for s in statemod._unfinishedstates: | for s in statemod._unfinishedstates: | ||||
if s._opname == b'merge' or state._reportonly: | if s._opname == b'merge' or state._reportonly: | ||||
continue | continue | ||||
if s._clearable and s.isunfinished(repo): | if s._clearable and s.isunfinished(repo): | ||||
util.unlink(repo.vfs.join(s._fname)) | util.unlink(repo.vfs.join(s._fname)) | ||||
If there's no task (repo.ui.note for 'hg commit'), it does not offer | If there's no task (repo.ui.note for 'hg commit'), it does not offer | ||||
a hint. | a hint. | ||||
''' | ''' | ||||
after = howtocontinue(repo) | after = howtocontinue(repo) | ||||
hint = None | hint = None | ||||
if after[1]: | if after[1]: | ||||
hint = after[0] | hint = after[0] | ||||
raise error.Abort(_(b'no %s in progress') % task, hint=hint) | raise error.StateError(_(b'no %s in progress') % task, hint=hint) | ||||
def abortgraft(ui, repo, graftstate): | def abortgraft(ui, repo, graftstate): | ||||
"""abort the interrupted graft and rollbacks to the state before interrupted | """abort the interrupted graft and rollbacks to the state before interrupted | ||||
graft""" | graft""" | ||||
if not graftstate.exists(): | if not graftstate.exists(): | ||||
raise error.Abort(_(b"no interrupted graft to abort")) | raise error.StateError(_(b"no interrupted graft to abort")) | ||||
statedata = readgraftstate(repo, graftstate) | statedata = readgraftstate(repo, graftstate) | ||||
newnodes = statedata.get(b'newnodes') | newnodes = statedata.get(b'newnodes') | ||||
if newnodes is None: | if newnodes is None: | ||||
# and old graft state which does not have all the data required to abort | # and old graft state which does not have all the data required to abort | ||||
# the graft | # the graft | ||||
raise error.Abort(_(b"cannot abort using an old graftstate")) | raise error.Abort(_(b"cannot abort using an old graftstate")) | ||||
# changeset from which graft operation was started | # changeset from which graft operation was started |
Aborts a multistep operation like graft, histedit, rebase, merge, | Aborts a multistep operation like graft, histedit, rebase, merge, | ||||
and unshelve if they are in an unfinished state. | and unshelve if they are in an unfinished state. | ||||
use --dry-run/-n to dry run the command. | use --dry-run/-n to dry run the command. | ||||
""" | """ | ||||
dryrun = opts.get('dry_run') | dryrun = opts.get('dry_run') | ||||
abortstate = cmdutil.getunfinishedstate(repo) | abortstate = cmdutil.getunfinishedstate(repo) | ||||
if not abortstate: | if not abortstate: | ||||
raise error.Abort(_(b'no operation in progress')) | raise error.StateError(_(b'no operation in progress')) | ||||
if not abortstate.abortfunc: | if not abortstate.abortfunc: | ||||
raise error.InputError( | raise error.InputError( | ||||
( | ( | ||||
_(b"%s in progress but does not support 'hg abort'") | _(b"%s in progress but does not support 'hg abort'") | ||||
% (abortstate._opname) | % (abortstate._opname) | ||||
), | ), | ||||
hint=abortstate.hint(), | hint=abortstate.hint(), | ||||
) | ) | ||||
displayer = logcmdutil.changesetdisplayer(ui, repo, {}) | displayer = logcmdutil.changesetdisplayer(ui, repo, {}) | ||||
if command: | if command: | ||||
changesets = 1 | changesets = 1 | ||||
if noupdate: | if noupdate: | ||||
try: | try: | ||||
node = state[b'current'][0] | node = state[b'current'][0] | ||||
except LookupError: | except LookupError: | ||||
raise error.Abort( | raise error.StateError( | ||||
_( | _( | ||||
b'current bisect revision is unknown - ' | b'current bisect revision is unknown - ' | ||||
b'start a new bisect to fix' | b'start a new bisect to fix' | ||||
) | ) | ||||
) | ) | ||||
else: | else: | ||||
node, p2 = repo.dirstate.parents() | node, p2 = repo.dirstate.parents() | ||||
if p2 != nullid: | if p2 != nullid: | ||||
raise error.Abort(_(b'current bisect revision is a merge')) | raise error.StateError(_(b'current bisect revision is a merge')) | ||||
if rev: | if rev: | ||||
node = repo[scmutil.revsingle(repo, rev, node)].node() | node = repo[scmutil.revsingle(repo, rev, node)].node() | ||||
with hbisect.restore_state(repo, state, node): | with hbisect.restore_state(repo, state, node): | ||||
while changesets: | while changesets: | ||||
# update state | # update state | ||||
state[b'current'] = [node] | state[b'current'] = [node] | ||||
hbisect.save_state(repo, state) | hbisect.save_state(repo, state) | ||||
status = ui.system( | status = ui.system( | ||||
if extendnode is not None: | if extendnode is not None: | ||||
ui.write( | ui.write( | ||||
_(b"Extending search to changeset %d:%s\n") | _(b"Extending search to changeset %d:%s\n") | ||||
% (extendnode.rev(), extendnode) | % (extendnode.rev(), extendnode) | ||||
) | ) | ||||
state[b'current'] = [extendnode.node()] | state[b'current'] = [extendnode.node()] | ||||
hbisect.save_state(repo, state) | hbisect.save_state(repo, state) | ||||
return mayupdate(repo, extendnode.node()) | return mayupdate(repo, extendnode.node()) | ||||
raise error.Abort(_(b"nothing to extend")) | raise error.StateError(_(b"nothing to extend")) | ||||
if changesets == 0: | if changesets == 0: | ||||
hbisect.printresult(ui, repo, state, displayer, nodes, good) | hbisect.printresult(ui, repo, state, displayer, nodes, good) | ||||
else: | else: | ||||
assert len(nodes) == 1 # only a single node can be tested next | assert len(nodes) == 1 # only a single node can be tested next | ||||
node = nodes[0] | node = nodes[0] | ||||
# compute the approximate number of remaining tests | # compute the approximate number of remaining tests | ||||
tests, size = 0, 2 | tests, size = 0, 2 | ||||
Finishes a multistep operation like graft, histedit, rebase, merge, | Finishes a multistep operation like graft, histedit, rebase, merge, | ||||
and unshelve if they are in an interrupted state. | and unshelve if they are in an interrupted state. | ||||
use --dry-run/-n to dry run the command. | use --dry-run/-n to dry run the command. | ||||
""" | """ | ||||
dryrun = opts.get('dry_run') | dryrun = opts.get('dry_run') | ||||
contstate = cmdutil.getunfinishedstate(repo) | contstate = cmdutil.getunfinishedstate(repo) | ||||
if not contstate: | if not contstate: | ||||
raise error.Abort(_(b'no operation in progress')) | raise error.StateError(_(b'no operation in progress')) | ||||
if not contstate.continuefunc: | if not contstate.continuefunc: | ||||
raise error.Abort( | raise error.StateError( | ||||
( | ( | ||||
_(b"%s in progress but does not support 'hg continue'") | _(b"%s in progress but does not support 'hg continue'") | ||||
% (contstate._opname) | % (contstate._opname) | ||||
), | ), | ||||
hint=contstate.continuemsg(), | hint=contstate.continuemsg(), | ||||
) | ) | ||||
if dryrun: | if dryrun: | ||||
ui.status(_(b'%s in progress, will be resumed\n') % (contstate._opname)) | ui.status(_(b'%s in progress, will be resumed\n') % (contstate._opname)) | ||||
graftstate.delete() | graftstate.delete() | ||||
return 0 | return 0 | ||||
def _stopgraft(ui, repo, graftstate): | def _stopgraft(ui, repo, graftstate): | ||||
"""stop the interrupted graft""" | """stop the interrupted graft""" | ||||
if not graftstate.exists(): | if not graftstate.exists(): | ||||
raise error.Abort(_(b"no interrupted graft found")) | raise error.StateError(_(b"no interrupted graft found")) | ||||
pctx = repo[b'.'] | pctx = repo[b'.'] | ||||
mergemod.clean_update(pctx) | mergemod.clean_update(pctx) | ||||
graftstate.delete() | graftstate.delete() | ||||
ui.status(_(b"stopped the interrupted graft\n")) | ui.status(_(b"stopped the interrupted graft\n")) | ||||
ui.status(_(b"working directory is now at %s\n") % pctx.hex()[:12]) | ui.status(_(b"working directory is now at %s\n") % pctx.hex()[:12]) | ||||
return 0 | return 0 | ||||
opts = pycompat.byteskwargs(opts) | opts = pycompat.byteskwargs(opts) | ||||
abort = opts.get(b'abort') | abort = opts.get(b'abort') | ||||
if abort and repo.dirstate.p2() == nullid: | if abort and repo.dirstate.p2() == nullid: | ||||
cmdutil.wrongtooltocontinue(repo, _(b'merge')) | cmdutil.wrongtooltocontinue(repo, _(b'merge')) | ||||
cmdutil.check_incompatible_arguments(opts, b'abort', [b'rev', b'preview']) | cmdutil.check_incompatible_arguments(opts, b'abort', [b'rev', b'preview']) | ||||
if abort: | if abort: | ||||
state = cmdutil.getunfinishedstate(repo) | state = cmdutil.getunfinishedstate(repo) | ||||
if state and state._opname != b'merge': | if state and state._opname != b'merge': | ||||
raise error.Abort( | raise error.StateError( | ||||
_(b'cannot abort merge with %s in progress') % (state._opname), | _(b'cannot abort merge with %s in progress') % (state._opname), | ||||
hint=state.hint(), | hint=state.hint(), | ||||
) | ) | ||||
if node: | if node: | ||||
raise error.InputError(_(b"cannot specify a node with --abort")) | raise error.InputError(_(b"cannot specify a node with --abort")) | ||||
return hg.abortmerge(repo.ui, repo) | return hg.abortmerge(repo.ui, repo) | ||||
if opts.get(b'rev') and node: | if opts.get(b'rev') and node: | ||||
fm.plain(b'%s\n' % uipathfn(f), label=label) | fm.plain(b'%s\n' % uipathfn(f), label=label) | ||||
fm.end() | fm.end() | ||||
return 0 | return 0 | ||||
with repo.wlock(): | with repo.wlock(): | ||||
ms = mergestatemod.mergestate.read(repo) | ms = mergestatemod.mergestate.read(repo) | ||||
if not (ms.active() or repo.dirstate.p2() != nullid): | if not (ms.active() or repo.dirstate.p2() != nullid): | ||||
raise error.Abort( | raise error.StateError( | ||||
_(b'resolve command not applicable when not merging') | _(b'resolve command not applicable when not merging') | ||||
) | ) | ||||
wctx = repo[None] | wctx = repo[None] | ||||
m = scmutil.match(wctx, pats, opts) | m = scmutil.match(wctx, pats, opts) | ||||
ret = 0 | ret = 0 | ||||
didwork = False | didwork = False | ||||
b'warning: the following files still have conflict ' | b'warning: the following files still have conflict ' | ||||
b'markers:\n' | b'markers:\n' | ||||
) | ) | ||||
+ b''.join( | + b''.join( | ||||
b' ' + uipathfn(f) + b'\n' for f in hasconflictmarkers | b' ' + uipathfn(f) + b'\n' for f in hasconflictmarkers | ||||
) | ) | ||||
) | ) | ||||
if markcheck == b'abort' and not all and not pats: | if markcheck == b'abort' and not all and not pats: | ||||
raise error.Abort( | raise error.StateError( | ||||
_(b'conflict markers detected'), | _(b'conflict markers detected'), | ||||
hint=_(b'use --all to mark anyway'), | hint=_(b'use --all to mark anyway'), | ||||
) | ) | ||||
for f in tocomplete: | for f in tocomplete: | ||||
try: | try: | ||||
# resolve file | # resolve file | ||||
overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')} | overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')} | ||||
for n in names: | for n in names: | ||||
if n in repo.tags(): | if n in repo.tags(): | ||||
raise error.InputError( | raise error.InputError( | ||||
_(b"tag '%s' already exists (use -f to force)") % n | _(b"tag '%s' already exists (use -f to force)") % n | ||||
) | ) | ||||
if not opts.get(b'local'): | if not opts.get(b'local'): | ||||
p1, p2 = repo.dirstate.parents() | p1, p2 = repo.dirstate.parents() | ||||
if p2 != nullid: | if p2 != nullid: | ||||
raise error.Abort(_(b'uncommitted merge')) | raise error.StateError(_(b'uncommitted merge')) | ||||
bheads = repo.branchheads() | bheads = repo.branchheads() | ||||
if not opts.get(b'force') and bheads and p1 not in bheads: | if not opts.get(b'force') and bheads and p1 not in bheads: | ||||
raise error.InputError( | raise error.InputError( | ||||
_( | _( | ||||
b'working directory is not at a branch head ' | b'working directory is not at a branch head ' | ||||
b'(use -f to force)' | b'(use -f to force)' | ||||
) | ) | ||||
) | ) |
class InputError(Abort): | class InputError(Abort): | ||||
"""Indicates that the user made an error in their input. | """Indicates that the user made an error in their input. | ||||
Examples: Invalid command, invalid flags, invalid revision. | Examples: Invalid command, invalid flags, invalid revision. | ||||
""" | """ | ||||
class StateError(Abort): | |||||
"""Indicates that the operation might work if retried in a different state. | |||||
Examples: Unresolved merge conflicts, unfinished operations. | |||||
""" | |||||
class HookLoadError(Abort): | class HookLoadError(Abort): | ||||
"""raised when loading a hook fails, aborting an operation | """raised when loading a hook fails, aborting an operation | ||||
Exists to allow more specialized catching.""" | Exists to allow more specialized catching.""" | ||||
class HookAbort(Abort): | class HookAbort(Abort): | ||||
"""raised when a validation hook fails, aborting an operation | """raised when a validation hook fails, aborting an operation |
ui.error(_(b"(%s)\n") % inst.hint) | ui.error(_(b"(%s)\n") % inst.hint) | ||||
detailed_exit_code = 240 | detailed_exit_code = 240 | ||||
coarse_exit_code = 1 | coarse_exit_code = 1 | ||||
except error.WdirUnsupported: | except error.WdirUnsupported: | ||||
ui.error(_(b"abort: working directory revision cannot be specified\n")) | ui.error(_(b"abort: working directory revision cannot be specified\n")) | ||||
except error.Abort as inst: | except error.Abort as inst: | ||||
if isinstance(inst, error.InputError): | if isinstance(inst, error.InputError): | ||||
detailed_exit_code = 10 | detailed_exit_code = 10 | ||||
elif isinstance(inst, error.StateError): | |||||
detailed_exit_code = 20 | |||||
ui.error(_(b"abort: %s\n") % inst.message) | ui.error(_(b"abort: %s\n") % inst.message) | ||||
if inst.hint: | if inst.hint: | ||||
ui.error(_(b"(%s)\n") % inst.hint) | ui.error(_(b"(%s)\n") % inst.hint) | ||||
except error.WorkerError as inst: | except error.WorkerError as inst: | ||||
# Don't print a message -- the worker already should have | # Don't print a message -- the worker already should have | ||||
return inst.status_code | return inst.status_code | ||||
except ImportError as inst: | except ImportError as inst: | ||||
ui.error(_(b"abort: %s!\n") % stringutil.forcebytestr(inst)) | ui.error(_(b"abort: %s!\n") % stringutil.forcebytestr(inst)) |
merging foo.whole | merging foo.whole | ||||
warning: conflicts while merging foo.whole! (edit, then use 'hg resolve --mark') | warning: conflicts while merging foo.whole! (edit, then use 'hg resolve --mark') | ||||
unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | ||||
[240] | [240] | ||||
$ hg --config extensions.rebase= absorb | $ hg --config extensions.rebase= absorb | ||||
abort: rebase in progress | abort: rebase in progress | ||||
(use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | ||||
[255] | [20] | ||||
abort: cannot change branch of changeset with children | abort: cannot change branch of changeset with children | ||||
[255] | [255] | ||||
Change with dirty working directory | Change with dirty working directory | ||||
$ echo bar > a | $ echo bar > a | ||||
$ hg branch -r . foo | $ hg branch -r . foo | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg revert --all | $ hg revert --all | ||||
reverting a | reverting a | ||||
Change on empty revision set | Change on empty revision set | ||||
$ hg branch -r 'draft() - all()' foo | $ hg branch -r 'draft() - all()' foo | ||||
abort: empty revision set | abort: empty revision set | ||||
~ | ~ | ||||
$ hg branch -q default | $ hg branch -q default | ||||
$ hg merge -r 28 | $ hg merge -r 28 | ||||
4 files updated, 0 files merged, 0 files removed, 0 files unresolved | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | (branch merge, don't forget to commit) | ||||
$ hg branch -r . abcd | $ hg branch -r . abcd | ||||
abort: outstanding uncommitted merge | abort: outstanding uncommitted merge | ||||
[255] | [20] | ||||
$ hg ci -m "Merge commit" | $ hg ci -m "Merge commit" | ||||
$ hg glog -r 'parents(.)::' | $ hg glog -r 'parents(.)::' | ||||
@ 30:4d56e6b1eb6b Merge commit | @ 30:4d56e6b1eb6b Merge commit | ||||
|\ default () | |\ default () | ||||
| o 29:6bc1c6c2c9da Added g | | o 29:6bc1c6c2c9da Added g | ||||
| | jkl () | | | jkl () | ||||
| ~ | | ~ |
update: 2 new changesets, 2 branch heads (merge) | update: 2 new changesets, 2 branch heads (merge) | ||||
phases: 4 draft | phases: 4 draft | ||||
Testing the abort functionality first in case of conflicts | Testing the abort functionality first in case of conflicts | ||||
$ hg abort | $ hg abort | ||||
abort: no merge in progress (abortflag !) | abort: no merge in progress (abortflag !) | ||||
abort: no operation in progress (abortcommand !) | abort: no operation in progress (abortcommand !) | ||||
[255] | [20] | ||||
$ hg merge | $ hg merge | ||||
merging A | merging A | ||||
warning: conflicts while merging A! (edit, then use 'hg resolve --mark') | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') | ||||
1 files updated, 0 files merged, 0 files removed, 1 files unresolved | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||||
use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | ||||
[1] | [1] | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
new changeset 4:f7faa0b7d3c6 merges remote changes with local | new changeset 4:f7faa0b7d3c6 merges remote changes with local | ||||
$ rm i/g | $ rm i/g | ||||
should abort, because i is modified | should abort, because i is modified | ||||
$ hg --cwd i fetch ../h | $ hg --cwd i fetch ../h | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
test fetch with named branches | test fetch with named branches | ||||
$ hg init nbase | $ hg init nbase | ||||
$ echo base > nbase/a | $ echo base > nbase/a | ||||
$ hg -R nbase ci -Am base | $ hg -R nbase ci -Am base | ||||
adding a | adding a | ||||
$ hg -R nbase branch a | $ hg -R nbase branch a |
$ hg --config extensions.rebase= fix --working-dir | $ hg --config extensions.rebase= fix --working-dir | ||||
abort: unresolved conflicts | abort: unresolved conflicts | ||||
(use 'hg resolve') | (use 'hg resolve') | ||||
[255] | [255] | ||||
$ hg --config extensions.rebase= fix -r . | $ hg --config extensions.rebase= fix -r . | ||||
abort: rebase in progress | abort: rebase in progress | ||||
(use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | ||||
[255] | [20] | ||||
$ cd .. | $ cd .. | ||||
When fixing a file that was renamed, we should diff against the source of the | When fixing a file that was renamed, we should diff against the source of the | ||||
rename for incremental fixing and we should correctly reproduce the rename in | rename for incremental fixing and we should correctly reproduce the rename in | ||||
the replacement revision. | the replacement revision. | ||||
$ hg init fixrenamecommit | $ hg init fixrenamecommit |
$ hg up '.^^' | $ hg up '.^^' | ||||
0 files updated, 0 files merged, 2 files removed, 0 files unresolved | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | ||||
$ echo foo > d | $ echo foo > d | ||||
$ hg ci -Aqm "added foo to d" | $ hg ci -Aqm "added foo to d" | ||||
$ hg graft --stop | $ hg graft --stop | ||||
abort: no interrupted graft found | abort: no interrupted graft found | ||||
[255] | [20] | ||||
$ hg graft -r 3 | $ hg graft -r 3 | ||||
grafting 3:9150fe93bec6 "added d" | grafting 3:9150fe93bec6 "added d" | ||||
merging d | merging d | ||||
warning: conflicts while merging d! (edit, then use 'hg resolve --mark') | warning: conflicts while merging d! (edit, then use 'hg resolve --mark') | ||||
abort: unresolved conflicts, can't continue | abort: unresolved conflicts, can't continue | ||||
(use 'hg resolve' and 'hg graft --continue') | (use 'hg resolve' and 'hg graft --continue') | ||||
[1] | [1] | ||||
o 0:9092f1db7931 added a | o 0:9092f1db7931 added a | ||||
$ hg up 9150fe93bec6 | $ hg up 9150fe93bec6 | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg abort | $ hg abort | ||||
abort: no interrupted graft to abort (abortflag !) | abort: no interrupted graft to abort (abortflag !) | ||||
abort: no operation in progress (abortcommand !) | abort: no operation in progress (abortcommand !) | ||||
[255] | [20] | ||||
when stripping is required | when stripping is required | ||||
$ hg graft -r 4 -r 5 | $ hg graft -r 4 -r 5 | ||||
grafting 4:863a25e1a9ea "added x" | grafting 4:863a25e1a9ea "added x" | ||||
grafting 5:36b793615f78 "added foo to c" (tip) | grafting 5:36b793615f78 "added foo to c" (tip) | ||||
merging c | merging c | ||||
warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | ||||
abort: unresolved conflicts, can't continue | abort: unresolved conflicts, can't continue |
note: graft of 2:5c095ad7e90f created no changes to commit | note: graft of 2:5c095ad7e90f created no changes to commit | ||||
Can't continue without starting: | Can't continue without starting: | ||||
$ hg -q up -cr tip | $ hg -q up -cr tip | ||||
$ hg rm -q e | $ hg rm -q e | ||||
$ hg graft --continue | $ hg graft --continue | ||||
abort: no graft in progress | abort: no graft in progress | ||||
[255] | [20] | ||||
$ hg revert -r . -q e | $ hg revert -r . -q e | ||||
Need to specify a rev: | Need to specify a rev: | ||||
$ hg graft | $ hg graft | ||||
abort: no revisions specified | abort: no revisions specified | ||||
[10] | [10] | ||||
[10] | [10] | ||||
Can't graft with dirty wd: | Can't graft with dirty wd: | ||||
$ hg up -q 0 | $ hg up -q 0 | ||||
$ echo foo > a | $ echo foo > a | ||||
$ hg graft 1 | $ hg graft 1 | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg revert a | $ hg revert a | ||||
Graft a rename: | Graft a rename: | ||||
(this also tests that editor is invoked if '--edit' is specified) | (this also tests that editor is invoked if '--edit' is specified) | ||||
$ hg status --rev "2^1" --rev 2 | $ hg status --rev "2^1" --rev 2 | ||||
A b | A b | ||||
R a | R a | ||||
# To stop: hg graft --stop | # To stop: hg graft --stop | ||||
Commit while interrupted should fail: | Commit while interrupted should fail: | ||||
$ hg ci -m 'commit interrupted graft' | $ hg ci -m 'commit interrupted graft' | ||||
abort: graft in progress | abort: graft in progress | ||||
(use 'hg graft --continue' or 'hg graft --stop' to stop) | (use 'hg graft --continue' or 'hg graft --stop' to stop) | ||||
[255] | [20] | ||||
Abort the graft and try committing: | Abort the graft and try committing: | ||||
$ hg up -C . | $ hg up -C . | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ echo c >> e | $ echo c >> e | ||||
$ hg ci -mtest | $ hg ci -mtest | ||||
one | one | ||||
histedit --continue/--abort with no existing state | histedit --continue/--abort with no existing state | ||||
-------------------------------------------------- | -------------------------------------------------- | ||||
$ hg histedit --continue | $ hg histedit --continue | ||||
abort: no histedit in progress | abort: no histedit in progress | ||||
[255] | [20] | ||||
$ hg abort | $ hg abort | ||||
abort: no histedit in progress (abortflag !) | abort: no histedit in progress (abortflag !) | ||||
abort: no operation in progress (abortcommand !) | abort: no operation in progress (abortcommand !) | ||||
[255] | [20] | ||||
Run a dummy edit to make sure we get tip^^ correctly via revsingle. | Run a dummy edit to make sure we get tip^^ correctly via revsingle. | ||||
-------------------------------------------------------------------- | -------------------------------------------------------------------- | ||||
$ HGEDITOR=cat hg histedit "tip^^" | $ HGEDITOR=cat hg histedit "tip^^" | ||||
pick eb57da33312f 2 three | pick eb57da33312f 2 three | ||||
pick c8e68270e35a 3 four | pick c8e68270e35a 3 four | ||||
pick 08d98a8350f3 4 five | pick 08d98a8350f3 4 five | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
Editing (08d98a8350f3), you may commit or record as needed now. | Editing (08d98a8350f3), you may commit or record as needed now. | ||||
(hg histedit --continue to resume) | (hg histedit --continue to resume) | ||||
[240] | [240] | ||||
$ hg graft --continue | $ hg graft --continue | ||||
abort: no graft in progress | abort: no graft in progress | ||||
(continue: hg histedit --continue) | (continue: hg histedit --continue) | ||||
[255] | [20] | ||||
$ mv .hg/histedit-state .hg/histedit-state.back | $ mv .hg/histedit-state .hg/histedit-state.back | ||||
$ hg update --quiet --clean 2 | $ hg update --quiet --clean 2 | ||||
$ echo alpha >> alpha | $ echo alpha >> alpha | ||||
$ mv .hg/histedit-state.back .hg/histedit-state | $ mv .hg/histedit-state.back .hg/histedit-state | ||||
$ hg histedit --continue | $ hg histedit --continue | ||||
saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-histedit.hg | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-histedit.hg | ||||
(hg histedit --continue to resume) | (hg histedit --continue to resume) | ||||
[240] | [240] | ||||
$ hg resolve -m --all | $ hg resolve -m --all | ||||
(no more unresolved files) | (no more unresolved files) | ||||
continue: hg histedit --continue | continue: hg histedit --continue | ||||
$ hg commit --amend -m 'reject this fold' | $ hg commit --amend -m 'reject this fold' | ||||
abort: histedit in progress | abort: histedit in progress | ||||
(use 'hg histedit --continue' or 'hg histedit --abort') | (use 'hg histedit --continue' or 'hg histedit --abort') | ||||
[255] | [20] | ||||
With markers enabled, histedit does not get confused, and | With markers enabled, histedit does not get confused, and | ||||
amend should not be blocked by the ongoing histedit. | amend should not be blocked by the ongoing histedit. | ||||
$ cat >>$HGRCPATH <<EOF | $ cat >>$HGRCPATH <<EOF | ||||
> [experimental] | > [experimental] | ||||
> evolution.createmarkers=True | > evolution.createmarkers=True | ||||
> evolution.allowunstable=True | > evolution.allowunstable=True |
date: Thu Jan 01 00:00:00 1970 +0000 | date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: a | summary: a | ||||
dirty a file | dirty a file | ||||
$ echo a > g | $ echo a > g | ||||
$ hg histedit 177f92b77385 --commands - 2>&1 << EOF | $ hg histedit 177f92b77385 --commands - 2>&1 << EOF | ||||
> EOF | > EOF | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ echo g > g | $ echo g > g | ||||
edit the history | edit the history | ||||
$ hg histedit 177f92b77385 --commands - 2>&1 << EOF| fixbundle | $ hg histedit 177f92b77385 --commands - 2>&1 << EOF| fixbundle | ||||
> pick 177f92b77385 c | > pick 177f92b77385 c | ||||
> pick 055a42cdd887 d | > pick 055a42cdd887 d | ||||
> edit e860deea161a e | > edit e860deea161a e | ||||
> pick 652413bf663e f | > pick 652413bf663e f | ||||
> pick 3c6a8ed2ebe8 g | > pick 3c6a8ed2ebe8 g | ||||
> EOF | > EOF | ||||
0 files updated, 0 files merged, 3 files removed, 0 files unresolved | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | ||||
Editing (e860deea161a), you may commit or record as needed now. | Editing (e860deea161a), you may commit or record as needed now. | ||||
(hg histedit --continue to resume) | (hg histedit --continue to resume) | ||||
try to update and get an error | try to update and get an error | ||||
$ hg update tip | $ hg update tip | ||||
abort: histedit in progress | abort: histedit in progress | ||||
(use 'hg histedit --continue' or 'hg histedit --abort') | (use 'hg histedit --continue' or 'hg histedit --abort') | ||||
[255] | [20] | ||||
edit the plan via the editor | edit the plan via the editor | ||||
$ cat >> $TESTTMP/editplan.sh <<EOF | $ cat >> $TESTTMP/editplan.sh <<EOF | ||||
> cat > \$1 <<EOF2 | > cat > \$1 <<EOF2 | ||||
> drop e860deea161a e | > drop e860deea161a e | ||||
> drop 652413bf663e f | > drop 652413bf663e f | ||||
> drop 3c6a8ed2ebe8 g | > drop 3c6a8ed2ebe8 g | ||||
> EOF2 | > EOF2 | ||||
Go at a random point and try to continue | Go at a random point and try to continue | ||||
$ hg id -n | $ hg id -n | ||||
3+ | 3+ | ||||
$ hg up 0 | $ hg up 0 | ||||
abort: histedit in progress | abort: histedit in progress | ||||
(use 'hg histedit --continue' or 'hg histedit --abort') | (use 'hg histedit --continue' or 'hg histedit --abort') | ||||
[255] | [20] | ||||
Try to delete necessary commit | Try to delete necessary commit | ||||
$ hg strip -r 652413b | $ hg strip -r 652413b | ||||
abort: histedit in progress, can't strip 652413bf663e | abort: histedit in progress, can't strip 652413bf663e | ||||
[255] | [255] | ||||
commit, then edit the revision | commit, then edit the revision | ||||
$ hg ci -m 'wat' | $ hg ci -m 'wat' | ||||
created new head | created new head | ||||
$ echo a > e | $ echo a > e | ||||
qnew should fail while we're in the middle of the edit step | qnew should fail while we're in the middle of the edit step | ||||
$ hg --config extensions.mq= qnew please-fail | $ hg --config extensions.mq= qnew please-fail | ||||
abort: histedit in progress | abort: histedit in progress | ||||
(use 'hg histedit --continue' or 'hg histedit --abort') | (use 'hg histedit --continue' or 'hg histedit --abort') | ||||
[255] | [20] | ||||
$ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle | $ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle | ||||
$ hg log --graph | $ hg log --graph | ||||
@ changeset: 6:b5f70786f9b0 | @ changeset: 6:b5f70786f9b0 | ||||
| tag: tip | | tag: tip | ||||
| user: test | | user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | | date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: f | | summary: f |
> pick 2aa920f62fb9 Second | > pick 2aa920f62fb9 Second | ||||
> pick 7181f42b8fca First | > pick 7181f42b8fca First | ||||
> EOF | > EOF | ||||
merging file | merging file | ||||
pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec | pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec | ||||
7181f42b8fca: skipping changeset (no changes) | 7181f42b8fca: skipping changeset (no changes) | ||||
$ hg histedit --abort | $ hg histedit --abort | ||||
abort: no histedit in progress | abort: no histedit in progress | ||||
[255] | [20] | ||||
$ cd .. | $ cd .. | ||||
Test legacy config name | Test legacy config name | ||||
$ hg init r2 | $ hg init r2 | ||||
$ cd r2 | $ cd r2 | ||||
$ echo foo > file | $ echo foo > file | ||||
$ hg add file | $ hg add file |
| | | | ||||
o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" | ||||
abort editing session, after first forcibly updating away | abort editing session, after first forcibly updating away | ||||
$ hg up 0 | $ hg up 0 | ||||
abort: histedit in progress | abort: histedit in progress | ||||
(use 'hg histedit --continue' or 'hg histedit --abort') | (use 'hg histedit --continue' or 'hg histedit --abort') | ||||
[255] | [20] | ||||
$ mv .hg/histedit-state .hg/histedit-state-ignore | $ mv .hg/histedit-state .hg/histedit-state-ignore | ||||
$ hg up 0 | $ hg up 0 | ||||
0 files updated, 0 files merged, 3 files removed, 0 files unresolved | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | ||||
$ mv .hg/histedit-state-ignore .hg/histedit-state | $ mv .hg/histedit-state-ignore .hg/histedit-state | ||||
$ hg sum | $ hg sum | ||||
parent: 0:cb9a9f314b8b | parent: 0:cb9a9f314b8b | ||||
a | a | ||||
branch: default | branch: default |
dirc/baz | dirc/baz | ||||
dirc/baz/largefile | dirc/baz/largefile | ||||
dirc/dirb | dirc/dirb | ||||
dirc/dirb/largefile | dirc/dirb/largefile | ||||
$ hg clone -q . ../fetch | $ hg clone -q . ../fetch | ||||
$ hg --config extensions.fetch= fetch ../fetch | $ hg --config extensions.fetch= fetch ../fetch | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg up -qC | $ hg up -qC | ||||
$ cd .. | $ cd .. | ||||
Clone a local repository owned by another user | Clone a local repository owned by another user | ||||
=================================================== | =================================================== | ||||
#if unix-permissions | #if unix-permissions | ||||
change b | change b | ||||
branch: default | branch: default | ||||
commit: 1 deleted (clean) | commit: 1 deleted (clean) | ||||
update: 1 new changesets, 2 branch heads (merge) | update: 1 new changesets, 2 branch heads (merge) | ||||
phases: 5 draft | phases: 5 draft | ||||
$ hg up --check -r '.^' | $ hg up --check -r '.^' | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg st -S | $ hg st -S | ||||
! a | ! a | ||||
$ hg up -Cq . | $ hg up -Cq . | ||||
Test that dirty is consistent through subrepos | Test that dirty is consistent through subrepos | ||||
$ rm subrepo/b | $ rm subrepo/b | ||||
$ mkdir b && touch b/nonempty | $ mkdir b && touch b/nonempty | ||||
$ hg up | $ hg up | ||||
abort: Unlinking directory not permitted: *$TESTTMP/t/b* (glob) (windows !) | abort: Unlinking directory not permitted: *$TESTTMP/t/b* (glob) (windows !) | ||||
abort: Directory not empty: '?\$TESTTMP/t/b'? (re) (no-windows !) | abort: Directory not empty: '?\$TESTTMP/t/b'? (re) (no-windows !) | ||||
[255] | [255] | ||||
$ hg ci | $ hg ci | ||||
abort: last update was interrupted | abort: last update was interrupted | ||||
(use 'hg update' to get a consistent checkout) | (use 'hg update' to get a consistent checkout) | ||||
[255] | [20] | ||||
$ hg sum | $ hg sum | ||||
parent: 0:538afb845929 | parent: 0:538afb845929 | ||||
commit #0 | commit #0 | ||||
branch: default | branch: default | ||||
commit: 1 unknown (interrupted update) | commit: 1 unknown (interrupted update) | ||||
update: 1 new changesets (update) | update: 1 new changesets (update) | ||||
phases: 2 draft | phases: 2 draft | ||||
Detect interrupted update by hg status --verbose | Detect interrupted update by hg status --verbose |
$ hg commit -A -m "comment #2" | $ hg commit -A -m "comment #2" | ||||
removing b | removing b | ||||
created new head | created new head | ||||
$ hg update 1 | $ hg update 1 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ rm b | $ rm b | ||||
$ hg update -c 2 | $ hg update -c 2 | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg revert b | $ hg revert b | ||||
$ hg update -c 2 | $ hg update -c 2 | ||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ mv a c | $ mv a c | ||||
Should abort: | Should abort: | ||||
$ hg update 1 | $ hg update 1 |
strip with local changes, should complain | strip with local changes, should complain | ||||
$ hg up | $ hg up | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ echo y>y | $ echo y>y | ||||
$ hg add y | $ hg add y | ||||
$ hg strip tip | $ hg strip tip | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
--force strip with local changes | --force strip with local changes | ||||
$ hg strip -f tip | $ hg strip -f tip | ||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
saved backup bundle to $TESTTMP/b/.hg/strip-backup/770eb8fce608-0ddcae0f-backup.hg | saved backup bundle to $TESTTMP/b/.hg/strip-backup/770eb8fce608-0ddcae0f-backup.hg | ||||
$ cd .. | $ cd .. | ||||
$ hg up -q 0 | $ hg up -q 0 | ||||
$ hg mv base a | $ hg mv base a | ||||
$ hg status -C | $ hg status -C | ||||
A a | A a | ||||
base | base | ||||
R base | R base | ||||
$ hg up --check dir | $ hg up --check dir | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg up dir | $ hg up dir | ||||
a: path conflict - a file or link has the same name as a directory | a: path conflict - a file or link has the same name as a directory | ||||
the local file has been renamed to a~d20a80d4def3 | the local file has been renamed to a~d20a80d4def3 | ||||
resolve manually then use 'hg resolve --mark a' | resolve manually then use 'hg resolve --mark a' | ||||
1 files updated, 0 files merged, 0 files removed, 1 files unresolved | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||||
use 'hg resolve' to retry unresolved file merges | use 'hg resolve' to retry unresolved file merges | ||||
(activating bookmark dir) | (activating bookmark dir) | ||||
[1] | [1] | ||||
$ hg status -C | $ hg status -C | ||||
A a~d20a80d4def3 | A a~d20a80d4def3 | ||||
base | base | ||||
R base | R base | ||||
$ hg resolve --list | $ hg resolve --list | ||||
P a | P a | ||||
$ hg up --clean -q 0 | $ hg up --clean -q 0 | ||||
Update clean - local directory conflicts with changed remote file | Update clean - local directory conflicts with changed remote file | ||||
$ hg up -q file | $ hg up -q file | ||||
$ rm a/b | $ rm a/b | ||||
$ mkdir a/b | $ mkdir a/b | ||||
$ echo 9 > a/b/c | $ echo 9 > a/b/c | ||||
$ hg up file2 --check --config merge.checkunknown=warn | $ hg up file2 --check --config merge.checkunknown=warn | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg up file2 --clean | $ hg up file2 --clean | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(activating bookmark file2) | (activating bookmark file2) |
searching for changes | searching for changes | ||||
adding changesets | adding changesets | ||||
adding manifests | adding manifests | ||||
adding file changes | adding file changes | ||||
added 1 changesets with 1 changes to 1 files (+1 heads) | added 1 changesets with 1 changes to 1 files (+1 heads) | ||||
new changesets 107cefe13e42 | new changesets 107cefe13e42 | ||||
1 local changesets published | 1 local changesets published | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg --config extensions.strip= strip --no-backup tip | $ hg --config extensions.strip= strip --no-backup tip | ||||
$ hg co -qC tip | $ hg co -qC tip | ||||
Should not update to the other topological branch: | Should not update to the other topological branch: | ||||
$ hg pull -u ../tt | $ hg pull -u ../tt | ||||
pulling from ../tt | pulling from ../tt | ||||
searching for changes | searching for changes |
> y | > y | ||||
> n | > n | ||||
> y | > y | ||||
> y | > y | ||||
> n | > n | ||||
> EOF | > EOF | ||||
abort: histedit in progress | abort: histedit in progress | ||||
(use 'hg histedit --continue' or 'hg histedit --abort') | (use 'hg histedit --continue' or 'hg histedit --abort') | ||||
[255] | [20] |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ mv rebasestate .hg/ # user upgrades to 2.7 | $ mv rebasestate .hg/ # user upgrades to 2.7 | ||||
$ echo new > a | $ echo new > a | ||||
$ hg up 1 # user gets an error saying to run hg rebase --abort | $ hg up 1 # user gets an error saying to run hg rebase --abort | ||||
abort: rebase in progress | abort: rebase in progress | ||||
(use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | ||||
[255] | [20] | ||||
$ cat a | $ cat a | ||||
new | new | ||||
$ hg abort | $ hg abort | ||||
rebase aborted | rebase aborted | ||||
$ cat a | $ cat a | ||||
new | new | ||||
.hg/rebasestate | .hg/rebasestate | ||||
.hg/undo.backup.dirstate | .hg/undo.backup.dirstate | ||||
.hg/undo.dirstate | .hg/undo.dirstate | ||||
.hg/updatestate | .hg/updatestate | ||||
$ hg rebase -s 3 -d tip | $ hg rebase -s 3 -d tip | ||||
abort: rebase in progress | abort: rebase in progress | ||||
(use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | ||||
[255] | [20] | ||||
$ hg up . | $ hg up . | ||||
abort: rebase in progress | abort: rebase in progress | ||||
(use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | ||||
[255] | [20] | ||||
$ hg up -C . | $ hg up -C . | ||||
abort: rebase in progress | abort: rebase in progress | ||||
(use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | ||||
[255] | [20] | ||||
$ hg graft 3 | $ hg graft 3 | ||||
abort: rebase in progress | abort: rebase in progress | ||||
(use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | ||||
[255] | [20] | ||||
$ hg abort | $ hg abort | ||||
saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/3d8812cf300d-93041a90-backup.hg | saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/3d8812cf300d-93041a90-backup.hg | ||||
rebase aborted | rebase aborted | ||||
$ hg log -G --template "{rev} {desc} {bookmarks}" | $ hg log -G --template "{rev} {desc} {bookmarks}" | ||||
o 6 no-a | o 6 no-a | ||||
| | | | ||||
| o 5 d | | o 5 d |
o 1:draft 'C2' | o 1:draft 'C2' | ||||
| | | | ||||
o 0:draft 'C1' | o 0:draft 'C1' | ||||
Try to call --continue: | Try to call --continue: | ||||
$ hg rebase --continue | $ hg rebase --continue | ||||
abort: no rebase in progress | abort: no rebase in progress | ||||
[255] | [20] | ||||
Conflicting rebase: | Conflicting rebase: | ||||
$ hg rebase -s 3 -d 2 | $ hg rebase -s 3 -d 2 | ||||
rebasing 3:3163e20567cc "L1" | rebasing 3:3163e20567cc "L1" | ||||
rebasing 4:46f0b057b5c0 "L2" | rebasing 4:46f0b057b5c0 "L2" | ||||
merging common | merging common | ||||
warning: conflicts while merging common! (edit, then use 'hg resolve --mark') | warning: conflicts while merging common! (edit, then use 'hg resolve --mark') |
rebasing 2:177f92b77385 "c" | rebasing 2:177f92b77385 "c" | ||||
rebasing 3:055a42cdd887 "d" | rebasing 3:055a42cdd887 "d" | ||||
rebasing 4:e860deea161a "e" | rebasing 4:e860deea161a "e" | ||||
merging e | merging e | ||||
hit merge conflicts; rebasing that commit again in the working copy | hit merge conflicts; rebasing that commit again in the working copy | ||||
transaction abort! | transaction abort! | ||||
rollback completed | rollback completed | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ cat a | $ cat a | ||||
dirty | dirty | ||||
Retrying without in-memory merge won't lose merge state | Retrying without in-memory merge won't lose merge state | ||||
$ cd .. | $ cd .. | ||||
$ hg clone repo3 repo3-merge-state -q | $ hg clone repo3 repo3-merge-state -q | ||||
$ cd repo3-merge-state | $ cd repo3-merge-state | ||||
$ hg merge 4 | $ hg merge 4 | ||||
merging e | merging e | ||||
warning: conflicts while merging e! (edit, then use 'hg resolve --mark') | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') | ||||
2 files updated, 0 files merged, 0 files removed, 1 files unresolved | 2 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||||
use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | ||||
[1] | [1] | ||||
$ hg resolve -l | $ hg resolve -l | ||||
U e | U e | ||||
$ hg rebase -s 2 -d 7 | $ hg rebase -s 2 -d 7 | ||||
abort: outstanding uncommitted merge | abort: outstanding uncommitted merge | ||||
(use 'hg commit' or 'hg merge --abort') | (use 'hg commit' or 'hg merge --abort') | ||||
[255] | [20] | ||||
$ hg resolve -l | $ hg resolve -l | ||||
U e | U e | ||||
========================== | ========================== | ||||
Test for --confirm option| | Test for --confirm option| | ||||
========================== | ========================== | ||||
$ cd .. | $ cd .. | ||||
$ hg clone repo3 repo4 -q | $ hg clone repo3 repo4 -q | ||||
hit merge conflicts; rebasing that commit again in the working copy | hit merge conflicts; rebasing that commit again in the working copy | ||||
merging foo | merging foo | ||||
warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') | warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') | ||||
unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | ||||
[240] | [240] | ||||
$ hg rebase -r 3 -d 1 -t:merge3 | $ hg rebase -r 3 -d 1 -t:merge3 | ||||
abort: rebase in progress | abort: rebase in progress | ||||
(use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | ||||
[255] | [20] | ||||
$ hg resolve --list | $ hg resolve --list | ||||
U foo | U foo | ||||
$ hg resolve --all --re-merge -t:other | $ hg resolve --all --re-merge -t:other | ||||
(no more unresolved files) | (no more unresolved files) | ||||
continue: hg rebase --continue | continue: hg rebase --continue | ||||
$ hg rebase --continue | $ hg rebase --continue | ||||
rebasing 2:b4d249fbf8dd "bye from foo" | rebasing 2:b4d249fbf8dd "bye from foo" | ||||
saved backup bundle to $TESTTMP/test_issue6214/.hg/strip-backup/b4d249fbf8dd-299ec25c-rebase.hg | saved backup bundle to $TESTTMP/test_issue6214/.hg/strip-backup/b4d249fbf8dd-299ec25c-rebase.hg |
+A-mod | +A-mod | ||||
Attempting to rebase the parent of a dirty working directory will abort, without | Attempting to rebase the parent of a dirty working directory will abort, without | ||||
mangling the working directory... | mangling the working directory... | ||||
$ hg rebase -s 5 -d 4 --dry-run | $ hg rebase -s 5 -d 4 --dry-run | ||||
starting dry-run rebase; repository will not be changed | starting dry-run rebase; repository will not be changed | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg diff | $ hg diff | ||||
diff -r 2b586e70108d A | diff -r 2b586e70108d A | ||||
--- a/A Thu Jan 01 00:00:00 1970 +0000 | --- a/A Thu Jan 01 00:00:00 1970 +0000 | ||||
+++ b/A Thu Jan 01 00:00:00 1970 +0000 | +++ b/A Thu Jan 01 00:00:00 1970 +0000 | ||||
@@ -1,1 +1,1 @@ | @@ -1,1 +1,1 @@ | ||||
-A | -A | ||||
+A-mod | +A-mod | ||||
... ditto for --confirm | ... ditto for --confirm | ||||
$ echo n | hg rebase -s 5 -d 4 --confirm --config ui.interactive=True | $ echo n | hg rebase -s 5 -d 4 --confirm --config ui.interactive=True | ||||
starting in-memory rebase | starting in-memory rebase | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg diff | $ hg diff | ||||
diff -r 2b586e70108d A | diff -r 2b586e70108d A | ||||
--- a/A Thu Jan 01 00:00:00 1970 +0000 | --- a/A Thu Jan 01 00:00:00 1970 +0000 | ||||
+++ b/A Thu Jan 01 00:00:00 1970 +0000 | +++ b/A Thu Jan 01 00:00:00 1970 +0000 | ||||
@@ -1,1 +1,1 @@ | @@ -1,1 +1,1 @@ | ||||
-A | -A | ||||
+A-mod | +A-mod | ||||
$ hg rebase -s 5 -d 4 --confirm | $ hg rebase -s 5 -d 4 --confirm | ||||
starting in-memory rebase | starting in-memory rebase | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg diff | $ hg diff | ||||
diff -r 2b586e70108d A | diff -r 2b586e70108d A | ||||
--- a/A Thu Jan 01 00:00:00 1970 +0000 | --- a/A Thu Jan 01 00:00:00 1970 +0000 | ||||
+++ b/A Thu Jan 01 00:00:00 1970 +0000 | +++ b/A Thu Jan 01 00:00:00 1970 +0000 | ||||
@@ -1,1 +1,1 @@ | @@ -1,1 +1,1 @@ | ||||
-A | -A | ||||
+A-mod | +A-mod | ||||
[240] | [240] | ||||
$ hg rebase --stop --dry-run | $ hg rebase --stop --dry-run | ||||
abort: cannot specify both --stop and --dry-run | abort: cannot specify both --stop and --dry-run | ||||
[10] | [10] | ||||
$ hg rebase -s 3 -d 5 | $ hg rebase -s 3 -d 5 | ||||
abort: rebase in progress | abort: rebase in progress | ||||
(use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') | ||||
[255] | [20] | ||||
$ hg rebase --stop --continue | $ hg rebase --stop --continue | ||||
abort: cannot specify both --stop and --continue | abort: cannot specify both --stop and --continue | ||||
[10] | [10] | ||||
Test --stop moves bookmarks of original revisions to new rebased nodes: | Test --stop moves bookmarks of original revisions to new rebased nodes: | ||||
====================================================================== | ====================================================================== | ||||
$ cd .. | $ cd .. | ||||
$ hg init repo | $ hg init repo |
U c2 | U c2 | ||||
$ hg resolve -m c2 | $ hg resolve -m c2 | ||||
(no more unresolved files) | (no more unresolved files) | ||||
continue: hg rebase --continue | continue: hg rebase --continue | ||||
$ hg graft --continue | $ hg graft --continue | ||||
abort: no graft in progress | abort: no graft in progress | ||||
(continue: hg rebase --continue) | (continue: hg rebase --continue) | ||||
[255] | [20] | ||||
$ hg rebase -c --tool internal:fail | $ hg rebase -c --tool internal:fail | ||||
rebasing 2:e4e3f3546619 tip "c2b" | rebasing 2:e4e3f3546619 tip "c2b" | ||||
note: not rebasing 2:e4e3f3546619 tip "c2b", its destination already has all its changes | note: not rebasing 2:e4e3f3546619 tip "c2b", its destination already has all its changes | ||||
saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg | saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg | ||||
$ hg rebase -i | $ hg rebase -i | ||||
abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit") | abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit") | ||||
[255] | [255] |
no changes found | no changes found | ||||
Abort pull early if working dir is not clean: | Abort pull early if working dir is not clean: | ||||
$ echo L1-mod > L1 | $ echo L1-mod > L1 | ||||
$ hg pull --rebase | $ hg pull --rebase | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
(cannot pull with rebase: please commit or shelve your changes first) | (cannot pull with rebase: please commit or shelve your changes first) | ||||
[255] | [20] | ||||
$ hg update --clean --quiet | $ hg update --clean --quiet | ||||
Abort pull early if another operation (histedit) is in progress: | Abort pull early if another operation (histedit) is in progress: | ||||
$ hg histedit . -q --commands - << EOF | $ hg histedit . -q --commands - << EOF | ||||
> edit d80cc2da061e histedit: generate unfinished state | > edit d80cc2da061e histedit: generate unfinished state | ||||
> EOF | > EOF | ||||
Editing (d80cc2da061e), you may commit or record as needed now. | Editing (d80cc2da061e), you may commit or record as needed now. | ||||
(hg histedit --continue to resume) | (hg histedit --continue to resume) | ||||
[240] | [240] | ||||
$ hg pull --rebase | $ hg pull --rebase | ||||
abort: histedit in progress | abort: histedit in progress | ||||
(use 'hg histedit --continue' or 'hg histedit --abort') | (use 'hg histedit --continue' or 'hg histedit --abort') | ||||
[255] | [20] | ||||
$ hg histedit --abort --quiet | $ hg histedit --abort --quiet | ||||
Abort pull early with pending uncommitted merge: | Abort pull early with pending uncommitted merge: | ||||
$ cd .. | $ cd .. | ||||
$ hg clone --noupdate c d | $ hg clone --noupdate c d | ||||
$ cd d | $ cd d | ||||
$ hg tglog | $ hg tglog | ||||
o 1: 783333faa078 'C2' | o 1: 783333faa078 'C2' | ||||
| | | | ||||
o 0: 05d58a0c15dd 'C1' | o 0: 05d58a0c15dd 'C1' | ||||
$ hg update --quiet 0 | $ hg update --quiet 0 | ||||
$ echo M1 > M1 | $ echo M1 > M1 | ||||
$ hg commit --quiet -Am M1 | $ hg commit --quiet -Am M1 | ||||
$ hg update --quiet 1 | $ hg update --quiet 1 | ||||
$ hg merge 2 | $ hg merge 2 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | (branch merge, don't forget to commit) | ||||
$ hg pull --rebase | $ hg pull --rebase | ||||
abort: outstanding uncommitted merge | abort: outstanding uncommitted merge | ||||
(cannot pull with rebase: please commit or shelve your changes first) | (cannot pull with rebase: please commit or shelve your changes first) | ||||
[255] | [20] | ||||
$ hg update --clean --quiet | $ hg update --clean --quiet | ||||
Abort pull early with unclean subrepo: | Abort pull early with unclean subrepo: | ||||
$ echo s = s > .hgsub | $ echo s = s > .hgsub | ||||
$ hg add .hgsub | $ hg add .hgsub | ||||
$ hg init s | $ hg init s | ||||
$ hg commit -m "generated a subrepo" | $ hg commit -m "generated a subrepo" | ||||
$ echo a > s/a | $ echo a > s/a |
$ hg resolve -l -Tjson | $ hg resolve -l -Tjson | ||||
[ | [ | ||||
] | ] | ||||
resolve --all should abort when no merge in progress | resolve --all should abort when no merge in progress | ||||
$ hg resolve --all | $ hg resolve --all | ||||
abort: resolve command not applicable when not merging | abort: resolve command not applicable when not merging | ||||
[255] | [20] | ||||
resolve -m should abort when no merge in progress | resolve -m should abort when no merge in progress | ||||
$ hg resolve -m | $ hg resolve -m | ||||
abort: resolve command not applicable when not merging | abort: resolve command not applicable when not merging | ||||
[255] | [20] | ||||
can not update or merge when there are unresolved conflicts | can not update or merge when there are unresolved conflicts | ||||
$ hg up -qC 0 | $ hg up -qC 0 | ||||
$ echo quux >> file1 | $ echo quux >> file1 | ||||
$ hg up 1 | $ hg up 1 | ||||
merging file1 | merging file1 | ||||
warning: conflicts while merging file1! (edit, then use 'hg resolve --mark') | warning: conflicts while merging file1! (edit, then use 'hg resolve --mark') | ||||
U file1 | U file1 | ||||
U file2 | U file2 | ||||
$ echo 'remove markers' > file1 | $ echo 'remove markers' > file1 | ||||
$ hg --config commands.resolve.mark-check=abort resolve -m | $ hg --config commands.resolve.mark-check=abort resolve -m | ||||
warning: the following files still have conflict markers: | warning: the following files still have conflict markers: | ||||
file2 | file2 | ||||
abort: conflict markers detected | abort: conflict markers detected | ||||
(use --all to mark anyway) | (use --all to mark anyway) | ||||
[255] | [20] | ||||
$ hg resolve -l | $ hg resolve -l | ||||
U file1 | U file1 | ||||
U file2 | U file2 | ||||
Try with --all from the hint | Try with --all from the hint | ||||
$ hg --config commands.resolve.mark-check=abort resolve -m --all | $ hg --config commands.resolve.mark-check=abort resolve -m --all | ||||
warning: the following files still have conflict markers: | warning: the following files still have conflict markers: | ||||
file2 | file2 | ||||
(no more unresolved files) | (no more unresolved files) |
@@ -1,1 +0,0 @@ | @@ -1,1 +0,0 @@ | ||||
-d | -d | ||||
$ hg resolve -l | $ hg resolve -l | ||||
U a/a | U a/a | ||||
$ hg shelve | $ hg shelve | ||||
abort: unshelve already in progress | abort: unshelve already in progress | ||||
(use 'hg unshelve --continue' or 'hg unshelve --abort') | (use 'hg unshelve --continue' or 'hg unshelve --abort') | ||||
[255] | [20] | ||||
abort the unshelve and be happy | abort the unshelve and be happy | ||||
$ hg status | $ hg status | ||||
M a/a | M a/a | ||||
M b.rename/b | M b.rename/b | ||||
M c.copy | M c.copy | ||||
R b/b | R b/b | ||||
$ hg status | $ hg status | ||||
A foo/foo | A foo/foo | ||||
? a/a.orig | ? a/a.orig | ||||
try to continue with no unshelve underway | try to continue with no unshelve underway | ||||
$ hg unshelve -c | $ hg unshelve -c | ||||
abort: no unshelve in progress | abort: no unshelve in progress | ||||
[255] | [20] | ||||
$ hg status | $ hg status | ||||
A foo/foo | A foo/foo | ||||
? a/a.orig | ? a/a.orig | ||||
redo the unshelve to get a conflict | redo the unshelve to get a conflict | ||||
$ hg unshelve -q | $ hg unshelve -q | ||||
warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark') | warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark') | ||||
$ hg revert -r . a/a | $ hg revert -r . a/a | ||||
$ hg resolve -m a/a | $ hg resolve -m a/a | ||||
(no more unresolved files) | (no more unresolved files) | ||||
continue: hg unshelve --continue | continue: hg unshelve --continue | ||||
$ hg commit -m 'commit while unshelve in progress' | $ hg commit -m 'commit while unshelve in progress' | ||||
abort: unshelve already in progress | abort: unshelve already in progress | ||||
(use 'hg unshelve --continue' or 'hg unshelve --abort') | (use 'hg unshelve --continue' or 'hg unshelve --abort') | ||||
[255] | [20] | ||||
$ hg graft --continue | $ hg graft --continue | ||||
abort: no graft in progress | abort: no graft in progress | ||||
(continue: hg unshelve --continue) | (continue: hg unshelve --continue) | ||||
[255] | [20] | ||||
$ hg unshelve -c | $ hg unshelve -c | ||||
unshelve of 'default' complete | unshelve of 'default' complete | ||||
ensure the repo is as we hope | ensure the repo is as we hope | ||||
$ hg parents | $ hg parents | ||||
changeset: [37]:2e69b451d1ea (re) | changeset: [37]:2e69b451d1ea (re) | ||||
tag: tip | tag: tip | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: a | summary: a | ||||
-- trying to pull in the shelve bits | -- trying to pull in the shelve bits | ||||
-- unshelve should abort otherwise, it'll eat my second parent. | -- unshelve should abort otherwise, it'll eat my second parent. | ||||
$ hg unshelve | $ hg unshelve | ||||
abort: outstanding uncommitted merge | abort: outstanding uncommitted merge | ||||
(use 'hg commit' or 'hg merge --abort') | (use 'hg commit' or 'hg merge --abort') | ||||
[255] | [20] | ||||
$ cd .. | $ cd .. | ||||
-- test for interactive mode on unshelve | -- test for interactive mode on unshelve | ||||
$ hg init a | $ hg init a | ||||
$ cd a | $ cd a | ||||
$ echo > b | $ echo > b | ||||
| user: test | | user: test | ||||
~ date: Thu Jan 01 00:00:00 1970 +0000 | ~ date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: add A to bars | summary: add A to bars | ||||
#endif | #endif | ||||
$ hg unshelve --continue | $ hg unshelve --continue | ||||
abort: no unshelve in progress | abort: no unshelve in progress | ||||
[255] | [20] | ||||
$ hg shelve --list | $ hg shelve --list | ||||
default-01 (*)* changes to: add A to bars (glob) | default-01 (*)* changes to: add A to bars (glob) | ||||
default (*)* changes to: add B to foo (glob) | default (*)* changes to: add B to foo (glob) | ||||
$ hg unshelve -n default-01 -i <<EOF | $ hg unshelve -n default-01 -i <<EOF | ||||
> y | > y | ||||
> y | > y | ||||
> EOF | > EOF |
[255] | [255] | ||||
Unshelve --abort fails with appropriate message if there's no unshelve in | Unshelve --abort fails with appropriate message if there's no unshelve in | ||||
progress | progress | ||||
#if abortflag | #if abortflag | ||||
$ hg unshelve --abort | $ hg unshelve --abort | ||||
abort: no unshelve in progress | abort: no unshelve in progress | ||||
[255] | [20] | ||||
#else | #else | ||||
$ hg abort | $ hg abort | ||||
aborting the merge, updating back to 9451eaa6eee3 | aborting the merge, updating back to 9451eaa6eee3 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
#endif | #endif | ||||
$ cd .. | $ cd .. | ||||
Unshelve respects --keep even if user intervention is needed | Unshelve respects --keep even if user intervention is needed | ||||
unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') | ||||
[240] | [240] | ||||
$ hg log --template '{desc|firstline} {author} {date|isodate} \n' -r . | $ hg log --template '{desc|firstline} {author} {date|isodate} \n' -r . | ||||
pending changes temporary commit shelve@localhost 1970-01-01 00:00 +0000 | pending changes temporary commit shelve@localhost 1970-01-01 00:00 +0000 | ||||
$ hg merge --abort | $ hg merge --abort | ||||
abort: cannot abort merge with unshelve in progress | abort: cannot abort merge with unshelve in progress | ||||
(use 'hg unshelve --continue' or 'hg unshelve --abort') | (use 'hg unshelve --continue' or 'hg unshelve --abort') | ||||
[255] | [20] | ||||
$ hg unshelve --abort | $ hg unshelve --abort | ||||
unshelve of 'default' aborted | unshelve of 'default' aborted | ||||
$ hg log -G --template '{desc|firstline} {author} {date|isodate} \n' -r . | $ hg log -G --template '{desc|firstline} {author} {date|isodate} \n' -r . | ||||
@ initial commit test 1970-01-01 00:00 +0000 | @ initial commit test 1970-01-01 00:00 +0000 | ||||
$ cd .. | $ cd .. |
$ hg phase --draft -f -r 'all()' | $ hg phase --draft -f -r 'all()' | ||||
Cannot split while working directory is dirty | Cannot split while working directory is dirty | ||||
$ touch dirty | $ touch dirty | ||||
$ hg add dirty | $ hg add dirty | ||||
$ hg split . | $ hg split . | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg forget dirty | $ hg forget dirty | ||||
$ rm dirty | $ rm dirty | ||||
Make a clean directory for future tests to build off of | Make a clean directory for future tests to build off of | ||||
$ cp -R . ../clean | $ cp -R . ../clean | ||||
Split a head | Split a head |
user: test | user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: c | summary: c | ||||
##strip not allowed with merge in progress | ##strip not allowed with merge in progress | ||||
$ hg strip 4 | $ hg strip 4 | ||||
abort: outstanding uncommitted merge | abort: outstanding uncommitted merge | ||||
(use 'hg commit' or 'hg merge --abort') | (use 'hg commit' or 'hg merge --abort') | ||||
[255] | [20] | ||||
##strip allowed --force with merge in progress | ##strip allowed --force with merge in progress | ||||
$ hg strip 4 --force | $ hg strip 4 --force | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | ||||
after strip of merge parent | after strip of merge parent | ||||
$ hg parents | $ hg parents | ||||
% changeset: 0:9ab35a2d17cb | % changeset: 0:9ab35a2d17cb | ||||
user: test | user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: a | summary: a | ||||
$ echo c > b | $ echo c > b | ||||
$ hg strip tip | $ hg strip tip | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg strip tip --keep | $ hg strip tip --keep | ||||
saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | ||||
$ hg log --graph | $ hg log --graph | ||||
@ changeset: 0:9ab35a2d17cb | @ changeset: 0:9ab35a2d17cb | ||||
tag: tip | tag: tip | ||||
user: test | user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: a | summary: a | ||||
[255] | [255] | ||||
$ hg update B | $ hg update B | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(activating bookmark B) | (activating bookmark B) | ||||
$ echo a > a | $ echo a > a | ||||
$ hg add a | $ hg add a | ||||
$ hg strip -B B | $ hg strip -B B | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg bookmarks | $ hg bookmarks | ||||
* B 6:ff43616e5d0f | * B 6:ff43616e5d0f | ||||
Make sure no one adds back a -b option: | Make sure no one adds back a -b option: | ||||
$ hg strip -b tip | $ hg strip -b tip | ||||
hg strip: option -b not recognized | hg strip: option -b not recognized | ||||
hg strip [-k] [-f] [-B bookmark] [-r] REV... | hg strip [-k] [-f] [-B bookmark] [-r] REV... |
$ hg up default | $ hg up default | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg merge b1 | $ hg merge b1 | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | (branch merge, don't forget to commit) | ||||
$ hg tag t1 | $ hg tag t1 | ||||
abort: uncommitted merge | abort: uncommitted merge | ||||
[255] | [20] | ||||
$ hg status | $ hg status | ||||
$ hg tag --rev 1 t2 | $ hg tag --rev 1 t2 | ||||
abort: uncommitted merge | abort: uncommitted merge | ||||
[255] | [20] | ||||
$ hg tag --rev 1 --local t3 | $ hg tag --rev 1 --local t3 | ||||
$ hg tags -v | $ hg tags -v | ||||
tip 2:2a156e8887cc | tip 2:2a156e8887cc | ||||
t3 1:c3adabd1a5f4 local | t3 1:c3adabd1a5f4 local | ||||
$ cd .. | $ cd .. | ||||
commit hook on tag used to be run without write lock - issue3344 | commit hook on tag used to be run without write lock - issue3344 |
adding b1 | adding b1 | ||||
created new head | created new head | ||||
$ hg merge 1 | $ hg merge 1 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | (branch merge, don't forget to commit) | ||||
$ hg transplant 1 | $ hg transplant 1 | ||||
abort: outstanding uncommitted merge | abort: outstanding uncommitted merge | ||||
(use 'hg commit' or 'hg merge --abort') | (use 'hg commit' or 'hg merge --abort') | ||||
[255] | [20] | ||||
$ hg up -qC tip | $ hg up -qC tip | ||||
$ echo b0 > b1 | $ echo b0 > b1 | ||||
$ hg transplant 1 | $ hg transplant 1 | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg up -qC tip | $ hg up -qC tip | ||||
$ echo b2 > b2 | $ echo b2 > b2 | ||||
$ hg ci -Amb2 -d '1 0' | $ hg ci -Amb2 -d '1 0' | ||||
adding b2 | adding b2 | ||||
$ echo b3 > b3 | $ echo b3 > b3 | ||||
$ hg ci -Amb3 -d '2 0' | $ hg ci -Amb3 -d '2 0' | ||||
adding b3 | adding b3 | ||||
$ hg up -C | $ hg up -C | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
updated to "e8643552fde5: foobar" | updated to "e8643552fde5: foobar" | ||||
1 other heads for branch "default" | 1 other heads for branch "default" | ||||
$ rm added | $ rm added | ||||
$ hg continue | $ hg continue | ||||
abort: no transplant to continue (continueflag !) | abort: no transplant to continue (continueflag !) | ||||
abort: no operation in progress (no-continueflag !) | abort: no operation in progress (no-continueflag !) | ||||
[255] | [20] | ||||
$ hg transplant --stop | $ hg transplant --stop | ||||
abort: no interrupted transplant found | abort: no interrupted transplant found | ||||
[255] | [20] | ||||
$ hg transplant 1 | $ hg transplant 1 | ||||
applying 46ae92138f3c | applying 46ae92138f3c | ||||
patching file foo | patching file foo | ||||
Hunk #1 FAILED at 0 | Hunk #1 FAILED at 0 | ||||
1 out of 1 hunks FAILED -- saving rejects to file foo.rej | 1 out of 1 hunks FAILED -- saving rejects to file foo.rej | ||||
patch failed to apply | patch failed to apply | ||||
abort: fix up the working directory and run hg transplant --continue | abort: fix up the working directory and run hg transplant --continue | ||||
[255] | [255] | ||||
Hunk #1 FAILED at 0 | Hunk #1 FAILED at 0 | ||||
1 out of 1 hunks FAILED -- saving rejects to file baz.rej | 1 out of 1 hunks FAILED -- saving rejects to file baz.rej | ||||
patch failed to apply | patch failed to apply | ||||
abort: fix up the working directory and run hg transplant --continue | abort: fix up the working directory and run hg transplant --continue | ||||
[255] | [255] | ||||
$ hg transplant 1:3 | $ hg transplant 1:3 | ||||
abort: transplant in progress | abort: transplant in progress | ||||
(use 'hg transplant --continue' or 'hg transplant --stop') | (use 'hg transplant --continue' or 'hg transplant --stop') | ||||
[255] | [20] | ||||
$ hg status -v | $ hg status -v | ||||
A bar | A bar | ||||
? added.rej | ? added.rej | ||||
? baz.rej | ? baz.rej | ||||
? foo.rej | ? foo.rej | ||||
# The repository is in an unfinished *transplant* state. | # The repository is in an unfinished *transplant* state. | ||||
# To continue: hg transplant --continue | # To continue: hg transplant --continue |
$ cat files | $ cat files | ||||
abcde | abcde | ||||
foo | foo | ||||
$ hg status | $ hg status | ||||
M files | M files | ||||
$ hg uncommit | $ hg uncommit | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
(requires --allow-dirty-working-copy to uncommit) | (requires --allow-dirty-working-copy to uncommit) | ||||
[255] | [20] | ||||
$ hg uncommit files | $ hg uncommit files | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
(requires --allow-dirty-working-copy to uncommit) | (requires --allow-dirty-working-copy to uncommit) | ||||
[255] | [20] | ||||
$ cat files | $ cat files | ||||
abcde | abcde | ||||
foo | foo | ||||
$ hg commit --amend -m "files abcde + foo" | $ hg commit --amend -m "files abcde + foo" | ||||
Testing the 'experimental.uncommitondirtywdir' config | Testing the 'experimental.uncommitondirtywdir' config | ||||
$ echo "bar" >> files | $ echo "bar" >> files | ||||
$ hg uncommit | $ hg uncommit | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
(requires --allow-dirty-working-copy to uncommit) | (requires --allow-dirty-working-copy to uncommit) | ||||
[255] | [20] | ||||
$ hg uncommit --config experimental.uncommitondirtywdir=True | $ hg uncommit --config experimental.uncommitondirtywdir=True | ||||
$ hg commit -m "files abcde + foo" | $ hg commit -m "files abcde + foo" | ||||
Uncommit in the middle of a stack, does not move bookmark | Uncommit in the middle of a stack, does not move bookmark | ||||
$ hg checkout '.^^^' | $ hg checkout '.^^^' | ||||
1 files updated, 0 files merged, 2 files removed, 0 files unresolved | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | ||||
(leaving bookmark foo) | (leaving bookmark foo) | ||||
$ hg merge 2 | $ hg merge 2 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | (branch merge, don't forget to commit) | ||||
$ hg uncommit | $ hg uncommit | ||||
abort: outstanding uncommitted merge | abort: outstanding uncommitted merge | ||||
(requires --allow-dirty-working-copy to uncommit) | (requires --allow-dirty-working-copy to uncommit) | ||||
[255] | [20] | ||||
$ hg uncommit --config experimental.uncommitondirtywdir=True | $ hg uncommit --config experimental.uncommitondirtywdir=True | ||||
abort: cannot uncommit while merging | abort: cannot uncommit while merging | ||||
[255] | [255] | ||||
$ hg status | $ hg status | ||||
M a | M a | ||||
$ hg commit -m 'merge a and b' | $ hg commit -m 'merge a and b' | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: add a | summary: add a | ||||
$ hg ci -Am 'add b' | $ hg ci -Am 'add b' | ||||
$ echo 'foo bar' > b | $ echo 'foo bar' > b | ||||
$ hg uncommit b | $ hg uncommit b | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
(requires --allow-dirty-working-copy to uncommit) | (requires --allow-dirty-working-copy to uncommit) | ||||
[255] | [20] | ||||
$ hg uncommit --allow-dirty-working-copy b | $ hg uncommit --allow-dirty-working-copy b | ||||
$ hg log | $ hg log | ||||
changeset: 3:30fa958635b2 | changeset: 3:30fa958635b2 | ||||
tag: tip | tag: tip | ||||
parent: 1:656ba143d384 | parent: 1:656ba143d384 | ||||
user: test | user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: add b | summary: add b |
Test that boolean flags allow --no-flag specification to override [defaults] | Test that boolean flags allow --no-flag specification to override [defaults] | ||||
$ cat >> $HGRCPATH <<EOF | $ cat >> $HGRCPATH <<EOF | ||||
> [defaults] | > [defaults] | ||||
> update = --check | > update = --check | ||||
> EOF | > EOF | ||||
$ hg co 2 | $ hg co 2 | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg co --no-check 2 | $ hg co --no-check 2 | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
Test that local removed/deleted, remote removed works with flags | Test that local removed/deleted, remote removed works with flags | ||||
$ hg rm toremove | $ hg rm toremove | ||||
$ rm todelete | $ rm todelete | ||||
$ hg co -q 0 | $ hg co -q 0 | ||||
$ echo dirty > foo | $ echo dirty > foo | ||||
$ hg up -c | $ hg up -c | ||||
abort: uncommitted changes | abort: uncommitted changes | ||||
[255] | [20] | ||||
$ hg up -q | $ hg up -q | ||||
$ cat foo | $ cat foo | ||||
dirty | dirty | ||||
$ hg st -A | $ hg st -A | ||||
M foo | M foo | ||||
C todelete | C todelete | ||||
C toremove | C toremove | ||||