Mercurial > evolve
comparison tests/test-stabilize-order.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 | e6d7d261ca4a |
children | 84affb254cdf |
comparison
equal
deleted
inserted
replaced
5776:453ba695c3d4 | 5777:c5dfbbe4363d |
---|---|
2 > [defaults] | 2 > [defaults] |
3 > amend=-d "0 0" | 3 > amend=-d "0 0" |
4 > [extensions] | 4 > [extensions] |
5 > EOF | 5 > EOF |
6 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH | 6 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH |
7 | |
8 #testcases inmemory ondisk | |
9 #if inmemory | |
10 $ cat >> $HGRCPATH <<EOF | |
11 > [experimental] | |
12 > evolution.in-memory = yes | |
13 > EOF | |
14 #endif | |
7 | 15 |
8 $ glog() { | 16 $ glog() { |
9 > hg log -G --template '{rev}:{node|short}@{branch}({phase}) {desc|firstline}\n' "$@" | 17 > hg log -G --template '{rev}:{node|short}@{branch}({phase}) {desc|firstline}\n' "$@" |
10 > } | 18 > } |
11 | 19 |
70 getting b | 78 getting b |
71 committing files: | 79 committing files: |
72 b | 80 b |
73 committing manifest | 81 committing manifest |
74 committing changelog | 82 committing changelog |
83 resolving manifests (inmemory !) | |
84 getting b (inmemory !) | |
75 resolving manifests | 85 resolving manifests |
76 removing b | 86 removing b |
77 $ glog | 87 $ glog |
78 o 6:81b8bbcd5892@default(draft) addb | 88 o 6:81b8bbcd5892@default(draft) addb |
79 | | 89 | |
93 $ hg debugobsolete > successors.old | 103 $ hg debugobsolete > successors.old |
94 $ hg evolve -v --update | 104 $ hg evolve -v --update |
95 move:[3] addc | 105 move:[3] addc |
96 atop:[6] addb | 106 atop:[6] addb |
97 hg rebase -r 7a7552255fb5 -d 81b8bbcd5892 | 107 hg rebase -r 7a7552255fb5 -d 81b8bbcd5892 |
98 resolving manifests | 108 resolving manifests (ondisk !) |
99 getting b | 109 getting b (ondisk !) |
100 resolving manifests | 110 resolving manifests |
101 getting c | 111 getting c |
102 committing files: | 112 committing files: |
103 c | 113 c |
104 committing manifest | 114 committing manifest |
105 committing changelog | 115 committing changelog |
116 resolving manifests (inmemory !) | |
117 getting b (inmemory !) | |
118 getting c (inmemory !) | |
106 working directory is now at 0f691739f917 | 119 working directory is now at 0f691739f917 |
107 $ hg debugobsolete > successors.new | 120 $ hg debugobsolete > successors.new |
108 $ diff -u successors.old successors.new | 121 $ diff -u successors.old successors.new |
109 --- successors.old* (glob) | 122 --- successors.old* (glob) |
110 +++ successors.new* (glob) | 123 +++ successors.new* (glob) |
155 [2] | 168 [2] |
156 $ hg evolve --any -v | 169 $ hg evolve --any -v |
157 move:[7] addc | 170 move:[7] addc |
158 atop:[8] addb | 171 atop:[8] addb |
159 hg rebase -r 0f691739f917 -d 7a68bc4596ea | 172 hg rebase -r 0f691739f917 -d 7a68bc4596ea |
160 resolving manifests | 173 resolving manifests (ondisk !) |
161 removing c | 174 removing c (ondisk !) |
162 getting b | 175 getting b (ondisk !) |
163 resolving manifests | 176 resolving manifests |
164 getting c | 177 getting c |
165 committing files: | 178 committing files: |
166 c | 179 c |
167 committing manifest | 180 committing manifest |
168 committing changelog | 181 committing changelog |
182 resolving manifests (inmemory !) | |
183 getting b (inmemory !) | |
169 working directory is now at 2256dae6521f | 184 working directory is now at 2256dae6521f |
170 $ glog | 185 $ glog |
171 @ 9:2256dae6521f@default(draft) addc | 186 @ 9:2256dae6521f@default(draft) addc |
172 | | 187 | |
173 o 8:7a68bc4596ea@default(draft) addb | 188 o 8:7a68bc4596ea@default(draft) addb |