2018-07-02 21:27:20 +03:00
|
|
|
$ . helpers-usechg.sh
|
2018-10-11 16:55:19 +03:00
|
|
|
$ enable amend rebase
|
2018-07-20 01:57:29 +03:00
|
|
|
$ setconfig rebase.experimental.inmemory=True
|
|
|
|
$ setconfig rebase.singletransaction=True
|
2018-07-02 21:27:20 +03:00
|
|
|
$ setconfig experimental.evolution.allowdivergence=True
|
|
|
|
$ setconfig experimental.evolution="createmarkers, allowunstable"
|
|
|
|
$ mkcommit() {
|
|
|
|
> echo "$1" > "$1"
|
|
|
|
> hg add "$1"
|
|
|
|
> hg ci -m "add $1"
|
|
|
|
> }
|
|
|
|
|
2018-07-20 01:57:29 +03:00
|
|
|
Test invalid value for amend.autorestack
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2018-07-20 01:57:29 +03:00
|
|
|
$ setconfig amend.autorestack=test
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C # C/file = 1\n2\n3\n4\n
|
|
|
|
> | # B/file = 1\n2\n
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ hg amend -m "new message"
|
|
|
|
invalid amend.autorestack config of "test"; falling back to only-trivial
|
|
|
|
rebasing 2:ca039b450ae0 "C" (C)
|
|
|
|
hint[amend-autorebase]: descendants have been auto-rebased because no merge conflict could have happened - use --no-rebase or set commands.amend.autorebase=False to disable auto rebase
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-autorebase' to silence these hints
|
|
|
|
|
|
|
|
If they disabled amend.autorestack, disable the new behavior (for now, during rollout)
|
|
|
|
$ newrepo
|
|
|
|
$ setconfig commands.amend.autorebase=False
|
|
|
|
$ setconfig amend.autorestack=always
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C # C/file = 1\n2\n3\n4\n
|
|
|
|
> | # B/file = 1\n2\n
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ hg amend -m "new message"
|
|
|
|
hint[amend-restack]: descendants of fe14e2b67b65 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
|
|
|
|
|
|
|
amend.autorestack=only-trivial, and simple changes (expect restack)
|
|
|
|
$ newrepo
|
|
|
|
$ setconfig amend.autorestack=only-trivial
|
2018-07-02 21:27:20 +03:00
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C
|
|
|
|
> |
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ hg amend -m 'Unchanged manifest for B'
|
|
|
|
rebasing 2:26805aba1e60 "C" (C)
|
|
|
|
hint[amend-autorebase]: descendants have been auto-rebased because no merge conflict could have happened - use --no-rebase or set commands.amend.autorebase=False to disable auto rebase
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-autorebase' to silence these hints
|
|
|
|
$ hg prev
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
[426bad] A
|
|
|
|
$ hg amend -m 'Unchanged manifest for A'
|
2018-08-15 21:41:39 +03:00
|
|
|
rebasing 1:112478962961 "B" (B)
|
|
|
|
rebasing 2:26805aba1e60 "C" (C)
|
2018-07-02 21:27:20 +03:00
|
|
|
rebasing 3:5357953e3ea3 "Unchanged manifest for B"
|
|
|
|
rebasing 4:b635bd2cf20b "C"
|
|
|
|
hint[amend-autorebase]: descendants have been auto-rebased because no merge conflict could have happened - use --no-rebase or set commands.amend.autorebase=False to disable auto rebase
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-autorebase' to silence these hints
|
|
|
|
|
2018-07-20 01:57:29 +03:00
|
|
|
amend.autorestack=never
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2018-07-20 01:57:29 +03:00
|
|
|
$ setconfig amend.autorestack=never
|
2018-07-02 21:27:20 +03:00
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C
|
|
|
|
> |
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
2018-07-20 01:57:29 +03:00
|
|
|
$ hg amend -m 'Unchanged manifest for B'
|
2018-07-02 21:27:20 +03:00
|
|
|
hint[amend-restack]: descendants of 112478962961 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
|
|
|
$ hg prev
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
[426bad] A
|
2018-07-20 01:57:29 +03:00
|
|
|
$ hg amend -m 'Unchanged manifest for A'
|
2018-07-02 21:27:20 +03:00
|
|
|
hint[amend-restack]: descendants of 426bada5c675 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
|
|
|
|
2018-07-20 01:57:29 +03:00
|
|
|
amend.autorestack=only-trivial, and manifest changes (expect no restack)
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2018-07-20 01:57:29 +03:00
|
|
|
$ setconfig amend.autorestack=only-trivial
|
2018-07-02 21:27:20 +03:00
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C
|
|
|
|
> |
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ echo 'new b' > B
|
|
|
|
$ hg amend -m 'Change manifest for B'
|
|
|
|
hint[amend-restack]: descendants of 112478962961 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
|
|
|
|
2018-07-20 01:57:29 +03:00
|
|
|
amend.autorestack=only-trivial, and dirty working copy (expect no restack)
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2018-07-20 01:57:29 +03:00
|
|
|
$ setconfig amend.autorestack=only-trivial
|
2018-07-02 21:27:20 +03:00
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C
|
|
|
|
> |
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ echo 'new b' > B
|
|
|
|
$ hg amend a -m 'Unchanged manifest, but dirty workdir'
|
|
|
|
hint[amend-restack]: descendants of 112478962961 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
|
|
|
|
2018-07-20 01:57:29 +03:00
|
|
|
amend.autorestack=only-trivial, and no manifest changes, but no children (expect no restack)
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2018-07-20 01:57:29 +03:00
|
|
|
$ setconfig amend.autorestack=only-trivial
|
2018-07-02 21:27:20 +03:00
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ hg amend -m 'Unchanged manifest for B'
|
2018-07-20 01:57:29 +03:00
|
|
|
|
|
|
|
amend.autorestack=no-conflict, and mergeable changes (expect restack)
|
|
|
|
$ newrepo
|
|
|
|
$ setconfig amend.autorestack=no-conflict
|
|
|
|
$ setconfig amend.autorestackmsg="custom autorestack message"
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C # C/file = 1\n2\n3\n4\n
|
|
|
|
> | # B/file = 1\n2\n
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ $TESTDIR/seq.py 0 2 > file
|
|
|
|
$ hg amend
|
|
|
|
custom autorestack message
|
|
|
|
rebasing 2:ca039b450ae0 "C" (C)
|
|
|
|
merging file
|
|
|
|
$ showgraph
|
2018-08-15 09:13:17 +03:00
|
|
|
o 4 7ed7d67ad7bf C
|
2018-07-20 01:57:29 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 3 767372f778c5 B
|
2018-07-20 01:57:29 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 2 ca039b450ae0 C
|
2018-07-20 01:57:29 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 fe14e2b67b65 B
|
2018-07-20 01:57:29 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 426bada5c675 A
|
2018-07-20 01:57:29 +03:00
|
|
|
$ cat file
|
|
|
|
0
|
|
|
|
1
|
|
|
|
2
|
|
|
|
|
|
|
|
amend.autorestack=no-conflict, and mergeable changes, but dirty WC (expect no restack)
|
|
|
|
$ newrepo
|
|
|
|
$ setconfig amend.autorestack=no-conflict
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C # C/file = 1\n2\n3\n4\n
|
|
|
|
> | # B/file = 1\n2\n
|
|
|
|
> B # A/other = i don't matter
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ echo "new content" > other
|
|
|
|
$ $TESTDIR/seq.py 0 2 > file
|
|
|
|
$ cat <<EOS | hg amend -i --config ui.interactive=1
|
|
|
|
> y
|
|
|
|
> y
|
|
|
|
> n
|
|
|
|
> EOS
|
|
|
|
diff --git a/file b/file
|
|
|
|
1 hunks, 1 lines changed
|
|
|
|
examine changes to 'file'? [Ynesfdaq?] y
|
|
|
|
|
|
|
|
@@ -1,2 +1,3 @@
|
|
|
|
+0
|
|
|
|
1
|
|
|
|
2
|
|
|
|
record change 1/2 to 'file'? [Ynesfdaq?] y
|
|
|
|
|
|
|
|
diff --git a/other b/other
|
|
|
|
1 hunks, 1 lines changed
|
|
|
|
examine changes to 'other'? [Ynesfdaq?] n
|
|
|
|
|
|
|
|
not restacking because working copy is dirty
|
|
|
|
hint[amend-restack]: descendants of bf943f2ff2de are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
amend.autorestack=no-conflict, and conflicting changes (expect cancelled restack)
|
|
|
|
$ newrepo
|
|
|
|
$ setconfig amend.autorestack=no-conflict
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> D
|
|
|
|
> |
|
|
|
|
> C # D/file = 1\n2\n3\n4\n
|
|
|
|
> | # B/file = 1\n2\n
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ echo 'unmergeable!' > file
|
|
|
|
$ hg amend
|
|
|
|
restacking children automatically (unless they conflict)
|
|
|
|
rebasing 2:b6c0d35dc9e9 "C" (C)
|
|
|
|
rebasing 3:02cc3cc1d010 "D" (D)
|
|
|
|
merging file
|
|
|
|
transaction abort!
|
|
|
|
rollback completed
|
|
|
|
restacking would create conflicts (hit merge conflicts in file), so you must run it manually
|
|
|
|
(run `hg restack` manually to restack this commit's children)
|
|
|
|
$ showgraph
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 4 3000de962fa1 B
|
2018-07-20 01:57:29 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 3 02cc3cc1d010 D
|
2018-07-20 01:57:29 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 2 b6c0d35dc9e9 C
|
2018-07-20 01:57:29 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 fe14e2b67b65 B
|
2018-07-20 01:57:29 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 426bada5c675 A
|
2018-07-20 01:57:29 +03:00
|
|
|
$ cat file
|
|
|
|
unmergeable!
|
|
|
|
|
|
|
|
amend.autorestack=always, and conflicting changes (expect restack)
|
|
|
|
$ newrepo
|
|
|
|
$ setconfig amend.autorestack=always
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> D
|
|
|
|
> |
|
|
|
|
> C # D/file = 1\n2\n3\n4\n
|
|
|
|
> | # B/file = 1\n2\n
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ echo 'unmergeable!' > file
|
|
|
|
$ hg amend
|
|
|
|
rebasing 2:b6c0d35dc9e9 "C" (C)
|
|
|
|
rebasing 3:02cc3cc1d010 "D" (D)
|
|
|
|
merging file
|
|
|
|
hit merge conflicts (in file); switching to on-disk merge
|
|
|
|
rebasing 3:02cc3cc1d010 "D" (D)
|
|
|
|
merging file
|
2018-10-22 22:45:46 +03:00
|
|
|
warning: 1 conflicts while merging file! (edit, then use 'hg resolve --mark')
|
2018-07-20 01:57:29 +03:00
|
|
|
unresolved conflicts (see hg resolve, then hg rebase --continue)
|
|
|
|
[1]
|
|
|
|
$ hg rebase --abort
|
|
|
|
rebase aborted
|
|
|
|
$ cat file
|
|
|
|
unmergeable!
|
|
|
|
$ showgraph
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 4 3000de962fa1 B
|
2018-07-20 01:57:29 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 3 02cc3cc1d010 D
|
2018-07-20 01:57:29 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 2 b6c0d35dc9e9 C
|
2018-07-20 01:57:29 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 fe14e2b67b65 B
|
2018-07-20 01:57:29 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 426bada5c675 A
|
2018-07-20 01:57:29 +03:00
|
|
|
|
|
|
|
Test rebasing children with obsolete children themselves needing a restack.
|
|
|
|
$ newrepo
|
|
|
|
$ setconfig amend.autorestack=no-conflict
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> D
|
|
|
|
> |
|
|
|
|
> C C2 # amend: C -> C2
|
|
|
|
> |/
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A # <-- then amend this
|
|
|
|
> |
|
|
|
|
> Z
|
|
|
|
> EOS
|
|
|
|
$ hg update A -q
|
|
|
|
$ echo "new value" > A
|
|
|
|
$ hg amend
|
|
|
|
restacking children automatically (unless they conflict)
|
|
|
|
rebasing 2:917a077edb8d "B" (B)
|
|
|
|
rebasing 4:ff9eba5e2480 "C2" (C2)
|
2018-08-15 21:41:39 +03:00
|
|
|
rebasing 3:b45c90359798 "C" (C)
|
2018-07-20 01:57:29 +03:00
|
|
|
rebasing 5:01f26f1a10b2 "D" (D)
|
|
|
|
$ showgraph
|
2018-08-15 21:41:39 +03:00
|
|
|
o 10 c83f7cf4e4f0 D
|
|
|
|
|
|
|
|
|
x 9 68f241c592e0 C
|
2018-07-20 01:57:29 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 8 84f362759e03 C2
|
2018-07-20 01:57:29 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 7 23018262b14e B
|
2018-07-20 01:57:29 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 6 21006be03678 A
|
2018-07-20 01:57:29 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 5 01f26f1a10b2 D
|
2018-07-20 01:57:29 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| | x 4 ff9eba5e2480 C2
|
2018-07-20 01:57:29 +03:00
|
|
|
| | |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x | 3 b45c90359798 C
|
2018-07-20 01:57:29 +03:00
|
|
|
| |/
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 2 917a077edb8d B
|
2018-07-20 01:57:29 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 ac2f7407182b A
|
2018-07-20 01:57:29 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 48b9aae0607f Z
|