Mercurial > evolve
comparison tests/test-divergent.t @ 3914:96945ea908df stable
branching: merge default into stable
The stable branch of Mercurial core now contains Mercurial 4.7 so evolve branch
policy requires this merge. The @ bookmark is in the right location, so people
doing clone will get to the latest release.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 31 Jul 2018 12:52:06 +0200 |
parents | f9dad99a90d5 |
children | d00f0c369bc7 |
comparison
equal
deleted
inserted
replaced
3901:f2b8429db565 | 3914:96945ea908df |
---|---|
30 Basic test of divergence: two divergent changesets with the same parents | 30 Basic test of divergence: two divergent changesets with the same parents |
31 With --all --any we dedupe the divergent and solve the divergence once | 31 With --all --any we dedupe the divergent and solve the divergence once |
32 | 32 |
33 $ hg init test1 | 33 $ hg init test1 |
34 $ cd test1 | 34 $ cd test1 |
35 $ mkcommits _a _b | 35 $ echo a > a |
36 $ hg up "desc(_a)" | 36 $ hg ci -Aqm "added a" |
37 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 37 $ echo b > b |
38 $ mkcommit bdivergent1 | 38 $ hg ci -Aqm "added b" |
39 created new head | 39 |
40 $ hg up "desc(_a)" | 40 $ hg up .^ |
41 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 41 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
42 $ mkcommit bdivergent2 | 42 $ echo bdivergent > bdivergent1 |
43 created new head | 43 $ hg ci -Am "divergent" |
44 $ hg prune -s "desc(bdivergent1)" "desc(_b)" | 44 adding bdivergent1 |
45 1 changesets pruned | 45 created new head |
46 $ hg prune -s "desc(bdivergent2)" "desc(_b)" --hidden | 46 |
47 $ hg up .^ | |
48 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
49 $ echo bdivergent > bdivergent2 | |
50 $ hg ci -Am "divergent" | |
51 adding bdivergent2 | |
52 created new head | |
53 | |
54 $ hg prune -s 8374d2ddc3a4 "desc('added b')" | |
55 1 changesets pruned | |
56 $ hg prune -s 593c57f2117e "desc('added b')" --hidden | |
47 1 changesets pruned | 57 1 changesets pruned |
48 2 new content-divergent changesets | 58 2 new content-divergent changesets |
49 $ hg log -G | 59 |
50 @ 3:e708fd28d5cf@default(draft) add bdivergent2 [content-divergent] | 60 $ hg log -G |
51 | | 61 @ 3:8374d2ddc3a4@default(draft) divergent [content-divergent] |
52 | * 2:c2f698071cba@default(draft) add bdivergent1 [content-divergent] | 62 | |
53 |/ | 63 | * 2:593c57f2117e@default(draft) divergent [content-divergent] |
54 o 0:135f39f4bd78@default(draft) add _a [] | 64 |/ |
55 | 65 o 0:9092f1db7931@default(draft) added a [] |
66 | |
67 | |
56 $ hg evolve --all --any --content-divergent | 68 $ hg evolve --all --any --content-divergent |
57 merge:[2] add bdivergent1 | 69 merge:[2] divergent |
58 with: [3] add bdivergent2 | 70 with: [3] divergent |
59 base: [1] add _b | 71 base: [1] added b |
60 updating to "local" conflict | 72 updating to "local" side of the conflict: 593c57f2117e |
61 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | 73 merging "other" content-divergent changeset '8374d2ddc3a4' |
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63 working directory is now at c26f1d3baed2 | 75 working directory is now at 45bf1312f454 |
64 $ hg log -G | 76 $ hg log -G |
65 @ 4:c26f1d3baed2@default(draft) add bdivergent1 [] | 77 @ 4:45bf1312f454@default(draft) divergent [] |
66 | | 78 | |
67 o 0:135f39f4bd78@default(draft) add _a [] | 79 o 0:9092f1db7931@default(draft) added a [] |
68 | 80 |
69 Test divergence resolution when it yields to an empty commit (issue4950) | 81 Test divergence resolution when it yields to an empty commit (issue4950) |
70 cdivergent2 contains the same content than cdivergent1 and they are divergent | 82 cdivergent2 contains the same content than cdivergent1 and they are divergent |
71 versions of the revision _c | 83 versions of the revision _c |
72 | 84 |
73 $ hg up "desc(_a)" | 85 $ hg up .^ |
74 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | 86 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
75 $ mkcommit _c | 87 $ mkcommit _c |
76 created new head | 88 created new head |
77 $ hg up "desc(_a)" | 89 |
90 $ hg up .^ | |
78 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 91 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
79 $ mkcommit cdivergent1 | 92 $ mkcommit cdivergent1 |
80 created new head | 93 created new head |
81 $ hg up "desc(_a)" | 94 |
95 $ hg up .^ | |
82 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 96 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
83 $ echo "cdivergent1" > cdivergent1 | 97 $ echo "cdivergent1" > cdivergent1 |
84 $ hg add cdivergent1 | 98 $ hg add cdivergent1 |
85 $ hg ci -m "cdivergent2" | 99 $ hg ci -m "add _c" |
86 created new head | 100 created new head |
87 $ hg prune -s "desc(cdivergent1)" "desc(_c)" | 101 |
88 1 changesets pruned | 102 $ hg log -G |
89 $ hg prune -s "desc(cdivergent2)" "desc(_c)" --hidden | 103 @ 7:b2ae71172042@default(draft) add _c [] |
104 | | |
105 | o 6:e3ff64ce8d4c@default(draft) add cdivergent1 [] | |
106 |/ | |
107 | o 5:48819a835615@default(draft) add _c [] | |
108 |/ | |
109 | o 4:45bf1312f454@default(draft) divergent [] | |
110 |/ | |
111 o 0:9092f1db7931@default(draft) added a [] | |
112 | |
113 | |
114 $ hg prune -s b2ae71172042 48819a835615 | |
115 1 changesets pruned | |
116 $ hg prune -s e3ff64ce8d4c 48819a835615 --hidden | |
90 1 changesets pruned | 117 1 changesets pruned |
91 2 new content-divergent changesets | 118 2 new content-divergent changesets |
92 $ hg log -G | 119 |
93 @ 7:0a768ef678d9@default(draft) cdivergent2 [content-divergent] | 120 $ hg log -G |
94 | | 121 @ 7:b2ae71172042@default(draft) add _c [content-divergent] |
95 | * 6:26c7705fee96@default(draft) add cdivergent1 [content-divergent] | 122 | |
96 |/ | 123 | * 6:e3ff64ce8d4c@default(draft) add cdivergent1 [content-divergent] |
97 | o 4:c26f1d3baed2@default(draft) add bdivergent1 [] | 124 |/ |
98 |/ | 125 | o 4:45bf1312f454@default(draft) divergent [] |
99 o 0:135f39f4bd78@default(draft) add _a [] | 126 |/ |
127 o 0:9092f1db7931@default(draft) added a [] | |
100 | 128 |
101 $ hg evolve --all --any --content-divergent | 129 $ hg evolve --all --any --content-divergent |
102 merge:[6] add cdivergent1 | 130 merge:[6] add cdivergent1 |
103 with: [7] cdivergent2 | 131 with: [7] add _c |
104 base: [5] add _c | 132 base: [5] add _c |
105 updating to "local" conflict | 133 updating to "local" side of the conflict: e3ff64ce8d4c |
106 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 134 merging "other" content-divergent changeset 'b2ae71172042' |
107 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 135 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
108 nothing changed | 136 nothing changed |
109 working directory is now at 26c7705fee96 | 137 working directory is now at e3ff64ce8d4c |
138 | |
139 $ cd .. | |
110 | 140 |
111 Test None docstring issue of evolve divergent, which caused hg crush | 141 Test None docstring issue of evolve divergent, which caused hg crush |
112 | 142 |
113 $ hg init test2 | 143 $ hg init test2 |
114 $ cd test2 | 144 $ cd test2 |
115 $ mkcommits _a _b | 145 $ mkcommits _a _b |
116 $ hg up "desc(_a)" | 146 |
117 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 147 $ hg up .^ |
118 $ mkcommit bdivergent1 | 148 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
119 created new head | 149 $ echo bdivergent > bdivergent11 |
120 $ hg up "desc(_a)" | 150 $ hg ci -Am "bdivergent" |
121 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 151 adding bdivergent11 |
122 $ mkcommit bdivergent2 | 152 created new head |
123 created new head | 153 |
124 $ hg prune -s "desc(bdivergent1)" "desc(_b)" | 154 $ hg up .^ |
125 1 changesets pruned | 155 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
126 $ hg prune -s "desc(bdivergent2)" "desc(_b)" --hidden | 156 $ echo bdivergent > bdivergent22 |
157 $ hg ci -Am "bdivergent" | |
158 adding bdivergent22 | |
159 created new head | |
160 | |
161 $ hg log -G | |
162 @ 3:6b096fb45070@default(draft) bdivergent [] | |
163 | | |
164 | o 2:05a6b6a9e633@default(draft) bdivergent [] | |
165 |/ | |
166 | o 1:37445b16603b@default(draft) add _b [] | |
167 |/ | |
168 o 0:135f39f4bd78@default(draft) add _a [] | |
169 | |
170 | |
171 $ hg prune -s 6b096fb45070 37445b16603b | |
172 1 changesets pruned | |
173 $ hg prune -s 05a6b6a9e633 37445b16603b --hidden | |
127 1 changesets pruned | 174 1 changesets pruned |
128 2 new content-divergent changesets | 175 2 new content-divergent changesets |
129 $ hg log -G | 176 $ hg log -G |
130 @ 3:e708fd28d5cf@default(draft) add bdivergent2 [content-divergent] | 177 @ 3:6b096fb45070@default(draft) bdivergent [content-divergent] |
131 | | 178 | |
132 | * 2:c2f698071cba@default(draft) add bdivergent1 [content-divergent] | 179 | * 2:05a6b6a9e633@default(draft) bdivergent [content-divergent] |
133 |/ | 180 |/ |
134 o 0:135f39f4bd78@default(draft) add _a [] | 181 o 0:135f39f4bd78@default(draft) add _a [] |
135 | 182 |
183 | |
136 $ cat >$TESTTMP/test_extension.py << EOF | 184 $ cat >$TESTTMP/test_extension.py << EOF |
137 > from mercurial import merge | 185 > from mercurial import merge |
138 > origupdate = merge.update | 186 > origupdate = merge.update |
139 > def newupdate(*args, **kwargs): | 187 > def newupdate(*args, **kwargs): |
140 > return origupdate(*args, **kwargs) | 188 > return origupdate(*args, **kwargs) |
147 $ hg evolve --all | 195 $ hg evolve --all |
148 nothing to evolve on current working copy parent | 196 nothing to evolve on current working copy parent |
149 (do you want to use --content-divergent) | 197 (do you want to use --content-divergent) |
150 [2] | 198 [2] |
151 $ hg evolve --content-divergent | 199 $ hg evolve --content-divergent |
152 merge:[3] add bdivergent2 | 200 merge:[3] bdivergent |
153 with: [2] add bdivergent1 | 201 with: [2] bdivergent |
154 base: [1] add _b | 202 base: [1] add _b |
203 merging "other" content-divergent changeset '05a6b6a9e633' | |
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 204 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
156 working directory is now at aa26817f6fbe | 205 working directory is now at 73ff357d3975 |
157 | |
158 | 206 |
159 $ cd .. | 207 $ cd .. |