Show More
@@ -1,198 +1,290 b'' | |||
|
1 | 1 | ================================================== |
|
2 | 2 | Test obsmarkers interaction with bundle and strip |
|
3 | 3 | ================================================== |
|
4 | 4 | |
|
5 | 5 | In practice, this file does not yet contains any tests for bundle and strip. |
|
6 | 6 | But their will be some soon (tm). |
|
7 | 7 | |
|
8 | 8 | For now this test check the logic computing markers relevant to a set of |
|
9 | 9 | revision. That logic will be use by "hg bundle" to select the markers to |
|
10 | 10 | include, and strip to find the markers to backup. |
|
11 | 11 | |
|
12 | 12 | Setup a repository with various case |
|
13 | 13 | ==================================== |
|
14 | 14 | |
|
15 | 15 | Config setup |
|
16 | 16 | ------------ |
|
17 | 17 | |
|
18 | 18 | $ cat >> $HGRCPATH <<EOF |
|
19 | 19 | > [ui] |
|
20 | 20 | > # simpler log output |
|
21 | 21 | > logtemplate = "{node|short}: {desc}\n" |
|
22 | 22 | > |
|
23 | 23 | > [experimental] |
|
24 | 24 | > # enable evolution |
|
25 | 25 | > evolution = all |
|
26 | 26 | > |
|
27 | 27 | > # include obsmarkers in bundle |
|
28 | 28 | > evolution.bundle-obsmarker = yes |
|
29 | 29 | > |
|
30 | 30 | > [extensions] |
|
31 | 31 | > # needed for some tests |
|
32 | 32 | > strip = |
|
33 | 33 | > [defaults] |
|
34 | 34 | > # we'll query many hidden changeset |
|
35 | 35 | > debugobsolete = --hidden |
|
36 | 36 | > EOF |
|
37 | 37 | |
|
38 | 38 | $ mkcommit() { |
|
39 | 39 | > echo "$1" > "$1" |
|
40 | 40 | > hg add "$1" |
|
41 | 41 | > hg ci -m "$1" |
|
42 | 42 | > } |
|
43 | 43 | |
|
44 | 44 | $ getid() { |
|
45 | 45 | > hg log --hidden --template '{node}\n' --rev "$1" |
|
46 | 46 | > } |
|
47 | 47 | |
|
48 | 48 | $ mktestrepo () { |
|
49 | 49 | > [ -n "$1" ] || exit 1 |
|
50 | 50 | > cd $TESTTMP |
|
51 | 51 | > hg init $1 |
|
52 | 52 | > cd $1 |
|
53 | 53 | > mkcommit ROOT |
|
54 | 54 | > } |
|
55 | 55 | |
|
56 | 56 | root setup |
|
57 | 57 | ------------- |
|
58 | 58 | |
|
59 | 59 | simple chain |
|
60 | 60 | ============ |
|
61 | 61 | |
|
62 | 62 | . A0 |
|
63 | 63 | . ⇠ø⇠◔ A1 |
|
64 | 64 | . |/ |
|
65 | 65 | . ● |
|
66 | 66 | |
|
67 | 67 | setup |
|
68 | 68 | ----- |
|
69 | 69 | |
|
70 | 70 | $ mktestrepo simple-chain |
|
71 | 71 | $ mkcommit 'C-A0' |
|
72 | 72 | $ hg up 'desc("ROOT")' |
|
73 | 73 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
74 | 74 | $ mkcommit 'C-A1' |
|
75 | 75 | created new head |
|
76 | 76 | $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'` |
|
77 | 77 | $ hg debugobsolete `getid 'desc("C-A0")'` a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 |
|
78 | 78 | $ hg debugobsolete a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 `getid 'desc("C-A1")'` |
|
79 | 79 | |
|
80 | 80 | $ hg up 'desc("ROOT")' |
|
81 | 81 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
82 | 82 | $ hg log --hidden -G |
|
83 | 83 | o cf2c22470d67: C-A1 |
|
84 | 84 | | |
|
85 | 85 | | x 84fcb0dfe17b: C-A0 |
|
86 | 86 | |/ |
|
87 | 87 | @ ea207398892e: ROOT |
|
88 | 88 | |
|
89 | 89 | $ hg debugobsolete |
|
90 | 90 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
91 | 91 | 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
92 | 92 | a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
93 | 93 | |
|
94 | 94 | Actual testing |
|
95 | 95 | -------------- |
|
96 | 96 | |
|
97 | 97 | $ hg debugobsolete --rev 'desc("C-A0")' |
|
98 | 98 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
99 | 99 | $ hg debugobsolete --rev 'desc("C-A1")' |
|
100 | 100 | 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
101 | 101 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
102 | 102 | a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
103 | 103 | |
|
104 | 104 | chain with prune children |
|
105 | 105 | ========================= |
|
106 | 106 | |
|
107 | 107 | . ⇠⊗ B0 |
|
108 | 108 | . | |
|
109 | 109 | . ⇠ø⇠◔ A1 |
|
110 | 110 | . | |
|
111 | 111 | . ● |
|
112 | 112 | |
|
113 | 113 | setup |
|
114 | 114 | ----- |
|
115 | 115 | |
|
116 | 116 | $ mktestrepo prune |
|
117 | 117 | $ mkcommit 'C-A0' |
|
118 | 118 | $ mkcommit 'C-B0' |
|
119 | 119 | $ hg up 'desc("ROOT")' |
|
120 | 120 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
121 | 121 | $ mkcommit 'C-A1' |
|
122 | 122 | created new head |
|
123 | 123 | $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'` |
|
124 | 124 | $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` |
|
125 | 125 | $ hg debugobsolete --record-parents `getid 'desc("C-B0")'` |
|
126 | 126 | $ hg up 'desc("ROOT")' |
|
127 | 127 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
128 | 128 | $ hg log --hidden -G |
|
129 | 129 | o cf2c22470d67: C-A1 |
|
130 | 130 | | |
|
131 | 131 | | x 29f93b1df87b: C-B0 |
|
132 | 132 | | | |
|
133 | 133 | | x 84fcb0dfe17b: C-A0 |
|
134 | 134 | |/ |
|
135 | 135 | @ ea207398892e: ROOT |
|
136 | 136 | |
|
137 | 137 | $ hg debugobsolete |
|
138 | 138 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
139 | 139 | 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
140 | 140 | 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
141 | 141 | |
|
142 | 142 | Actual testing |
|
143 | 143 | -------------- |
|
144 | 144 | |
|
145 | 145 | $ hg debugobsolete --rev 'desc("C-A0")' |
|
146 | 146 | 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
147 | 147 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
148 | 148 | $ hg debugobsolete --rev 'desc("C-B0")' |
|
149 | 149 | 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
150 | 150 | $ hg debugobsolete --rev 'desc("C-A1")' |
|
151 | 151 | 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
152 | 152 | 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
153 | 153 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
154 | 154 | |
|
155 | 155 | chain with precursors also pruned |
|
156 | 156 | ================================= |
|
157 | 157 | |
|
158 | 158 | . A0 (also pruned) |
|
159 | 159 | . ⇠ø⇠◔ A1 |
|
160 | 160 | . | |
|
161 | 161 | . ● |
|
162 | 162 | |
|
163 | 163 | setup |
|
164 | 164 | ----- |
|
165 | 165 | |
|
166 | 166 | $ mktestrepo prune-inline |
|
167 | 167 | $ mkcommit 'C-A0' |
|
168 | 168 | $ hg up 'desc("ROOT")' |
|
169 | 169 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
170 | 170 | $ mkcommit 'C-A1' |
|
171 | 171 | created new head |
|
172 | 172 | $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'` |
|
173 | 173 | $ hg debugobsolete --record-parents `getid 'desc("C-A0")'` |
|
174 | 174 | $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` |
|
175 | 175 | $ hg up 'desc("ROOT")' |
|
176 | 176 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
177 | 177 | $ hg log --hidden -G |
|
178 | 178 | o cf2c22470d67: C-A1 |
|
179 | 179 | | |
|
180 | 180 | | x 84fcb0dfe17b: C-A0 |
|
181 | 181 | |/ |
|
182 | 182 | @ ea207398892e: ROOT |
|
183 | 183 | |
|
184 | 184 | $ hg debugobsolete |
|
185 | 185 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
186 | 186 | 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
187 | 187 | 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
188 | 188 | |
|
189 | 189 | Actual testing |
|
190 | 190 | -------------- |
|
191 | 191 | |
|
192 | 192 | $ hg debugobsolete --rev 'desc("C-A0")' |
|
193 | 193 | 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
194 | 194 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
195 | 195 | $ hg debugobsolete --rev 'desc("C-A1")' |
|
196 | 196 | 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
197 | 197 | 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
198 | 198 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
199 | ||
|
200 | chain with missing prune | |
|
201 | ======================== | |
|
202 | ||
|
203 | . ⊗ B | |
|
204 | . | | |
|
205 | . ⇠◌⇠◔ A1 | |
|
206 | . | | |
|
207 | . ● | |
|
208 | ||
|
209 | setup | |
|
210 | ----- | |
|
211 | ||
|
212 | $ mktestrepo missing-prune | |
|
213 | $ mkcommit 'C-A0' | |
|
214 | $ mkcommit 'C-B0' | |
|
215 | $ hg up 'desc("ROOT")' | |
|
216 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
|
217 | $ mkcommit 'C-A1' | |
|
218 | created new head | |
|
219 | $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'` | |
|
220 | $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` | |
|
221 | $ hg debugobsolete --record-parents `getid 'desc("C-B0")'` | |
|
222 | ||
|
223 | (it is annoying to create prune with parent data without the changeset, so we strip it after the fact) | |
|
224 | ||
|
225 | $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup | |
|
226 | ||
|
227 | $ hg up 'desc("ROOT")' | |
|
228 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
229 | $ hg log --hidden -G | |
|
230 | o cf2c22470d67: C-A1 | |
|
231 | | | |
|
232 | @ ea207398892e: ROOT | |
|
233 | ||
|
234 | $ hg debugobsolete | |
|
235 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
236 | 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
237 | 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
238 | ||
|
239 | Actual testing | |
|
240 | -------------- | |
|
241 | ||
|
242 | $ hg debugobsolete --rev 'desc("C-A1")' | |
|
243 | 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
244 | 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
245 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
246 | ||
|
247 | chain with precursors also pruned | |
|
248 | ================================= | |
|
249 | ||
|
250 | . A0 (also pruned) | |
|
251 | . ⇠◌⇠◔ A1 | |
|
252 | . | | |
|
253 | . ● | |
|
254 | ||
|
255 | setup | |
|
256 | ----- | |
|
257 | ||
|
258 | $ mktestrepo prune-inline-missing | |
|
259 | $ mkcommit 'C-A0' | |
|
260 | $ hg up 'desc("ROOT")' | |
|
261 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
262 | $ mkcommit 'C-A1' | |
|
263 | created new head | |
|
264 | $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'` | |
|
265 | $ hg debugobsolete --record-parents `getid 'desc("C-A0")'` | |
|
266 | $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` | |
|
267 | ||
|
268 | (it is annoying to create prune with parent data without the changeset, so we strip it after the fact) | |
|
269 | ||
|
270 | $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup | |
|
271 | ||
|
272 | $ hg up 'desc("ROOT")' | |
|
273 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
274 | $ hg log --hidden -G | |
|
275 | o cf2c22470d67: C-A1 | |
|
276 | | | |
|
277 | @ ea207398892e: ROOT | |
|
278 | ||
|
279 | $ hg debugobsolete | |
|
280 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
281 | 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
282 | 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
283 | ||
|
284 | Actual testing | |
|
285 | -------------- | |
|
286 | ||
|
287 | $ hg debugobsolete --rev 'desc("C-A1")' | |
|
288 | 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
289 | 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
290 | a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
General Comments 0
You need to be logged in to leave comments.
Login now