Read about our upcoming Code of Conduct on this issue

This instance was upgraded to Heptapod 0.28.0 today

test-evolve-obshistory-lots-of-splits.t 14.2 KB
Newer Older
1
Testing obslog and other commands accessing obsolete revisions.
2
3
4
5
6
7

Global setup
============

  $ . $TESTDIR/testlib/obshistory_setup.sh

8
9
Test output with lots of split commit
=====================================
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

Test setup
----------

  $ hg init $TESTTMP/local-lots-split
  $ cd $TESTTMP/local-lots-split
  $ mkcommit ROOT
  $ echo 42 >> a
  $ echo 43 >> b
  $ echo 44 >> c
  $ echo 45 >> d
  $ hg commit -A -m "A0"
  adding a
  adding b
  adding c
  adding d
  $ hg log --hidden -G
  @  changeset:   1:de7290d8b885
  |  tag:         tip
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     A0
  |
  o  changeset:   0:ea207398892e
     user:        test
     date:        Thu Jan 01 00:00:00 1970 +0000
     summary:     ROOT
  

  $ hg split -r 'desc(A0)' -d "0 0" << EOF
  > y
  > y
  > n
  > n
  > n
  > y
  > y
47
  > y
48
49
50
51
  > n
  > n
  > y
  > y
52
  > y
53
  > n
54
  > y
55
56
57
58
59
60
61
62
63
64
  > y
  > y
  > EOF
  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
  adding a
  adding b
  adding c
  adding d
  diff --git a/a b/a
  new file mode 100644
65
66
  examine changes to 'a'?
  (enter ? for help) [Ynesfdaq?] y
67
68
69
  
  @@ -0,0 +1,1 @@
  +42
70
71
  record change 1/4 to 'a'?
  (enter ? for help) [Ynesfdaq?] y
72
73
74
  
  diff --git a/b b/b
  new file mode 100644
75
76
  examine changes to 'b'?
  (enter ? for help) [Ynesfdaq?] n
77
78
79
  
  diff --git a/c b/c
  new file mode 100644
80
81
  examine changes to 'c'?
  (enter ? for help) [Ynesfdaq?] n
82
83
84
  
  diff --git a/d b/d
  new file mode 100644
85
86
  examine changes to 'd'?
  (enter ? for help) [Ynesfdaq?] n
87
88
  
  created new head
89
  continue splitting? [Ycdq?] y
90
91
  diff --git a/b b/b
  new file mode 100644
92
93
  examine changes to 'b'?
  (enter ? for help) [Ynesfdaq?] y
94
95
96
  
  @@ -0,0 +1,1 @@
  +43
97
98
  record change 1/3 to 'b'?
  (enter ? for help) [Ynesfdaq?] y
99
100
101
  
  diff --git a/c b/c
  new file mode 100644
102
103
  examine changes to 'c'?
  (enter ? for help) [Ynesfdaq?] n
104
105
106
  
  diff --git a/d b/d
  new file mode 100644
107
108
  examine changes to 'd'?
  (enter ? for help) [Ynesfdaq?] n
109
  
110
  continue splitting? [Ycdq?] y
111
112
  diff --git a/c b/c
  new file mode 100644
113
114
  examine changes to 'c'?
  (enter ? for help) [Ynesfdaq?] y
115
116
117
  
  @@ -0,0 +1,1 @@
  +44
118
119
  record change 1/2 to 'c'?
  (enter ? for help) [Ynesfdaq?] y
120
121
122
  
  diff --git a/d b/d
  new file mode 100644
123
124
  examine changes to 'd'?
  (enter ? for help) [Ynesfdaq?] n
125
  
126
  continue splitting? [Ycdq?] y
127
128
  diff --git a/d b/d
  new file mode 100644
129
130
  examine changes to 'd'?
  (enter ? for help) [Ynesfdaq?] y
131
132
133
  
  @@ -0,0 +1,1 @@
  +45
