Mercurial > hg
comparison tests/test-obsolete.t @ 35709:1a09dad8b85a
evolution: report new unstable changesets
This adds a transaction summary callback that reports the number of
new orphan, content-divergent and phase-divergent changesets.
The code for reporting it is based on the code from the evolve
extension, but simplified a bit. It simply counts the numbers for each
kind of instability before and after the transaction. That's obviously
not very efficient, but it's easy to reason about, so I'm doing this
as a first step that can make us quite confident about the test case
changes. We can optimize it later and make sure that the tests are not
affected. The code has been used in the evolve extension for a long
time and has apparently been sufficiently fast, so it doesn't seem
like a pressing issue.
Unlike the evolve extension's version of this report, this version
applies to all commands (or all transactions run as part of any
command, to be exact).
Differential Revision: https://phab.mercurial-scm.org/D1867
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sun, 14 Jan 2018 23:59:17 -0800 |
parents | 7336ac5e786e |
children | 5cd60b0587a8 |
comparison
equal
deleted
inserted
replaced
35708:03e921942163 | 35709:1a09dad8b85a |
---|---|
206 -1 | 206 -1 |
207 | 207 |
208 Check that public changeset are not accounted as obsolete: | 208 Check that public changeset are not accounted as obsolete: |
209 | 209 |
210 $ hg --hidden phase --public 2 | 210 $ hg --hidden phase --public 2 |
211 1 new phase-divergent changesets | |
211 $ hg log -G | 212 $ hg log -G |
212 @ 5:5601fb93a350 (draft phase-divergent) [tip ] add new_3_c | 213 @ 5:5601fb93a350 (draft phase-divergent) [tip ] add new_3_c |
213 | | 214 | |
214 | o 2:245bde4270cd (public) [ ] add original_c | 215 | o 2:245bde4270cd (public) [ ] add original_c |
215 |/ | 216 |/ |
517 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | 518 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
518 $ mkcommit original_d | 519 $ mkcommit original_d |
519 $ mkcommit original_e | 520 $ mkcommit original_e |
520 $ hg debugobsolete --record-parents `getid original_d` -d '0 0' | 521 $ hg debugobsolete --record-parents `getid original_d` -d '0 0' |
521 obsoleted 1 changesets | 522 obsoleted 1 changesets |
523 1 new orphan changesets | |
522 $ hg debugobsolete | grep `getid original_d` | 524 $ hg debugobsolete | grep `getid original_d` |
523 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | 525 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
524 $ hg log -r 'obsolete()' | 526 $ hg log -r 'obsolete()' |
525 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned] | 527 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned] |
526 $ hg summary | 528 $ hg summary |
581 adding changesets | 583 adding changesets |
582 adding manifests | 584 adding manifests |
583 adding file changes | 585 adding file changes |
584 added 6 changesets with 6 changes to 6 files (+1 heads) | 586 added 6 changesets with 6 changes to 6 files (+1 heads) |
585 7 new obsolescence markers | 587 7 new obsolescence markers |
588 1 new orphan changesets | |
586 | 589 |
587 no warning displayed | 590 no warning displayed |
588 | 591 |
589 $ hg push ../tmpf | 592 $ hg push ../tmpf |
590 pushing to ../tmpf | 593 pushing to ../tmpf |
916 | 919 |
917 Several troubles on the same changeset (create an unstable and bumped changeset) | 920 Several troubles on the same changeset (create an unstable and bumped changeset) |
918 | 921 |
919 $ hg debugobsolete `getid obsolete_e` | 922 $ hg debugobsolete `getid obsolete_e` |
920 obsoleted 1 changesets | 923 obsoleted 1 changesets |
924 2 new orphan changesets | |
921 $ hg debugobsolete `getid original_c` `getid babar` | 925 $ hg debugobsolete `getid original_c` `getid babar` |
926 1 new phase-divergent changesets | |
922 $ hg log --config ui.logtemplate= -r 'phasedivergent() and orphan()' | 927 $ hg log --config ui.logtemplate= -r 'phasedivergent() and orphan()' |
923 changeset: 7:50c51b361e60 | 928 changeset: 7:50c51b361e60 |
924 user: test | 929 user: test |
925 date: Thu Jan 01 00:00:00 1970 +0000 | 930 date: Thu Jan 01 00:00:00 1970 +0000 |
926 instability: orphan, phase-divergent | 931 instability: orphan, phase-divergent |
1291 $ mkcommit b | 1296 $ mkcommit b |
1292 $ hg up ".^" | 1297 $ hg up ".^" |
1293 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 1298 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
1294 $ echo aa > a | 1299 $ echo aa > a |
1295 $ hg amendtransient | 1300 $ hg amendtransient |
1301 1 new orphan changesets | |
1296 [1, 2] | 1302 [1, 2] |
1297 | 1303 |
1298 Test cache consistency for the visible filter | 1304 Test cache consistency for the visible filter |
1299 1) We want to make sure that the cached filtered revs are invalidated when | 1305 1) We want to make sure that the cached filtered revs are invalidated when |
1300 bookmarks change | 1306 bookmarks change |