##// END OF EJS Templates
test: enable sparse-revlog for test-phases.t...
Boris Feld -
r40937:7bdc9753 default
parent child Browse files
Show More
@@ -1,953 +1,961 b''
1 TRANSITIONAL CONFIG
2 $ cat << EOF >> $HGRCPATH
3 > [format]
4 > sparse-revlog = yes
5 > EOF
6
1 $ cat > $TESTTMP/hook.sh << 'EOF'
7 $ cat > $TESTTMP/hook.sh << 'EOF'
2 > echo "test-hook-close-phase: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE"
8 > echo "test-hook-close-phase: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE"
3 > EOF
9 > EOF
4
10
5 $ cat >> $HGRCPATH << EOF
11 $ cat >> $HGRCPATH << EOF
6 > [extensions]
12 > [extensions]
7 > phasereport=$TESTDIR/testlib/ext-phase-report.py
13 > phasereport=$TESTDIR/testlib/ext-phase-report.py
8 > [hooks]
14 > [hooks]
9 > txnclose-phase.test = sh $TESTTMP/hook.sh
15 > txnclose-phase.test = sh $TESTTMP/hook.sh
10 > EOF
16 > EOF
11
17
12 $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
18 $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
13 $ mkcommit() {
19 $ mkcommit() {
14 > echo "$1" > "$1"
20 > echo "$1" > "$1"
15 > hg add "$1"
21 > hg add "$1"
16 > message="$1"
22 > message="$1"
17 > shift
23 > shift
18 > hg ci -m "$message" $*
24 > hg ci -m "$message" $*
19 > }
25 > }
20
26
21 $ hg init initialrepo
27 $ hg init initialrepo
22 $ cd initialrepo
28 $ cd initialrepo
23
29
24 Cannot change null revision phase
30 Cannot change null revision phase
25
31
26 $ hg phase --force --secret null
32 $ hg phase --force --secret null
27 abort: cannot change null revision phase
33 abort: cannot change null revision phase
28 [255]
34 [255]
29 $ hg phase null
35 $ hg phase null
30 -1: public
36 -1: public
31
37
32 $ mkcommit A
38 $ mkcommit A
33 test-debug-phase: new rev 0: x -> 1
39 test-debug-phase: new rev 0: x -> 1
34 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft
40 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft
35
41
36 New commit are draft by default
42 New commit are draft by default
37
43
38 $ hglog
44 $ hglog
39 0 1 A
45 0 1 A
40
46
41 Following commit are draft too
47 Following commit are draft too
42
48
43 $ mkcommit B
49 $ mkcommit B
44 test-debug-phase: new rev 1: x -> 1
50 test-debug-phase: new rev 1: x -> 1
45 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> draft
51 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> draft
46
52
47 $ hglog
53 $ hglog
48 1 1 B
54 1 1 B
49 0 1 A
55 0 1 A
50
56
51 Draft commit are properly created over public one:
57 Draft commit are properly created over public one:
52
58
53 $ hg phase --public .
59 $ hg phase --public .
54 test-debug-phase: move rev 0: 1 -> 0
60 test-debug-phase: move rev 0: 1 -> 0
55 test-debug-phase: move rev 1: 1 -> 0
61 test-debug-phase: move rev 1: 1 -> 0
56 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> public
62 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> public
57 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public
63 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public
58 $ hg phase
64 $ hg phase
59 1: public
65 1: public
60 $ hglog
66 $ hglog
61 1 0 B
67 1 0 B
62 0 0 A
68 0 0 A
63
69
64 $ mkcommit C
70 $ mkcommit C
65 test-debug-phase: new rev 2: x -> 1
71 test-debug-phase: new rev 2: x -> 1
66 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft
72 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft
67 $ mkcommit D
73 $ mkcommit D
68 test-debug-phase: new rev 3: x -> 1
74 test-debug-phase: new rev 3: x -> 1
69 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft
75 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft
70
76
71 $ hglog
77 $ hglog
72 3 1 D
78 3 1 D
73 2 1 C
79 2 1 C
74 1 0 B
80 1 0 B
75 0 0 A
81 0 0 A
76
82
77 Test creating changeset as secret
83 Test creating changeset as secret
78
84
79 $ mkcommit E --config phases.new-commit='secret'
85 $ mkcommit E --config phases.new-commit='secret'
80 test-debug-phase: new rev 4: x -> 2
86 test-debug-phase: new rev 4: x -> 2
81 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> secret
87 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> secret
82 $ hglog
88 $ hglog
83 4 2 E
89 4 2 E
84 3 1 D
90 3 1 D
85 2 1 C
91 2 1 C
86 1 0 B
92 1 0 B
87 0 0 A
93 0 0 A
88
94
89 Test the secret property is inherited
95 Test the secret property is inherited
90
96
91 $ mkcommit H
97 $ mkcommit H
92 test-debug-phase: new rev 5: x -> 2
98 test-debug-phase: new rev 5: x -> 2
93 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret
99 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret
94 $ hglog
100 $ hglog
95 5 2 H
101 5 2 H
96 4 2 E
102 4 2 E
97 3 1 D
103 3 1 D
98 2 1 C
104 2 1 C
99 1 0 B
105 1 0 B
100 0 0 A
106 0 0 A
101
107
102 Even on merge
108 Even on merge
103
109
104 $ hg up -q 1
110 $ hg up -q 1
105 $ mkcommit "B'"
111 $ mkcommit "B'"
106 test-debug-phase: new rev 6: x -> 1
112 test-debug-phase: new rev 6: x -> 1
107 created new head
113 created new head
108 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft
114 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft
109 $ hglog
115 $ hglog
110 6 1 B'
116 6 1 B'
111 5 2 H
117 5 2 H
112 4 2 E
118 4 2 E
113 3 1 D
119 3 1 D
114 2 1 C
120 2 1 C
115 1 0 B
121 1 0 B
116 0 0 A
122 0 0 A
117 $ hg merge 4 # E
123 $ hg merge 4 # E
118 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
124 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 (branch merge, don't forget to commit)
125 (branch merge, don't forget to commit)
120 $ hg phase
126 $ hg phase
121 6: draft
127 6: draft
122 4: secret
128 4: secret
123 $ hg ci -m "merge B' and E"
129 $ hg ci -m "merge B' and E"
124 test-debug-phase: new rev 7: x -> 2
130 test-debug-phase: new rev 7: x -> 2
125 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> secret
131 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> secret
126
132
127 $ hglog
133 $ hglog
128 7 2 merge B' and E
134 7 2 merge B' and E
129 6 1 B'
135 6 1 B'
130 5 2 H
136 5 2 H
131 4 2 E
137 4 2 E
132 3 1 D
138 3 1 D
133 2 1 C
139 2 1 C
134 1 0 B
140 1 0 B
135 0 0 A
141 0 0 A
136
142
137 Test secret changeset are not pushed
143 Test secret changeset are not pushed
138
144
139 $ hg init ../push-dest
145 $ hg init ../push-dest
140 $ cat > ../push-dest/.hg/hgrc << EOF
146 $ cat > ../push-dest/.hg/hgrc << EOF
141 > [phases]
147 > [phases]
142 > publish=False
148 > publish=False
143 > EOF
149 > EOF
144 $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n'
150 $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n'
145 comparing with ../push-dest
151 comparing with ../push-dest
146 searching for changes
152 searching for changes
147 0 public A
153 0 public A
148 1 public B
154 1 public B
149 2 draft C
155 2 draft C
150 3 draft D
156 3 draft D
151 6 draft B'
157 6 draft B'
152 $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n'
158 $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n'
153 comparing with ../push-dest
159 comparing with ../push-dest
154 searching for changes
160 searching for changes
155 0 public A
161 0 public A
156 1 public B
162 1 public B
157 2 draft C
163 2 draft C
158 3 draft D
164 3 draft D
159 6 draft B'
165 6 draft B'
160
166
161 $ hg push ../push-dest -f # force because we push multiple heads
167 $ hg push ../push-dest -f # force because we push multiple heads
162 pushing to ../push-dest
168 pushing to ../push-dest
163 searching for changes
169 searching for changes
164 adding changesets
170 adding changesets
165 adding manifests
171 adding manifests
166 adding file changes
172 adding file changes
167 added 5 changesets with 5 changes to 5 files (+1 heads)
173 added 5 changesets with 5 changes to 5 files (+1 heads)
168 test-debug-phase: new rev 0: x -> 0
174 test-debug-phase: new rev 0: x -> 0
169 test-debug-phase: new rev 1: x -> 0
175 test-debug-phase: new rev 1: x -> 0
170 test-debug-phase: new rev 2: x -> 1
176 test-debug-phase: new rev 2: x -> 1
171 test-debug-phase: new rev 3: x -> 1
177 test-debug-phase: new rev 3: x -> 1
172 test-debug-phase: new rev 4: x -> 1
178 test-debug-phase: new rev 4: x -> 1
173 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
179 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
174 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
180 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
175 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft
181 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft
176 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft
182 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft
177 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft
183 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft
178 $ hglog
184 $ hglog
179 7 2 merge B' and E
185 7 2 merge B' and E
180 6 1 B'
186 6 1 B'
181 5 2 H
187 5 2 H
182 4 2 E
188 4 2 E
183 3 1 D
189 3 1 D
184 2 1 C
190 2 1 C
185 1 0 B
191 1 0 B
186 0 0 A
192 0 0 A
187 $ cd ../push-dest
193 $ cd ../push-dest
188 $ hglog
194 $ hglog
189 4 1 B'
195 4 1 B'
190 3 1 D
196 3 1 D
191 2 1 C
197 2 1 C
192 1 0 B
198 1 0 B
193 0 0 A
199 0 0 A
194
200
195 (Issue3303)
201 (Issue3303)
196 Check that remote secret changeset are ignore when checking creation of remote heads
202 Check that remote secret changeset are ignore when checking creation of remote heads
197
203
198 We add a secret head into the push destination. This secret head shadows a
204 We add a secret head into the push destination. This secret head shadows a
199 visible shared between the initial repo and the push destination.
205 visible shared between the initial repo and the push destination.
200
206
201 $ hg up -q 4 # B'
207 $ hg up -q 4 # B'
202 $ mkcommit Z --config phases.new-commit=secret
208 $ mkcommit Z --config phases.new-commit=secret
203 test-debug-phase: new rev 5: x -> 2
209 test-debug-phase: new rev 5: x -> 2
204 test-hook-close-phase: 2713879da13d6eea1ff22b442a5a87cb31a7ce6a: -> secret
210 test-hook-close-phase: 2713879da13d6eea1ff22b442a5a87cb31a7ce6a: -> secret
205 $ hg phase .
211 $ hg phase .
206 5: secret
212 5: secret
207
213
208 We now try to push a new public changeset that descend from the common public
214 We now try to push a new public changeset that descend from the common public
209 head shadowed by the remote secret head.
215 head shadowed by the remote secret head.
210
216
211 $ cd ../initialrepo
217 $ cd ../initialrepo
212 $ hg up -q 6 #B'
218 $ hg up -q 6 #B'
213 $ mkcommit I
219 $ mkcommit I
214 test-debug-phase: new rev 8: x -> 1
220 test-debug-phase: new rev 8: x -> 1
215 created new head
221 created new head
216 test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft
222 test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft
217 $ hg push ../push-dest
223 $ hg push ../push-dest
218 pushing to ../push-dest
224 pushing to ../push-dest
219 searching for changes
225 searching for changes
220 adding changesets
226 adding changesets
221 adding manifests
227 adding manifests
222 adding file changes
228 adding file changes
223 added 1 changesets with 1 changes to 1 files (+1 heads)
229 added 1 changesets with 1 changes to 1 files (+1 heads)
224 test-debug-phase: new rev 6: x -> 1
230 test-debug-phase: new rev 6: x -> 1
225 test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft
231 test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft
226
232
227 :note: The "(+1 heads)" is wrong as we do not had any visible head
233 :note: The "(+1 heads)" is wrong as we do not had any visible head
228
234
229 check that branch cache with "served" filter are properly computed and stored
235 check that branch cache with "served" filter are properly computed and stored
230
236
231 $ ls ../push-dest/.hg/cache/branch2*
237 $ ls ../push-dest/.hg/cache/branch2*
232 ../push-dest/.hg/cache/branch2-base
238 ../push-dest/.hg/cache/branch2-base
233 ../push-dest/.hg/cache/branch2-served
239 ../push-dest/.hg/cache/branch2-served
234 $ cat ../push-dest/.hg/cache/branch2-served
240 $ cat ../push-dest/.hg/cache/branch2-served
235 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
241 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
236 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
242 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
237 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
243 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
238 $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too
244 $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too
239 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft
245 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft
240 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret
246 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret
241 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft
247 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft
242 $ ls ../push-dest/.hg/cache/branch2*
248 $ ls ../push-dest/.hg/cache/branch2*
243 ../push-dest/.hg/cache/branch2-base
249 ../push-dest/.hg/cache/branch2-base
244 ../push-dest/.hg/cache/branch2-served
250 ../push-dest/.hg/cache/branch2-served
245 ../push-dest/.hg/cache/branch2-visible
251 ../push-dest/.hg/cache/branch2-visible
246 $ cat ../push-dest/.hg/cache/branch2-served
252 $ cat ../push-dest/.hg/cache/branch2-served
247 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
253 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
248 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
254 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
249 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
255 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
250 $ cat ../push-dest/.hg/cache/branch2-visible
256 $ cat ../push-dest/.hg/cache/branch2-visible
251 6d6770faffce199f1fddd1cf87f6f026138cf061 6
257 6d6770faffce199f1fddd1cf87f6f026138cf061 6
252 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
258 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
253 2713879da13d6eea1ff22b442a5a87cb31a7ce6a o default
259 2713879da13d6eea1ff22b442a5a87cb31a7ce6a o default
254 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
260 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
255
261
256
262
257 Restore condition prior extra insertion.
263 Restore condition prior extra insertion.
258 $ hg -q --config extensions.mq= strip .
264 $ hg -q --config extensions.mq= strip .
259 $ hg up -q 7
265 $ hg up -q 7
260 $ cd ..
266 $ cd ..
261
267
262 Test secret changeset are not pull
268 Test secret changeset are not pull
263
269
264 $ hg init pull-dest
270 $ hg init pull-dest
265 $ cd pull-dest
271 $ cd pull-dest
266 $ hg pull ../initialrepo
272 $ hg pull ../initialrepo
267 pulling from ../initialrepo
273 pulling from ../initialrepo
268 requesting all changes
274 requesting all changes
269 adding changesets
275 adding changesets
270 adding manifests
276 adding manifests
271 adding file changes
277 adding file changes
272 added 5 changesets with 5 changes to 5 files (+1 heads)
278 added 5 changesets with 5 changes to 5 files (+1 heads)
273 new changesets 4a2df7238c3b:cf9fe039dfd6
279 new changesets 4a2df7238c3b:cf9fe039dfd6
274 test-debug-phase: new rev 0: x -> 0
280 test-debug-phase: new rev 0: x -> 0
275 test-debug-phase: new rev 1: x -> 0
281 test-debug-phase: new rev 1: x -> 0
276 test-debug-phase: new rev 2: x -> 0
282 test-debug-phase: new rev 2: x -> 0
277 test-debug-phase: new rev 3: x -> 0
283 test-debug-phase: new rev 3: x -> 0
278 test-debug-phase: new rev 4: x -> 0
284 test-debug-phase: new rev 4: x -> 0
279 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
285 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
280 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
286 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
281 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
287 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
282 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
288 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
283 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
289 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
284 (run 'hg heads' to see heads, 'hg merge' to merge)
290 (run 'hg heads' to see heads, 'hg merge' to merge)
285 $ hglog
291 $ hglog
286 4 0 B'
292 4 0 B'
287 3 0 D
293 3 0 D
288 2 0 C
294 2 0 C
289 1 0 B
295 1 0 B
290 0 0 A
296 0 0 A
291 $ cd ..
297 $ cd ..
292
298
293 But secret can still be bundled explicitly
299 But secret can still be bundled explicitly
294
300
295 $ cd initialrepo
301 $ cd initialrepo
296 $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg
302 $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg
297 4 changesets found
303 4 changesets found
298 $ cd ..
304 $ cd ..
299
305
300 Test secret changeset are not cloned
306 Test secret changeset are not cloned
301 (during local clone)
307 (during local clone)
302
308
303 $ hg clone -qU initialrepo clone-dest
309 $ hg clone -qU initialrepo clone-dest
304 test-debug-phase: new rev 0: x -> 0
310 test-debug-phase: new rev 0: x -> 0
305 test-debug-phase: new rev 1: x -> 0
311 test-debug-phase: new rev 1: x -> 0
306 test-debug-phase: new rev 2: x -> 0
312 test-debug-phase: new rev 2: x -> 0
307 test-debug-phase: new rev 3: x -> 0
313 test-debug-phase: new rev 3: x -> 0
308 test-debug-phase: new rev 4: x -> 0
314 test-debug-phase: new rev 4: x -> 0
309 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
315 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
310 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
316 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
311 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
317 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
312 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
318 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
313 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
319 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
314 $ hglog -R clone-dest
320 $ hglog -R clone-dest
315 4 0 B'
321 4 0 B'
316 3 0 D
322 3 0 D
317 2 0 C
323 2 0 C
318 1 0 B
324 1 0 B
319 0 0 A
325 0 0 A
320
326
321 Test summary
327 Test summary
322
328
323 $ hg summary -R clone-dest --verbose
329 $ hg summary -R clone-dest --verbose
324 parent: -1:000000000000 (no revision checked out)
330 parent: -1:000000000000 (no revision checked out)
325 branch: default
331 branch: default
326 commit: (clean)
332 commit: (clean)
327 update: 5 new changesets (update)
333 update: 5 new changesets (update)
328 $ hg summary -R initialrepo
334 $ hg summary -R initialrepo
329 parent: 7:17a481b3bccb tip
335 parent: 7:17a481b3bccb tip
330 merge B' and E
336 merge B' and E
331 branch: default
337 branch: default
332 commit: (clean) (secret)
338 commit: (clean) (secret)
333 update: 1 new changesets, 2 branch heads (merge)
339 update: 1 new changesets, 2 branch heads (merge)
334 phases: 3 draft, 3 secret
340 phases: 3 draft, 3 secret
335 $ hg summary -R initialrepo --quiet
341 $ hg summary -R initialrepo --quiet
336 parent: 7:17a481b3bccb tip
342 parent: 7:17a481b3bccb tip
337 update: 1 new changesets, 2 branch heads (merge)
343 update: 1 new changesets, 2 branch heads (merge)
338
344
339 Test revset
345 Test revset
340
346
341 $ cd initialrepo
347 $ cd initialrepo
342 $ hglog -r 'public()'
348 $ hglog -r 'public()'
343 0 0 A
349 0 0 A
344 1 0 B
350 1 0 B
345 $ hglog -r 'draft()'
351 $ hglog -r 'draft()'
346 2 1 C
352 2 1 C
347 3 1 D
353 3 1 D
348 6 1 B'
354 6 1 B'
349 $ hglog -r 'secret()'
355 $ hglog -r 'secret()'
350 4 2 E
356 4 2 E
351 5 2 H
357 5 2 H
352 7 2 merge B' and E
358 7 2 merge B' and E
353
359
354 test that phase are displayed in log at debug level
360 test that phase are displayed in log at debug level
355
361
356 $ hg log --debug
362 $ hg log --debug
357 changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af
363 changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af
358 tag: tip
364 tag: tip
359 phase: secret
365 phase: secret
360 parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
366 parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
361 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
367 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
362 manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8
368 manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8
363 user: test
369 user: test
364 date: Thu Jan 01 00:00:00 1970 +0000
370 date: Thu Jan 01 00:00:00 1970 +0000
365 files+: C D E
371 files+: C D E
366 extra: branch=default
372 extra: branch=default
367 description:
373 description:
368 merge B' and E
374 merge B' and E
369
375
370
376
371 changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
377 changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
372 phase: draft
378 phase: draft
373 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
379 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
374 parent: -1:0000000000000000000000000000000000000000
380 parent: -1:0000000000000000000000000000000000000000
375 manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a
381 manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a
376 user: test
382 user: test
377 date: Thu Jan 01 00:00:00 1970 +0000
383 date: Thu Jan 01 00:00:00 1970 +0000
378 files+: B'
384 files+: B'
379 extra: branch=default
385 extra: branch=default
380 description:
386 description:
381 B'
387 B'
382
388
383
389
384 changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8
390 changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8
385 phase: secret
391 phase: secret
386 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
392 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
387 parent: -1:0000000000000000000000000000000000000000
393 parent: -1:0000000000000000000000000000000000000000
388 manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a
394 manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a
389 user: test
395 user: test
390 date: Thu Jan 01 00:00:00 1970 +0000
396 date: Thu Jan 01 00:00:00 1970 +0000
391 files+: H
397 files+: H
392 extra: branch=default
398 extra: branch=default
393 description:
399 description:
394 H
400 H
395
401
396
402
397 changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
403 changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
398 phase: secret
404 phase: secret
399 parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
405 parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
400 parent: -1:0000000000000000000000000000000000000000
406 parent: -1:0000000000000000000000000000000000000000
401 manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc
407 manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc
402 user: test
408 user: test
403 date: Thu Jan 01 00:00:00 1970 +0000
409 date: Thu Jan 01 00:00:00 1970 +0000
404 files+: E
410 files+: E
405 extra: branch=default
411 extra: branch=default
406 description:
412 description:
407 E
413 E
408
414
409
415
410 changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
416 changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
411 phase: draft
417 phase: draft
412 parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
418 parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
413 parent: -1:0000000000000000000000000000000000000000
419 parent: -1:0000000000000000000000000000000000000000
414 manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c
420 manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c
415 user: test
421 user: test
416 date: Thu Jan 01 00:00:00 1970 +0000
422 date: Thu Jan 01 00:00:00 1970 +0000
417 files+: D
423 files+: D
418 extra: branch=default
424 extra: branch=default
419 description:
425 description:
420 D
426 D
421
427
422
428
423 changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
429 changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
424 phase: draft
430 phase: draft
425 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
431 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
426 parent: -1:0000000000000000000000000000000000000000
432 parent: -1:0000000000000000000000000000000000000000
427 manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4
433 manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4
428 user: test
434 user: test
429 date: Thu Jan 01 00:00:00 1970 +0000
435 date: Thu Jan 01 00:00:00 1970 +0000
430 files+: C
436 files+: C
431 extra: branch=default
437 extra: branch=default
432 description:
438 description:
433 C
439 C
434
440
435
441
436 changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
442 changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
437 phase: public
443 phase: public
438 parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
444 parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
439 parent: -1:0000000000000000000000000000000000000000
445 parent: -1:0000000000000000000000000000000000000000
440 manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd
446 manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd
441 user: test
447 user: test
442 date: Thu Jan 01 00:00:00 1970 +0000
448 date: Thu Jan 01 00:00:00 1970 +0000
443 files+: B
449 files+: B
444 extra: branch=default
450 extra: branch=default
445 description:
451 description:
446 B
452 B
447
453
448
454
449 changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
455 changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
450 phase: public
456 phase: public
451 parent: -1:0000000000000000000000000000000000000000
457 parent: -1:0000000000000000000000000000000000000000
452 parent: -1:0000000000000000000000000000000000000000
458 parent: -1:0000000000000000000000000000000000000000
453 manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83
459 manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83
454 user: test
460 user: test
455 date: Thu Jan 01 00:00:00 1970 +0000
461 date: Thu Jan 01 00:00:00 1970 +0000
456 files+: A
462 files+: A
457 extra: branch=default
463 extra: branch=default
458 description:
464 description:
459 A
465 A
460
466
461
467
462
468
463
469
464 (Issue3707)
470 (Issue3707)
465 test invalid phase name
471 test invalid phase name
466
472
467 $ mkcommit I --config phases.new-commit='babar'
473 $ mkcommit I --config phases.new-commit='babar'
468 transaction abort!
474 transaction abort!
469 rollback completed
475 rollback completed
470 abort: phases.new-commit: not a valid phase name ('babar')
476 abort: phases.new-commit: not a valid phase name ('babar')
471 [255]
477 [255]
472 Test phase command
478 Test phase command
473 ===================
479 ===================
474
480
475 initial picture
481 initial picture
476
482
477 $ hg log -G --template "{rev} {phase} {desc}\n"
483 $ hg log -G --template "{rev} {phase} {desc}\n"
478 @ 7 secret merge B' and E
484 @ 7 secret merge B' and E
479 |\
485 |\
480 | o 6 draft B'
486 | o 6 draft B'
481 | |
487 | |
482 +---o 5 secret H
488 +---o 5 secret H
483 | |
489 | |
484 o | 4 secret E
490 o | 4 secret E
485 | |
491 | |
486 o | 3 draft D
492 o | 3 draft D
487 | |
493 | |
488 o | 2 draft C
494 o | 2 draft C
489 |/
495 |/
490 o 1 public B
496 o 1 public B
491 |
497 |
492 o 0 public A
498 o 0 public A
493
499
494
500
495 display changesets phase
501 display changesets phase
496
502
497 (mixing -r and plain rev specification)
503 (mixing -r and plain rev specification)
498
504
499 $ hg phase 1::4 -r 7
505 $ hg phase 1::4 -r 7
500 1: public
506 1: public
501 2: draft
507 2: draft
502 3: draft
508 3: draft
503 4: secret
509 4: secret
504 7: secret
510 7: secret
505
511
506
512
507 move changeset forward
513 move changeset forward
508
514
509 (with -r option)
515 (with -r option)
510
516
511 $ hg phase --public -r 2
517 $ hg phase --public -r 2
512 test-debug-phase: move rev 2: 1 -> 0
518 test-debug-phase: move rev 2: 1 -> 0
513 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public
519 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public
514 $ hg log -G --template "{rev} {phase} {desc}\n"
520 $ hg log -G --template "{rev} {phase} {desc}\n"
515 @ 7 secret merge B' and E
521 @ 7 secret merge B' and E
516 |\
522 |\
517 | o 6 draft B'
523 | o 6 draft B'
518 | |
524 | |
519 +---o 5 secret H
525 +---o 5 secret H
520 | |
526 | |
521 o | 4 secret E
527 o | 4 secret E
522 | |
528 | |
523 o | 3 draft D
529 o | 3 draft D
524 | |
530 | |
525 o | 2 public C
531 o | 2 public C
526 |/
532 |/
527 o 1 public B
533 o 1 public B
528 |
534 |
529 o 0 public A
535 o 0 public A
530
536
531
537
532 move changeset backward
538 move changeset backward
533
539
534 (without -r option)
540 (without -r option)
535
541
536 $ hg phase --draft --force 2
542 $ hg phase --draft --force 2
537 test-debug-phase: move rev 2: 0 -> 1
543 test-debug-phase: move rev 2: 0 -> 1
538 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: public -> draft
544 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: public -> draft
539 $ hg log -G --template "{rev} {phase} {desc}\n"
545 $ hg log -G --template "{rev} {phase} {desc}\n"
540 @ 7 secret merge B' and E
546 @ 7 secret merge B' and E
541 |\
547 |\
542 | o 6 draft B'
548 | o 6 draft B'
543 | |
549 | |
544 +---o 5 secret H
550 +---o 5 secret H
545 | |
551 | |
546 o | 4 secret E
552 o | 4 secret E
547 | |
553 | |
548 o | 3 draft D
554 o | 3 draft D
549 | |
555 | |
550 o | 2 draft C
556 o | 2 draft C
551 |/
557 |/
552 o 1 public B
558 o 1 public B
553 |
559 |
554 o 0 public A
560 o 0 public A
555
561
556
562
557 move changeset forward and backward
563 move changeset forward and backward
558
564
559 $ hg phase --draft --force 1::4
565 $ hg phase --draft --force 1::4
560 test-debug-phase: move rev 1: 0 -> 1
566 test-debug-phase: move rev 1: 0 -> 1
561 test-debug-phase: move rev 4: 2 -> 1
567 test-debug-phase: move rev 4: 2 -> 1
562 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: public -> draft
568 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: public -> draft
563 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft
569 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft
564 $ hg log -G --template "{rev} {phase} {desc}\n"
570 $ hg log -G --template "{rev} {phase} {desc}\n"
565 @ 7 secret merge B' and E
571 @ 7 secret merge B' and E
566 |\
572 |\
567 | o 6 draft B'
573 | o 6 draft B'
568 | |
574 | |
569 +---o 5 secret H
575 +---o 5 secret H
570 | |
576 | |
571 o | 4 draft E
577 o | 4 draft E
572 | |
578 | |
573 o | 3 draft D
579 o | 3 draft D
574 | |
580 | |
575 o | 2 draft C
581 o | 2 draft C
576 |/
582 |/
577 o 1 draft B
583 o 1 draft B
578 |
584 |
579 o 0 public A
585 o 0 public A
580
586
581 test partial failure
587 test partial failure
582
588
583 $ hg phase --public 7
589 $ hg phase --public 7
584 test-debug-phase: move rev 1: 1 -> 0
590 test-debug-phase: move rev 1: 1 -> 0
585 test-debug-phase: move rev 2: 1 -> 0
591 test-debug-phase: move rev 2: 1 -> 0
586 test-debug-phase: move rev 3: 1 -> 0
592 test-debug-phase: move rev 3: 1 -> 0
587 test-debug-phase: move rev 4: 1 -> 0
593 test-debug-phase: move rev 4: 1 -> 0
588 test-debug-phase: move rev 6: 1 -> 0
594 test-debug-phase: move rev 6: 1 -> 0
589 test-debug-phase: move rev 7: 2 -> 0
595 test-debug-phase: move rev 7: 2 -> 0
590 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public
596 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public
591 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public
597 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public
592 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: draft -> public
598 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: draft -> public
593 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: draft -> public
599 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: draft -> public
594 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: draft -> public
600 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: draft -> public
595 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> public
601 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> public
596 $ hg phase --draft '5 or 7'
602 $ hg phase --draft '5 or 7'
597 test-debug-phase: move rev 5: 2 -> 1
603 test-debug-phase: move rev 5: 2 -> 1
598 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: secret -> draft
604 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: secret -> draft
599 cannot move 1 changesets to a higher phase, use --force
605 cannot move 1 changesets to a higher phase, use --force
600 phase changed for 1 changesets
606 phase changed for 1 changesets
601 [1]
607 [1]
602 $ hg log -G --template "{rev} {phase} {desc}\n"
608 $ hg log -G --template "{rev} {phase} {desc}\n"
603 @ 7 public merge B' and E
609 @ 7 public merge B' and E
604 |\
610 |\
605 | o 6 public B'
611 | o 6 public B'
606 | |
612 | |
607 +---o 5 draft H
613 +---o 5 draft H
608 | |
614 | |
609 o | 4 public E
615 o | 4 public E
610 | |
616 | |
611 o | 3 public D
617 o | 3 public D
612 | |
618 | |
613 o | 2 public C
619 o | 2 public C
614 |/
620 |/
615 o 1 public B
621 o 1 public B
616 |
622 |
617 o 0 public A
623 o 0 public A
618
624
619
625
620 test complete failure
626 test complete failure
621
627
622 $ hg phase --draft 7
628 $ hg phase --draft 7
623 cannot move 1 changesets to a higher phase, use --force
629 cannot move 1 changesets to a higher phase, use --force
624 no phases changed
630 no phases changed
625 [1]
631 [1]
626
632
627 $ cd ..
633 $ cd ..
628
634
629 test hidden changeset are not cloned as public (issue3935)
635 test hidden changeset are not cloned as public (issue3935)
630
636
631 $ cd initialrepo
637 $ cd initialrepo
632
638
633 (enabling evolution)
639 (enabling evolution)
634 $ cat >> $HGRCPATH << EOF
640 $ cat >> $HGRCPATH << EOF
635 > [experimental]
641 > [experimental]
636 > evolution.createmarkers=True
642 > evolution.createmarkers=True
637 > EOF
643 > EOF
638
644
639 (making a changeset hidden; H in that case)
645 (making a changeset hidden; H in that case)
640 $ hg debugobsolete `hg id --debug -r 5`
646 $ hg debugobsolete `hg id --debug -r 5`
641 obsoleted 1 changesets
647 obsoleted 1 changesets
642
648
643 $ cd ..
649 $ cd ..
644 $ hg clone initialrepo clonewithobs
650 $ hg clone initialrepo clonewithobs
645 requesting all changes
651 requesting all changes
646 adding changesets
652 adding changesets
647 adding manifests
653 adding manifests
648 adding file changes
654 adding file changes
649 added 7 changesets with 6 changes to 6 files
655 added 7 changesets with 6 changes to 6 files
650 new changesets 4a2df7238c3b:17a481b3bccb
656 new changesets 4a2df7238c3b:17a481b3bccb
651 test-debug-phase: new rev 0: x -> 0
657 test-debug-phase: new rev 0: x -> 0
652 test-debug-phase: new rev 1: x -> 0
658 test-debug-phase: new rev 1: x -> 0
653 test-debug-phase: new rev 2: x -> 0
659 test-debug-phase: new rev 2: x -> 0
654 test-debug-phase: new rev 3: x -> 0
660 test-debug-phase: new rev 3: x -> 0
655 test-debug-phase: new rev 4: x -> 0
661 test-debug-phase: new rev 4: x -> 0
656 test-debug-phase: new rev 5: x -> 0
662 test-debug-phase: new rev 5: x -> 0
657 test-debug-phase: new rev 6: x -> 0
663 test-debug-phase: new rev 6: x -> 0
658 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
664 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
659 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
665 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
660 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
666 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
661 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
667 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
662 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> public
668 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> public
663 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
669 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
664 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> public
670 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> public
665 updating to branch default
671 updating to branch default
666 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
672 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
667 $ cd clonewithobs
673 $ cd clonewithobs
668 $ hg log -G --template "{rev} {phase} {desc}\n"
674 $ hg log -G --template "{rev} {phase} {desc}\n"
669 @ 6 public merge B' and E
675 @ 6 public merge B' and E
670 |\
676 |\
671 | o 5 public B'
677 | o 5 public B'
672 | |
678 | |
673 o | 4 public E
679 o | 4 public E
674 | |
680 | |
675 o | 3 public D
681 o | 3 public D
676 | |
682 | |
677 o | 2 public C
683 o | 2 public C
678 |/
684 |/
679 o 1 public B
685 o 1 public B
680 |
686 |
681 o 0 public A
687 o 0 public A
682
688
683
689
684 test verify repo containing hidden changesets, which should not abort just
690 test verify repo containing hidden changesets, which should not abort just
685 because repo.cancopy() is False
691 because repo.cancopy() is False
686
692
687 $ cd ../initialrepo
693 $ cd ../initialrepo
688 $ hg verify
694 $ hg verify
689 checking changesets
695 checking changesets
690 checking manifests
696 checking manifests
691 crosschecking files in changesets and manifests
697 crosschecking files in changesets and manifests
692 checking files
698 checking files
693 checked 8 changesets with 7 changes to 7 files
699 checked 8 changesets with 7 changes to 7 files
694
700
695 $ cd ..
701 $ cd ..
696
702
697 check whether HG_PENDING makes pending changes only in related
703 check whether HG_PENDING makes pending changes only in related
698 repositories visible to an external hook.
704 repositories visible to an external hook.
699
705
700 (emulate a transaction running concurrently by copied
706 (emulate a transaction running concurrently by copied
701 .hg/phaseroots.pending in subsequent test)
707 .hg/phaseroots.pending in subsequent test)
702
708
703 $ cat > $TESTTMP/savepending.sh <<EOF
709 $ cat > $TESTTMP/savepending.sh <<EOF
704 > cp .hg/store/phaseroots.pending .hg/store/phaseroots.pending.saved
710 > cp .hg/store/phaseroots.pending .hg/store/phaseroots.pending.saved
705 > exit 1 # to avoid changing phase for subsequent tests
711 > exit 1 # to avoid changing phase for subsequent tests
706 > EOF
712 > EOF
707 $ cd push-dest
713 $ cd push-dest
708 $ hg phase 6
714 $ hg phase 6
709 6: draft
715 6: draft
710 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6
716 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6
711 transaction abort!
717 transaction abort!
712 rollback completed
718 rollback completed
713 abort: pretxnclose hook exited with status 1
719 abort: pretxnclose hook exited with status 1
714 [255]
720 [255]
715 $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending
721 $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending
716
722
717 (check (in)visibility of phaseroot while transaction running in repo)
723 (check (in)visibility of phaseroot while transaction running in repo)
718
724
719 $ cat > $TESTTMP/checkpending.sh <<EOF
725 $ cat > $TESTTMP/checkpending.sh <<EOF
720 > echo '@initialrepo'
726 > echo '@initialrepo'
721 > hg -R "$TESTTMP/initialrepo" phase 7
727 > hg -R "$TESTTMP/initialrepo" phase 7
722 > echo '@push-dest'
728 > echo '@push-dest'
723 > hg -R "$TESTTMP/push-dest" phase 6
729 > hg -R "$TESTTMP/push-dest" phase 6
724 > exit 1 # to avoid changing phase for subsequent tests
730 > exit 1 # to avoid changing phase for subsequent tests
725 > EOF
731 > EOF
726 $ cd ../initialrepo
732 $ cd ../initialrepo
727 $ hg phase 7
733 $ hg phase 7
728 7: public
734 7: public
729 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" phase -f -s 7
735 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" phase -f -s 7
730 @initialrepo
736 @initialrepo
731 7: secret
737 7: secret
732 @push-dest
738 @push-dest
733 6: draft
739 6: draft
734 transaction abort!
740 transaction abort!
735 rollback completed
741 rollback completed
736 abort: pretxnclose hook exited with status 1
742 abort: pretxnclose hook exited with status 1
737 [255]
743 [255]
738
744
739 Check that pretxnclose-phase hook can control phase movement
745 Check that pretxnclose-phase hook can control phase movement
740
746
741 $ hg phase --force b3325c91a4d9 --secret
747 $ hg phase --force b3325c91a4d9 --secret
742 test-debug-phase: move rev 3: 0 -> 2
748 test-debug-phase: move rev 3: 0 -> 2
743 test-debug-phase: move rev 4: 0 -> 2
749 test-debug-phase: move rev 4: 0 -> 2
744 test-debug-phase: move rev 5: 1 -> 2
750 test-debug-phase: move rev 5: 1 -> 2
745 test-debug-phase: move rev 7: 0 -> 2
751 test-debug-phase: move rev 7: 0 -> 2
746 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: public -> secret
752 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: public -> secret
747 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: public -> secret
753 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: public -> secret
748 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: draft -> secret
754 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: draft -> secret
749 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: public -> secret
755 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: public -> secret
750 $ hg log -G -T phases
756 $ hg log -G -T phases
751 @ changeset: 7:17a481b3bccb
757 @ changeset: 7:17a481b3bccb
752 |\ tag: tip
758 |\ tag: tip
753 | | phase: secret
759 | | phase: secret
754 | | parent: 6:cf9fe039dfd6
760 | | parent: 6:cf9fe039dfd6
755 | | parent: 4:a603bfb5a83e
761 | | parent: 4:a603bfb5a83e
756 | | user: test
762 | | user: test
757 | | date: Thu Jan 01 00:00:00 1970 +0000
763 | | date: Thu Jan 01 00:00:00 1970 +0000
758 | | summary: merge B' and E
764 | | summary: merge B' and E
759 | |
765 | |
760 | o changeset: 6:cf9fe039dfd6
766 | o changeset: 6:cf9fe039dfd6
761 | | phase: public
767 | | phase: public
762 | | parent: 1:27547f69f254
768 | | parent: 1:27547f69f254
763 | | user: test
769 | | user: test
764 | | date: Thu Jan 01 00:00:00 1970 +0000
770 | | date: Thu Jan 01 00:00:00 1970 +0000
765 | | summary: B'
771 | | summary: B'
766 | |
772 | |
767 o | changeset: 4:a603bfb5a83e
773 o | changeset: 4:a603bfb5a83e
768 | | phase: secret
774 | | phase: secret
769 | | user: test
775 | | user: test
770 | | date: Thu Jan 01 00:00:00 1970 +0000
776 | | date: Thu Jan 01 00:00:00 1970 +0000
771 | | summary: E
777 | | summary: E
772 | |
778 | |
773 o | changeset: 3:b3325c91a4d9
779 o | changeset: 3:b3325c91a4d9
774 | | phase: secret
780 | | phase: secret
775 | | user: test
781 | | user: test
776 | | date: Thu Jan 01 00:00:00 1970 +0000
782 | | date: Thu Jan 01 00:00:00 1970 +0000
777 | | summary: D
783 | | summary: D
778 | |
784 | |
779 o | changeset: 2:f838bfaca5c7
785 o | changeset: 2:f838bfaca5c7
780 |/ phase: public
786 |/ phase: public
781 | user: test
787 | user: test
782 | date: Thu Jan 01 00:00:00 1970 +0000
788 | date: Thu Jan 01 00:00:00 1970 +0000
783 | summary: C
789 | summary: C
784 |
790 |
785 o changeset: 1:27547f69f254
791 o changeset: 1:27547f69f254
786 | phase: public
792 | phase: public
787 | user: test
793 | user: test
788 | date: Thu Jan 01 00:00:00 1970 +0000
794 | date: Thu Jan 01 00:00:00 1970 +0000
789 | summary: B
795 | summary: B
790 |
796 |
791 o changeset: 0:4a2df7238c3b
797 o changeset: 0:4a2df7238c3b
792 phase: public
798 phase: public
793 user: test
799 user: test
794 date: Thu Jan 01 00:00:00 1970 +0000
800 date: Thu Jan 01 00:00:00 1970 +0000
795 summary: A
801 summary: A
796
802
797
803
798 Install a hook that prevent b3325c91a4d9 to become public
804 Install a hook that prevent b3325c91a4d9 to become public
799
805
800 $ cat >> .hg/hgrc << EOF
806 $ cat >> .hg/hgrc << EOF
801 > [hooks]
807 > [hooks]
802 > pretxnclose-phase.nopublish_D = sh -c "(echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 'public' != \$HG_PHASE ]"
808 > pretxnclose-phase.nopublish_D = sh -c "(echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 'public' != \$HG_PHASE ]"
803 > EOF
809 > EOF
804
810
805 Try various actions. only the draft move should succeed
811 Try various actions. only the draft move should succeed
806
812
807 $ hg phase --public b3325c91a4d9
813 $ hg phase --public b3325c91a4d9
808 transaction abort!
814 transaction abort!
809 rollback completed
815 rollback completed
810 abort: pretxnclose-phase.nopublish_D hook exited with status 1
816 abort: pretxnclose-phase.nopublish_D hook exited with status 1
811 [255]
817 [255]
812 $ hg phase --public a603bfb5a83e
818 $ hg phase --public a603bfb5a83e
813 transaction abort!
819 transaction abort!
814 rollback completed
820 rollback completed
815 abort: pretxnclose-phase.nopublish_D hook exited with status 1
821 abort: pretxnclose-phase.nopublish_D hook exited with status 1
816 [255]
822 [255]
817 $ hg phase --draft 17a481b3bccb
823 $ hg phase --draft 17a481b3bccb
818 test-debug-phase: move rev 3: 2 -> 1
824 test-debug-phase: move rev 3: 2 -> 1
819 test-debug-phase: move rev 4: 2 -> 1
825 test-debug-phase: move rev 4: 2 -> 1
820 test-debug-phase: move rev 7: 2 -> 1
826 test-debug-phase: move rev 7: 2 -> 1
821 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: secret -> draft
827 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: secret -> draft
822 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft
828 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft
823 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> draft
829 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> draft
824 $ hg phase --public 17a481b3bccb
830 $ hg phase --public 17a481b3bccb
825 transaction abort!
831 transaction abort!
826 rollback completed
832 rollback completed
827 abort: pretxnclose-phase.nopublish_D hook exited with status 1
833 abort: pretxnclose-phase.nopublish_D hook exited with status 1
828 [255]
834 [255]
829
835
830 $ cd ..
836 $ cd ..
831
837
832 Test for the "internal" phase
838 Test for the "internal" phase
833 =============================
839 =============================
834
840
835 Check we deny its usage on older repository
841 Check we deny its usage on older repository
836
842
837 $ hg init no-internal-phase --config format.internal-phase=no
843 $ hg init no-internal-phase --config format.internal-phase=no
838 $ cd no-internal-phase
844 $ cd no-internal-phase
839 $ cat .hg/requires
845 $ cat .hg/requires
840 dotencode
846 dotencode
841 fncache
847 fncache
842 generaldelta
848 generaldelta
843 revlogv1
849 revlogv1
850 sparserevlog
844 store
851 store
845 $ echo X > X
852 $ echo X > X
846 $ hg add X
853 $ hg add X
847 $ hg status
854 $ hg status
848 A X
855 A X
849 $ hg --config "phases.new-commit=internal" commit -m "my test internal commit" 2>&1 | grep ProgrammingError
856 $ hg --config "phases.new-commit=internal" commit -m "my test internal commit" 2>&1 | grep ProgrammingError
850 ** ProgrammingError: this repository does not support the internal phase
857 ** ProgrammingError: this repository does not support the internal phase
851 raise error.ProgrammingError(msg)
858 raise error.ProgrammingError(msg)
852 mercurial.error.ProgrammingError: this repository does not support the internal phase
859 mercurial.error.ProgrammingError: this repository does not support the internal phase
853 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit" 2>&1 | grep ProgrammingError
860 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit" 2>&1 | grep ProgrammingError
854 ** ProgrammingError: this repository does not support the archived phase
861 ** ProgrammingError: this repository does not support the archived phase
855 raise error.ProgrammingError(msg)
862 raise error.ProgrammingError(msg)
856 mercurial.error.ProgrammingError: this repository does not support the archived phase
863 mercurial.error.ProgrammingError: this repository does not support the archived phase
857
864
858 $ cd ..
865 $ cd ..
859
866
860 Check it works fine with repository that supports it.
867 Check it works fine with repository that supports it.
861
868
862 $ hg init internal-phase --config format.internal-phase=yes
869 $ hg init internal-phase --config format.internal-phase=yes
863 $ cd internal-phase
870 $ cd internal-phase
864 $ cat .hg/requires
871 $ cat .hg/requires
865 dotencode
872 dotencode
866 fncache
873 fncache
867 generaldelta
874 generaldelta
868 internal-phase
875 internal-phase
869 revlogv1
876 revlogv1
877 sparserevlog
870 store
878 store
871 $ mkcommit A
879 $ mkcommit A
872 test-debug-phase: new rev 0: x -> 1
880 test-debug-phase: new rev 0: x -> 1
873 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft
881 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft
874
882
875 Commit an internal changesets
883 Commit an internal changesets
876
884
877 $ echo B > B
885 $ echo B > B
878 $ hg add B
886 $ hg add B
879 $ hg status
887 $ hg status
880 A B
888 A B
881 $ hg --config "phases.new-commit=internal" commit -m "my test internal commit"
889 $ hg --config "phases.new-commit=internal" commit -m "my test internal commit"
882 test-debug-phase: new rev 1: x -> 96
890 test-debug-phase: new rev 1: x -> 96
883 test-hook-close-phase: c01c42dffc7f81223397e99652a0703f83e1c5ea: -> internal
891 test-hook-close-phase: c01c42dffc7f81223397e99652a0703f83e1c5ea: -> internal
884
892
885 The changeset is a working parent descendant.
893 The changeset is a working parent descendant.
886 Per the usual visibility rules, it is made visible.
894 Per the usual visibility rules, it is made visible.
887
895
888 $ hg log -G -l 3
896 $ hg log -G -l 3
889 @ changeset: 1:c01c42dffc7f
897 @ changeset: 1:c01c42dffc7f
890 | tag: tip
898 | tag: tip
891 | user: test
899 | user: test
892 | date: Thu Jan 01 00:00:00 1970 +0000
900 | date: Thu Jan 01 00:00:00 1970 +0000
893 | summary: my test internal commit
901 | summary: my test internal commit
894 |
902 |
895 o changeset: 0:4a2df7238c3b
903 o changeset: 0:4a2df7238c3b
896 user: test
904 user: test
897 date: Thu Jan 01 00:00:00 1970 +0000
905 date: Thu Jan 01 00:00:00 1970 +0000
898 summary: A
906 summary: A
899
907
900
908
901 Commit is hidden as expected
909 Commit is hidden as expected
902
910
903 $ hg up 0
911 $ hg up 0
904 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
912 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
905 $ hg log -G
913 $ hg log -G
906 @ changeset: 0:4a2df7238c3b
914 @ changeset: 0:4a2df7238c3b
907 tag: tip
915 tag: tip
908 user: test
916 user: test
909 date: Thu Jan 01 00:00:00 1970 +0000
917 date: Thu Jan 01 00:00:00 1970 +0000
910 summary: A
918 summary: A
911
919
912
920
913 Test for archived phase
921 Test for archived phase
914 -----------------------
922 -----------------------
915
923
916 Commit an archived changesets
924 Commit an archived changesets
917
925
918 $ echo B > B
926 $ echo B > B
919 $ hg add B
927 $ hg add B
920 $ hg status
928 $ hg status
921 A B
929 A B
922 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit"
930 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit"
923 test-debug-phase: new rev 2: x -> 32
931 test-debug-phase: new rev 2: x -> 32
924 test-hook-close-phase: 8df5997c3361518f733d1ae67cd3adb9b0eaf125: -> archived
932 test-hook-close-phase: 8df5997c3361518f733d1ae67cd3adb9b0eaf125: -> archived
925
933
926 The changeset is a working parent descendant.
934 The changeset is a working parent descendant.
927 Per the usual visibility rules, it is made visible.
935 Per the usual visibility rules, it is made visible.
928
936
929 $ hg log -G -l 3
937 $ hg log -G -l 3
930 @ changeset: 2:8df5997c3361
938 @ changeset: 2:8df5997c3361
931 | tag: tip
939 | tag: tip
932 | parent: 0:4a2df7238c3b
940 | parent: 0:4a2df7238c3b
933 | user: test
941 | user: test
934 | date: Thu Jan 01 00:00:00 1970 +0000
942 | date: Thu Jan 01 00:00:00 1970 +0000
935 | summary: my test archived commit
943 | summary: my test archived commit
936 |
944 |
937 o changeset: 0:4a2df7238c3b
945 o changeset: 0:4a2df7238c3b
938 user: test
946 user: test
939 date: Thu Jan 01 00:00:00 1970 +0000
947 date: Thu Jan 01 00:00:00 1970 +0000
940 summary: A
948 summary: A
941
949
942
950
943 Commit is hidden as expected
951 Commit is hidden as expected
944
952
945 $ hg up 0
953 $ hg up 0
946 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
954 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
947 $ hg log -G
955 $ hg log -G
948 @ changeset: 0:4a2df7238c3b
956 @ changeset: 0:4a2df7238c3b
949 tag: tip
957 tag: tip
950 user: test
958 user: test
951 date: Thu Jan 01 00:00:00 1970 +0000
959 date: Thu Jan 01 00:00:00 1970 +0000
952 summary: A
960 summary: A
953
961
General Comments 0
You need to be logged in to leave comments. Login now