comparison tests/test-copies-in-changeset.t @ 43142:beed7ce61681

sidedatacopies: write copies information in sidedata when applicable If the format of the repository indicate it stores copies information into changeset's sidedata, then we actually write that information into sidedata at commit time. It will be put to use in later changesets. Currently, we store all field unconditionally, but that is likely to change in the future for the sake of efficiency. Differential Revision: https://phab.mercurial-scm.org/D6950
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 06 Oct 2019 23:36:51 -0400
parents 52781d57313d
children 843da18386d5
comparison
equal deleted inserted replaced
43141:52781d57313d 43142:beed7ce61681
73 2 73 2
74 74
75 p1copies: 0\x00a (esc) 75 p1copies: 0\x00a (esc)
76 1\x00a (esc) 76 1\x00a (esc)
77 2\x00a (esc) 77 2\x00a (esc)
78 78 #else
79 $ hg debugsidedata -c -v -- -1
80 4 sidedata entries
81 entry-0010 size 11
82 '0\x00a\n1\x00a\n2\x00a'
83 entry-0011 size 0
84 ''
85 entry-0012 size 5
86 '0\n1\n2'
87 entry-0013 size 0
88 ''
79 #endif 89 #endif
80 90
81 $ hg showcopies 91 $ hg showcopies
82 a -> b 92 a -> b
83 a -> c 93 a -> c
105 filesadded: 1 115 filesadded: 1
106 filesremoved: 0 116 filesremoved: 0
107 117
108 p1copies: 1\x00b (esc) 118 p1copies: 1\x00b (esc)
109 119
120 #else
121 $ hg debugsidedata -c -v -- -1
122 4 sidedata entries
123 entry-0010 size 3
124 '1\x00b'
125 entry-0011 size 0
126 ''
127 entry-0012 size 1
128 '1'
129 entry-0013 size 1
130 '0'
110 #endif 131 #endif
111 132
112 $ hg showcopies 133 $ hg showcopies
113 b -> b2 134 b -> b2
114 135
143 $ hg changesetcopies 164 $ hg changesetcopies
144 files: c 165 files: c
145 166
146 p1copies: 0\x00b2 (esc) 167 p1copies: 0\x00b2 (esc)
147 168
169 #else
170 $ hg debugsidedata -c -v -- -1
171 4 sidedata entries
172 entry-0010 size 4
173 '0\x00b2'
174 entry-0011 size 0
175 ''
176 entry-0012 size 0
177 ''
178 entry-0013 size 0
179 ''
148 #endif 180 #endif
149 181
150 $ hg showcopies 182 $ hg showcopies
151 b2 -> c 183 b2 -> c
152 184
195 227
196 p1copies: 0\x00a (esc) 228 p1copies: 0\x00a (esc)
197 2\x00f (esc) 229 2\x00f (esc)
198 p2copies: 1\x00d (esc) 230 p2copies: 1\x00d (esc)
199 231
232 #else
233 $ hg debugsidedata -c -v -- -1
234 4 sidedata entries
235 entry-0010 size 7
236 '0\x00a\n2\x00f'
237 entry-0011 size 3
238 '1\x00d'
239 entry-0012 size 5
240 '0\n1\n2'
241 entry-0013 size 0
242 ''
200 #endif 243 #endif
201 244
202 $ hg showcopies 245 $ hg showcopies
203 a -> g 246 a -> g
204 d -> h 247 d -> h
216 259
217 p1copies: 0\x00a (esc) 260 p1copies: 0\x00a (esc)
218 p2copies: 261 p2copies:
219 #else 262 #else
220 $ hg ci -m 'copy a to j' 263 $ hg ci -m 'copy a to j'
264 $ hg debugsidedata -c -v -- -1
265 4 sidedata entries
266 entry-0010 size 3
267 '0\x00a'
268 entry-0011 size 0
269 ''
270 entry-0012 size 1
271 '0'
272 entry-0013 size 0
273 ''
221 #endif 274 #endif
222 $ hg debugdata j 0 275 $ hg debugdata j 0
223 \x01 (esc) 276 \x01 (esc)
224 copy: a 277 copy: a
225 copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 278 copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
241 files: j 294 files: j
242 295
243 #else 296 #else
244 $ hg ci --amend -m 'copy a to j, v2' 297 $ hg ci --amend -m 'copy a to j, v2'
245 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-*-amend.hg (glob) 298 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-*-amend.hg (glob)
299 $ hg debugsidedata -c -v -- -1
300 4 sidedata entries
301 entry-0010 size 3
302 '0\x00a'
303 entry-0011 size 0
304 ''
305 entry-0012 size 1
306 '0'
307 entry-0013 size 0
308 ''
246 #endif 309 #endif
247 $ hg showcopies --config experimental.copies.read-from=filelog-only 310 $ hg showcopies --config experimental.copies.read-from=filelog-only
248 a -> j 311 a -> j
249 The entries should be written to extras even if they're empty (so the client 312 The entries should be written to extras even if they're empty (so the client
250 won't have to fall back to reading from filelogs) 313 won't have to fall back to reading from filelogs)
258 321
259 p1copies: 322 p1copies:
260 p2copies: 323 p2copies:
261 #else 324 #else
262 $ hg ci -m 'modify j' 325 $ hg ci -m 'modify j'
326 $ hg debugsidedata -c -v -- -1
327 4 sidedata entries
328 entry-0010 size 0
329 ''
330 entry-0011 size 0
331 ''
332 entry-0012 size 0
333 ''
334 entry-0013 size 0
335 ''
263 #endif 336 #endif
264 337
265 Test writing only to filelog 338 Test writing only to filelog
266 339
267 $ hg cp a k 340 $ hg cp a k
271 $ hg changesetcopies 344 $ hg changesetcopies
272 files: k 345 files: k
273 346
274 #else 347 #else
275 $ hg ci -m 'copy a to k' 348 $ hg ci -m 'copy a to k'
349 $ hg debugsidedata -c -v -- -1
350 4 sidedata entries
351 entry-0010 size 3
352 '0\x00a'
353 entry-0011 size 0
354 ''
355 entry-0012 size 1
356 '0'
357 entry-0013 size 0
358 ''
276 #endif 359 #endif
277 360
278 $ hg debugdata k 0 361 $ hg debugdata k 0
279 \x01 (esc) 362 \x01 (esc)
280 copy: a 363 copy: a