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