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