2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2020-06-11 03:33:43 +03:00
|
|
|
$ configure mutation-norecord
|
2018-07-02 21:24:59 +03:00
|
|
|
Tests the --noconflict rebase flag
|
2018-06-20 06:13:13 +03:00
|
|
|
|
2018-10-11 16:55:19 +03:00
|
|
|
$ enable amend morestatus rebase
|
2018-06-20 06:13:13 +03:00
|
|
|
$ setconfig morestatus.show=True
|
|
|
|
$ setconfig rebase.singletransaction=True
|
|
|
|
$ setconfig rebase.experimental.inmemory=True
|
|
|
|
$ setconfig rebase.experimental.inmemorywarning="rebasing in-memory!"
|
2018-06-26 00:53:31 +03:00
|
|
|
$ newrepo
|
2018-06-20 06:13:13 +03:00
|
|
|
|
|
|
|
$ hg debugdrawdag <<'EOS'
|
|
|
|
> c
|
|
|
|
> |
|
|
|
|
> b g
|
|
|
|
> |/
|
|
|
|
> a
|
|
|
|
> EOS
|
|
|
|
$ hg up -q g
|
|
|
|
$ echo "conflict" > c
|
|
|
|
$ hg add -q
|
|
|
|
$ hg amend -q
|
|
|
|
$ hg up c
|
|
|
|
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2019-12-17 05:10:38 +03:00
|
|
|
(activating bookmark c)
|
2018-06-20 06:13:13 +03:00
|
|
|
$ echo "local change" > b
|
2018-06-26 00:53:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
Confirm it fails when rebasing a change that conflicts:
|
2018-07-02 21:24:59 +03:00
|
|
|
$ hg rebase -r tip -d . --noconflict
|
2018-06-20 06:13:13 +03:00
|
|
|
rebasing in-memory!
|
2019-12-18 00:45:17 +03:00
|
|
|
rebasing 955ac081fc7c "g" (g)
|
2018-06-26 00:53:31 +03:00
|
|
|
merging c
|
2018-07-20 01:57:29 +03:00
|
|
|
hit merge conflicts (in c) and --noconflict passed; exiting
|
2018-06-20 06:13:13 +03:00
|
|
|
$ hg st
|
|
|
|
M b
|
|
|
|
$ cat b
|
|
|
|
local change
|
|
|
|
|
2018-06-26 00:53:31 +03:00
|
|
|
Confirm rebase without a merge behaves the same:
|
2018-07-02 21:24:59 +03:00
|
|
|
$ hg rebase -r tip -d .~1 --noconflict
|
2018-06-20 06:13:13 +03:00
|
|
|
rebasing in-memory!
|
2019-12-18 00:45:17 +03:00
|
|
|
rebasing 955ac081fc7c "g" (g)
|
2018-06-20 06:13:13 +03:00
|
|
|
|
2018-06-26 00:53:31 +03:00
|
|
|
Confirm the flag fails without IMM:
|
2018-06-20 06:13:13 +03:00
|
|
|
|
|
|
|
$ setconfig rebase.experimental.inmemory=False
|
|
|
|
$ hg up -C .
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg st
|
2018-07-02 21:24:59 +03:00
|
|
|
$ hg rebase -r tip -d . --noconflict
|
|
|
|
abort: --noconflict requires in-memory merge
|
2018-06-20 06:13:13 +03:00
|
|
|
[255]
|
2018-06-26 00:53:31 +03:00
|
|
|
|
|
|
|
Confirm that it rebases a three-way merge, but no conflict:
|
|
|
|
$ newrepo
|
|
|
|
$ $TESTDIR/seq.py 1 5 > a
|
|
|
|
$ hg commit -Aq -m "base"
|
|
|
|
$ $TESTDIR/seq.py 1 10 > a
|
|
|
|
$ hg commit -q -m "extend to 10"
|
|
|
|
$ hg up -q .~1
|
|
|
|
$ $TESTDIR/seq.py 0 5 > a
|
|
|
|
$ hg commit -q -m "prepend with 0"
|
2020-10-08 21:06:31 +03:00
|
|
|
$ hg log -G -r 'desc(base)':: -T '{desc}'
|
2020-10-08 06:58:22 +03:00
|
|
|
@ prepend with 0
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
|
|
|
│ o extend to 10
|
|
|
|
├─╯
|
2020-10-08 06:58:22 +03:00
|
|
|
o base
|
2018-06-26 00:53:31 +03:00
|
|
|
|
2020-10-08 21:06:31 +03:00
|
|
|
$ hg up -qC 'desc(base)'
|
|
|
|
$ hg rebase -r 'desc(extend)' -d 'desc(prepend)' --noconflict
|
2018-06-26 00:53:31 +03:00
|
|
|
rebasing in-memory!
|
2019-10-16 02:28:01 +03:00
|
|
|
rebasing 12cba56c6d27 "extend to 10"
|
2018-06-26 00:53:31 +03:00
|
|
|
merging a
|
|
|
|
$ hg cat -r tip a | wc -l | xargs
|
|
|
|
11
|
|
|
|
|
|
|
|
^ (xargs is used for trimming)
|