comparison tests/test-single-head-obsolescence-named-branch-A4.t @ 5227:b20d04641c0f stable

head-checking: ignore obsolete section when checking for single heads This overwrite the core code that enforce single heads to ignore obsolete section. That way older obsolete version of a branch no longer prevent the new version to be pushed.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 11 Mar 2020 23:56:11 +0100
parents
children 35e769c9604f 8cc7732a29bf
comparison
equal deleted inserted replaced
5226:1e0516ee4cb9 5227:b20d04641c0f
1 =========================================
2 Testing single head enforcement: Case A-4
3 =========================================
4
5 A repository is set to only accept a single head per name (typically named
6 branch). However, obsolete changesets can make this enforcement more
7 complicated, because they can be kept visible by other changeset on other
8 branch.
9
10 This case is part of a series of tests checking this behavior.
11
12 Category A: Involving obsolescence
13 TestCase 4: Partial rewrite of a branch to dis-interleave it
14
15 .. old-state:
16 ..
17 .. * 2 changeset changeset on branch default
18 .. * 2 changeset changeset on branch Z interleaved with the other one
19 ..
20 .. new-state:
21 ..
22 .. * 2 changeset changeset on branch Z at the same location
23 .. * 1 changeset on default untouched (the lower one)
24 .. * 1 changeset on default moved on the other one
25 ..
26 .. expected-result:
27 ..
28 .. * only one head detected
29 ..
30 .. graph-summary:
31 ..
32 .. D ● (branch Z)
33 .. |
34 .. C ø⇠◔ C'
35 .. | |
36 .. B ● | (branch Z)
37 .. |/
38 .. A ●
39 .. |
40 .. ●
41
42 $ . $TESTDIR/testlib/topic_setup.sh
43 $ . $TESTDIR/testlib/push-checkheads-util.sh
44
45 Test setup
46 ----------
47
48 $ mkdir A4
49 $ cd A4
50 $ setuprepos single-head
51 creating basic server and client repo
52 updating to branch default
53 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 $ cd client
55 $ hg branch Z
56 marked working directory as branch Z
57 (branches are permanent and global, did you want a bookmark?)
58 $ mkcommit B0
59 $ hg branch default --force
60 marked working directory as branch default
61 $ mkcommit C0
62 created new head
63 (consider using topic for lightweight branches. See 'hg help topic')
64 $ hg branch Z --force
65 marked working directory as branch Z
66 $ mkcommit D0
67 created new head
68 (consider using topic for lightweight branches. See 'hg help topic')
69 $ hg push --new-branch
70 pushing to $TESTTMP/A4/server
71 searching for changes
72 adding changesets
73 adding manifests
74 adding file changes
75 added 3 changesets with 3 changes to 3 files
76 $ hg up 'desc("A0")'
77 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
78 $ mkcommit C1
79 created new head
80 (consider using topic for lightweight branches. See 'hg help topic')
81 $ hg debugobsolete `getid "desc(C0)" ` `getid "desc(C1)"`
82 1 new obsolescence markers
83 obsoleted 1 changesets
84 1 new orphan changesets
85 $ hg log -G --hidden
86 @ cfe9ed94fa4a [default] (draft): C1
87 |
88 | * 78578c4306ce [Z] (draft): D0
89 | |
90 | x afc55ba2ce61 [default] (draft): C0
91 | |
92 | o 93e5c1321ece [Z] (draft): B0
93 |/
94 o 8aaa48160adc [default] (draft): A0
95 |
96 o 1e4be0697311 [default] (public): root
97
98
99 Actual testing
100 --------------
101
102 (force push to make sure we get the changeset on the remote)
103
104 $ hg push -r 'desc("C1")' --force
105 pushing to $TESTTMP/A4/server
106 searching for changes
107 adding changesets
108 adding manifests
109 adding file changes
110 added 1 changesets with 1 changes to 1 files (+1 heads)
111 1 new obsolescence markers
112 obsoleted 1 changesets
113 1 new orphan changesets