2018-01-23 23:09:16 +03:00
|
|
|
$ . helpers-usechg.sh
|
|
|
|
|
2010-08-14 04:28:53 +04:00
|
|
|
$ hg init basic
|
|
|
|
$ cd basic
|
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
should complain
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ hg backout
|
|
|
|
abort: please specify a revision to backout
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:28:53 +04:00
|
|
|
$ hg backout -r 0 0
|
|
|
|
abort: please specify just one revision
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
basic operation
|
2014-05-10 19:49:36 +04:00
|
|
|
(this also tests that editor is invoked if the commit message is not
|
|
|
|
specified explicitly)
|
2018-01-31 02:36:50 +03:00
|
|
|
(this also tests correctness of default message)
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ echo a > a
|
|
|
|
$ hg commit -d '0 0' -A -m a
|
|
|
|
adding a
|
|
|
|
$ echo b >> a
|
2018-01-31 02:36:50 +03:00
|
|
|
$ hg commit -d '1 0' -m $'b\nc'
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2014-05-10 19:49:36 +04:00
|
|
|
$ hg status --rev tip --rev "tip^1"
|
|
|
|
M a
|
|
|
|
$ HGEDITOR=cat hg backout -d '2 0' tip --tool=true
|
2010-08-14 04:28:53 +04:00
|
|
|
reverting a
|
2018-01-26 21:53:00 +03:00
|
|
|
Back out "b"
|
|
|
|
|
2018-01-31 02:36:50 +03:00
|
|
|
Original commit changeset: a451c20d3c0b
|
2014-05-10 19:49:36 +04:00
|
|
|
|
|
|
|
|
|
|
|
HG: Enter commit message. Lines beginning with 'HG:' are removed.
|
|
|
|
HG: Leave message empty to abort commit.
|
|
|
|
HG: --
|
|
|
|
HG: user: test
|
|
|
|
HG: branch 'default'
|
|
|
|
HG: changed a
|
2018-01-31 02:36:50 +03:00
|
|
|
changeset 2:8540552e2ce9 backs out changeset 1:a451c20d3c0b
|
2010-08-14 04:28:53 +04:00
|
|
|
$ cat a
|
|
|
|
a
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
2018-01-31 02:36:50 +03:00
|
|
|
parent: 2:8540552e2ce9 tip
|
2018-01-26 21:53:00 +03:00
|
|
|
Back out "b"
|
2014-01-09 05:15:22 +04:00
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2014-12-18 04:26:12 +03:00
|
|
|
commit option
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ hg init commit
|
|
|
|
$ cd commit
|
|
|
|
|
|
|
|
$ echo tomatoes > a
|
|
|
|
$ hg add a
|
|
|
|
$ hg commit -d '0 0' -m tomatoes
|
|
|
|
|
|
|
|
$ echo chair > b
|
|
|
|
$ hg add b
|
|
|
|
$ hg commit -d '1 0' -m chair
|
|
|
|
|
|
|
|
$ echo grapes >> a
|
|
|
|
$ hg commit -d '2 0' -m grapes
|
|
|
|
|
2016-01-16 00:46:33 +03:00
|
|
|
$ hg backout -d '4 0' 1 --tool=:fail
|
2014-12-18 04:26:12 +03:00
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2018-01-26 21:53:00 +03:00
|
|
|
changeset 3:6b2e5750efab backs out changeset 1:22cb4f70d813
|
2014-12-18 04:26:12 +03:00
|
|
|
$ hg summary
|
2018-01-26 21:53:00 +03:00
|
|
|
parent: 3:6b2e5750efab tip
|
|
|
|
Back out "chair"
|
2014-12-18 04:26:12 +03:00
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 4 draft
|
2014-12-18 04:26:12 +03:00
|
|
|
|
|
|
|
$ echo ypples > a
|
|
|
|
$ hg commit -d '5 0' -m ypples
|
|
|
|
|
2016-01-16 00:46:33 +03:00
|
|
|
$ hg backout -d '6 0' 2 --tool=:fail
|
2014-12-18 04:26:12 +03:00
|
|
|
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
|
|
|
|
use 'hg resolve' to retry unresolved file merges
|
|
|
|
[1]
|
|
|
|
$ hg summary
|
2018-01-26 21:53:00 +03:00
|
|
|
parent: 4:2cf19744f63f tip
|
2014-12-18 04:26:12 +03:00
|
|
|
ypples
|
|
|
|
commit: 1 unresolved (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 5 draft
|
2014-12-18 04:26:12 +03:00
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
file that was removed is recreated
|
2014-05-10 19:49:36 +04:00
|
|
|
(this also tests that editor is not invoked if the commit message is
|
|
|
|
specified explicitly)
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ hg init remove
|
|
|
|
$ cd remove
|
|
|
|
|
|
|
|
$ echo content > a
|
|
|
|
$ hg commit -d '0 0' -A -m a
|
|
|
|
adding a
|
|
|
|
|
|
|
|
$ hg rm a
|
|
|
|
$ hg commit -d '1 0' -m b
|
|
|
|
|
2014-05-10 19:49:36 +04:00
|
|
|
$ HGEDITOR=cat hg backout -d '2 0' tip --tool=true -m "Backed out changeset 76862dcce372"
|
2010-08-14 04:28:53 +04:00
|
|
|
adding a
|
2018-01-26 21:53:00 +03:00
|
|
|
changeset 2:0ab3c2be0b32 backs out changeset 1:76862dcce372
|
2010-08-14 04:28:53 +04:00
|
|
|
$ cat a
|
|
|
|
content
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
2018-01-26 21:53:00 +03:00
|
|
|
parent: 2:0ab3c2be0b32 tip
|
2014-01-09 05:15:22 +04:00
|
|
|
Backed out changeset 76862dcce372
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
backout of backout is as if nothing happened
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2010-10-22 20:58:43 +04:00
|
|
|
$ hg backout -d '3 0' --merge tip --tool=true
|
2010-08-14 04:28:53 +04:00
|
|
|
removing a
|
2018-01-31 02:36:50 +03:00
|
|
|
changeset 3:5b1b9b2a0f35 backs out changeset 2:0ab3c2be0b32
|
2011-11-16 06:45:14 +04:00
|
|
|
$ test -f a
|
|
|
|
[1]
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
2018-01-31 02:36:50 +03:00
|
|
|
parent: 3:5b1b9b2a0f35 tip
|
|
|
|
Back out "Backed out changeset 76862dcce372"
|
2014-01-09 05:15:22 +04:00
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 4 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
localrepo: make journal.dirstate contain in-memory changes before transaction
Before this patch, in-memory dirstate changes aren't written out at
opening transaction, even though 'journal.dirstate' is created
directly from '.hg/dirstate'.
Therefore, subsequent 'hg rollback' uses incomplete 'undo.dirstate' to
restore dirstate, if dirstate is changed and isn't written out before
opening transaction.
In cases below, the condition "dirstate is changed and isn't written
out before opening transaction" isn't satisfied and this problem
doesn't appear:
- "wlock scope" and "transaction scope" are almost equivalent
e.g. 'commit --amend', 'import' and so on
- dirstate changes are written out before opening transaction
e.g. 'rebase' (via 'dirstateguard') and 'commit -A' (by separated
wlock scopes)
On the other hand, 'backout' may satisfy the condition above.
To make 'journal.dirstate' contain in-memory changes before opening
transaction, this patch explicitly invokes 'dirstate.write()' in
'localrepository.transaction()'.
'dirstate.write()' is placed before not "writing journal files out"
but "invoking pretxnopen hooks" for visibility of dirstate changes to
external hook processes.
BTW, in the test script, 'touch -t 200001010000' and 'hg status' are
invoked to make file 'c' surely clean in dirstate, because "clean but
unsure" files indirectly cause 'dirstate.write()' at 'repo.status()'
in 'repo.commit()' (see e1d123a2ee1f for detail) and prevents from
certainly reproducing the issue.
2015-07-30 00:16:12 +03:00
|
|
|
Test that 'hg rollback' restores dirstate just before opening
|
|
|
|
transaction: in-memory dirstate changes should be written into
|
|
|
|
'.hg/journal.dirstate' as expected.
|
|
|
|
|
|
|
|
$ echo 'removed soon' > b
|
|
|
|
$ hg commit -A -d '4 0' -m 'prepare for subsequent removing'
|
|
|
|
adding b
|
|
|
|
$ echo 'newly added' > c
|
|
|
|
$ hg add c
|
|
|
|
$ hg remove b
|
|
|
|
$ hg commit -d '5 0' -m 'prepare for subsequent backout'
|
|
|
|
$ touch -t 200001010000 c
|
|
|
|
$ hg status -A
|
|
|
|
C c
|
|
|
|
$ hg debugstate --nodates
|
|
|
|
n 644 12 set c
|
|
|
|
$ hg backout -d '6 0' -m 'to be rollback-ed soon' -r .
|
|
|
|
adding b
|
|
|
|
removing c
|
2018-01-31 02:36:50 +03:00
|
|
|
changeset 6:3ab761ce0df4 backs out changeset 5:19a306f2a2e0
|
localrepo: make journal.dirstate contain in-memory changes before transaction
Before this patch, in-memory dirstate changes aren't written out at
opening transaction, even though 'journal.dirstate' is created
directly from '.hg/dirstate'.
Therefore, subsequent 'hg rollback' uses incomplete 'undo.dirstate' to
restore dirstate, if dirstate is changed and isn't written out before
opening transaction.
In cases below, the condition "dirstate is changed and isn't written
out before opening transaction" isn't satisfied and this problem
doesn't appear:
- "wlock scope" and "transaction scope" are almost equivalent
e.g. 'commit --amend', 'import' and so on
- dirstate changes are written out before opening transaction
e.g. 'rebase' (via 'dirstateguard') and 'commit -A' (by separated
wlock scopes)
On the other hand, 'backout' may satisfy the condition above.
To make 'journal.dirstate' contain in-memory changes before opening
transaction, this patch explicitly invokes 'dirstate.write()' in
'localrepository.transaction()'.
'dirstate.write()' is placed before not "writing journal files out"
but "invoking pretxnopen hooks" for visibility of dirstate changes to
external hook processes.
BTW, in the test script, 'touch -t 200001010000' and 'hg status' are
invoked to make file 'c' surely clean in dirstate, because "clean but
unsure" files indirectly cause 'dirstate.write()' at 'repo.status()'
in 'repo.commit()' (see e1d123a2ee1f for detail) and prevents from
certainly reproducing the issue.
2015-07-30 00:16:12 +03:00
|
|
|
$ hg rollback -q
|
|
|
|
$ hg status -A
|
|
|
|
A b
|
|
|
|
R c
|
|
|
|
$ hg debugstate --nodates
|
|
|
|
a 0 -1 unset b
|
2018-07-18 02:03:52 +03:00
|
|
|
r 0 0 unset c
|
localrepo: make journal.dirstate contain in-memory changes before transaction
Before this patch, in-memory dirstate changes aren't written out at
opening transaction, even though 'journal.dirstate' is created
directly from '.hg/dirstate'.
Therefore, subsequent 'hg rollback' uses incomplete 'undo.dirstate' to
restore dirstate, if dirstate is changed and isn't written out before
opening transaction.
In cases below, the condition "dirstate is changed and isn't written
out before opening transaction" isn't satisfied and this problem
doesn't appear:
- "wlock scope" and "transaction scope" are almost equivalent
e.g. 'commit --amend', 'import' and so on
- dirstate changes are written out before opening transaction
e.g. 'rebase' (via 'dirstateguard') and 'commit -A' (by separated
wlock scopes)
On the other hand, 'backout' may satisfy the condition above.
To make 'journal.dirstate' contain in-memory changes before opening
transaction, this patch explicitly invokes 'dirstate.write()' in
'localrepository.transaction()'.
'dirstate.write()' is placed before not "writing journal files out"
but "invoking pretxnopen hooks" for visibility of dirstate changes to
external hook processes.
BTW, in the test script, 'touch -t 200001010000' and 'hg status' are
invoked to make file 'c' surely clean in dirstate, because "clean but
unsure" files indirectly cause 'dirstate.write()' at 'repo.status()'
in 'repo.commit()' (see e1d123a2ee1f for detail) and prevents from
certainly reproducing the issue.
2015-07-30 00:16:12 +03:00
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
across branch
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ hg init branch
|
|
|
|
$ cd branch
|
|
|
|
$ echo a > a
|
|
|
|
$ hg ci -Am0
|
|
|
|
adding a
|
|
|
|
$ echo b > b
|
|
|
|
$ hg ci -Am1
|
|
|
|
adding b
|
|
|
|
$ hg co -C 0
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 0:f7b1eb17ad24
|
|
|
|
0
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 2 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
should fail
|
|
|
|
|
|
|
|
$ hg backout 1
|
2014-02-25 01:42:14 +04:00
|
|
|
abort: cannot backout change that is not an ancestor
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:28:53 +04:00
|
|
|
$ echo c > c
|
|
|
|
$ hg ci -Am2
|
|
|
|
adding c
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 2:db815d6d32e6 tip
|
|
|
|
2
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
should fail
|
|
|
|
|
|
|
|
$ hg backout 1
|
2014-02-25 01:42:14 +04:00
|
|
|
abort: cannot backout change that is not an ancestor
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 2:db815d6d32e6 tip
|
|
|
|
2
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
backout with merge
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ hg init merge
|
|
|
|
$ cd merge
|
|
|
|
|
|
|
|
$ echo line 1 > a
|
|
|
|
$ echo line 2 >> a
|
|
|
|
$ hg commit -d '0 0' -A -m a
|
|
|
|
adding a
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 0:59395513a13a tip
|
|
|
|
a
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 1 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
remove line 1
|
|
|
|
|
|
|
|
$ echo line 2 > a
|
|
|
|
$ hg commit -d '1 0' -m b
|
|
|
|
|
|
|
|
$ echo line 3 >> a
|
|
|
|
$ hg commit -d '2 0' -m c
|
|
|
|
|
2010-10-22 20:58:43 +04:00
|
|
|
$ hg backout --merge -d '3 0' 1 --tool=true
|
2010-08-14 04:28:53 +04:00
|
|
|
reverting a
|
2018-01-26 21:53:00 +03:00
|
|
|
changeset 3:d3729c426fdb backs out changeset 1:5a50a024c182
|
|
|
|
merging with changeset 3:d3729c426fdb
|
2010-08-14 04:28:53 +04:00
|
|
|
merging a
|
|
|
|
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
|
|
|
$ hg commit -d '4 0' -m d
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
2018-01-26 21:53:00 +03:00
|
|
|
parent: 4:76e753f52d24 tip
|
2014-01-09 05:15:22 +04:00
|
|
|
d
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 5 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
check line 1 is back
|
|
|
|
|
|
|
|
$ cat a
|
|
|
|
line 1
|
|
|
|
line 2
|
|
|
|
line 3
|
|
|
|
|
2015-10-16 19:15:34 +03:00
|
|
|
Test visibility of in-memory dirstate changes outside transaction to
|
|
|
|
external hook process
|
|
|
|
|
|
|
|
$ cat > $TESTTMP/checkvisibility.sh <<EOF
|
|
|
|
> echo "==== \$1:"
|
|
|
|
> hg parents --template "{rev}:{node|short}\n"
|
|
|
|
> echo "===="
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
"hg backout --merge REV1" at REV2 below implies steps below:
|
|
|
|
|
|
|
|
(1) update to REV1 (REV2 => REV1)
|
|
|
|
(2) revert by REV1^1
|
2016-10-18 00:16:55 +03:00
|
|
|
(3) commit backing out revision (REV3)
|
2015-10-16 19:15:34 +03:00
|
|
|
(4) update to REV2 (REV3 => REV2)
|
|
|
|
(5) merge with REV3 (REV2 => REV2, REV3)
|
|
|
|
|
|
|
|
== test visibility to external preupdate hook
|
|
|
|
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ hg --config extensions.strip= strip 3
|
|
|
|
saved backup bundle to * (glob)
|
|
|
|
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [hooks]
|
|
|
|
> preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate
|
|
|
|
> EOF
|
|
|
|
|
2016-10-18 00:16:55 +03:00
|
|
|
("-m" is needed to avoid writing dirstate changes out at other than
|
2015-10-16 19:15:34 +03:00
|
|
|
invocation of the hook to be examined)
|
|
|
|
|
|
|
|
$ hg backout --merge -d '3 0' 1 --tool=true -m 'fixed comment'
|
|
|
|
==== preupdate:
|
|
|
|
2:6ea3f2a197a2
|
|
|
|
====
|
|
|
|
reverting a
|
2018-01-26 21:53:00 +03:00
|
|
|
changeset 3:9a3b8b6c2523 backs out changeset 1:5a50a024c182
|
2015-10-16 19:15:34 +03:00
|
|
|
==== preupdate:
|
2018-01-26 21:53:00 +03:00
|
|
|
3:9a3b8b6c2523
|
2015-10-16 19:15:34 +03:00
|
|
|
====
|
2018-01-26 21:53:00 +03:00
|
|
|
merging with changeset 3:9a3b8b6c2523
|
2015-10-16 19:15:34 +03:00
|
|
|
==== preupdate:
|
|
|
|
2:6ea3f2a197a2
|
|
|
|
====
|
|
|
|
merging a
|
|
|
|
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
|
|
|
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [hooks]
|
|
|
|
> preupdate.visibility =
|
|
|
|
> EOF
|
|
|
|
|
merge: make in-memory changes visible to external update hooks
c67339617276 (while 3.4 code-freeze) made all 'update' hooks run after
releasing wlock for visibility of in-memory dirstate changes. But this
breaks paired invocation of 'preupdate' and 'update' hooks.
For example, 'hg backout --merge' for TARGET revision, which isn't
parent of CURRENT, consists of steps below:
1. update from CURRENT to TARGET
2. commit BACKOUT revision, which backs TARGET out
3. update from BACKOUT to CURRENT
4. merge TARGET into CURRENT
Then, we expects hooks to run in the order below:
- 'preupdate' on CURRENT for (1)
- 'update' on TARGET for (1)
- 'preupdate' on BACKOUT for (3)
- 'update' on CURRENT for (3)
- 'preupdate' on TARGET for (4)
- 'update' on CURRENT/TARGET for (4)
But hooks actually run in the order below:
- 'preupdate' on CURRENT for (1)
- 'preupdate' on BACKOUT for (3)
- 'preupdate' on TARGET for (4)
- 'update' on TARGET for (1), but actually on CURRENT/TARGET
- 'update' on CURRENT for (3), but actually on CURRENT/TARGET
- 'update' on CURRENT for (4), but actually on CURRENT/TARGET
Root cause of the issue focused by c67339617276 is that external
'update' hook process can't view in-memory changes (especially, of
dirstate), because they aren't written out until the end of
transaction (or wlock).
Now, hooks can be invoked just after updating, because previous
patches made in-memory changes visible to external process.
This patch may break backward compatibility from the point of view of
"scheduling hook execution", but should be reasonable because 'update'
hooks had been executed in this order before 3.4.
This patch tests "hg backout" and "hg unshelve", because the former
activates the transaction before 'update' hook invocation, but the
former doesn't.
2015-10-16 19:15:34 +03:00
|
|
|
== test visibility to external update hook
|
|
|
|
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ hg --config extensions.strip= strip 3
|
|
|
|
saved backup bundle to * (glob)
|
|
|
|
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [hooks]
|
|
|
|
> update.visibility = sh $TESTTMP/checkvisibility.sh update
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
$ hg backout --merge -d '3 0' 1 --tool=true -m 'fixed comment'
|
|
|
|
==== update:
|
|
|
|
1:5a50a024c182
|
|
|
|
====
|
|
|
|
reverting a
|
2018-01-26 21:53:00 +03:00
|
|
|
changeset 3:9a3b8b6c2523 backs out changeset 1:5a50a024c182
|
merge: make in-memory changes visible to external update hooks
c67339617276 (while 3.4 code-freeze) made all 'update' hooks run after
releasing wlock for visibility of in-memory dirstate changes. But this
breaks paired invocation of 'preupdate' and 'update' hooks.
For example, 'hg backout --merge' for TARGET revision, which isn't
parent of CURRENT, consists of steps below:
1. update from CURRENT to TARGET
2. commit BACKOUT revision, which backs TARGET out
3. update from BACKOUT to CURRENT
4. merge TARGET into CURRENT
Then, we expects hooks to run in the order below:
- 'preupdate' on CURRENT for (1)
- 'update' on TARGET for (1)
- 'preupdate' on BACKOUT for (3)
- 'update' on CURRENT for (3)
- 'preupdate' on TARGET for (4)
- 'update' on CURRENT/TARGET for (4)
But hooks actually run in the order below:
- 'preupdate' on CURRENT for (1)
- 'preupdate' on BACKOUT for (3)
- 'preupdate' on TARGET for (4)
- 'update' on TARGET for (1), but actually on CURRENT/TARGET
- 'update' on CURRENT for (3), but actually on CURRENT/TARGET
- 'update' on CURRENT for (4), but actually on CURRENT/TARGET
Root cause of the issue focused by c67339617276 is that external
'update' hook process can't view in-memory changes (especially, of
dirstate), because they aren't written out until the end of
transaction (or wlock).
Now, hooks can be invoked just after updating, because previous
patches made in-memory changes visible to external process.
This patch may break backward compatibility from the point of view of
"scheduling hook execution", but should be reasonable because 'update'
hooks had been executed in this order before 3.4.
This patch tests "hg backout" and "hg unshelve", because the former
activates the transaction before 'update' hook invocation, but the
former doesn't.
2015-10-16 19:15:34 +03:00
|
|
|
==== update:
|
|
|
|
2:6ea3f2a197a2
|
|
|
|
====
|
2018-01-26 21:53:00 +03:00
|
|
|
merging with changeset 3:9a3b8b6c2523
|
merge: make in-memory changes visible to external update hooks
c67339617276 (while 3.4 code-freeze) made all 'update' hooks run after
releasing wlock for visibility of in-memory dirstate changes. But this
breaks paired invocation of 'preupdate' and 'update' hooks.
For example, 'hg backout --merge' for TARGET revision, which isn't
parent of CURRENT, consists of steps below:
1. update from CURRENT to TARGET
2. commit BACKOUT revision, which backs TARGET out
3. update from BACKOUT to CURRENT
4. merge TARGET into CURRENT
Then, we expects hooks to run in the order below:
- 'preupdate' on CURRENT for (1)
- 'update' on TARGET for (1)
- 'preupdate' on BACKOUT for (3)
- 'update' on CURRENT for (3)
- 'preupdate' on TARGET for (4)
- 'update' on CURRENT/TARGET for (4)
But hooks actually run in the order below:
- 'preupdate' on CURRENT for (1)
- 'preupdate' on BACKOUT for (3)
- 'preupdate' on TARGET for (4)
- 'update' on TARGET for (1), but actually on CURRENT/TARGET
- 'update' on CURRENT for (3), but actually on CURRENT/TARGET
- 'update' on CURRENT for (4), but actually on CURRENT/TARGET
Root cause of the issue focused by c67339617276 is that external
'update' hook process can't view in-memory changes (especially, of
dirstate), because they aren't written out until the end of
transaction (or wlock).
Now, hooks can be invoked just after updating, because previous
patches made in-memory changes visible to external process.
This patch may break backward compatibility from the point of view of
"scheduling hook execution", but should be reasonable because 'update'
hooks had been executed in this order before 3.4.
This patch tests "hg backout" and "hg unshelve", because the former
activates the transaction before 'update' hook invocation, but the
former doesn't.
2015-10-16 19:15:34 +03:00
|
|
|
merging a
|
|
|
|
==== update:
|
|
|
|
2:6ea3f2a197a2
|
2018-01-26 21:53:00 +03:00
|
|
|
3:9a3b8b6c2523
|
merge: make in-memory changes visible to external update hooks
c67339617276 (while 3.4 code-freeze) made all 'update' hooks run after
releasing wlock for visibility of in-memory dirstate changes. But this
breaks paired invocation of 'preupdate' and 'update' hooks.
For example, 'hg backout --merge' for TARGET revision, which isn't
parent of CURRENT, consists of steps below:
1. update from CURRENT to TARGET
2. commit BACKOUT revision, which backs TARGET out
3. update from BACKOUT to CURRENT
4. merge TARGET into CURRENT
Then, we expects hooks to run in the order below:
- 'preupdate' on CURRENT for (1)
- 'update' on TARGET for (1)
- 'preupdate' on BACKOUT for (3)
- 'update' on CURRENT for (3)
- 'preupdate' on TARGET for (4)
- 'update' on CURRENT/TARGET for (4)
But hooks actually run in the order below:
- 'preupdate' on CURRENT for (1)
- 'preupdate' on BACKOUT for (3)
- 'preupdate' on TARGET for (4)
- 'update' on TARGET for (1), but actually on CURRENT/TARGET
- 'update' on CURRENT for (3), but actually on CURRENT/TARGET
- 'update' on CURRENT for (4), but actually on CURRENT/TARGET
Root cause of the issue focused by c67339617276 is that external
'update' hook process can't view in-memory changes (especially, of
dirstate), because they aren't written out until the end of
transaction (or wlock).
Now, hooks can be invoked just after updating, because previous
patches made in-memory changes visible to external process.
This patch may break backward compatibility from the point of view of
"scheduling hook execution", but should be reasonable because 'update'
hooks had been executed in this order before 3.4.
This patch tests "hg backout" and "hg unshelve", because the former
activates the transaction before 'update' hook invocation, but the
former doesn't.
2015-10-16 19:15:34 +03:00
|
|
|
====
|
|
|
|
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
|
|
|
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [hooks]
|
|
|
|
> update.visibility =
|
|
|
|
> EOF
|
|
|
|
|
2012-06-11 03:38:32 +04:00
|
|
|
$ cd ..
|
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
backout should not back out subsequent changesets
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ hg init onecs
|
|
|
|
$ cd onecs
|
|
|
|
$ echo 1 > a
|
|
|
|
$ hg commit -d '0 0' -A -m a
|
|
|
|
adding a
|
|
|
|
$ echo 2 >> a
|
|
|
|
$ hg commit -d '1 0' -m b
|
|
|
|
$ echo 1 > b
|
|
|
|
$ hg commit -d '2 0' -A -m c
|
|
|
|
adding b
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 2:882396649954 tip
|
|
|
|
c
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2010-09-10 12:28:18 +04:00
|
|
|
|
|
|
|
without --merge
|
2016-01-16 00:46:33 +03:00
|
|
|
$ hg backout --no-commit -d '3 0' 1 --tool=true
|
2010-09-10 12:28:18 +04:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2014-01-09 05:23:26 +04:00
|
|
|
changeset 22bca4c721e5 backed out, don't forget to commit.
|
2010-09-10 12:28:18 +04:00
|
|
|
$ hg locate b
|
|
|
|
b
|
|
|
|
$ hg update -C tip
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg locate b
|
|
|
|
b
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 2:882396649954 tip
|
|
|
|
c
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2010-09-10 12:28:18 +04:00
|
|
|
|
|
|
|
with --merge
|
2010-10-22 20:58:43 +04:00
|
|
|
$ hg backout --merge -d '3 0' 1 --tool=true
|
2010-09-10 12:28:18 +04:00
|
|
|
reverting a
|
2018-01-26 21:53:00 +03:00
|
|
|
changeset 3:19e57856498e backs out changeset 1:22bca4c721e5
|
|
|
|
merging with changeset 3:19e57856498e
|
2010-09-10 12:28:18 +04:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
2010-08-14 04:28:53 +04:00
|
|
|
$ hg locate b
|
|
|
|
b
|
|
|
|
$ hg update -C tip
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ hg locate b
|
2010-09-17 02:51:32 +04:00
|
|
|
[1]
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ hg init m
|
|
|
|
$ cd m
|
|
|
|
$ echo a > a
|
|
|
|
$ hg commit -d '0 0' -A -m a
|
|
|
|
adding a
|
|
|
|
$ echo b > b
|
|
|
|
$ hg commit -d '1 0' -A -m b
|
|
|
|
adding b
|
|
|
|
$ echo c > c
|
|
|
|
$ hg commit -d '2 0' -A -m b
|
|
|
|
adding c
|
|
|
|
$ hg update 1
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ echo d > d
|
|
|
|
$ hg commit -d '3 0' -A -m c
|
|
|
|
adding d
|
|
|
|
$ hg merge 2
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
|
|
|
$ hg commit -d '4 0' -A -m d
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 4:b2f3bb92043e tip
|
|
|
|
d
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 5 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
backout of merge should fail
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ hg backout 4
|
2011-10-08 23:18:18 +04:00
|
|
|
abort: cannot backout a merge changeset
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
backout of merge with bad parent should fail
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ hg backout --parent 0 4
|
|
|
|
abort: cb9a9f314b8b is not a parent of b2f3bb92043e
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
backout of non-merge with parent should fail
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ hg backout --parent 0 3
|
|
|
|
abort: cannot use --parent on non-merge changeset
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
backout with valid parent should be ok
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2010-10-22 20:58:43 +04:00
|
|
|
$ hg backout -d '5 0' --parent 2 4 --tool=true
|
2010-08-14 04:28:53 +04:00
|
|
|
removing d
|
2018-01-26 21:53:00 +03:00
|
|
|
changeset 5:84e16af81ce4 backs out changeset 4:b2f3bb92043e
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
2018-01-26 21:53:00 +03:00
|
|
|
parent: 5:84e16af81ce4 tip
|
|
|
|
Back out "d"
|
2014-01-09 05:15:22 +04:00
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 6 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ hg rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 4 (undo commit)
|
|
|
|
working directory now based on revision 4
|
2010-08-14 04:28:53 +04:00
|
|
|
$ hg update -C
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 4:b2f3bb92043e tip
|
|
|
|
d
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 5 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
2010-10-22 20:58:43 +04:00
|
|
|
$ hg backout -d '6 0' --parent 3 4 --tool=true
|
2010-08-14 04:28:53 +04:00
|
|
|
removing c
|
2018-01-26 21:53:00 +03:00
|
|
|
changeset 5:042ecc423244 backs out changeset 4:b2f3bb92043e
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
2018-01-26 21:53:00 +03:00
|
|
|
parent: 5:042ecc423244 tip
|
|
|
|
Back out "d"
|
2014-01-09 05:15:22 +04:00
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 6 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
2010-09-18 02:03:08 +04:00
|
|
|
named branches
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
$ hg init named_branches
|
|
|
|
$ cd named_branches
|
|
|
|
|
|
|
|
$ echo default > default
|
|
|
|
$ hg ci -d '0 0' -Am default
|
|
|
|
adding default
|
|
|
|
$ hg branch branch1
|
|
|
|
marked working directory as branch branch1
|
2011-12-09 00:32:44 +04:00
|
|
|
(branches are permanent and global, did you want a bookmark?)
|
2010-08-14 04:28:53 +04:00
|
|
|
$ echo branch1 > file1
|
|
|
|
$ hg ci -d '1 0' -Am file1
|
|
|
|
adding file1
|
|
|
|
$ hg branch branch2
|
|
|
|
marked working directory as branch branch2
|
|
|
|
$ echo branch2 > file2
|
|
|
|
$ hg ci -d '2 0' -Am file2
|
|
|
|
adding file2
|
2010-09-10 12:28:18 +04:00
|
|
|
|
|
|
|
without --merge
|
2016-01-16 00:46:33 +03:00
|
|
|
$ hg backout --no-commit -r 1 --tool=true
|
2014-01-09 02:53:46 +04:00
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2014-01-09 05:23:26 +04:00
|
|
|
changeset bf1602f437f3 backed out, don't forget to commit.
|
2010-09-10 12:28:18 +04:00
|
|
|
$ hg branch
|
|
|
|
branch2
|
|
|
|
$ hg status -A
|
|
|
|
R file1
|
|
|
|
C default
|
|
|
|
C file2
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 2:45bbcd363bf0 tip
|
|
|
|
file2
|
|
|
|
commit: 1 removed
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2010-09-10 12:28:18 +04:00
|
|
|
|
|
|
|
with --merge
|
2014-05-31 19:08:32 +04:00
|
|
|
(this also tests that editor is invoked if '--edit' is specified
|
|
|
|
explicitly regardless of '--message')
|
|
|
|
|
2010-09-10 12:28:18 +04:00
|
|
|
$ hg update -qC
|
2014-05-31 19:08:32 +04:00
|
|
|
$ HGEDITOR=cat hg backout --merge -d '3 0' -r 1 -m 'backout on branch1' --tool=true --edit
|
2010-08-14 04:28:53 +04:00
|
|
|
removing file1
|
2014-05-31 19:08:32 +04:00
|
|
|
backout on branch1
|
|
|
|
|
2018-01-26 21:53:00 +03:00
|
|
|
Original commit changeset: bf1602f437f3
|
|
|
|
|
2014-05-31 19:08:32 +04:00
|
|
|
|
|
|
|
HG: Enter commit message. Lines beginning with 'HG:' are removed.
|
|
|
|
HG: Leave message empty to abort commit.
|
|
|
|
HG: --
|
|
|
|
HG: user: test
|
|
|
|
HG: branch 'branch2'
|
|
|
|
HG: removed file1
|
2018-01-26 21:53:00 +03:00
|
|
|
changeset 3:8857f307d2b3 backs out changeset 1:bf1602f437f3
|
|
|
|
merging with changeset 3:8857f307d2b3
|
2010-09-10 12:28:18 +04:00
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 2:45bbcd363bf0
|
|
|
|
file2
|
2018-01-26 21:53:00 +03:00
|
|
|
parent: 3:8857f307d2b3 tip
|
2014-01-09 05:15:22 +04:00
|
|
|
backout on branch1
|
|
|
|
commit: 1 removed (merge)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 4 draft
|
2010-09-10 12:28:18 +04:00
|
|
|
$ hg update -q -C 2
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
on branch2 with branch1 not merged, so file1 should still exist:
|
|
|
|
|
|
|
|
$ hg id
|
|
|
|
45bbcd363bf0 (branch2)
|
|
|
|
$ hg st -A
|
|
|
|
C default
|
|
|
|
C file1
|
|
|
|
C file2
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 2:45bbcd363bf0
|
|
|
|
file2
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 4 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
on branch2 with branch1 merged, so file1 should be gone:
|
|
|
|
|
|
|
|
$ hg merge
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
|
|
|
$ hg ci -d '4 0' -m 'merge backout of branch1'
|
|
|
|
$ hg id
|
2018-01-26 21:53:00 +03:00
|
|
|
6b63d6afbede (branch2) tip
|
2010-08-14 04:28:53 +04:00
|
|
|
$ hg st -A
|
|
|
|
C default
|
|
|
|
C file2
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
2018-01-26 21:53:00 +03:00
|
|
|
parent: 4:6b63d6afbede tip
|
2014-01-09 05:15:22 +04:00
|
|
|
merge backout of branch1
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 5 draft
|
2010-08-14 04:28:53 +04:00
|
|
|
|
|
|
|
on branch1, so no file1 and file2:
|
|
|
|
|
|
|
|
$ hg co -C branch1
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ hg id
|
|
|
|
bf1602f437f3 (branch1)
|
|
|
|
$ hg st -A
|
|
|
|
C default
|
|
|
|
C file1
|
2014-01-09 05:15:22 +04:00
|
|
|
$ hg summary
|
|
|
|
parent: 1:bf1602f437f3
|
|
|
|
file1
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 5 draft
|
2012-06-11 03:38:32 +04:00
|
|
|
|
|
|
|
$ cd ..
|
2014-02-26 06:45:01 +04:00
|
|
|
|
2014-03-08 13:52:16 +04:00
|
|
|
backout of empty changeset (issue4190)
|
|
|
|
|
|
|
|
$ hg init emptycommit
|
|
|
|
$ cd emptycommit
|
|
|
|
|
|
|
|
$ touch file1
|
|
|
|
$ hg ci -Aqm file1
|
|
|
|
$ hg branch -q branch1
|
|
|
|
$ hg ci -qm branch1
|
|
|
|
$ hg backout -v 1
|
|
|
|
resolving manifests
|
|
|
|
nothing changed
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
2014-02-26 06:45:01 +04:00
|
|
|
|
|
|
|
Test usage of `hg resolve` in case of conflict
|
|
|
|
(issue4163)
|
|
|
|
|
|
|
|
$ hg init issue4163
|
|
|
|
$ cd issue4163
|
|
|
|
$ touch foo
|
|
|
|
$ hg add foo
|
|
|
|
$ cat > foo << EOF
|
|
|
|
> one
|
|
|
|
> two
|
|
|
|
> three
|
|
|
|
> four
|
|
|
|
> five
|
|
|
|
> six
|
|
|
|
> seven
|
|
|
|
> height
|
|
|
|
> nine
|
|
|
|
> ten
|
|
|
|
> EOF
|
|
|
|
$ hg ci -m 'initial'
|
|
|
|
$ cat > foo << EOF
|
|
|
|
> one
|
|
|
|
> two
|
|
|
|
> THREE
|
|
|
|
> four
|
|
|
|
> five
|
|
|
|
> six
|
|
|
|
> seven
|
|
|
|
> height
|
|
|
|
> nine
|
|
|
|
> ten
|
|
|
|
> EOF
|
|
|
|
$ hg ci -m 'capital three'
|
|
|
|
$ cat > foo << EOF
|
|
|
|
> one
|
|
|
|
> two
|
|
|
|
> THREE
|
|
|
|
> four
|
|
|
|
> five
|
|
|
|
> six
|
|
|
|
> seven
|
|
|
|
> height
|
|
|
|
> nine
|
|
|
|
> TEN
|
|
|
|
> EOF
|
|
|
|
$ hg ci -m 'capital ten'
|
|
|
|
$ hg backout -r 'desc("capital three")' --tool internal:fail
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
|
|
|
|
use 'hg resolve' to retry unresolved file merges
|
|
|
|
[1]
|
|
|
|
$ hg status
|
2015-10-02 23:00:47 +03:00
|
|
|
$ hg debugmergestate
|
|
|
|
* version 2 records
|
|
|
|
local: b71750c4b0fdf719734971e3ef90dbeab5919a2d
|
|
|
|
other: a30dd8addae3ce71b8667868478542bc417439e6
|
2016-02-05 21:22:14 +03:00
|
|
|
file extras: foo (ancestorlinknode = 91360952243723bd5b1138d5f26bd8c8564cb553)
|
2015-11-14 10:01:36 +03:00
|
|
|
file: foo (record type "F", state "u", hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33)
|
2015-10-02 23:00:47 +03:00
|
|
|
local path: foo (flags "")
|
|
|
|
ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708)
|
|
|
|
other path: foo (node f50039b486d6fa1a90ae51778388cad161f425ee)
|
|
|
|
$ mv .hg/merge/state2 .hg/merge/state2-moved
|
|
|
|
$ hg debugmergestate
|
|
|
|
* version 1 records
|
|
|
|
local: b71750c4b0fdf719734971e3ef90dbeab5919a2d
|
2015-11-14 10:01:36 +03:00
|
|
|
file: foo (record type "F", state "u", hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33)
|
2015-10-02 23:00:47 +03:00
|
|
|
local path: foo (flags "")
|
|
|
|
ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708)
|
|
|
|
other path: foo (node not stored in v1 format)
|
|
|
|
$ mv .hg/merge/state2-moved .hg/merge/state2
|
2014-02-26 06:45:01 +04:00
|
|
|
$ hg resolve -l # still unresolved
|
|
|
|
U foo
|
|
|
|
$ hg summary
|
|
|
|
parent: 2:b71750c4b0fd tip
|
|
|
|
capital ten
|
|
|
|
commit: 1 unresolved (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2014-02-26 06:45:01 +04:00
|
|
|
$ hg resolve --all --debug
|
2015-11-26 01:25:26 +03:00
|
|
|
picked tool ':merge' for foo (binary False symlink False changedelete False)
|
2014-02-26 06:45:01 +04:00
|
|
|
merging foo
|
|
|
|
my foo@b71750c4b0fd+ other foo@a30dd8addae3 ancestor foo@913609522437
|
|
|
|
premerge successful
|
2014-07-26 05:32:49 +04:00
|
|
|
(no more unresolved files)
|
2015-12-24 22:25:44 +03:00
|
|
|
continue: hg commit
|
2014-02-26 06:45:01 +04:00
|
|
|
$ hg status
|
|
|
|
M foo
|
|
|
|
? foo.orig
|
|
|
|
$ hg resolve -l
|
|
|
|
R foo
|
|
|
|
$ hg summary
|
|
|
|
parent: 2:b71750c4b0fd tip
|
|
|
|
capital ten
|
|
|
|
commit: 1 modified, 1 unknown
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2014-02-26 06:45:01 +04:00
|
|
|
$ cat foo
|
|
|
|
one
|
|
|
|
two
|
|
|
|
three
|
|
|
|
four
|
|
|
|
five
|
|
|
|
six
|
|
|
|
seven
|
|
|
|
height
|
|
|
|
nine
|
|
|
|
TEN
|
|
|
|
|
2016-01-20 19:16:58 +03:00
|
|
|
--no-commit shouldn't commit
|
|
|
|
|
|
|
|
$ hg init a
|
|
|
|
$ cd a
|
|
|
|
$ for i in 1 2 3; do
|
|
|
|
> touch $i
|
|
|
|
> hg ci -Am $i
|
|
|
|
> done
|
|
|
|
adding 1
|
|
|
|
adding 2
|
|
|
|
adding 3
|
|
|
|
$ hg backout --no-commit .
|
|
|
|
removing 3
|
|
|
|
changeset cccc23d9d68f backed out, don't forget to commit.
|
2016-01-30 12:00:11 +03:00
|
|
|
$ hg revert -aq
|
|
|
|
|
|
|
|
--no-commit can't be used with --merge
|
|
|
|
|
|
|
|
$ hg backout --merge --no-commit 2
|
|
|
|
abort: cannot use --merge with --no-commit
|
|
|
|
[255]
|