134
135
  record this change to 'd'?
  (enter ? for help) [Ynesfdaq?] y
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
  
  no more change to split

  $ hg log --hidden -G
  @  changeset:   5:c7f044602e9b
  |  tag:         tip
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     A0
  |
  o  changeset:   4:1ae8bc733a14
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     A0
  |
  o  changeset:   3:f257fde29c7a
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     A0
  |
  o  changeset:   2:337fec4d2edc
  |  parent:      0:ea207398892e
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     A0
  |
  | x  changeset:   1:de7290d8b885
  |/   user:        test
  |    date:        Thu Jan 01 00:00:00 1970 +0000
  |    obsolete:    split using split as 2:337fec4d2edc, 3:f257fde29c7a, 4:1ae8bc733a14, 5:c7f044602e9b
  |    summary:     A0
  |
  o  changeset:   0:ea207398892e
     user:        test
     date:        Thu Jan 01 00:00:00 1970 +0000
     summary:     ROOT
  
Actual test
-----------

176
  $ hg obslog de7290d8b885 --hidden --patch --no-origin
177
  x  de7290d8b885 (1) A0
178
       split(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
179
180
         (No patch available, too many successors (4))
  
181
  $ hg obslog de7290d8b885 --hidden --all --patch --no-origin
182
183
184
185
186
187
188
189
190
  o  1ae8bc733a14 (4) A0
  |
  | o  337fec4d2edc (2) A0
  |/
  | @  c7f044602e9b (5) A0
  |/
  | o  f257fde29c7a (3) A0
  |/
  x  de7290d8b885 (1) A0
191
       split(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
192
193
         (No patch available, too many successors (4))
  
194
195
  $ hg obslog de7290d8b885 --hidden --all --patch
  o  1ae8bc733a14 (4) A0
196
  |    split(parent, content) together with 337fec4d2edc, c7f044602e9b, f257fde29c7a from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
197
198
199
  |      (No patch available, changesets rebased)
  |
  | o  337fec4d2edc (2) A0
200
  |/     split(parent, content) together with 1ae8bc733a14, c7f044602e9b, f257fde29c7a from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
  |        diff -r de7290d8b885 -r 337fec4d2edc b
  |        --- a/b	Thu Jan 01 00:00:00 1970 +0000
  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  |        @@ -1,1 +0,0 @@
  |        -43
  |        diff -r de7290d8b885 -r 337fec4d2edc c
  |        --- a/c	Thu Jan 01 00:00:00 1970 +0000
  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  |        @@ -1,1 +0,0 @@
  |        -44
  |        diff -r de7290d8b885 -r 337fec4d2edc d
  |        --- a/d	Thu Jan 01 00:00:00 1970 +0000
  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  |        @@ -1,1 +0,0 @@
  |        -45
  |
  |
  | @  c7f044602e9b (5) A0
219
  |/     split(parent, content) together with 1ae8bc733a14, 337fec4d2edc, f257fde29c7a from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
220
221
222
  |        (No patch available, changesets rebased)
  |
  | o  f257fde29c7a (3) A0
223
  |/     split(parent, content) together with 1ae8bc733a14, 337fec4d2edc, c7f044602e9b from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
224
225
226
227
228
  |        (No patch available, changesets rebased)
  |
  x  de7290d8b885 (1) A0
  
  $ hg obslog de7290d8b885 --hidden --no-graph --no-origin -Tjson | python -m json.tool
229
230
231
232
  [
      {
          "markers": [
              {
233
234
235
236
237
                  "dates": [
                      [
                          *, (glob)
                          0
                      ]
238
                  ],
239
                  "effects": [
240
241
242
                      "parent",
                      "content"
                  ],
243
244
245
                  "operations": [
                      "split"
                  ],
246
                  "succnodes": [
247
248
249
250
                      "1ae8bc733a14e374f11767d2ad128d4c891dc43f",
                      "337fec4d2edcf0e7a467e35f818234bc620068b5",
                      "c7f044602e9bd5dec6528b33114df3d0221e6359",
                      "f257fde29c7a847c9b607f6e958656d0df0fb15c"
251
                  ],
252
253
254
                  "users": [
                      "test"
                  ],
255
                  "verb": "split"
256
257
              }
          ],
258
          "node": "de7290d8b885925115bb9e88887252dfc20ef2a8",
259
260
261
          "shortdescription": "A0"
      }
  ]
262
  $ hg obslog c7f044602e9b --patch --no-origin
263
264
265
  @  c7f044602e9b (5) A0
  |
  x  de7290d8b885 (1) A0
266
       split(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
267
268
         (No patch available, too many successors (4))
  
269
270
  $ hg obslog c7f044602e9b --patch
  @  c7f044602e9b (5) A0
271
  |    split(parent, content) together with 1ae8bc733a14, 337fec4d2edc, f257fde29c7a from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
272
273
274
275
276
  |      (No patch available, changesets rebased)
  |
  x  de7290d8b885 (1) A0
  
  $ hg obslog c7f044602e9b --no-graph --no-origin -Tjson | python -m json.tool
277
278
279
  [
      {
          "markers": [],
280
          "node": "c7f044602e9bd5dec6528b33114df3d0221e6359",
281
282
283
284
285
          "shortdescription": "A0"
      },
      {
          "markers": [
              {
286
287
288
289
290
                  "dates": [
                      [
                          *, (glob)
                          0
                      ]
291
                  ],
292
                  "effects": [
293
294
295
                      "parent",
                      "content"
                  ],
296
297
298
                  "operations": [
                      "split"
                  ],
299
                  "succnodes": [
300
301
302
303
                      "1ae8bc733a14e374f11767d2ad128d4c891dc43f",
                      "337fec4d2edcf0e7a467e35f818234bc620068b5",
                      "c7f044602e9bd5dec6528b33114df3d0221e6359",
                      "f257fde29c7a847c9b607f6e958656d0df0fb15c"
304
                  ],
305
306
307
                  "users": [
                      "test"
                  ],
308
                  "verb": "split"
309
310
              }
          ],
311
          "node": "de7290d8b885925115bb9e88887252dfc20ef2a8",
312
313
314
          "shortdescription": "A0"
      }
  ]
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
  $ hg obslog c7f044602e9b --no-graph -Tjson | python -m json.tool
  [
      {
          "markers": [
              {
                  "dates": [
                      [
                          *, (glob)
                          0
                      ]
                  ],
                  "effects": [
                      "parent",
                      "content"
                  ],
                  "operations": [
                      "split"
                  ],
                  "prednodes": [
                      "de7290d8b885925115bb9e88887252dfc20ef2a8"
                  ],
336
337
338
339
340
                  "relnodes": [
                      "1ae8bc733a14e374f11767d2ad128d4c891dc43f",
                      "337fec4d2edcf0e7a467e35f818234bc620068b5",
                      "f257fde29c7a847c9b607f6e958656d0df0fb15c"
                  ],
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
                  "users": [
                      "test"
                  ],
                  "verb": "split"
              }
          ],
          "node": "c7f044602e9bd5dec6528b33114df3d0221e6359",
          "shortdescription": "A0"
      },
      {
          "markers": [],
          "node": "de7290d8b885925115bb9e88887252dfc20ef2a8",
          "shortdescription": "A0"
      }
  ]
356
Check that obslog on all heads shows a coherent graph
357
  $ hg obslog 2::5 --patch --no-origin
358
359
360
361
362
363
364
365
366
  o  1ae8bc733a14 (4) A0
  |
  | o  337fec4d2edc (2) A0
  |/
  | @  c7f044602e9b (5) A0
  |/
  | o  f257fde29c7a (3) A0
  |/
  x  de7290d8b885 (1) A0
367
       split(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
368
369
         (No patch available, too many successors (4))
  
370
371
  $ hg obslog 2::5 --patch
  o  1ae8bc733a14 (4) A0
372
  |    split(parent, content) together with 337fec4d2edc, c7f044602e9b, f257fde29c7a from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
373
374
375
  |      (No patch available, changesets rebased)
  |
  | o  337fec4d2edc (2) A0
376
  |/     split(parent, content) together with 1ae8bc733a14, c7f044602e9b, f257fde29c7a from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
  |        diff -r de7290d8b885 -r 337fec4d2edc b
  |        --- a/b	Thu Jan 01 00:00:00 1970 +0000
  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  |        @@ -1,1 +0,0 @@
  |        -43
  |        diff -r de7290d8b885 -r 337fec4d2edc c
  |        --- a/c	Thu Jan 01 00:00:00 1970 +0000
  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  |        @@ -1,1 +0,0 @@
  |        -44
  |        diff -r de7290d8b885 -r 337fec4d2edc d
  |        --- a/d	Thu Jan 01 00:00:00 1970 +0000
  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  |        @@ -1,1 +0,0 @@
  |        -45
  |
  |
  | @  c7f044602e9b (5) A0
395
  |/     split(parent, content) together with 1ae8bc733a14, 337fec4d2edc, f257fde29c7a from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
396
397
398
  |        (No patch available, changesets rebased)
  |
  | o  f257fde29c7a (3) A0
399
  |/     split(parent, content) together with 1ae8bc733a14, 337fec4d2edc, c7f044602e9b from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
400
401
402
403
404
  |        (No patch available, changesets rebased)
  |
  x  de7290d8b885 (1) A0
  
  $ hg obslog 5 --all --patch --no-origin
405
406
407
408
409
410
411
412
413
  o  1ae8bc733a14 (4) A0
  |
  | o  337fec4d2edc (2) A0
  |/
  | @  c7f044602e9b (5) A0
  |/
  | o  f257fde29c7a (3) A0
  |/
  x  de7290d8b885 (1) A0
414
       split(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
415
416
         (No patch available, too many successors (4))
  
417
418
  $ hg obslog 5 --all --patch
  o  1ae8bc733a14 (4) A0
419
  |    split(parent, content) together with 337fec4d2edc, c7f044602e9b, f257fde29c7a from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
420
421
422
  |      (No patch available, changesets rebased)
  |
  | o  337fec4d2edc (2) A0
423
  |/     split(parent, content) together with 1ae8bc733a14, c7f044602e9b, f257fde29c7a from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
  |        diff -r de7290d8b885 -r 337fec4d2edc b
  |        --- a/b	Thu Jan 01 00:00:00 1970 +0000
  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  |        @@ -1,1 +0,0 @@
  |        -43
  |        diff -r de7290d8b885 -r 337fec4d2edc c
  |        --- a/c	Thu Jan 01 00:00:00 1970 +0000
  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  |        @@ -1,1 +0,0 @@
  |        -44
  |        diff -r de7290d8b885 -r 337fec4d2edc d
  |        --- a/d	Thu Jan 01 00:00:00 1970 +0000
  |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  |        @@ -1,1 +0,0 @@
  |        -45
  |
  |
  | @  c7f044602e9b (5) A0
442
  |/     split(parent, content) together with 1ae8bc733a14, 337fec4d2edc, f257fde29c7a from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
443
444
445
  |        (No patch available, changesets rebased)
  |
  | o  f257fde29c7a (3) A0
446
  |/     split(parent, content) together with 1ae8bc733a14, 337fec4d2edc, c7f044602e9b from de7290d8b885 using split by test (Thu Jan 01 00:00:00 1970 +0000)
447
448
449
450
  |        (No patch available, changesets rebased)
  |
  x  de7290d8b885 (1) A0
  
451
452
453
454
455
456
457
458
459
460
  $ hg update de7290d8b885
  abort: hidden revision 'de7290d8b885' was split as: 337fec4d2edc, f257fde29c7a and 2 more!
  (use --hidden to access hidden revisions)
  [255]
  $ hg update --hidden 'min(desc(A0))'
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  updated to hidden changeset de7290d8b885
  (hidden revision 'de7290d8b885' was split as: 337fec4d2edc, f257fde29c7a and 2 more)
  working directory parent is obsolete! (de7290d8b885)
  (use 'hg evolve' to update to its tipmost successor: 337fec4d2edc, f257fde29c7a and 2 more)