annotate tests/test-evolve-stop-phasediv.t @ 5777:c5dfbbe4363d

evolve: when relocating, optionally first try to do it using in-memory merge This patch adds a config option to let run evolve's relocation step using in-memory merge. It is disabled by default. When the option is on, the relocation is first attempted in memory. If that fails because of merge conflicts, it retries that commit in the working copy. There are a few reasons that I made it configurable. The most important one is that the precommit hook won't trigger when using in-memory merge. Another reason is that it lets us roll out the feature slowly to our users at Google. For now, we also update the working copy after creating the commit (in the successful case, when there are no merge conflicts). The next patch will make it so we don't do that update. Because of the unnecessary working-copy update, this patch doesn't provide any benefit on its own. Evolving 29 commits that each change one line in the hg slows down from ~4.5s to ~4.8s when the config option is on. I've added `#testcases inmemory ondisk` to select `.t` files. Almost all differences are because of the new "hit merge conflicts" message and retrying the merge. There's also one difference in `test-stabilize-order.t` caused by the different order of working copy updates (we now update the working copy at the end).
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 15 Oct 2020 15:40:36 -0700
parents e5d91fd1f319
children 4688b7eb7e40
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3732
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
1 Tests for the --stop flag for `hg evolve` command while resolving phase-divergence
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
2 ==================================================================================
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
3
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
4 The `--stop` flag stops the interrupted evolution and delete the state file so
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
5 user can do other things and comeback and do evolution later on
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
6
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
7 This is testing cases when `hg evolve` command is doing phase-divergence resolution.
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
8
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
9 Setup
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
10 =====
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
11
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
12 $ cat >> $HGRCPATH <<EOF
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
13 > [alias]
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
14 > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}"
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
15 > [extensions]
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
16 > EOF
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
17 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
18
5777
c5dfbbe4363d evolve: when relocating, optionally first try to do it using in-memory merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 5666
diff changeset
19 #testcases inmemory ondisk
c5dfbbe4363d evolve: when relocating, optionally first try to do it using in-memory merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 5666
diff changeset
20 #if inmemory
c5dfbbe4363d evolve: when relocating, optionally first try to do it using in-memory merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 5666
diff changeset
21 $ cat >> $HGRCPATH <<EOF
c5dfbbe4363d evolve: when relocating, optionally first try to do it using in-memory merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 5666
diff changeset
22 > [experimental]
c5dfbbe4363d evolve: when relocating, optionally first try to do it using in-memory merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 5666
diff changeset
23 > evolution.in-memory = yes
c5dfbbe4363d evolve: when relocating, optionally first try to do it using in-memory merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 5666
diff changeset
24 > EOF
c5dfbbe4363d evolve: when relocating, optionally first try to do it using in-memory merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 5666
diff changeset
25 #endif
c5dfbbe4363d evolve: when relocating, optionally first try to do it using in-memory merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 5666
diff changeset
26
3732
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
27 $ hg init stoprepo
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
28 $ cd stoprepo
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
29 $ echo ".*\.orig" > .hgignore
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
30 $ hg add .hgignore
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
31 $ hg ci -m "added hgignore"
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
32 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done;
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
33
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
34 $ hg glog
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
35 @ 4:c41c793e0ef1 added d
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
36 | () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
37 o 3:ca1b80f7960a added c
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
38 | () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
39 o 2:b1661037fa25 added b
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
40 | () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
41 o 1:c7586e2a9264 added a
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
42 | () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
43 o 0:8fa14d15e168 added hgignore
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
44 () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
45
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
46 Creating phase divergence, resolution of which will lead to conflicts
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
47 ----------------------------------------------------------------------
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
48
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
49 $ hg up .^^^
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
50 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4049
diff changeset
51 $ hg pick -r .~-3
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3852
diff changeset
52 picking 4:c41c793e0ef1 "added d"
3732
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
53 $ echo foobar > c
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
54 $ hg add c
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
55 $ hg amend
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
56
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
57 $ hg glog --hidden
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
58 @ 6:ddba58020bc0 added d
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
59 | () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
60 | x 5:cfe30edc6125 added d
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
61 |/ () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
62 | x 4:c41c793e0ef1 added d
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
63 | | () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
64 | o 3:ca1b80f7960a added c
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
65 | | () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
66 | o 2:b1661037fa25 added b
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
67 |/ () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
68 o 1:c7586e2a9264 added a
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
69 | () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
70 o 0:8fa14d15e168 added hgignore
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
71 () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
72
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
73 $ hg phase -r c41c793e0ef1 --public --hidden
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
74 1 new phase-divergent changesets
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
75
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
76 $ hg glog
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
77 @ 6:ddba58020bc0 added d
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
78 | () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
79 | o 4:c41c793e0ef1 added d
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
80 | | () public
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
81 | o 3:ca1b80f7960a added c
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
82 | | () public
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
83 | o 2:b1661037fa25 added b
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
84 |/ () public
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
85 o 1:c7586e2a9264 added a
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
86 | () public
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
87 o 0:8fa14d15e168 added hgignore
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
88 () public
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
89 $ hg evolve --phase-divergent
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
90 recreate:[6] added d
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
91 atop:[4] added d
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
92 rebasing to destination parent: ca1b80f7960a
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
93 merging c
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
94 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
4676
b6c819facbe8 evolvecmd: the proper way to deal with conflicts is to resolve them
Anton Shestakov <av6@dwimlabs.net>
parents: 4053
diff changeset
95 unresolved merge conflicts
b6c819facbe8 evolvecmd: the proper way to deal with conflicts is to resolve them
Anton Shestakov <av6@dwimlabs.net>
parents: 4053
diff changeset
96 (see 'hg help evolve.interrupted')
5666
e5d91fd1f319 tests: update with more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents: 4676
diff changeset
97 [240]
3732
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
98
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
99 $ hg evolve --stop
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
100 stopped the interrupted evolve
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
101 working directory is now at ca1b80f7960a
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
102
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
103 XXX: maybe we should update wdir to where it was
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
104 $ hg glog
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
105 * 6:ddba58020bc0 added d
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
106 | () draft
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
107 | o 4:c41c793e0ef1 added d
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
108 | | () public
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
109 | @ 3:ca1b80f7960a added c
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
110 | | () public
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
111 | o 2:b1661037fa25 added b
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
112 |/ () public
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
113 o 1:c7586e2a9264 added a
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
114 | () public
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
115 o 0:8fa14d15e168 added hgignore
422294cd682f tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
116 () public