comparison tests/test-push-checkheads-pruned-B1.t @ 32009:c6cb21ddf74a

checkheads: upgrade the obsolescence postprocessing logic (issue4354) The previous logic had many shortcoming (eg: looking at the head only, not handling prune, etc...), the new logic use a more robust approach: For each head, we check if after the push all changesets exclusive to this heads will be obsolete. If they are, the branch considered be "replaced". To check if a changeset will be obsolete, we simply checks: * the changeset phase * the existence of a marker relevant to the "pushed set" that affects the changesets.. This fixes two major issues of the previous algorithm: * branch partially rewritten (eg: head but not root) are no longer detected as replaced, * Prune are now properly handled. (This implementation was introduction in the evolve extension, version 6.0.0.) This new algorithm has an extended number of tests, a basic one is provided in this patch. The others will be introduced in their own changeset for clarity. In addition, we stop trying to process heads unknown locally, we do not have enough data to take an informed decision so we should stop pretending we do. This reflect a test that is now update.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sat, 15 Apr 2017 02:55:18 +0200
parents
children 53b3a1968aa6
comparison
equal deleted inserted replaced
32008:9a782e7e651e 32009:c6cb21ddf74a
1 ====================================
2 Testing head checking code: Case B-1
3 ====================================
4
5 Mercurial checks for the introduction of new heads on push. Evolution comes
6 into play to detect if existing branches on the server are being replaced by
7 some of the new one we push.
8
9 This case is part of a series of tests checking this behavior.
10
11 Category B: simple case involving pruned changesets
12 TestCase 1: single pruned changeset
13
14 .. old-state:
15 ..
16 .. * 1 changeset branch
17 ..
18 .. new-state:
19 ..
20 .. * old branch is pruned
21 .. * 1 new unrelated branch
22 ..
23 .. expected-result:
24 ..
25 .. * push allowed
26 ..
27 .. graph-summary:
28 ..
29 .. ◔ B
30 .. |
31 .. A ⊗ |
32 .. |/
33 .. ●
34
35 $ . $TESTDIR/testlib/push-checkheads-util.sh
36
37 Test setup
38 ----------
39
40 $ mkdir B1
41 $ cd B1
42 $ setuprepos
43 creating basic server and client repo
44 updating to branch default
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ cd client
47 $ hg up 0
48 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
49 $ mkcommit B0
50 created new head
51 $ hg debugobsolete --record-parents `getid "desc(A0)"`
52 $ hg log -G --hidden
53 @ 74ff5441d343 (draft): B0
54 |
55 | x 8aaa48160adc (draft): A0
56 |/
57 o 1e4be0697311 (public): root
58
59
60 Actual testing
61 --------------
62
63 $ hg push
64 pushing to $TESTTMP/B1/server (glob)
65 searching for changes
66 adding changesets
67 adding manifests
68 adding file changes
69 added 1 changesets with 1 changes to 1 files (+1 heads)
70 1 new obsolescence markers
71
72 $ cd ../..