##// END OF EJS Templates
push: test for checks preventing publishing obsolete changeset...
marmoute -
r45786:559ebfb5 stable
parent child Browse files
Show More
@@ -1,209 +1,236
1 1 =======================================================
2 2 Test check for obsolescence and instability during push
3 3 =======================================================
4 4
5 5 $ . $TESTDIR/testlib/obsmarker-common.sh
6 6
7 7 $ cat >> $HGRCPATH << EOF
8 8 > [phases]
9 9 > publish=false
10 10 > [experimental]
11 11 > evolution = all
12 12 > EOF
13 13
14 14
15 15 Tests that pushing orphaness to the server is detected
16 16 ======================================================
17 17
18 18 initial setup
19 19
20 20 $ mkdir base
21 21 $ cd base
22 22 $ hg init server
23 23 $ cd server
24 24 $ mkcommit root
25 25 $ hg phase --public .
26 26 $ mkcommit commit_A0_
27 27 $ mkcommit commit_B0_
28 28 $ cd ..
29 29 $ hg init client
30 30 $ cd client
31 31 $ echo '[paths]' >> .hg/hgrc
32 32 $ echo 'default=../server' >> .hg/hgrc
33 33 $ hg pull
34 34 pulling from $TESTTMP/base/server
35 35 requesting all changes
36 36 adding changesets
37 37 adding manifests
38 38 adding file changes
39 39 added 3 changesets with 3 changes to 3 files
40 40 new changesets 1e4be0697311:c09d8ab29fda (2 drafts)
41 41 (run 'hg update' to get a working copy)
42 42 $ hg up 'desc("root")'
43 43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 44 (having some unrelated change affects discovery result, we should ideally test both case)
45 45 $ hg branch unrelated --quiet
46 46 $ mkcommit unrelated
47 47 $ hg up null
48 48 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
49 49 $ hg log -G
50 50 o changeset: 3:16affbe0f986
51 51 | branch: unrelated
52 52 | tag: tip
53 53 | parent: 0:1e4be0697311
54 54 | user: test
55 55 | date: Thu Jan 01 00:00:00 1970 +0000
56 56 | summary: unrelated
57 57 |
58 58 | o changeset: 2:c09d8ab29fda
59 59 | | user: test
60 60 | | date: Thu Jan 01 00:00:00 1970 +0000
61 61 | | summary: commit_B0_
62 62 | |
63 63 | o changeset: 1:37624bf21024
64 64 |/ user: test
65 65 | date: Thu Jan 01 00:00:00 1970 +0000
66 66 | summary: commit_A0_
67 67 |
68 68 o changeset: 0:1e4be0697311
69 69 user: test
70 70 date: Thu Jan 01 00:00:00 1970 +0000
71 71 summary: root
72 72
73 73 $ cd ..
74 74 $ cd ..
75 75
76 76
77 77 Orphan from pruning
78 78 -------------------
79 79
80 80 Setup
81 81
82 82 $ cp -R base check-pruned
83 83 $ cd check-pruned/client
84 84 $ hg debugobsolete --record-parents `getid 'desc("commit_A0_")'`
85 85 1 new obsolescence markers
86 86 obsoleted 1 changesets
87 87 1 new orphan changesets
88 88 $ hg log -G
89 89 o changeset: 3:16affbe0f986
90 90 | branch: unrelated
91 91 | tag: tip
92 92 | parent: 0:1e4be0697311
93 93 | user: test
94 94 | date: Thu Jan 01 00:00:00 1970 +0000
95 95 | summary: unrelated
96 96 |
97 97 | * changeset: 2:c09d8ab29fda
98 98 | | user: test
99 99 | | date: Thu Jan 01 00:00:00 1970 +0000
100 100 | | instability: orphan
101 101 | | summary: commit_B0_
102 102 | |
103 103 | x changeset: 1:37624bf21024
104 104 |/ user: test
105 105 | date: Thu Jan 01 00:00:00 1970 +0000
106 106 | obsolete: pruned
107 107 | summary: commit_A0_
108 108 |
109 109 o changeset: 0:1e4be0697311
110 110 user: test
111 111 date: Thu Jan 01 00:00:00 1970 +0000
112 112 summary: root
113 113
114 114
115 115 Pushing the result is prevented with a message
116 116
117 117 $ hg push --new-branch
118 118 pushing to $TESTTMP/check-pruned/server
119 119 searching for changes
120 120 abort: push includes orphan changeset: c09d8ab29fda!
121 121 [255]
122 122
123 123 $ cd ../..
124 124
125 125
126 126 Orphan from superseding
127 127 -----------------------
128 128
129 129 Setup
130 130
131 131 $ cp -R base check-superseded
132 132 $ cd check-superseded/client
133 133 $ hg up 'desc("commit_A0_")'
134 134 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
135 135 $ hg branch other
136 136 marked working directory as branch other
137 137 $ hg commit --amend -m commit_A1_
138 138 1 new orphan changesets
139 139 $ hg log -G
140 140 @ changeset: 4:df9b82a99e21
141 141 | branch: other
142 142 | tag: tip
143 143 | parent: 0:1e4be0697311
144 144 | user: test
145 145 | date: Thu Jan 01 00:00:00 1970 +0000
146 146 | summary: commit_A1_
147 147 |
148 148 | o changeset: 3:16affbe0f986
149 149 |/ branch: unrelated
150 150 | parent: 0:1e4be0697311
151 151 | user: test
152 152 | date: Thu Jan 01 00:00:00 1970 +0000
153 153 | summary: unrelated
154 154 |
155 155 | * changeset: 2:c09d8ab29fda
156 156 | | user: test
157 157 | | date: Thu Jan 01 00:00:00 1970 +0000
158 158 | | instability: orphan
159 159 | | summary: commit_B0_
160 160 | |
161 161 | x changeset: 1:37624bf21024
162 162 |/ user: test
163 163 | date: Thu Jan 01 00:00:00 1970 +0000
164 164 | obsolete: rewritten using amend as 4:df9b82a99e21
165 165 | summary: commit_A0_
166 166 |
167 167 o changeset: 0:1e4be0697311
168 168 user: test
169 169 date: Thu Jan 01 00:00:00 1970 +0000
170 170 summary: root
171 171
172 172
173 173 Pushing the result is prevented with a message
174 174
175 175 $ hg push --new-branch
176 176 pushing to $TESTTMP/check-superseded/server
177 177 searching for changes
178 178 abort: push includes orphan changeset: c09d8ab29fda!
179 179 [255]
180 180
181 181 $ cd ../..
182 182
183 183 Tests that user get warned if it is about to publish obsolete/unstable content
184 184 ------------------------------------------------------------------------------
185 185
186 186 Orphan from pruning
187 187 -------------------
188 188
189 189 Make sure the only difference is phase:
190 190
191 191 $ cd check-pruned/client
192 192 $ hg push --force --rev 'not desc("unrelated")'
193 193 pushing to $TESTTMP/check-pruned/server
194 194 searching for changes
195 195 no changes found
196 196 1 new obsolescence markers
197 197 obsoleted 1 changesets
198 198 1 new orphan changesets
199 199 [1]
200 200
201 201 Check something prevents a silent publication of the obsolete changeset
202 202
203 203 $ hg push --publish --new-branch
204 204 pushing to $TESTTMP/check-pruned/server
205 205 searching for changes
206 206 abort: push includes orphan changeset: c09d8ab29fda!
207 207 [255]
208 208
209 209 $ cd ../..
210
211 Orphan from superseding
212 -----------------------
213
214 Make sure the only difference is phase:
215
216 $ cd check-superseded/client
217 $ hg push --force --rev 'not desc("unrelated")'
218 pushing to $TESTTMP/check-superseded/server
219 searching for changes
220 adding changesets
221 adding manifests
222 adding file changes
223 added 1 changesets with 0 changes to 0 files (+1 heads)
224 1 new obsolescence markers
225 obsoleted 1 changesets
226 1 new orphan changesets
227
228 Check something prevents a silent publication of the obsolete changeset
229
230 $ hg push --publish --new-branch
231 pushing to $TESTTMP/check-superseded/server
232 searching for changes
233 abort: push includes orphan changeset: c09d8ab29fda!
234 [255]
235
236 $ cd ../..
General Comments 0
You need to be logged in to leave comments. Login now