Show More
@@ -1,906 +1,909 b'' | |||||
1 | #require serve |
|
1 | #require serve | |
2 |
|
2 | |||
3 | $ cat << EOF >> $HGRCPATH |
|
3 | $ cat << EOF >> $HGRCPATH | |
4 | > [ui] |
|
4 | > [ui] | |
5 | > logtemplate={rev}:{node|short} {desc|firstline} |
|
5 | > logtemplate={rev}:{node|short} {desc|firstline} | |
6 | > [phases] |
|
6 | > [phases] | |
7 | > publish=False |
|
7 | > publish=False | |
8 | > [experimental] |
|
8 | > [experimental] | |
9 | > evolution.createmarkers=True |
|
9 | > evolution.createmarkers=True | |
10 | > evolution.exchange=True |
|
10 | > evolution.exchange=True | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 | $ TESTHOOK='hooks.txnclose-bookmark.test=echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE"' |
|
13 | $ cat > $TESTTMP/hook.sh <<'EOF' | |
|
14 | > echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE" | |||
|
15 | > EOF | |||
|
16 | $ TESTHOOK="hooks.txnclose-bookmark.test=sh $TESTTMP/hook.sh" | |||
14 |
|
17 | |||
15 | initialize |
|
18 | initialize | |
16 |
|
19 | |||
17 | $ hg init a |
|
20 | $ hg init a | |
18 | $ cd a |
|
21 | $ cd a | |
19 | $ echo 'test' > test |
|
22 | $ echo 'test' > test | |
20 | $ hg commit -Am'test' |
|
23 | $ hg commit -Am'test' | |
21 | adding test |
|
24 | adding test | |
22 |
|
25 | |||
23 | set bookmarks |
|
26 | set bookmarks | |
24 |
|
27 | |||
25 | $ hg bookmark X |
|
28 | $ hg bookmark X | |
26 | $ hg bookmark Y |
|
29 | $ hg bookmark Y | |
27 | $ hg bookmark Z |
|
30 | $ hg bookmark Z | |
28 |
|
31 | |||
29 | import bookmark by name |
|
32 | import bookmark by name | |
30 |
|
33 | |||
31 | $ hg init ../b |
|
34 | $ hg init ../b | |
32 | $ cd ../b |
|
35 | $ cd ../b | |
33 | $ hg book Y |
|
36 | $ hg book Y | |
34 | $ hg book |
|
37 | $ hg book | |
35 | * Y -1:000000000000 |
|
38 | * Y -1:000000000000 | |
36 | $ hg pull ../a --config "$TESTHOOK" |
|
39 | $ hg pull ../a --config "$TESTHOOK" | |
37 | pulling from ../a |
|
40 | pulling from ../a | |
38 | requesting all changes |
|
41 | requesting all changes | |
39 | adding changesets |
|
42 | adding changesets | |
40 | adding manifests |
|
43 | adding manifests | |
41 | adding file changes |
|
44 | adding file changes | |
42 | added 1 changesets with 1 changes to 1 files |
|
45 | added 1 changesets with 1 changes to 1 files | |
43 | adding remote bookmark X |
|
46 | adding remote bookmark X | |
44 | updating bookmark Y |
|
47 | updating bookmark Y | |
45 | adding remote bookmark Z |
|
48 | adding remote bookmark Z | |
46 | new changesets 4e3505fd9583 |
|
49 | new changesets 4e3505fd9583 | |
47 | test-hook-bookmark: X: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
50 | test-hook-bookmark: X: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 | |
48 | test-hook-bookmark: Y: 0000000000000000000000000000000000000000 -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
51 | test-hook-bookmark: Y: 0000000000000000000000000000000000000000 -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 | |
49 | test-hook-bookmark: Z: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
52 | test-hook-bookmark: Z: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 | |
50 | (run 'hg update' to get a working copy) |
|
53 | (run 'hg update' to get a working copy) | |
51 | $ hg bookmarks |
|
54 | $ hg bookmarks | |
52 | X 0:4e3505fd9583 |
|
55 | X 0:4e3505fd9583 | |
53 | * Y 0:4e3505fd9583 |
|
56 | * Y 0:4e3505fd9583 | |
54 | Z 0:4e3505fd9583 |
|
57 | Z 0:4e3505fd9583 | |
55 | $ hg debugpushkey ../a namespaces |
|
58 | $ hg debugpushkey ../a namespaces | |
56 | bookmarks |
|
59 | bookmarks | |
57 | namespaces |
|
60 | namespaces | |
58 | obsolete |
|
61 | obsolete | |
59 | phases |
|
62 | phases | |
60 | $ hg debugpushkey ../a bookmarks |
|
63 | $ hg debugpushkey ../a bookmarks | |
61 | X 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
64 | X 4e3505fd95835d721066b76e75dbb8cc554d7f77 | |
62 | Y 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
65 | Y 4e3505fd95835d721066b76e75dbb8cc554d7f77 | |
63 | Z 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
66 | Z 4e3505fd95835d721066b76e75dbb8cc554d7f77 | |
64 |
|
67 | |||
65 | delete the bookmark to re-pull it |
|
68 | delete the bookmark to re-pull it | |
66 |
|
69 | |||
67 | $ hg book -d X |
|
70 | $ hg book -d X | |
68 | $ hg pull -B X ../a |
|
71 | $ hg pull -B X ../a | |
69 | pulling from ../a |
|
72 | pulling from ../a | |
70 | no changes found |
|
73 | no changes found | |
71 | adding remote bookmark X |
|
74 | adding remote bookmark X | |
72 |
|
75 | |||
73 | finally no-op pull |
|
76 | finally no-op pull | |
74 |
|
77 | |||
75 | $ hg pull -B X ../a |
|
78 | $ hg pull -B X ../a | |
76 | pulling from ../a |
|
79 | pulling from ../a | |
77 | no changes found |
|
80 | no changes found | |
78 | $ hg bookmark |
|
81 | $ hg bookmark | |
79 | X 0:4e3505fd9583 |
|
82 | X 0:4e3505fd9583 | |
80 | * Y 0:4e3505fd9583 |
|
83 | * Y 0:4e3505fd9583 | |
81 | Z 0:4e3505fd9583 |
|
84 | Z 0:4e3505fd9583 | |
82 |
|
85 | |||
83 | export bookmark by name |
|
86 | export bookmark by name | |
84 |
|
87 | |||
85 | $ hg bookmark W |
|
88 | $ hg bookmark W | |
86 | $ hg bookmark foo |
|
89 | $ hg bookmark foo | |
87 | $ hg bookmark foobar |
|
90 | $ hg bookmark foobar | |
88 | $ hg push -B W ../a |
|
91 | $ hg push -B W ../a | |
89 | pushing to ../a |
|
92 | pushing to ../a | |
90 | searching for changes |
|
93 | searching for changes | |
91 | no changes found |
|
94 | no changes found | |
92 | exporting bookmark W |
|
95 | exporting bookmark W | |
93 | [1] |
|
96 | [1] | |
94 | $ hg -R ../a bookmarks |
|
97 | $ hg -R ../a bookmarks | |
95 | W -1:000000000000 |
|
98 | W -1:000000000000 | |
96 | X 0:4e3505fd9583 |
|
99 | X 0:4e3505fd9583 | |
97 | Y 0:4e3505fd9583 |
|
100 | Y 0:4e3505fd9583 | |
98 | * Z 0:4e3505fd9583 |
|
101 | * Z 0:4e3505fd9583 | |
99 |
|
102 | |||
100 | delete a remote bookmark |
|
103 | delete a remote bookmark | |
101 |
|
104 | |||
102 | $ hg book -d W |
|
105 | $ hg book -d W | |
103 | $ hg push -B W ../a --config "$TESTHOOK" |
|
106 | $ hg push -B W ../a --config "$TESTHOOK" | |
104 | pushing to ../a |
|
107 | pushing to ../a | |
105 | searching for changes |
|
108 | searching for changes | |
106 | no changes found |
|
109 | no changes found | |
107 | test-hook-bookmark: W: 0000000000000000000000000000000000000000 -> |
|
110 | test-hook-bookmark: W: 0000000000000000000000000000000000000000 -> | |
108 | deleting remote bookmark W |
|
111 | deleting remote bookmark W | |
109 | [1] |
|
112 | [1] | |
110 |
|
113 | |||
111 | export the active bookmark |
|
114 | export the active bookmark | |
112 |
|
115 | |||
113 | $ hg bookmark V |
|
116 | $ hg bookmark V | |
114 | $ hg push -B . ../a |
|
117 | $ hg push -B . ../a | |
115 | pushing to ../a |
|
118 | pushing to ../a | |
116 | searching for changes |
|
119 | searching for changes | |
117 | no changes found |
|
120 | no changes found | |
118 | exporting bookmark V |
|
121 | exporting bookmark V | |
119 | [1] |
|
122 | [1] | |
120 |
|
123 | |||
121 | exporting the active bookmark with 'push -B .' |
|
124 | exporting the active bookmark with 'push -B .' | |
122 | demand that one of the bookmarks is activated |
|
125 | demand that one of the bookmarks is activated | |
123 |
|
126 | |||
124 | $ hg update -r default |
|
127 | $ hg update -r default | |
125 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
128 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
126 | (leaving bookmark V) |
|
129 | (leaving bookmark V) | |
127 | $ hg push -B . ../a |
|
130 | $ hg push -B . ../a | |
128 | abort: no active bookmark |
|
131 | abort: no active bookmark | |
129 | [255] |
|
132 | [255] | |
130 | $ hg update -r V |
|
133 | $ hg update -r V | |
131 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
134 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
132 | (activating bookmark V) |
|
135 | (activating bookmark V) | |
133 |
|
136 | |||
134 | delete the bookmark |
|
137 | delete the bookmark | |
135 |
|
138 | |||
136 | $ hg book -d V |
|
139 | $ hg book -d V | |
137 | $ hg push -B V ../a |
|
140 | $ hg push -B V ../a | |
138 | pushing to ../a |
|
141 | pushing to ../a | |
139 | searching for changes |
|
142 | searching for changes | |
140 | no changes found |
|
143 | no changes found | |
141 | deleting remote bookmark V |
|
144 | deleting remote bookmark V | |
142 | [1] |
|
145 | [1] | |
143 | $ hg up foobar |
|
146 | $ hg up foobar | |
144 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
147 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
145 | (activating bookmark foobar) |
|
148 | (activating bookmark foobar) | |
146 |
|
149 | |||
147 | push/pull name that doesn't exist |
|
150 | push/pull name that doesn't exist | |
148 |
|
151 | |||
149 | $ hg push -B badname ../a |
|
152 | $ hg push -B badname ../a | |
150 | pushing to ../a |
|
153 | pushing to ../a | |
151 | searching for changes |
|
154 | searching for changes | |
152 | bookmark badname does not exist on the local or remote repository! |
|
155 | bookmark badname does not exist on the local or remote repository! | |
153 | no changes found |
|
156 | no changes found | |
154 | [2] |
|
157 | [2] | |
155 | $ hg pull -B anotherbadname ../a |
|
158 | $ hg pull -B anotherbadname ../a | |
156 | pulling from ../a |
|
159 | pulling from ../a | |
157 | abort: remote bookmark anotherbadname not found! |
|
160 | abort: remote bookmark anotherbadname not found! | |
158 | [255] |
|
161 | [255] | |
159 |
|
162 | |||
160 | divergent bookmarks |
|
163 | divergent bookmarks | |
161 |
|
164 | |||
162 | $ cd ../a |
|
165 | $ cd ../a | |
163 | $ echo c1 > f1 |
|
166 | $ echo c1 > f1 | |
164 | $ hg ci -Am1 |
|
167 | $ hg ci -Am1 | |
165 | adding f1 |
|
168 | adding f1 | |
166 | $ hg book -f @ |
|
169 | $ hg book -f @ | |
167 | $ hg book -f X |
|
170 | $ hg book -f X | |
168 | $ hg book |
|
171 | $ hg book | |
169 | @ 1:0d2164f0ce0d |
|
172 | @ 1:0d2164f0ce0d | |
170 | * X 1:0d2164f0ce0d |
|
173 | * X 1:0d2164f0ce0d | |
171 | Y 0:4e3505fd9583 |
|
174 | Y 0:4e3505fd9583 | |
172 | Z 1:0d2164f0ce0d |
|
175 | Z 1:0d2164f0ce0d | |
173 |
|
176 | |||
174 | $ cd ../b |
|
177 | $ cd ../b | |
175 | $ hg up --config |
|
178 | $ hg up --config | |
176 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
179 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
177 | updating bookmark foobar |
|
180 | updating bookmark foobar | |
178 | $ echo c2 > f2 |
|
181 | $ echo c2 > f2 | |
179 | $ hg ci -Am2 |
|
182 | $ hg ci -Am2 | |
180 | adding f2 |
|
183 | adding f2 | |
181 | $ hg book -if @ |
|
184 | $ hg book -if @ | |
182 | $ hg book -if X |
|
185 | $ hg book -if X | |
183 | $ hg book |
|
186 | $ hg book | |
184 | @ 1:9b140be10808 |
|
187 | @ 1:9b140be10808 | |
185 | X 1:9b140be10808 |
|
188 | X 1:9b140be10808 | |
186 | Y 0:4e3505fd9583 |
|
189 | Y 0:4e3505fd9583 | |
187 | Z 0:4e3505fd9583 |
|
190 | Z 0:4e3505fd9583 | |
188 | foo -1:000000000000 |
|
191 | foo -1:000000000000 | |
189 | * foobar 1:9b140be10808 |
|
192 | * foobar 1:9b140be10808 | |
190 |
|
193 | |||
191 | $ hg pull --config paths.foo=../a foo --config "$TESTHOOK" |
|
194 | $ hg pull --config paths.foo=../a foo --config "$TESTHOOK" | |
192 | pulling from $TESTTMP/a (glob) |
|
195 | pulling from $TESTTMP/a (glob) | |
193 | searching for changes |
|
196 | searching for changes | |
194 | adding changesets |
|
197 | adding changesets | |
195 | adding manifests |
|
198 | adding manifests | |
196 | adding file changes |
|
199 | adding file changes | |
197 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
200 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
198 | divergent bookmark @ stored as @foo |
|
201 | divergent bookmark @ stored as @foo | |
199 | divergent bookmark X stored as X@foo |
|
202 | divergent bookmark X stored as X@foo | |
200 | updating bookmark Z |
|
203 | updating bookmark Z | |
201 | new changesets 0d2164f0ce0d |
|
204 | new changesets 0d2164f0ce0d | |
202 | test-hook-bookmark: @foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
205 | test-hook-bookmark: @foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | |
203 | test-hook-bookmark: X@foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
206 | test-hook-bookmark: X@foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | |
204 | test-hook-bookmark: Z: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
207 | test-hook-bookmark: Z: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | |
205 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
208 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
206 | $ hg book |
|
209 | $ hg book | |
207 | @ 1:9b140be10808 |
|
210 | @ 1:9b140be10808 | |
208 | @foo 2:0d2164f0ce0d |
|
211 | @foo 2:0d2164f0ce0d | |
209 | X 1:9b140be10808 |
|
212 | X 1:9b140be10808 | |
210 | X@foo 2:0d2164f0ce0d |
|
213 | X@foo 2:0d2164f0ce0d | |
211 | Y 0:4e3505fd9583 |
|
214 | Y 0:4e3505fd9583 | |
212 | Z 2:0d2164f0ce0d |
|
215 | Z 2:0d2164f0ce0d | |
213 | foo -1:000000000000 |
|
216 | foo -1:000000000000 | |
214 | * foobar 1:9b140be10808 |
|
217 | * foobar 1:9b140be10808 | |
215 |
|
218 | |||
216 | (test that too many divergence of bookmark) |
|
219 | (test that too many divergence of bookmark) | |
217 |
|
220 | |||
218 | $ $PYTHON $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done |
|
221 | $ $PYTHON $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done | |
219 | $ hg pull ../a |
|
222 | $ hg pull ../a | |
220 | pulling from ../a |
|
223 | pulling from ../a | |
221 | searching for changes |
|
224 | searching for changes | |
222 | no changes found |
|
225 | no changes found | |
223 | warning: failed to assign numbered name to divergent bookmark X |
|
226 | warning: failed to assign numbered name to divergent bookmark X | |
224 | divergent bookmark @ stored as @1 |
|
227 | divergent bookmark @ stored as @1 | |
225 | $ hg bookmarks | grep '^ X' | grep -v ':000000000000' |
|
228 | $ hg bookmarks | grep '^ X' | grep -v ':000000000000' | |
226 | X 1:9b140be10808 |
|
229 | X 1:9b140be10808 | |
227 | X@foo 2:0d2164f0ce0d |
|
230 | X@foo 2:0d2164f0ce0d | |
228 |
|
231 | |||
229 | (test that remotely diverged bookmarks are reused if they aren't changed) |
|
232 | (test that remotely diverged bookmarks are reused if they aren't changed) | |
230 |
|
233 | |||
231 | $ hg bookmarks | grep '^ @' |
|
234 | $ hg bookmarks | grep '^ @' | |
232 | @ 1:9b140be10808 |
|
235 | @ 1:9b140be10808 | |
233 | @1 2:0d2164f0ce0d |
|
236 | @1 2:0d2164f0ce0d | |
234 | @foo 2:0d2164f0ce0d |
|
237 | @foo 2:0d2164f0ce0d | |
235 | $ hg pull ../a |
|
238 | $ hg pull ../a | |
236 | pulling from ../a |
|
239 | pulling from ../a | |
237 | searching for changes |
|
240 | searching for changes | |
238 | no changes found |
|
241 | no changes found | |
239 | warning: failed to assign numbered name to divergent bookmark X |
|
242 | warning: failed to assign numbered name to divergent bookmark X | |
240 | divergent bookmark @ stored as @1 |
|
243 | divergent bookmark @ stored as @1 | |
241 | $ hg bookmarks | grep '^ @' |
|
244 | $ hg bookmarks | grep '^ @' | |
242 | @ 1:9b140be10808 |
|
245 | @ 1:9b140be10808 | |
243 | @1 2:0d2164f0ce0d |
|
246 | @1 2:0d2164f0ce0d | |
244 | @foo 2:0d2164f0ce0d |
|
247 | @foo 2:0d2164f0ce0d | |
245 |
|
248 | |||
246 | $ $PYTHON $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done |
|
249 | $ $PYTHON $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done | |
247 | $ hg bookmarks -d "@1" |
|
250 | $ hg bookmarks -d "@1" | |
248 |
|
251 | |||
249 | $ hg push -f ../a |
|
252 | $ hg push -f ../a | |
250 | pushing to ../a |
|
253 | pushing to ../a | |
251 | searching for changes |
|
254 | searching for changes | |
252 | adding changesets |
|
255 | adding changesets | |
253 | adding manifests |
|
256 | adding manifests | |
254 | adding file changes |
|
257 | adding file changes | |
255 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
258 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
256 | $ hg -R ../a book |
|
259 | $ hg -R ../a book | |
257 | @ 1:0d2164f0ce0d |
|
260 | @ 1:0d2164f0ce0d | |
258 | * X 1:0d2164f0ce0d |
|
261 | * X 1:0d2164f0ce0d | |
259 | Y 0:4e3505fd9583 |
|
262 | Y 0:4e3505fd9583 | |
260 | Z 1:0d2164f0ce0d |
|
263 | Z 1:0d2164f0ce0d | |
261 |
|
264 | |||
262 | explicit pull should overwrite the local version (issue4439) |
|
265 | explicit pull should overwrite the local version (issue4439) | |
263 |
|
266 | |||
264 | $ hg update -r X |
|
267 | $ hg update -r X | |
265 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
268 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
266 | (activating bookmark X) |
|
269 | (activating bookmark X) | |
267 | $ hg pull --config paths.foo=../a foo -B . --config "$TESTHOOK" |
|
270 | $ hg pull --config paths.foo=../a foo -B . --config "$TESTHOOK" | |
268 | pulling from $TESTTMP/a (glob) |
|
271 | pulling from $TESTTMP/a (glob) | |
269 | no changes found |
|
272 | no changes found | |
270 | divergent bookmark @ stored as @foo |
|
273 | divergent bookmark @ stored as @foo | |
271 | importing bookmark X |
|
274 | importing bookmark X | |
272 | test-hook-bookmark: @foo: 0d2164f0ce0d8f1d6f94351eba04b794909be66c -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
275 | test-hook-bookmark: @foo: 0d2164f0ce0d8f1d6f94351eba04b794909be66c -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | |
273 | test-hook-bookmark: X: 9b140be1080824d768c5a4691a564088eede71f9 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
276 | test-hook-bookmark: X: 9b140be1080824d768c5a4691a564088eede71f9 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | |
274 |
|
277 | |||
275 | reinstall state for further testing: |
|
278 | reinstall state for further testing: | |
276 |
|
279 | |||
277 | $ hg book -fr 9b140be10808 X |
|
280 | $ hg book -fr 9b140be10808 X | |
278 |
|
281 | |||
279 | revsets should not ignore divergent bookmarks |
|
282 | revsets should not ignore divergent bookmarks | |
280 |
|
283 | |||
281 | $ hg bookmark -fr 1 Z |
|
284 | $ hg bookmark -fr 1 Z | |
282 | $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n' |
|
285 | $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n' | |
283 | 0:4e3505fd9583 Y |
|
286 | 0:4e3505fd9583 Y | |
284 | 1:9b140be10808 @ X Z foobar |
|
287 | 1:9b140be10808 @ X Z foobar | |
285 | 2:0d2164f0ce0d @foo X@foo |
|
288 | 2:0d2164f0ce0d @foo X@foo | |
286 | $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n' |
|
289 | $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n' | |
287 | 2:0d2164f0ce0d @foo X@foo |
|
290 | 2:0d2164f0ce0d @foo X@foo | |
288 | $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n' |
|
291 | $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n' | |
289 | 2:0d2164f0ce0d @foo X@foo |
|
292 | 2:0d2164f0ce0d @foo X@foo | |
290 |
|
293 | |||
291 | update a remote bookmark from a non-head to a head |
|
294 | update a remote bookmark from a non-head to a head | |
292 |
|
295 | |||
293 | $ hg up -q Y |
|
296 | $ hg up -q Y | |
294 | $ echo c3 > f2 |
|
297 | $ echo c3 > f2 | |
295 | $ hg ci -Am3 |
|
298 | $ hg ci -Am3 | |
296 | adding f2 |
|
299 | adding f2 | |
297 | created new head |
|
300 | created new head | |
298 | $ hg push ../a --config "$TESTHOOK" |
|
301 | $ hg push ../a --config "$TESTHOOK" | |
299 | pushing to ../a |
|
302 | pushing to ../a | |
300 | searching for changes |
|
303 | searching for changes | |
301 | adding changesets |
|
304 | adding changesets | |
302 | adding manifests |
|
305 | adding manifests | |
303 | adding file changes |
|
306 | adding file changes | |
304 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
307 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
305 | test-hook-bookmark: Y: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f |
|
308 | test-hook-bookmark: Y: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f | |
306 | updating bookmark Y |
|
309 | updating bookmark Y | |
307 | $ hg -R ../a book |
|
310 | $ hg -R ../a book | |
308 | @ 1:0d2164f0ce0d |
|
311 | @ 1:0d2164f0ce0d | |
309 | * X 1:0d2164f0ce0d |
|
312 | * X 1:0d2164f0ce0d | |
310 | Y 3:f6fc62dde3c0 |
|
313 | Y 3:f6fc62dde3c0 | |
311 | Z 1:0d2164f0ce0d |
|
314 | Z 1:0d2164f0ce0d | |
312 |
|
315 | |||
313 | update a bookmark in the middle of a client pulling changes |
|
316 | update a bookmark in the middle of a client pulling changes | |
314 |
|
317 | |||
315 | $ cd .. |
|
318 | $ cd .. | |
316 | $ hg clone -q a pull-race |
|
319 | $ hg clone -q a pull-race | |
317 |
|
320 | |||
318 | We want to use http because it is stateless and therefore more susceptible to |
|
321 | We want to use http because it is stateless and therefore more susceptible to | |
319 | race conditions |
|
322 | race conditions | |
320 |
|
323 | |||
321 | $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log |
|
324 | $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log | |
322 | $ cat pull-race.pid >> $DAEMON_PIDS |
|
325 | $ cat pull-race.pid >> $DAEMON_PIDS | |
323 |
|
326 | |||
324 | $ cat <<EOF > $TESTTMP/out_makecommit.sh |
|
327 | $ cat <<EOF > $TESTTMP/out_makecommit.sh | |
325 | > #!/bin/sh |
|
328 | > #!/bin/sh | |
326 | > hg ci -Am5 |
|
329 | > hg ci -Am5 | |
327 | > echo committed in pull-race |
|
330 | > echo committed in pull-race | |
328 | > EOF |
|
331 | > EOF | |
329 |
|
332 | |||
330 | $ hg clone -q http://localhost:$HGPORT/ pull-race2 --config "$TESTHOOK" |
|
333 | $ hg clone -q http://localhost:$HGPORT/ pull-race2 --config "$TESTHOOK" | |
331 | test-hook-bookmark: @: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
334 | test-hook-bookmark: @: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | |
332 | test-hook-bookmark: X: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
335 | test-hook-bookmark: X: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | |
333 | test-hook-bookmark: Y: -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f |
|
336 | test-hook-bookmark: Y: -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f | |
334 | test-hook-bookmark: Z: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
337 | test-hook-bookmark: Z: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c | |
335 | $ cd pull-race |
|
338 | $ cd pull-race | |
336 | $ hg up -q Y |
|
339 | $ hg up -q Y | |
337 | $ echo c4 > f2 |
|
340 | $ echo c4 > f2 | |
338 | $ hg ci -Am4 |
|
341 | $ hg ci -Am4 | |
339 | $ echo c5 > f3 |
|
342 | $ echo c5 > f3 | |
340 | $ cat <<EOF > .hg/hgrc |
|
343 | $ cat <<EOF > .hg/hgrc | |
341 | > [hooks] |
|
344 | > [hooks] | |
342 | > outgoing.makecommit = sh $TESTTMP/out_makecommit.sh |
|
345 | > outgoing.makecommit = sh $TESTTMP/out_makecommit.sh | |
343 | > EOF |
|
346 | > EOF | |
344 |
|
347 | |||
345 | (new config needs a server restart) |
|
348 | (new config needs a server restart) | |
346 |
|
349 | |||
347 | $ cd .. |
|
350 | $ cd .. | |
348 | $ killdaemons.py |
|
351 | $ killdaemons.py | |
349 | $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log |
|
352 | $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log | |
350 | $ cat pull-race.pid >> $DAEMON_PIDS |
|
353 | $ cat pull-race.pid >> $DAEMON_PIDS | |
351 | $ cd pull-race2 |
|
354 | $ cd pull-race2 | |
352 | $ hg -R $TESTTMP/pull-race book |
|
355 | $ hg -R $TESTTMP/pull-race book | |
353 | @ 1:0d2164f0ce0d |
|
356 | @ 1:0d2164f0ce0d | |
354 | X 1:0d2164f0ce0d |
|
357 | X 1:0d2164f0ce0d | |
355 | * Y 4:b0a5eff05604 |
|
358 | * Y 4:b0a5eff05604 | |
356 | Z 1:0d2164f0ce0d |
|
359 | Z 1:0d2164f0ce0d | |
357 | $ hg pull |
|
360 | $ hg pull | |
358 | pulling from http://localhost:$HGPORT/ |
|
361 | pulling from http://localhost:$HGPORT/ | |
359 | searching for changes |
|
362 | searching for changes | |
360 | adding changesets |
|
363 | adding changesets | |
361 | adding manifests |
|
364 | adding manifests | |
362 | adding file changes |
|
365 | adding file changes | |
363 | added 1 changesets with 1 changes to 1 files |
|
366 | added 1 changesets with 1 changes to 1 files | |
364 | updating bookmark Y |
|
367 | updating bookmark Y | |
365 | new changesets b0a5eff05604 |
|
368 | new changesets b0a5eff05604 | |
366 | (run 'hg update' to get a working copy) |
|
369 | (run 'hg update' to get a working copy) | |
367 | $ hg book |
|
370 | $ hg book | |
368 | * @ 1:0d2164f0ce0d |
|
371 | * @ 1:0d2164f0ce0d | |
369 | X 1:0d2164f0ce0d |
|
372 | X 1:0d2164f0ce0d | |
370 | Y 4:b0a5eff05604 |
|
373 | Y 4:b0a5eff05604 | |
371 | Z 1:0d2164f0ce0d |
|
374 | Z 1:0d2164f0ce0d | |
372 |
|
375 | |||
373 | Update a bookmark right after the initial lookup -B (issue4689) |
|
376 | Update a bookmark right after the initial lookup -B (issue4689) | |
374 |
|
377 | |||
375 | $ echo c6 > ../pull-race/f3 # to be committed during the race |
|
378 | $ echo c6 > ../pull-race/f3 # to be committed during the race | |
376 | $ cat <<EOF > $TESTTMP/listkeys_makecommit.sh |
|
379 | $ cat <<EOF > $TESTTMP/listkeys_makecommit.sh | |
377 | > #!/bin/sh |
|
380 | > #!/bin/sh | |
378 | > if hg st | grep -q M; then |
|
381 | > if hg st | grep -q M; then | |
379 | > hg commit -m race |
|
382 | > hg commit -m race | |
380 | > echo committed in pull-race |
|
383 | > echo committed in pull-race | |
381 | > else |
|
384 | > else | |
382 | > exit 0 |
|
385 | > exit 0 | |
383 | > fi |
|
386 | > fi | |
384 | > EOF |
|
387 | > EOF | |
385 | $ cat <<EOF > ../pull-race/.hg/hgrc |
|
388 | $ cat <<EOF > ../pull-race/.hg/hgrc | |
386 | > [hooks] |
|
389 | > [hooks] | |
387 | > # If anything to commit, commit it right after the first key listing used |
|
390 | > # If anything to commit, commit it right after the first key listing used | |
388 | > # during lookup. This makes the commit appear before the actual getbundle |
|
391 | > # during lookup. This makes the commit appear before the actual getbundle | |
389 | > # call. |
|
392 | > # call. | |
390 | > listkeys.makecommit= sh $TESTTMP/listkeys_makecommit.sh |
|
393 | > listkeys.makecommit= sh $TESTTMP/listkeys_makecommit.sh | |
391 | > EOF |
|
394 | > EOF | |
392 |
|
395 | |||
393 | (new config need server restart) |
|
396 | (new config need server restart) | |
394 |
|
397 | |||
395 | $ killdaemons.py |
|
398 | $ killdaemons.py | |
396 | $ hg serve -R ../pull-race -p $HGPORT -d --pid-file=../pull-race.pid -E main-error.log |
|
399 | $ hg serve -R ../pull-race -p $HGPORT -d --pid-file=../pull-race.pid -E main-error.log | |
397 | $ cat ../pull-race.pid >> $DAEMON_PIDS |
|
400 | $ cat ../pull-race.pid >> $DAEMON_PIDS | |
398 |
|
401 | |||
399 | $ hg -R $TESTTMP/pull-race book |
|
402 | $ hg -R $TESTTMP/pull-race book | |
400 | @ 1:0d2164f0ce0d |
|
403 | @ 1:0d2164f0ce0d | |
401 | X 1:0d2164f0ce0d |
|
404 | X 1:0d2164f0ce0d | |
402 | * Y 5:35d1ef0a8d1b |
|
405 | * Y 5:35d1ef0a8d1b | |
403 | Z 1:0d2164f0ce0d |
|
406 | Z 1:0d2164f0ce0d | |
404 | $ hg update -r Y |
|
407 | $ hg update -r Y | |
405 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
408 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
406 | (activating bookmark Y) |
|
409 | (activating bookmark Y) | |
407 | $ hg pull -B . |
|
410 | $ hg pull -B . | |
408 | pulling from http://localhost:$HGPORT/ |
|
411 | pulling from http://localhost:$HGPORT/ | |
409 | searching for changes |
|
412 | searching for changes | |
410 | adding changesets |
|
413 | adding changesets | |
411 | adding manifests |
|
414 | adding manifests | |
412 | adding file changes |
|
415 | adding file changes | |
413 | added 1 changesets with 1 changes to 1 files |
|
416 | added 1 changesets with 1 changes to 1 files | |
414 | updating bookmark Y |
|
417 | updating bookmark Y | |
415 | new changesets 35d1ef0a8d1b |
|
418 | new changesets 35d1ef0a8d1b | |
416 | (run 'hg update' to get a working copy) |
|
419 | (run 'hg update' to get a working copy) | |
417 | $ hg book |
|
420 | $ hg book | |
418 | @ 1:0d2164f0ce0d |
|
421 | @ 1:0d2164f0ce0d | |
419 | X 1:0d2164f0ce0d |
|
422 | X 1:0d2164f0ce0d | |
420 | * Y 5:35d1ef0a8d1b |
|
423 | * Y 5:35d1ef0a8d1b | |
421 | Z 1:0d2164f0ce0d |
|
424 | Z 1:0d2164f0ce0d | |
422 |
|
425 | |||
423 | (done with this section of the test) |
|
426 | (done with this section of the test) | |
424 |
|
427 | |||
425 | $ killdaemons.py |
|
428 | $ killdaemons.py | |
426 | $ cd ../b |
|
429 | $ cd ../b | |
427 |
|
430 | |||
428 | diverging a remote bookmark fails |
|
431 | diverging a remote bookmark fails | |
429 |
|
432 | |||
430 | $ hg up -q 4e3505fd9583 |
|
433 | $ hg up -q 4e3505fd9583 | |
431 | $ echo c4 > f2 |
|
434 | $ echo c4 > f2 | |
432 | $ hg ci -Am4 |
|
435 | $ hg ci -Am4 | |
433 | adding f2 |
|
436 | adding f2 | |
434 | created new head |
|
437 | created new head | |
435 | $ echo c5 > f2 |
|
438 | $ echo c5 > f2 | |
436 | $ hg ci -Am5 |
|
439 | $ hg ci -Am5 | |
437 | $ hg log -G |
|
440 | $ hg log -G | |
438 | @ 5:c922c0139ca0 5 |
|
441 | @ 5:c922c0139ca0 5 | |
439 | | |
|
442 | | | |
440 | o 4:4efff6d98829 4 |
|
443 | o 4:4efff6d98829 4 | |
441 | | |
|
444 | | | |
442 | | o 3:f6fc62dde3c0 3 |
|
445 | | o 3:f6fc62dde3c0 3 | |
443 | |/ |
|
446 | |/ | |
444 | | o 2:0d2164f0ce0d 1 |
|
447 | | o 2:0d2164f0ce0d 1 | |
445 | |/ |
|
448 | |/ | |
446 | | o 1:9b140be10808 2 |
|
449 | | o 1:9b140be10808 2 | |
447 | |/ |
|
450 | |/ | |
448 | o 0:4e3505fd9583 test |
|
451 | o 0:4e3505fd9583 test | |
449 |
|
452 | |||
450 |
|
453 | |||
451 | $ hg book -f Y |
|
454 | $ hg book -f Y | |
452 |
|
455 | |||
453 | $ cat <<EOF > ../a/.hg/hgrc |
|
456 | $ cat <<EOF > ../a/.hg/hgrc | |
454 | > [web] |
|
457 | > [web] | |
455 | > push_ssl = false |
|
458 | > push_ssl = false | |
456 | > allow_push = * |
|
459 | > allow_push = * | |
457 | > EOF |
|
460 | > EOF | |
458 |
|
461 | |||
459 | $ hg serve -R ../a -p $HGPORT2 -d --pid-file=../hg2.pid |
|
462 | $ hg serve -R ../a -p $HGPORT2 -d --pid-file=../hg2.pid | |
460 | $ cat ../hg2.pid >> $DAEMON_PIDS |
|
463 | $ cat ../hg2.pid >> $DAEMON_PIDS | |
461 |
|
464 | |||
462 | $ hg push http://localhost:$HGPORT2/ |
|
465 | $ hg push http://localhost:$HGPORT2/ | |
463 | pushing to http://localhost:$HGPORT2/ |
|
466 | pushing to http://localhost:$HGPORT2/ | |
464 | searching for changes |
|
467 | searching for changes | |
465 | abort: push creates new remote head c922c0139ca0 with bookmark 'Y'! |
|
468 | abort: push creates new remote head c922c0139ca0 with bookmark 'Y'! | |
466 | (merge or see 'hg help push' for details about pushing new heads) |
|
469 | (merge or see 'hg help push' for details about pushing new heads) | |
467 | [255] |
|
470 | [255] | |
468 | $ hg -R ../a book |
|
471 | $ hg -R ../a book | |
469 | @ 1:0d2164f0ce0d |
|
472 | @ 1:0d2164f0ce0d | |
470 | * X 1:0d2164f0ce0d |
|
473 | * X 1:0d2164f0ce0d | |
471 | Y 3:f6fc62dde3c0 |
|
474 | Y 3:f6fc62dde3c0 | |
472 | Z 1:0d2164f0ce0d |
|
475 | Z 1:0d2164f0ce0d | |
473 |
|
476 | |||
474 |
|
477 | |||
475 | Unrelated marker does not alter the decision |
|
478 | Unrelated marker does not alter the decision | |
476 |
|
479 | |||
477 | $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
|
480 | $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb | |
478 | $ hg push http://localhost:$HGPORT2/ |
|
481 | $ hg push http://localhost:$HGPORT2/ | |
479 | pushing to http://localhost:$HGPORT2/ |
|
482 | pushing to http://localhost:$HGPORT2/ | |
480 | searching for changes |
|
483 | searching for changes | |
481 | abort: push creates new remote head c922c0139ca0 with bookmark 'Y'! |
|
484 | abort: push creates new remote head c922c0139ca0 with bookmark 'Y'! | |
482 | (merge or see 'hg help push' for details about pushing new heads) |
|
485 | (merge or see 'hg help push' for details about pushing new heads) | |
483 | [255] |
|
486 | [255] | |
484 | $ hg -R ../a book |
|
487 | $ hg -R ../a book | |
485 | @ 1:0d2164f0ce0d |
|
488 | @ 1:0d2164f0ce0d | |
486 | * X 1:0d2164f0ce0d |
|
489 | * X 1:0d2164f0ce0d | |
487 | Y 3:f6fc62dde3c0 |
|
490 | Y 3:f6fc62dde3c0 | |
488 | Z 1:0d2164f0ce0d |
|
491 | Z 1:0d2164f0ce0d | |
489 |
|
492 | |||
490 | Update to a successor works |
|
493 | Update to a successor works | |
491 |
|
494 | |||
492 | $ hg id --debug -r 3 |
|
495 | $ hg id --debug -r 3 | |
493 | f6fc62dde3c0771e29704af56ba4d8af77abcc2f |
|
496 | f6fc62dde3c0771e29704af56ba4d8af77abcc2f | |
494 | $ hg id --debug -r 4 |
|
497 | $ hg id --debug -r 4 | |
495 | 4efff6d98829d9c824c621afd6e3f01865f5439f |
|
498 | 4efff6d98829d9c824c621afd6e3f01865f5439f | |
496 | $ hg id --debug -r 5 |
|
499 | $ hg id --debug -r 5 | |
497 | c922c0139ca03858f655e4a2af4dd02796a63969 tip Y |
|
500 | c922c0139ca03858f655e4a2af4dd02796a63969 tip Y | |
498 | $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f cccccccccccccccccccccccccccccccccccccccc |
|
501 | $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f cccccccccccccccccccccccccccccccccccccccc | |
499 | obsoleted 1 changesets |
|
502 | obsoleted 1 changesets | |
500 | $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc 4efff6d98829d9c824c621afd6e3f01865f5439f |
|
503 | $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc 4efff6d98829d9c824c621afd6e3f01865f5439f | |
501 | $ hg push http://localhost:$HGPORT2/ |
|
504 | $ hg push http://localhost:$HGPORT2/ | |
502 | pushing to http://localhost:$HGPORT2/ |
|
505 | pushing to http://localhost:$HGPORT2/ | |
503 | searching for changes |
|
506 | searching for changes | |
504 | remote: adding changesets |
|
507 | remote: adding changesets | |
505 | remote: adding manifests |
|
508 | remote: adding manifests | |
506 | remote: adding file changes |
|
509 | remote: adding file changes | |
507 | remote: added 2 changesets with 2 changes to 1 files (+1 heads) |
|
510 | remote: added 2 changesets with 2 changes to 1 files (+1 heads) | |
508 | remote: 2 new obsolescence markers |
|
511 | remote: 2 new obsolescence markers | |
509 | remote: obsoleted 1 changesets |
|
512 | remote: obsoleted 1 changesets | |
510 | updating bookmark Y |
|
513 | updating bookmark Y | |
511 | $ hg -R ../a book |
|
514 | $ hg -R ../a book | |
512 | @ 1:0d2164f0ce0d |
|
515 | @ 1:0d2164f0ce0d | |
513 | * X 1:0d2164f0ce0d |
|
516 | * X 1:0d2164f0ce0d | |
514 | Y 5:c922c0139ca0 |
|
517 | Y 5:c922c0139ca0 | |
515 | Z 1:0d2164f0ce0d |
|
518 | Z 1:0d2164f0ce0d | |
516 |
|
519 | |||
517 | hgweb |
|
520 | hgweb | |
518 |
|
521 | |||
519 | $ cat <<EOF > .hg/hgrc |
|
522 | $ cat <<EOF > .hg/hgrc | |
520 | > [web] |
|
523 | > [web] | |
521 | > push_ssl = false |
|
524 | > push_ssl = false | |
522 | > allow_push = * |
|
525 | > allow_push = * | |
523 | > EOF |
|
526 | > EOF | |
524 |
|
527 | |||
525 | $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log |
|
528 | $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log | |
526 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
529 | $ cat ../hg.pid >> $DAEMON_PIDS | |
527 | $ cd ../a |
|
530 | $ cd ../a | |
528 |
|
531 | |||
529 | $ hg debugpushkey http://localhost:$HGPORT/ namespaces |
|
532 | $ hg debugpushkey http://localhost:$HGPORT/ namespaces | |
530 | bookmarks |
|
533 | bookmarks | |
531 | namespaces |
|
534 | namespaces | |
532 | obsolete |
|
535 | obsolete | |
533 | phases |
|
536 | phases | |
534 | $ hg debugpushkey http://localhost:$HGPORT/ bookmarks |
|
537 | $ hg debugpushkey http://localhost:$HGPORT/ bookmarks | |
535 | @ 9b140be1080824d768c5a4691a564088eede71f9 |
|
538 | @ 9b140be1080824d768c5a4691a564088eede71f9 | |
536 | X 9b140be1080824d768c5a4691a564088eede71f9 |
|
539 | X 9b140be1080824d768c5a4691a564088eede71f9 | |
537 | Y c922c0139ca03858f655e4a2af4dd02796a63969 |
|
540 | Y c922c0139ca03858f655e4a2af4dd02796a63969 | |
538 | Z 9b140be1080824d768c5a4691a564088eede71f9 |
|
541 | Z 9b140be1080824d768c5a4691a564088eede71f9 | |
539 | foo 0000000000000000000000000000000000000000 |
|
542 | foo 0000000000000000000000000000000000000000 | |
540 | foobar 9b140be1080824d768c5a4691a564088eede71f9 |
|
543 | foobar 9b140be1080824d768c5a4691a564088eede71f9 | |
541 | $ hg out -B http://localhost:$HGPORT/ |
|
544 | $ hg out -B http://localhost:$HGPORT/ | |
542 | comparing with http://localhost:$HGPORT/ |
|
545 | comparing with http://localhost:$HGPORT/ | |
543 | searching for changed bookmarks |
|
546 | searching for changed bookmarks | |
544 | @ 0d2164f0ce0d |
|
547 | @ 0d2164f0ce0d | |
545 | X 0d2164f0ce0d |
|
548 | X 0d2164f0ce0d | |
546 | Z 0d2164f0ce0d |
|
549 | Z 0d2164f0ce0d | |
547 | foo |
|
550 | foo | |
548 | foobar |
|
551 | foobar | |
549 | $ hg push -B Z http://localhost:$HGPORT/ |
|
552 | $ hg push -B Z http://localhost:$HGPORT/ | |
550 | pushing to http://localhost:$HGPORT/ |
|
553 | pushing to http://localhost:$HGPORT/ | |
551 | searching for changes |
|
554 | searching for changes | |
552 | no changes found |
|
555 | no changes found | |
553 | updating bookmark Z |
|
556 | updating bookmark Z | |
554 | [1] |
|
557 | [1] | |
555 | $ hg book -d Z |
|
558 | $ hg book -d Z | |
556 | $ hg in -B http://localhost:$HGPORT/ |
|
559 | $ hg in -B http://localhost:$HGPORT/ | |
557 | comparing with http://localhost:$HGPORT/ |
|
560 | comparing with http://localhost:$HGPORT/ | |
558 | searching for changed bookmarks |
|
561 | searching for changed bookmarks | |
559 | @ 9b140be10808 |
|
562 | @ 9b140be10808 | |
560 | X 9b140be10808 |
|
563 | X 9b140be10808 | |
561 | Z 0d2164f0ce0d |
|
564 | Z 0d2164f0ce0d | |
562 | foo 000000000000 |
|
565 | foo 000000000000 | |
563 | foobar 9b140be10808 |
|
566 | foobar 9b140be10808 | |
564 | $ hg pull -B Z http://localhost:$HGPORT/ |
|
567 | $ hg pull -B Z http://localhost:$HGPORT/ | |
565 | pulling from http://localhost:$HGPORT/ |
|
568 | pulling from http://localhost:$HGPORT/ | |
566 | no changes found |
|
569 | no changes found | |
567 | divergent bookmark @ stored as @1 |
|
570 | divergent bookmark @ stored as @1 | |
568 | divergent bookmark X stored as X@1 |
|
571 | divergent bookmark X stored as X@1 | |
569 | adding remote bookmark Z |
|
572 | adding remote bookmark Z | |
570 | adding remote bookmark foo |
|
573 | adding remote bookmark foo | |
571 | adding remote bookmark foobar |
|
574 | adding remote bookmark foobar | |
572 | $ hg clone http://localhost:$HGPORT/ cloned-bookmarks |
|
575 | $ hg clone http://localhost:$HGPORT/ cloned-bookmarks | |
573 | requesting all changes |
|
576 | requesting all changes | |
574 | adding changesets |
|
577 | adding changesets | |
575 | adding manifests |
|
578 | adding manifests | |
576 | adding file changes |
|
579 | adding file changes | |
577 | added 5 changesets with 5 changes to 3 files (+2 heads) |
|
580 | added 5 changesets with 5 changes to 3 files (+2 heads) | |
578 | 2 new obsolescence markers |
|
581 | 2 new obsolescence markers | |
579 | new changesets 4e3505fd9583:c922c0139ca0 |
|
582 | new changesets 4e3505fd9583:c922c0139ca0 | |
580 | updating to bookmark @ |
|
583 | updating to bookmark @ | |
581 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
584 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
582 | $ hg -R cloned-bookmarks bookmarks |
|
585 | $ hg -R cloned-bookmarks bookmarks | |
583 | * @ 1:9b140be10808 |
|
586 | * @ 1:9b140be10808 | |
584 | X 1:9b140be10808 |
|
587 | X 1:9b140be10808 | |
585 | Y 4:c922c0139ca0 |
|
588 | Y 4:c922c0139ca0 | |
586 | Z 2:0d2164f0ce0d |
|
589 | Z 2:0d2164f0ce0d | |
587 | foo -1:000000000000 |
|
590 | foo -1:000000000000 | |
588 | foobar 1:9b140be10808 |
|
591 | foobar 1:9b140be10808 | |
589 |
|
592 | |||
590 | $ cd .. |
|
593 | $ cd .. | |
591 |
|
594 | |||
592 | Test to show result of bookmarks comparison |
|
595 | Test to show result of bookmarks comparison | |
593 |
|
596 | |||
594 | $ mkdir bmcomparison |
|
597 | $ mkdir bmcomparison | |
595 | $ cd bmcomparison |
|
598 | $ cd bmcomparison | |
596 |
|
599 | |||
597 | $ hg init source |
|
600 | $ hg init source | |
598 | $ hg -R source debugbuilddag '+2*2*3*4' |
|
601 | $ hg -R source debugbuilddag '+2*2*3*4' | |
599 | $ hg -R source log -G --template '{rev}:{node|short}' |
|
602 | $ hg -R source log -G --template '{rev}:{node|short}' | |
600 | o 4:e7bd5218ca15 |
|
603 | o 4:e7bd5218ca15 | |
601 | | |
|
604 | | | |
602 | | o 3:6100d3090acf |
|
605 | | o 3:6100d3090acf | |
603 | |/ |
|
606 | |/ | |
604 | | o 2:fa942426a6fd |
|
607 | | o 2:fa942426a6fd | |
605 | |/ |
|
608 | |/ | |
606 | | o 1:66f7d451a68b |
|
609 | | o 1:66f7d451a68b | |
607 | |/ |
|
610 | |/ | |
608 | o 0:1ea73414a91b |
|
611 | o 0:1ea73414a91b | |
609 |
|
612 | |||
610 | $ hg -R source bookmarks -r 0 SAME |
|
613 | $ hg -R source bookmarks -r 0 SAME | |
611 | $ hg -R source bookmarks -r 0 ADV_ON_REPO1 |
|
614 | $ hg -R source bookmarks -r 0 ADV_ON_REPO1 | |
612 | $ hg -R source bookmarks -r 0 ADV_ON_REPO2 |
|
615 | $ hg -R source bookmarks -r 0 ADV_ON_REPO2 | |
613 | $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO1 |
|
616 | $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO1 | |
614 | $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO2 |
|
617 | $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO2 | |
615 | $ hg -R source bookmarks -r 1 DIVERGED |
|
618 | $ hg -R source bookmarks -r 1 DIVERGED | |
616 |
|
619 | |||
617 | $ hg clone -U source repo1 |
|
620 | $ hg clone -U source repo1 | |
618 |
|
621 | |||
619 | (test that incoming/outgoing exit with 1, if there is no bookmark to |
|
622 | (test that incoming/outgoing exit with 1, if there is no bookmark to | |
620 | be exchanged) |
|
623 | be exchanged) | |
621 |
|
624 | |||
622 | $ hg -R repo1 incoming -B |
|
625 | $ hg -R repo1 incoming -B | |
623 | comparing with $TESTTMP/bmcomparison/source (glob) |
|
626 | comparing with $TESTTMP/bmcomparison/source (glob) | |
624 | searching for changed bookmarks |
|
627 | searching for changed bookmarks | |
625 | no changed bookmarks found |
|
628 | no changed bookmarks found | |
626 | [1] |
|
629 | [1] | |
627 | $ hg -R repo1 outgoing -B |
|
630 | $ hg -R repo1 outgoing -B | |
628 | comparing with $TESTTMP/bmcomparison/source (glob) |
|
631 | comparing with $TESTTMP/bmcomparison/source (glob) | |
629 | searching for changed bookmarks |
|
632 | searching for changed bookmarks | |
630 | no changed bookmarks found |
|
633 | no changed bookmarks found | |
631 | [1] |
|
634 | [1] | |
632 |
|
635 | |||
633 | $ hg -R repo1 bookmarks -f -r 1 ADD_ON_REPO1 |
|
636 | $ hg -R repo1 bookmarks -f -r 1 ADD_ON_REPO1 | |
634 | $ hg -R repo1 bookmarks -f -r 2 ADV_ON_REPO1 |
|
637 | $ hg -R repo1 bookmarks -f -r 2 ADV_ON_REPO1 | |
635 | $ hg -R repo1 bookmarks -f -r 3 DIFF_ADV_ON_REPO1 |
|
638 | $ hg -R repo1 bookmarks -f -r 3 DIFF_ADV_ON_REPO1 | |
636 | $ hg -R repo1 bookmarks -f -r 3 DIFF_DIVERGED |
|
639 | $ hg -R repo1 bookmarks -f -r 3 DIFF_DIVERGED | |
637 | $ hg -R repo1 -q --config extensions.mq= strip 4 |
|
640 | $ hg -R repo1 -q --config extensions.mq= strip 4 | |
638 | $ hg -R repo1 log -G --template '{node|short} ({bookmarks})' |
|
641 | $ hg -R repo1 log -G --template '{node|short} ({bookmarks})' | |
639 | o 6100d3090acf (DIFF_ADV_ON_REPO1 DIFF_DIVERGED) |
|
642 | o 6100d3090acf (DIFF_ADV_ON_REPO1 DIFF_DIVERGED) | |
640 | | |
|
643 | | | |
641 | | o fa942426a6fd (ADV_ON_REPO1) |
|
644 | | o fa942426a6fd (ADV_ON_REPO1) | |
642 | |/ |
|
645 | |/ | |
643 | | o 66f7d451a68b (ADD_ON_REPO1 DIVERGED) |
|
646 | | o 66f7d451a68b (ADD_ON_REPO1 DIVERGED) | |
644 | |/ |
|
647 | |/ | |
645 | o 1ea73414a91b (ADV_ON_REPO2 DIFF_ADV_ON_REPO2 SAME) |
|
648 | o 1ea73414a91b (ADV_ON_REPO2 DIFF_ADV_ON_REPO2 SAME) | |
646 |
|
649 | |||
647 |
|
650 | |||
648 | $ hg clone -U source repo2 |
|
651 | $ hg clone -U source repo2 | |
649 | $ hg -R repo2 bookmarks -f -r 1 ADD_ON_REPO2 |
|
652 | $ hg -R repo2 bookmarks -f -r 1 ADD_ON_REPO2 | |
650 | $ hg -R repo2 bookmarks -f -r 1 ADV_ON_REPO2 |
|
653 | $ hg -R repo2 bookmarks -f -r 1 ADV_ON_REPO2 | |
651 | $ hg -R repo2 bookmarks -f -r 2 DIVERGED |
|
654 | $ hg -R repo2 bookmarks -f -r 2 DIVERGED | |
652 | $ hg -R repo2 bookmarks -f -r 4 DIFF_ADV_ON_REPO2 |
|
655 | $ hg -R repo2 bookmarks -f -r 4 DIFF_ADV_ON_REPO2 | |
653 | $ hg -R repo2 bookmarks -f -r 4 DIFF_DIVERGED |
|
656 | $ hg -R repo2 bookmarks -f -r 4 DIFF_DIVERGED | |
654 | $ hg -R repo2 -q --config extensions.mq= strip 3 |
|
657 | $ hg -R repo2 -q --config extensions.mq= strip 3 | |
655 | $ hg -R repo2 log -G --template '{node|short} ({bookmarks})' |
|
658 | $ hg -R repo2 log -G --template '{node|short} ({bookmarks})' | |
656 | o e7bd5218ca15 (DIFF_ADV_ON_REPO2 DIFF_DIVERGED) |
|
659 | o e7bd5218ca15 (DIFF_ADV_ON_REPO2 DIFF_DIVERGED) | |
657 | | |
|
660 | | | |
658 | | o fa942426a6fd (DIVERGED) |
|
661 | | o fa942426a6fd (DIVERGED) | |
659 | |/ |
|
662 | |/ | |
660 | | o 66f7d451a68b (ADD_ON_REPO2 ADV_ON_REPO2) |
|
663 | | o 66f7d451a68b (ADD_ON_REPO2 ADV_ON_REPO2) | |
661 | |/ |
|
664 | |/ | |
662 | o 1ea73414a91b (ADV_ON_REPO1 DIFF_ADV_ON_REPO1 SAME) |
|
665 | o 1ea73414a91b (ADV_ON_REPO1 DIFF_ADV_ON_REPO1 SAME) | |
663 |
|
666 | |||
664 |
|
667 | |||
665 | (test that difference of bookmarks between repositories are fully shown) |
|
668 | (test that difference of bookmarks between repositories are fully shown) | |
666 |
|
669 | |||
667 | $ hg -R repo1 incoming -B repo2 -v |
|
670 | $ hg -R repo1 incoming -B repo2 -v | |
668 | comparing with repo2 |
|
671 | comparing with repo2 | |
669 | searching for changed bookmarks |
|
672 | searching for changed bookmarks | |
670 | ADD_ON_REPO2 66f7d451a68b added |
|
673 | ADD_ON_REPO2 66f7d451a68b added | |
671 | ADV_ON_REPO2 66f7d451a68b advanced |
|
674 | ADV_ON_REPO2 66f7d451a68b advanced | |
672 | DIFF_ADV_ON_REPO2 e7bd5218ca15 changed |
|
675 | DIFF_ADV_ON_REPO2 e7bd5218ca15 changed | |
673 | DIFF_DIVERGED e7bd5218ca15 changed |
|
676 | DIFF_DIVERGED e7bd5218ca15 changed | |
674 | DIVERGED fa942426a6fd diverged |
|
677 | DIVERGED fa942426a6fd diverged | |
675 | $ hg -R repo1 outgoing -B repo2 -v |
|
678 | $ hg -R repo1 outgoing -B repo2 -v | |
676 | comparing with repo2 |
|
679 | comparing with repo2 | |
677 | searching for changed bookmarks |
|
680 | searching for changed bookmarks | |
678 | ADD_ON_REPO1 66f7d451a68b added |
|
681 | ADD_ON_REPO1 66f7d451a68b added | |
679 | ADD_ON_REPO2 deleted |
|
682 | ADD_ON_REPO2 deleted | |
680 | ADV_ON_REPO1 fa942426a6fd advanced |
|
683 | ADV_ON_REPO1 fa942426a6fd advanced | |
681 | DIFF_ADV_ON_REPO1 6100d3090acf advanced |
|
684 | DIFF_ADV_ON_REPO1 6100d3090acf advanced | |
682 | DIFF_ADV_ON_REPO2 1ea73414a91b changed |
|
685 | DIFF_ADV_ON_REPO2 1ea73414a91b changed | |
683 | DIFF_DIVERGED 6100d3090acf changed |
|
686 | DIFF_DIVERGED 6100d3090acf changed | |
684 | DIVERGED 66f7d451a68b diverged |
|
687 | DIVERGED 66f7d451a68b diverged | |
685 |
|
688 | |||
686 | $ hg -R repo2 incoming -B repo1 -v |
|
689 | $ hg -R repo2 incoming -B repo1 -v | |
687 | comparing with repo1 |
|
690 | comparing with repo1 | |
688 | searching for changed bookmarks |
|
691 | searching for changed bookmarks | |
689 | ADD_ON_REPO1 66f7d451a68b added |
|
692 | ADD_ON_REPO1 66f7d451a68b added | |
690 | ADV_ON_REPO1 fa942426a6fd advanced |
|
693 | ADV_ON_REPO1 fa942426a6fd advanced | |
691 | DIFF_ADV_ON_REPO1 6100d3090acf changed |
|
694 | DIFF_ADV_ON_REPO1 6100d3090acf changed | |
692 | DIFF_DIVERGED 6100d3090acf changed |
|
695 | DIFF_DIVERGED 6100d3090acf changed | |
693 | DIVERGED 66f7d451a68b diverged |
|
696 | DIVERGED 66f7d451a68b diverged | |
694 | $ hg -R repo2 outgoing -B repo1 -v |
|
697 | $ hg -R repo2 outgoing -B repo1 -v | |
695 | comparing with repo1 |
|
698 | comparing with repo1 | |
696 | searching for changed bookmarks |
|
699 | searching for changed bookmarks | |
697 | ADD_ON_REPO1 deleted |
|
700 | ADD_ON_REPO1 deleted | |
698 | ADD_ON_REPO2 66f7d451a68b added |
|
701 | ADD_ON_REPO2 66f7d451a68b added | |
699 | ADV_ON_REPO2 66f7d451a68b advanced |
|
702 | ADV_ON_REPO2 66f7d451a68b advanced | |
700 | DIFF_ADV_ON_REPO1 1ea73414a91b changed |
|
703 | DIFF_ADV_ON_REPO1 1ea73414a91b changed | |
701 | DIFF_ADV_ON_REPO2 e7bd5218ca15 advanced |
|
704 | DIFF_ADV_ON_REPO2 e7bd5218ca15 advanced | |
702 | DIFF_DIVERGED e7bd5218ca15 changed |
|
705 | DIFF_DIVERGED e7bd5218ca15 changed | |
703 | DIVERGED fa942426a6fd diverged |
|
706 | DIVERGED fa942426a6fd diverged | |
704 |
|
707 | |||
705 | $ cd .. |
|
708 | $ cd .. | |
706 |
|
709 | |||
707 | Pushing a bookmark should only push the changes required by that |
|
710 | Pushing a bookmark should only push the changes required by that | |
708 | bookmark, not all outgoing changes: |
|
711 | bookmark, not all outgoing changes: | |
709 | $ hg clone http://localhost:$HGPORT/ addmarks |
|
712 | $ hg clone http://localhost:$HGPORT/ addmarks | |
710 | requesting all changes |
|
713 | requesting all changes | |
711 | adding changesets |
|
714 | adding changesets | |
712 | adding manifests |
|
715 | adding manifests | |
713 | adding file changes |
|
716 | adding file changes | |
714 | added 5 changesets with 5 changes to 3 files (+2 heads) |
|
717 | added 5 changesets with 5 changes to 3 files (+2 heads) | |
715 | 2 new obsolescence markers |
|
718 | 2 new obsolescence markers | |
716 | new changesets 4e3505fd9583:c922c0139ca0 |
|
719 | new changesets 4e3505fd9583:c922c0139ca0 | |
717 | updating to bookmark @ |
|
720 | updating to bookmark @ | |
718 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
721 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
719 | $ cd addmarks |
|
722 | $ cd addmarks | |
720 | $ echo foo > foo |
|
723 | $ echo foo > foo | |
721 | $ hg add foo |
|
724 | $ hg add foo | |
722 | $ hg commit -m 'add foo' |
|
725 | $ hg commit -m 'add foo' | |
723 | $ echo bar > bar |
|
726 | $ echo bar > bar | |
724 | $ hg add bar |
|
727 | $ hg add bar | |
725 | $ hg commit -m 'add bar' |
|
728 | $ hg commit -m 'add bar' | |
726 | $ hg co "tip^" |
|
729 | $ hg co "tip^" | |
727 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
730 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
728 | (leaving bookmark @) |
|
731 | (leaving bookmark @) | |
729 | $ hg book add-foo |
|
732 | $ hg book add-foo | |
730 | $ hg book -r tip add-bar |
|
733 | $ hg book -r tip add-bar | |
731 | Note: this push *must* push only a single changeset, as that's the point |
|
734 | Note: this push *must* push only a single changeset, as that's the point | |
732 | of this test. |
|
735 | of this test. | |
733 | $ hg push -B add-foo --traceback |
|
736 | $ hg push -B add-foo --traceback | |
734 | pushing to http://localhost:$HGPORT/ |
|
737 | pushing to http://localhost:$HGPORT/ | |
735 | searching for changes |
|
738 | searching for changes | |
736 | remote: adding changesets |
|
739 | remote: adding changesets | |
737 | remote: adding manifests |
|
740 | remote: adding manifests | |
738 | remote: adding file changes |
|
741 | remote: adding file changes | |
739 | remote: added 1 changesets with 1 changes to 1 files |
|
742 | remote: added 1 changesets with 1 changes to 1 files | |
740 | exporting bookmark add-foo |
|
743 | exporting bookmark add-foo | |
741 |
|
744 | |||
742 | pushing a new bookmark on a new head does not require -f if -B is specified |
|
745 | pushing a new bookmark on a new head does not require -f if -B is specified | |
743 |
|
746 | |||
744 | $ hg up -q X |
|
747 | $ hg up -q X | |
745 | $ hg book W |
|
748 | $ hg book W | |
746 | $ echo c5 > f2 |
|
749 | $ echo c5 > f2 | |
747 | $ hg ci -Am5 |
|
750 | $ hg ci -Am5 | |
748 | created new head |
|
751 | created new head | |
749 | $ hg push -B . |
|
752 | $ hg push -B . | |
750 | pushing to http://localhost:$HGPORT/ |
|
753 | pushing to http://localhost:$HGPORT/ | |
751 | searching for changes |
|
754 | searching for changes | |
752 | remote: adding changesets |
|
755 | remote: adding changesets | |
753 | remote: adding manifests |
|
756 | remote: adding manifests | |
754 | remote: adding file changes |
|
757 | remote: adding file changes | |
755 | remote: added 1 changesets with 1 changes to 1 files (+1 heads) |
|
758 | remote: added 1 changesets with 1 changes to 1 files (+1 heads) | |
756 | exporting bookmark W |
|
759 | exporting bookmark W | |
757 | $ hg -R ../b id -r W |
|
760 | $ hg -R ../b id -r W | |
758 | cc978a373a53 tip W |
|
761 | cc978a373a53 tip W | |
759 |
|
762 | |||
760 | pushing an existing but divergent bookmark with -B still requires -f |
|
763 | pushing an existing but divergent bookmark with -B still requires -f | |
761 |
|
764 | |||
762 | $ hg clone -q . ../r |
|
765 | $ hg clone -q . ../r | |
763 | $ hg up -q X |
|
766 | $ hg up -q X | |
764 | $ echo 1 > f2 |
|
767 | $ echo 1 > f2 | |
765 | $ hg ci -qAml |
|
768 | $ hg ci -qAml | |
766 |
|
769 | |||
767 | $ cd ../r |
|
770 | $ cd ../r | |
768 | $ hg up -q X |
|
771 | $ hg up -q X | |
769 | $ echo 2 > f2 |
|
772 | $ echo 2 > f2 | |
770 | $ hg ci -qAmr |
|
773 | $ hg ci -qAmr | |
771 | $ hg push -B X |
|
774 | $ hg push -B X | |
772 | pushing to $TESTTMP/addmarks (glob) |
|
775 | pushing to $TESTTMP/addmarks (glob) | |
773 | searching for changes |
|
776 | searching for changes | |
774 | remote has heads on branch 'default' that are not known locally: a2a606d9ff1b |
|
777 | remote has heads on branch 'default' that are not known locally: a2a606d9ff1b | |
775 | abort: push creates new remote head 54694f811df9 with bookmark 'X'! |
|
778 | abort: push creates new remote head 54694f811df9 with bookmark 'X'! | |
776 | (pull and merge or see 'hg help push' for details about pushing new heads) |
|
779 | (pull and merge or see 'hg help push' for details about pushing new heads) | |
777 | [255] |
|
780 | [255] | |
778 | $ cd ../addmarks |
|
781 | $ cd ../addmarks | |
779 |
|
782 | |||
780 | Check summary output for incoming/outgoing bookmarks |
|
783 | Check summary output for incoming/outgoing bookmarks | |
781 |
|
784 | |||
782 | $ hg bookmarks -d X |
|
785 | $ hg bookmarks -d X | |
783 | $ hg bookmarks -d Y |
|
786 | $ hg bookmarks -d Y | |
784 | $ hg summary --remote | grep '^remote:' |
|
787 | $ hg summary --remote | grep '^remote:' | |
785 | remote: *, 2 incoming bookmarks, 1 outgoing bookmarks (glob) |
|
788 | remote: *, 2 incoming bookmarks, 1 outgoing bookmarks (glob) | |
786 |
|
789 | |||
787 | $ cd .. |
|
790 | $ cd .. | |
788 |
|
791 | |||
789 | pushing an unchanged bookmark should result in no changes |
|
792 | pushing an unchanged bookmark should result in no changes | |
790 |
|
793 | |||
791 | $ hg init unchanged-a |
|
794 | $ hg init unchanged-a | |
792 | $ hg init unchanged-b |
|
795 | $ hg init unchanged-b | |
793 | $ cd unchanged-a |
|
796 | $ cd unchanged-a | |
794 | $ echo initial > foo |
|
797 | $ echo initial > foo | |
795 | $ hg commit -A -m initial |
|
798 | $ hg commit -A -m initial | |
796 | adding foo |
|
799 | adding foo | |
797 | $ hg bookmark @ |
|
800 | $ hg bookmark @ | |
798 | $ hg push -B @ ../unchanged-b |
|
801 | $ hg push -B @ ../unchanged-b | |
799 | pushing to ../unchanged-b |
|
802 | pushing to ../unchanged-b | |
800 | searching for changes |
|
803 | searching for changes | |
801 | adding changesets |
|
804 | adding changesets | |
802 | adding manifests |
|
805 | adding manifests | |
803 | adding file changes |
|
806 | adding file changes | |
804 | added 1 changesets with 1 changes to 1 files |
|
807 | added 1 changesets with 1 changes to 1 files | |
805 | exporting bookmark @ |
|
808 | exporting bookmark @ | |
806 |
|
809 | |||
807 | $ hg push -B @ ../unchanged-b |
|
810 | $ hg push -B @ ../unchanged-b | |
808 | pushing to ../unchanged-b |
|
811 | pushing to ../unchanged-b | |
809 | searching for changes |
|
812 | searching for changes | |
810 | no changes found |
|
813 | no changes found | |
811 | [1] |
|
814 | [1] | |
812 |
|
815 | |||
813 |
|
816 | |||
814 | Check hook preventing push (issue4455) |
|
817 | Check hook preventing push (issue4455) | |
815 | ====================================== |
|
818 | ====================================== | |
816 |
|
819 | |||
817 | $ hg bookmarks |
|
820 | $ hg bookmarks | |
818 | * @ 0:55482a6fb4b1 |
|
821 | * @ 0:55482a6fb4b1 | |
819 | $ hg log -G |
|
822 | $ hg log -G | |
820 | @ 0:55482a6fb4b1 initial |
|
823 | @ 0:55482a6fb4b1 initial | |
821 |
|
824 | |||
822 | $ hg init ../issue4455-dest |
|
825 | $ hg init ../issue4455-dest | |
823 | $ hg push ../issue4455-dest # changesets only |
|
826 | $ hg push ../issue4455-dest # changesets only | |
824 | pushing to ../issue4455-dest |
|
827 | pushing to ../issue4455-dest | |
825 | searching for changes |
|
828 | searching for changes | |
826 | adding changesets |
|
829 | adding changesets | |
827 | adding manifests |
|
830 | adding manifests | |
828 | adding file changes |
|
831 | adding file changes | |
829 | added 1 changesets with 1 changes to 1 files |
|
832 | added 1 changesets with 1 changes to 1 files | |
830 | $ cat >> .hg/hgrc << EOF |
|
833 | $ cat >> .hg/hgrc << EOF | |
831 | > [paths] |
|
834 | > [paths] | |
832 | > local=../issue4455-dest/ |
|
835 | > local=../issue4455-dest/ | |
833 | > ssh=ssh://user@dummy/issue4455-dest |
|
836 | > ssh=ssh://user@dummy/issue4455-dest | |
834 | > http=http://localhost:$HGPORT/ |
|
837 | > http=http://localhost:$HGPORT/ | |
835 | > [ui] |
|
838 | > [ui] | |
836 | > ssh=$PYTHON "$TESTDIR/dummyssh" |
|
839 | > ssh=$PYTHON "$TESTDIR/dummyssh" | |
837 | > EOF |
|
840 | > EOF | |
838 | $ cat >> ../issue4455-dest/.hg/hgrc << EOF |
|
841 | $ cat >> ../issue4455-dest/.hg/hgrc << EOF | |
839 | > [hooks] |
|
842 | > [hooks] | |
840 | > prepushkey=false |
|
843 | > prepushkey=false | |
841 | > [web] |
|
844 | > [web] | |
842 | > push_ssl = false |
|
845 | > push_ssl = false | |
843 | > allow_push = * |
|
846 | > allow_push = * | |
844 | > EOF |
|
847 | > EOF | |
845 | $ killdaemons.py |
|
848 | $ killdaemons.py | |
846 | $ hg serve -R ../issue4455-dest -p $HGPORT -d --pid-file=../issue4455.pid -E ../issue4455-error.log |
|
849 | $ hg serve -R ../issue4455-dest -p $HGPORT -d --pid-file=../issue4455.pid -E ../issue4455-error.log | |
847 | $ cat ../issue4455.pid >> $DAEMON_PIDS |
|
850 | $ cat ../issue4455.pid >> $DAEMON_PIDS | |
848 |
|
851 | |||
849 | Local push |
|
852 | Local push | |
850 | ---------- |
|
853 | ---------- | |
851 |
|
854 | |||
852 | $ hg push -B @ local |
|
855 | $ hg push -B @ local | |
853 | pushing to $TESTTMP/issue4455-dest (glob) |
|
856 | pushing to $TESTTMP/issue4455-dest (glob) | |
854 | searching for changes |
|
857 | searching for changes | |
855 | no changes found |
|
858 | no changes found | |
856 | pushkey-abort: prepushkey hook exited with status 1 |
|
859 | pushkey-abort: prepushkey hook exited with status 1 | |
857 | abort: exporting bookmark @ failed! |
|
860 | abort: exporting bookmark @ failed! | |
858 | [255] |
|
861 | [255] | |
859 | $ hg -R ../issue4455-dest/ bookmarks |
|
862 | $ hg -R ../issue4455-dest/ bookmarks | |
860 | no bookmarks set |
|
863 | no bookmarks set | |
861 |
|
864 | |||
862 | Using ssh |
|
865 | Using ssh | |
863 | --------- |
|
866 | --------- | |
864 |
|
867 | |||
865 | $ hg push -B @ ssh # bundle2+ |
|
868 | $ hg push -B @ ssh # bundle2+ | |
866 | pushing to ssh://user@dummy/issue4455-dest |
|
869 | pushing to ssh://user@dummy/issue4455-dest | |
867 | searching for changes |
|
870 | searching for changes | |
868 | no changes found |
|
871 | no changes found | |
869 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
872 | remote: pushkey-abort: prepushkey hook exited with status 1 | |
870 | abort: exporting bookmark @ failed! |
|
873 | abort: exporting bookmark @ failed! | |
871 | [255] |
|
874 | [255] | |
872 | $ hg -R ../issue4455-dest/ bookmarks |
|
875 | $ hg -R ../issue4455-dest/ bookmarks | |
873 | no bookmarks set |
|
876 | no bookmarks set | |
874 |
|
877 | |||
875 | $ hg push -B @ ssh --config devel.legacy.exchange=bundle1 |
|
878 | $ hg push -B @ ssh --config devel.legacy.exchange=bundle1 | |
876 | pushing to ssh://user@dummy/issue4455-dest |
|
879 | pushing to ssh://user@dummy/issue4455-dest | |
877 | searching for changes |
|
880 | searching for changes | |
878 | no changes found |
|
881 | no changes found | |
879 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
882 | remote: pushkey-abort: prepushkey hook exited with status 1 | |
880 | exporting bookmark @ failed! |
|
883 | exporting bookmark @ failed! | |
881 | [1] |
|
884 | [1] | |
882 | $ hg -R ../issue4455-dest/ bookmarks |
|
885 | $ hg -R ../issue4455-dest/ bookmarks | |
883 | no bookmarks set |
|
886 | no bookmarks set | |
884 |
|
887 | |||
885 | Using http |
|
888 | Using http | |
886 | ---------- |
|
889 | ---------- | |
887 |
|
890 | |||
888 | $ hg push -B @ http # bundle2+ |
|
891 | $ hg push -B @ http # bundle2+ | |
889 | pushing to http://localhost:$HGPORT/ |
|
892 | pushing to http://localhost:$HGPORT/ | |
890 | searching for changes |
|
893 | searching for changes | |
891 | no changes found |
|
894 | no changes found | |
892 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
895 | remote: pushkey-abort: prepushkey hook exited with status 1 | |
893 | abort: exporting bookmark @ failed! |
|
896 | abort: exporting bookmark @ failed! | |
894 | [255] |
|
897 | [255] | |
895 | $ hg -R ../issue4455-dest/ bookmarks |
|
898 | $ hg -R ../issue4455-dest/ bookmarks | |
896 | no bookmarks set |
|
899 | no bookmarks set | |
897 |
|
900 | |||
898 | $ hg push -B @ http --config devel.legacy.exchange=bundle1 |
|
901 | $ hg push -B @ http --config devel.legacy.exchange=bundle1 | |
899 | pushing to http://localhost:$HGPORT/ |
|
902 | pushing to http://localhost:$HGPORT/ | |
900 | searching for changes |
|
903 | searching for changes | |
901 | no changes found |
|
904 | no changes found | |
902 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
905 | remote: pushkey-abort: prepushkey hook exited with status 1 | |
903 | exporting bookmark @ failed! |
|
906 | exporting bookmark @ failed! | |
904 | [1] |
|
907 | [1] | |
905 | $ hg -R ../issue4455-dest/ bookmarks |
|
908 | $ hg -R ../issue4455-dest/ bookmarks | |
906 | no bookmarks set |
|
909 | no bookmarks set |
@@ -1,1161 +1,1164 b'' | |||||
1 |
|
1 | |||
2 | $ hg init repo |
|
2 | $ hg init repo | |
3 | $ cd repo |
|
3 | $ cd repo | |
4 |
|
4 | |||
5 | $ TESTHOOK='hooks.txnclose-bookmark.test=echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE"' |
|
5 | $ cat > $TESTTMP/hook.sh <<'EOF' | |
|
6 | > echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE" | |||
|
7 | > EOF | |||
|
8 | $ TESTHOOK="hooks.txnclose-bookmark.test=sh $TESTTMP/hook.sh" | |||
6 |
|
9 | |||
7 | no bookmarks |
|
10 | no bookmarks | |
8 |
|
11 | |||
9 | $ hg bookmarks |
|
12 | $ hg bookmarks | |
10 | no bookmarks set |
|
13 | no bookmarks set | |
11 |
|
14 | |||
12 | $ hg bookmarks -Tjson |
|
15 | $ hg bookmarks -Tjson | |
13 | [ |
|
16 | [ | |
14 | ] |
|
17 | ] | |
15 |
|
18 | |||
16 | bookmark rev -1 |
|
19 | bookmark rev -1 | |
17 |
|
20 | |||
18 | $ hg bookmark X --config "$TESTHOOK" |
|
21 | $ hg bookmark X --config "$TESTHOOK" | |
19 | test-hook-bookmark: X: -> 0000000000000000000000000000000000000000 |
|
22 | test-hook-bookmark: X: -> 0000000000000000000000000000000000000000 | |
20 |
|
23 | |||
21 | list bookmarks |
|
24 | list bookmarks | |
22 |
|
25 | |||
23 | $ hg bookmarks |
|
26 | $ hg bookmarks | |
24 | * X -1:000000000000 |
|
27 | * X -1:000000000000 | |
25 |
|
28 | |||
26 | list bookmarks with color |
|
29 | list bookmarks with color | |
27 |
|
30 | |||
28 | $ hg --config extensions.color= --config color.mode=ansi \ |
|
31 | $ hg --config extensions.color= --config color.mode=ansi \ | |
29 | > bookmarks --color=always |
|
32 | > bookmarks --color=always | |
30 | \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc) |
|
33 | \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc) | |
31 |
|
34 | |||
32 | $ echo a > a |
|
35 | $ echo a > a | |
33 | $ hg add a |
|
36 | $ hg add a | |
34 | $ hg commit -m 0 --config "$TESTHOOK" |
|
37 | $ hg commit -m 0 --config "$TESTHOOK" | |
35 | test-hook-bookmark: X: 0000000000000000000000000000000000000000 -> f7b1eb17ad24730a1651fccd46c43826d1bbc2ac |
|
38 | test-hook-bookmark: X: 0000000000000000000000000000000000000000 -> f7b1eb17ad24730a1651fccd46c43826d1bbc2ac | |
36 |
|
39 | |||
37 | bookmark X moved to rev 0 |
|
40 | bookmark X moved to rev 0 | |
38 |
|
41 | |||
39 | $ hg bookmarks |
|
42 | $ hg bookmarks | |
40 | * X 0:f7b1eb17ad24 |
|
43 | * X 0:f7b1eb17ad24 | |
41 |
|
44 | |||
42 | look up bookmark |
|
45 | look up bookmark | |
43 |
|
46 | |||
44 | $ hg log -r X |
|
47 | $ hg log -r X | |
45 | changeset: 0:f7b1eb17ad24 |
|
48 | changeset: 0:f7b1eb17ad24 | |
46 | bookmark: X |
|
49 | bookmark: X | |
47 | tag: tip |
|
50 | tag: tip | |
48 | user: test |
|
51 | user: test | |
49 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
52 | date: Thu Jan 01 00:00:00 1970 +0000 | |
50 | summary: 0 |
|
53 | summary: 0 | |
51 |
|
54 | |||
52 |
|
55 | |||
53 | second bookmark for rev 0, command should work even with ui.strict on |
|
56 | second bookmark for rev 0, command should work even with ui.strict on | |
54 |
|
57 | |||
55 | $ hg --config ui.strict=1 bookmark X2 --config "$TESTHOOK" |
|
58 | $ hg --config ui.strict=1 bookmark X2 --config "$TESTHOOK" | |
56 | test-hook-bookmark: X2: -> f7b1eb17ad24730a1651fccd46c43826d1bbc2ac |
|
59 | test-hook-bookmark: X2: -> f7b1eb17ad24730a1651fccd46c43826d1bbc2ac | |
57 |
|
60 | |||
58 | bookmark rev -1 again |
|
61 | bookmark rev -1 again | |
59 |
|
62 | |||
60 | $ hg bookmark -r null Y |
|
63 | $ hg bookmark -r null Y | |
61 |
|
64 | |||
62 | list bookmarks |
|
65 | list bookmarks | |
63 |
|
66 | |||
64 | $ hg bookmarks |
|
67 | $ hg bookmarks | |
65 | X 0:f7b1eb17ad24 |
|
68 | X 0:f7b1eb17ad24 | |
66 | * X2 0:f7b1eb17ad24 |
|
69 | * X2 0:f7b1eb17ad24 | |
67 | Y -1:000000000000 |
|
70 | Y -1:000000000000 | |
68 |
|
71 | |||
69 | $ echo b > b |
|
72 | $ echo b > b | |
70 | $ hg add b |
|
73 | $ hg add b | |
71 | $ hg commit -m 1 --config "$TESTHOOK" |
|
74 | $ hg commit -m 1 --config "$TESTHOOK" | |
72 | test-hook-bookmark: X2: f7b1eb17ad24730a1651fccd46c43826d1bbc2ac -> 925d80f479bb026b0fb3deb27503780b13f74123 |
|
75 | test-hook-bookmark: X2: f7b1eb17ad24730a1651fccd46c43826d1bbc2ac -> 925d80f479bb026b0fb3deb27503780b13f74123 | |
73 |
|
76 | |||
74 | $ hg bookmarks -Tjson |
|
77 | $ hg bookmarks -Tjson | |
75 | [ |
|
78 | [ | |
76 | { |
|
79 | { | |
77 | "active": false, |
|
80 | "active": false, | |
78 | "bookmark": "X", |
|
81 | "bookmark": "X", | |
79 | "node": "f7b1eb17ad24730a1651fccd46c43826d1bbc2ac", |
|
82 | "node": "f7b1eb17ad24730a1651fccd46c43826d1bbc2ac", | |
80 | "rev": 0 |
|
83 | "rev": 0 | |
81 | }, |
|
84 | }, | |
82 | { |
|
85 | { | |
83 | "active": true, |
|
86 | "active": true, | |
84 | "bookmark": "X2", |
|
87 | "bookmark": "X2", | |
85 | "node": "925d80f479bb026b0fb3deb27503780b13f74123", |
|
88 | "node": "925d80f479bb026b0fb3deb27503780b13f74123", | |
86 | "rev": 1 |
|
89 | "rev": 1 | |
87 | }, |
|
90 | }, | |
88 | { |
|
91 | { | |
89 | "active": false, |
|
92 | "active": false, | |
90 | "bookmark": "Y", |
|
93 | "bookmark": "Y", | |
91 | "node": "0000000000000000000000000000000000000000", |
|
94 | "node": "0000000000000000000000000000000000000000", | |
92 | "rev": -1 |
|
95 | "rev": -1 | |
93 | } |
|
96 | } | |
94 | ] |
|
97 | ] | |
95 |
|
98 | |||
96 | bookmarks revset |
|
99 | bookmarks revset | |
97 |
|
100 | |||
98 | $ hg log -r 'bookmark()' |
|
101 | $ hg log -r 'bookmark()' | |
99 | changeset: 0:f7b1eb17ad24 |
|
102 | changeset: 0:f7b1eb17ad24 | |
100 | bookmark: X |
|
103 | bookmark: X | |
101 | user: test |
|
104 | user: test | |
102 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
105 | date: Thu Jan 01 00:00:00 1970 +0000 | |
103 | summary: 0 |
|
106 | summary: 0 | |
104 |
|
107 | |||
105 | changeset: 1:925d80f479bb |
|
108 | changeset: 1:925d80f479bb | |
106 | bookmark: X2 |
|
109 | bookmark: X2 | |
107 | tag: tip |
|
110 | tag: tip | |
108 | user: test |
|
111 | user: test | |
109 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
112 | date: Thu Jan 01 00:00:00 1970 +0000 | |
110 | summary: 1 |
|
113 | summary: 1 | |
111 |
|
114 | |||
112 | $ hg log -r 'bookmark(Y)' |
|
115 | $ hg log -r 'bookmark(Y)' | |
113 | $ hg log -r 'bookmark(X2)' |
|
116 | $ hg log -r 'bookmark(X2)' | |
114 | changeset: 1:925d80f479bb |
|
117 | changeset: 1:925d80f479bb | |
115 | bookmark: X2 |
|
118 | bookmark: X2 | |
116 | tag: tip |
|
119 | tag: tip | |
117 | user: test |
|
120 | user: test | |
118 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
121 | date: Thu Jan 01 00:00:00 1970 +0000 | |
119 | summary: 1 |
|
122 | summary: 1 | |
120 |
|
123 | |||
121 | $ hg log -r 'bookmark("re:X")' |
|
124 | $ hg log -r 'bookmark("re:X")' | |
122 | changeset: 0:f7b1eb17ad24 |
|
125 | changeset: 0:f7b1eb17ad24 | |
123 | bookmark: X |
|
126 | bookmark: X | |
124 | user: test |
|
127 | user: test | |
125 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
128 | date: Thu Jan 01 00:00:00 1970 +0000 | |
126 | summary: 0 |
|
129 | summary: 0 | |
127 |
|
130 | |||
128 | changeset: 1:925d80f479bb |
|
131 | changeset: 1:925d80f479bb | |
129 | bookmark: X2 |
|
132 | bookmark: X2 | |
130 | tag: tip |
|
133 | tag: tip | |
131 | user: test |
|
134 | user: test | |
132 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
135 | date: Thu Jan 01 00:00:00 1970 +0000 | |
133 | summary: 1 |
|
136 | summary: 1 | |
134 |
|
137 | |||
135 | $ hg log -r 'bookmark("literal:X")' |
|
138 | $ hg log -r 'bookmark("literal:X")' | |
136 | changeset: 0:f7b1eb17ad24 |
|
139 | changeset: 0:f7b1eb17ad24 | |
137 | bookmark: X |
|
140 | bookmark: X | |
138 | user: test |
|
141 | user: test | |
139 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
142 | date: Thu Jan 01 00:00:00 1970 +0000 | |
140 | summary: 0 |
|
143 | summary: 0 | |
141 |
|
144 | |||
142 |
|
145 | |||
143 | $ hg log -r 'bookmark(unknown)' |
|
146 | $ hg log -r 'bookmark(unknown)' | |
144 | abort: bookmark 'unknown' does not exist! |
|
147 | abort: bookmark 'unknown' does not exist! | |
145 | [255] |
|
148 | [255] | |
146 | $ hg log -r 'bookmark("literal:unknown")' |
|
149 | $ hg log -r 'bookmark("literal:unknown")' | |
147 | abort: bookmark 'unknown' does not exist! |
|
150 | abort: bookmark 'unknown' does not exist! | |
148 | [255] |
|
151 | [255] | |
149 | $ hg log -r 'bookmark("re:unknown")' |
|
152 | $ hg log -r 'bookmark("re:unknown")' | |
150 | abort: no bookmarks exist that match 'unknown'! |
|
153 | abort: no bookmarks exist that match 'unknown'! | |
151 | [255] |
|
154 | [255] | |
152 | $ hg log -r 'present(bookmark("literal:unknown"))' |
|
155 | $ hg log -r 'present(bookmark("literal:unknown"))' | |
153 | $ hg log -r 'present(bookmark("re:unknown"))' |
|
156 | $ hg log -r 'present(bookmark("re:unknown"))' | |
154 |
|
157 | |||
155 | $ hg help revsets | grep 'bookmark(' |
|
158 | $ hg help revsets | grep 'bookmark(' | |
156 | "bookmark([name])" |
|
159 | "bookmark([name])" | |
157 |
|
160 | |||
158 | bookmarks X and X2 moved to rev 1, Y at rev -1 |
|
161 | bookmarks X and X2 moved to rev 1, Y at rev -1 | |
159 |
|
162 | |||
160 | $ hg bookmarks |
|
163 | $ hg bookmarks | |
161 | X 0:f7b1eb17ad24 |
|
164 | X 0:f7b1eb17ad24 | |
162 | * X2 1:925d80f479bb |
|
165 | * X2 1:925d80f479bb | |
163 | Y -1:000000000000 |
|
166 | Y -1:000000000000 | |
164 |
|
167 | |||
165 | bookmark rev 0 again |
|
168 | bookmark rev 0 again | |
166 |
|
169 | |||
167 | $ hg bookmark -r 0 Z |
|
170 | $ hg bookmark -r 0 Z | |
168 |
|
171 | |||
169 | $ hg update X |
|
172 | $ hg update X | |
170 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
173 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
171 | (activating bookmark X) |
|
174 | (activating bookmark X) | |
172 | $ echo c > c |
|
175 | $ echo c > c | |
173 | $ hg add c |
|
176 | $ hg add c | |
174 | $ hg commit -m 2 |
|
177 | $ hg commit -m 2 | |
175 | created new head |
|
178 | created new head | |
176 |
|
179 | |||
177 | bookmarks X moved to rev 2, Y at rev -1, Z at rev 0 |
|
180 | bookmarks X moved to rev 2, Y at rev -1, Z at rev 0 | |
178 |
|
181 | |||
179 | $ hg bookmarks |
|
182 | $ hg bookmarks | |
180 | * X 2:db815d6d32e6 |
|
183 | * X 2:db815d6d32e6 | |
181 | X2 1:925d80f479bb |
|
184 | X2 1:925d80f479bb | |
182 | Y -1:000000000000 |
|
185 | Y -1:000000000000 | |
183 | Z 0:f7b1eb17ad24 |
|
186 | Z 0:f7b1eb17ad24 | |
184 |
|
187 | |||
185 | rename nonexistent bookmark |
|
188 | rename nonexistent bookmark | |
186 |
|
189 | |||
187 | $ hg bookmark -m A B |
|
190 | $ hg bookmark -m A B | |
188 | abort: bookmark 'A' does not exist |
|
191 | abort: bookmark 'A' does not exist | |
189 | [255] |
|
192 | [255] | |
190 |
|
193 | |||
191 | rename to existent bookmark |
|
194 | rename to existent bookmark | |
192 |
|
195 | |||
193 | $ hg bookmark -m X Y |
|
196 | $ hg bookmark -m X Y | |
194 | abort: bookmark 'Y' already exists (use -f to force) |
|
197 | abort: bookmark 'Y' already exists (use -f to force) | |
195 | [255] |
|
198 | [255] | |
196 |
|
199 | |||
197 | force rename to existent bookmark |
|
200 | force rename to existent bookmark | |
198 |
|
201 | |||
199 | $ hg bookmark -f -m X Y |
|
202 | $ hg bookmark -f -m X Y | |
200 |
|
203 | |||
201 | rename bookmark using . |
|
204 | rename bookmark using . | |
202 |
|
205 | |||
203 | $ hg book rename-me |
|
206 | $ hg book rename-me | |
204 | $ hg book -m . renamed --config "$TESTHOOK" |
|
207 | $ hg book -m . renamed --config "$TESTHOOK" | |
205 | test-hook-bookmark: rename-me: db815d6d32e69058eadefc8cffbad37675707975 -> |
|
208 | test-hook-bookmark: rename-me: db815d6d32e69058eadefc8cffbad37675707975 -> | |
206 | test-hook-bookmark: renamed: -> db815d6d32e69058eadefc8cffbad37675707975 |
|
209 | test-hook-bookmark: renamed: -> db815d6d32e69058eadefc8cffbad37675707975 | |
207 | $ hg bookmark |
|
210 | $ hg bookmark | |
208 | X2 1:925d80f479bb |
|
211 | X2 1:925d80f479bb | |
209 | Y 2:db815d6d32e6 |
|
212 | Y 2:db815d6d32e6 | |
210 | Z 0:f7b1eb17ad24 |
|
213 | Z 0:f7b1eb17ad24 | |
211 | * renamed 2:db815d6d32e6 |
|
214 | * renamed 2:db815d6d32e6 | |
212 | $ hg up -q Y |
|
215 | $ hg up -q Y | |
213 | $ hg book -d renamed --config "$TESTHOOK" |
|
216 | $ hg book -d renamed --config "$TESTHOOK" | |
214 | test-hook-bookmark: renamed: db815d6d32e69058eadefc8cffbad37675707975 -> |
|
217 | test-hook-bookmark: renamed: db815d6d32e69058eadefc8cffbad37675707975 -> | |
215 |
|
218 | |||
216 | rename bookmark using . with no active bookmark |
|
219 | rename bookmark using . with no active bookmark | |
217 |
|
220 | |||
218 | $ hg book rename-me |
|
221 | $ hg book rename-me | |
219 | $ hg book -i rename-me |
|
222 | $ hg book -i rename-me | |
220 | $ hg book -m . renamed |
|
223 | $ hg book -m . renamed | |
221 | abort: no active bookmark |
|
224 | abort: no active bookmark | |
222 | [255] |
|
225 | [255] | |
223 | $ hg up -q Y |
|
226 | $ hg up -q Y | |
224 | $ hg book -d rename-me |
|
227 | $ hg book -d rename-me | |
225 |
|
228 | |||
226 | delete bookmark using . |
|
229 | delete bookmark using . | |
227 |
|
230 | |||
228 | $ hg book delete-me |
|
231 | $ hg book delete-me | |
229 | $ hg book -d . |
|
232 | $ hg book -d . | |
230 | $ hg bookmark |
|
233 | $ hg bookmark | |
231 | X2 1:925d80f479bb |
|
234 | X2 1:925d80f479bb | |
232 | Y 2:db815d6d32e6 |
|
235 | Y 2:db815d6d32e6 | |
233 | Z 0:f7b1eb17ad24 |
|
236 | Z 0:f7b1eb17ad24 | |
234 | $ hg up -q Y |
|
237 | $ hg up -q Y | |
235 |
|
238 | |||
236 | delete bookmark using . with no active bookmark |
|
239 | delete bookmark using . with no active bookmark | |
237 |
|
240 | |||
238 | $ hg book delete-me |
|
241 | $ hg book delete-me | |
239 | $ hg book -i delete-me |
|
242 | $ hg book -i delete-me | |
240 | $ hg book -d . |
|
243 | $ hg book -d . | |
241 | abort: no active bookmark |
|
244 | abort: no active bookmark | |
242 | [255] |
|
245 | [255] | |
243 | $ hg up -q Y |
|
246 | $ hg up -q Y | |
244 | $ hg book -d delete-me |
|
247 | $ hg book -d delete-me | |
245 |
|
248 | |||
246 | list bookmarks |
|
249 | list bookmarks | |
247 |
|
250 | |||
248 | $ hg bookmark |
|
251 | $ hg bookmark | |
249 | X2 1:925d80f479bb |
|
252 | X2 1:925d80f479bb | |
250 | * Y 2:db815d6d32e6 |
|
253 | * Y 2:db815d6d32e6 | |
251 | Z 0:f7b1eb17ad24 |
|
254 | Z 0:f7b1eb17ad24 | |
252 |
|
255 | |||
253 | bookmarks from a revset |
|
256 | bookmarks from a revset | |
254 | $ hg bookmark -r '.^1' REVSET |
|
257 | $ hg bookmark -r '.^1' REVSET | |
255 | $ hg bookmark -r ':tip' TIP |
|
258 | $ hg bookmark -r ':tip' TIP | |
256 | $ hg up -q TIP |
|
259 | $ hg up -q TIP | |
257 | $ hg bookmarks |
|
260 | $ hg bookmarks | |
258 | REVSET 0:f7b1eb17ad24 |
|
261 | REVSET 0:f7b1eb17ad24 | |
259 | * TIP 2:db815d6d32e6 |
|
262 | * TIP 2:db815d6d32e6 | |
260 | X2 1:925d80f479bb |
|
263 | X2 1:925d80f479bb | |
261 | Y 2:db815d6d32e6 |
|
264 | Y 2:db815d6d32e6 | |
262 | Z 0:f7b1eb17ad24 |
|
265 | Z 0:f7b1eb17ad24 | |
263 |
|
266 | |||
264 | $ hg bookmark -d REVSET |
|
267 | $ hg bookmark -d REVSET | |
265 | $ hg bookmark -d TIP |
|
268 | $ hg bookmark -d TIP | |
266 |
|
269 | |||
267 | rename without new name or multiple names |
|
270 | rename without new name or multiple names | |
268 |
|
271 | |||
269 | $ hg bookmark -m Y |
|
272 | $ hg bookmark -m Y | |
270 | abort: new bookmark name required |
|
273 | abort: new bookmark name required | |
271 | [255] |
|
274 | [255] | |
272 | $ hg bookmark -m Y Y2 Y3 |
|
275 | $ hg bookmark -m Y Y2 Y3 | |
273 | abort: only one new bookmark name allowed |
|
276 | abort: only one new bookmark name allowed | |
274 | [255] |
|
277 | [255] | |
275 |
|
278 | |||
276 | delete without name |
|
279 | delete without name | |
277 |
|
280 | |||
278 | $ hg bookmark -d |
|
281 | $ hg bookmark -d | |
279 | abort: bookmark name required |
|
282 | abort: bookmark name required | |
280 | [255] |
|
283 | [255] | |
281 |
|
284 | |||
282 | delete nonexistent bookmark |
|
285 | delete nonexistent bookmark | |
283 |
|
286 | |||
284 | $ hg bookmark -d A |
|
287 | $ hg bookmark -d A | |
285 | abort: bookmark 'A' does not exist |
|
288 | abort: bookmark 'A' does not exist | |
286 | [255] |
|
289 | [255] | |
287 |
|
290 | |||
288 | bookmark name with spaces should be stripped |
|
291 | bookmark name with spaces should be stripped | |
289 |
|
292 | |||
290 | $ hg bookmark ' x y ' |
|
293 | $ hg bookmark ' x y ' | |
291 |
|
294 | |||
292 | list bookmarks |
|
295 | list bookmarks | |
293 |
|
296 | |||
294 | $ hg bookmarks |
|
297 | $ hg bookmarks | |
295 | X2 1:925d80f479bb |
|
298 | X2 1:925d80f479bb | |
296 | Y 2:db815d6d32e6 |
|
299 | Y 2:db815d6d32e6 | |
297 | Z 0:f7b1eb17ad24 |
|
300 | Z 0:f7b1eb17ad24 | |
298 | * x y 2:db815d6d32e6 |
|
301 | * x y 2:db815d6d32e6 | |
299 |
|
302 | |||
300 | look up stripped bookmark name |
|
303 | look up stripped bookmark name | |
301 |
|
304 | |||
302 | $ hg log -r '"x y"' |
|
305 | $ hg log -r '"x y"' | |
303 | changeset: 2:db815d6d32e6 |
|
306 | changeset: 2:db815d6d32e6 | |
304 | bookmark: Y |
|
307 | bookmark: Y | |
305 | bookmark: x y |
|
308 | bookmark: x y | |
306 | tag: tip |
|
309 | tag: tip | |
307 | parent: 0:f7b1eb17ad24 |
|
310 | parent: 0:f7b1eb17ad24 | |
308 | user: test |
|
311 | user: test | |
309 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
312 | date: Thu Jan 01 00:00:00 1970 +0000 | |
310 | summary: 2 |
|
313 | summary: 2 | |
311 |
|
314 | |||
312 |
|
315 | |||
313 | reject bookmark name with newline |
|
316 | reject bookmark name with newline | |
314 |
|
317 | |||
315 | $ hg bookmark ' |
|
318 | $ hg bookmark ' | |
316 | > ' |
|
319 | > ' | |
317 | abort: bookmark names cannot consist entirely of whitespace |
|
320 | abort: bookmark names cannot consist entirely of whitespace | |
318 | [255] |
|
321 | [255] | |
319 |
|
322 | |||
320 | $ hg bookmark -m Z ' |
|
323 | $ hg bookmark -m Z ' | |
321 | > ' |
|
324 | > ' | |
322 | abort: bookmark names cannot consist entirely of whitespace |
|
325 | abort: bookmark names cannot consist entirely of whitespace | |
323 | [255] |
|
326 | [255] | |
324 |
|
327 | |||
325 | bookmark with reserved name |
|
328 | bookmark with reserved name | |
326 |
|
329 | |||
327 | $ hg bookmark tip |
|
330 | $ hg bookmark tip | |
328 | abort: the name 'tip' is reserved |
|
331 | abort: the name 'tip' is reserved | |
329 | [255] |
|
332 | [255] | |
330 |
|
333 | |||
331 | $ hg bookmark . |
|
334 | $ hg bookmark . | |
332 | abort: the name '.' is reserved |
|
335 | abort: the name '.' is reserved | |
333 | [255] |
|
336 | [255] | |
334 |
|
337 | |||
335 | $ hg bookmark null |
|
338 | $ hg bookmark null | |
336 | abort: the name 'null' is reserved |
|
339 | abort: the name 'null' is reserved | |
337 | [255] |
|
340 | [255] | |
338 |
|
341 | |||
339 |
|
342 | |||
340 | bookmark with existing name |
|
343 | bookmark with existing name | |
341 |
|
344 | |||
342 | $ hg bookmark X2 |
|
345 | $ hg bookmark X2 | |
343 | abort: bookmark 'X2' already exists (use -f to force) |
|
346 | abort: bookmark 'X2' already exists (use -f to force) | |
344 | [255] |
|
347 | [255] | |
345 |
|
348 | |||
346 | $ hg bookmark -m Y Z |
|
349 | $ hg bookmark -m Y Z | |
347 | abort: bookmark 'Z' already exists (use -f to force) |
|
350 | abort: bookmark 'Z' already exists (use -f to force) | |
348 | [255] |
|
351 | [255] | |
349 |
|
352 | |||
350 | bookmark with name of branch |
|
353 | bookmark with name of branch | |
351 |
|
354 | |||
352 | $ hg bookmark default |
|
355 | $ hg bookmark default | |
353 | abort: a bookmark cannot have the name of an existing branch |
|
356 | abort: a bookmark cannot have the name of an existing branch | |
354 | [255] |
|
357 | [255] | |
355 |
|
358 | |||
356 | $ hg bookmark -m Y default |
|
359 | $ hg bookmark -m Y default | |
357 | abort: a bookmark cannot have the name of an existing branch |
|
360 | abort: a bookmark cannot have the name of an existing branch | |
358 | [255] |
|
361 | [255] | |
359 |
|
362 | |||
360 | bookmark with integer name |
|
363 | bookmark with integer name | |
361 |
|
364 | |||
362 | $ hg bookmark 10 |
|
365 | $ hg bookmark 10 | |
363 | abort: cannot use an integer as a name |
|
366 | abort: cannot use an integer as a name | |
364 | [255] |
|
367 | [255] | |
365 |
|
368 | |||
366 | bookmark with a name that matches a node id |
|
369 | bookmark with a name that matches a node id | |
367 | $ hg bookmark 925d80f479bb db815d6d32e6 --config "$TESTHOOK" |
|
370 | $ hg bookmark 925d80f479bb db815d6d32e6 --config "$TESTHOOK" | |
368 | bookmark 925d80f479bb matches a changeset hash |
|
371 | bookmark 925d80f479bb matches a changeset hash | |
369 | (did you leave a -r out of an 'hg bookmark' command?) |
|
372 | (did you leave a -r out of an 'hg bookmark' command?) | |
370 | bookmark db815d6d32e6 matches a changeset hash |
|
373 | bookmark db815d6d32e6 matches a changeset hash | |
371 | (did you leave a -r out of an 'hg bookmark' command?) |
|
374 | (did you leave a -r out of an 'hg bookmark' command?) | |
372 | test-hook-bookmark: 925d80f479bb: -> db815d6d32e69058eadefc8cffbad37675707975 |
|
375 | test-hook-bookmark: 925d80f479bb: -> db815d6d32e69058eadefc8cffbad37675707975 | |
373 | test-hook-bookmark: db815d6d32e6: -> db815d6d32e69058eadefc8cffbad37675707975 |
|
376 | test-hook-bookmark: db815d6d32e6: -> db815d6d32e69058eadefc8cffbad37675707975 | |
374 | $ hg bookmark -d 925d80f479bb |
|
377 | $ hg bookmark -d 925d80f479bb | |
375 | $ hg bookmark -d db815d6d32e6 |
|
378 | $ hg bookmark -d db815d6d32e6 | |
376 |
|
379 | |||
377 | $ cd .. |
|
380 | $ cd .. | |
378 |
|
381 | |||
379 | bookmark with a name that matches an ambiguous node id |
|
382 | bookmark with a name that matches an ambiguous node id | |
380 |
|
383 | |||
381 | $ hg init ambiguous |
|
384 | $ hg init ambiguous | |
382 | $ cd ambiguous |
|
385 | $ cd ambiguous | |
383 | $ echo 0 > a |
|
386 | $ echo 0 > a | |
384 | $ hg ci -qAm 0 |
|
387 | $ hg ci -qAm 0 | |
385 | $ for i in 1057 2857 4025; do |
|
388 | $ for i in 1057 2857 4025; do | |
386 | > hg up -q 0 |
|
389 | > hg up -q 0 | |
387 | > echo $i > a |
|
390 | > echo $i > a | |
388 | > hg ci -qm $i |
|
391 | > hg ci -qm $i | |
389 | > done |
|
392 | > done | |
390 | $ hg up -q null |
|
393 | $ hg up -q null | |
391 | $ hg log -r0: -T '{rev}:{node}\n' |
|
394 | $ hg log -r0: -T '{rev}:{node}\n' | |
392 | 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a |
|
395 | 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a | |
393 | 1:c56256a09cd28e5764f32e8e2810d0f01e2e357a |
|
396 | 1:c56256a09cd28e5764f32e8e2810d0f01e2e357a | |
394 | 2:c5623987d205cd6d9d8389bfc40fff9dbb670b48 |
|
397 | 2:c5623987d205cd6d9d8389bfc40fff9dbb670b48 | |
395 | 3:c562ddd9c94164376c20b86b0b4991636a3bf84f |
|
398 | 3:c562ddd9c94164376c20b86b0b4991636a3bf84f | |
396 |
|
399 | |||
397 | $ hg bookmark -r0 c562 |
|
400 | $ hg bookmark -r0 c562 | |
398 | $ hg bookmarks |
|
401 | $ hg bookmarks | |
399 | c562 0:b4e73ffab476 |
|
402 | c562 0:b4e73ffab476 | |
400 |
|
403 | |||
401 | $ cd .. |
|
404 | $ cd .. | |
402 |
|
405 | |||
403 | incompatible options |
|
406 | incompatible options | |
404 |
|
407 | |||
405 | $ cd repo |
|
408 | $ cd repo | |
406 |
|
409 | |||
407 | $ hg bookmark -m Y -d Z |
|
410 | $ hg bookmark -m Y -d Z | |
408 | abort: --delete and --rename are incompatible |
|
411 | abort: --delete and --rename are incompatible | |
409 | [255] |
|
412 | [255] | |
410 |
|
413 | |||
411 | $ hg bookmark -r 1 -d Z |
|
414 | $ hg bookmark -r 1 -d Z | |
412 | abort: --rev is incompatible with --delete |
|
415 | abort: --rev is incompatible with --delete | |
413 | [255] |
|
416 | [255] | |
414 |
|
417 | |||
415 | $ hg bookmark -r 1 -m Z Y |
|
418 | $ hg bookmark -r 1 -m Z Y | |
416 | abort: --rev is incompatible with --rename |
|
419 | abort: --rev is incompatible with --rename | |
417 | [255] |
|
420 | [255] | |
418 |
|
421 | |||
419 | force bookmark with existing name |
|
422 | force bookmark with existing name | |
420 |
|
423 | |||
421 | $ hg bookmark -f X2 --config "$TESTHOOK" |
|
424 | $ hg bookmark -f X2 --config "$TESTHOOK" | |
422 | test-hook-bookmark: X2: 925d80f479bb026b0fb3deb27503780b13f74123 -> db815d6d32e69058eadefc8cffbad37675707975 |
|
425 | test-hook-bookmark: X2: 925d80f479bb026b0fb3deb27503780b13f74123 -> db815d6d32e69058eadefc8cffbad37675707975 | |
423 |
|
426 | |||
424 | force bookmark back to where it was, should deactivate it |
|
427 | force bookmark back to where it was, should deactivate it | |
425 |
|
428 | |||
426 | $ hg bookmark -fr1 X2 |
|
429 | $ hg bookmark -fr1 X2 | |
427 | $ hg bookmarks |
|
430 | $ hg bookmarks | |
428 | X2 1:925d80f479bb |
|
431 | X2 1:925d80f479bb | |
429 | Y 2:db815d6d32e6 |
|
432 | Y 2:db815d6d32e6 | |
430 | Z 0:f7b1eb17ad24 |
|
433 | Z 0:f7b1eb17ad24 | |
431 | x y 2:db815d6d32e6 |
|
434 | x y 2:db815d6d32e6 | |
432 |
|
435 | |||
433 | forward bookmark to descendant without --force |
|
436 | forward bookmark to descendant without --force | |
434 |
|
437 | |||
435 | $ hg bookmark Z |
|
438 | $ hg bookmark Z | |
436 | moving bookmark 'Z' forward from f7b1eb17ad24 |
|
439 | moving bookmark 'Z' forward from f7b1eb17ad24 | |
437 |
|
440 | |||
438 | list bookmarks |
|
441 | list bookmarks | |
439 |
|
442 | |||
440 | $ hg bookmark |
|
443 | $ hg bookmark | |
441 | X2 1:925d80f479bb |
|
444 | X2 1:925d80f479bb | |
442 | Y 2:db815d6d32e6 |
|
445 | Y 2:db815d6d32e6 | |
443 | * Z 2:db815d6d32e6 |
|
446 | * Z 2:db815d6d32e6 | |
444 | x y 2:db815d6d32e6 |
|
447 | x y 2:db815d6d32e6 | |
445 |
|
448 | |||
446 | revision but no bookmark name |
|
449 | revision but no bookmark name | |
447 |
|
450 | |||
448 | $ hg bookmark -r . |
|
451 | $ hg bookmark -r . | |
449 | abort: bookmark name required |
|
452 | abort: bookmark name required | |
450 | [255] |
|
453 | [255] | |
451 |
|
454 | |||
452 | bookmark name with whitespace only |
|
455 | bookmark name with whitespace only | |
453 |
|
456 | |||
454 | $ hg bookmark ' ' |
|
457 | $ hg bookmark ' ' | |
455 | abort: bookmark names cannot consist entirely of whitespace |
|
458 | abort: bookmark names cannot consist entirely of whitespace | |
456 | [255] |
|
459 | [255] | |
457 |
|
460 | |||
458 | $ hg bookmark -m Y ' ' |
|
461 | $ hg bookmark -m Y ' ' | |
459 | abort: bookmark names cannot consist entirely of whitespace |
|
462 | abort: bookmark names cannot consist entirely of whitespace | |
460 | [255] |
|
463 | [255] | |
461 |
|
464 | |||
462 | invalid bookmark |
|
465 | invalid bookmark | |
463 |
|
466 | |||
464 | $ hg bookmark 'foo:bar' |
|
467 | $ hg bookmark 'foo:bar' | |
465 | abort: ':' cannot be used in a name |
|
468 | abort: ':' cannot be used in a name | |
466 | [255] |
|
469 | [255] | |
467 |
|
470 | |||
468 | $ hg bookmark 'foo |
|
471 | $ hg bookmark 'foo | |
469 | > bar' |
|
472 | > bar' | |
470 | abort: '\n' cannot be used in a name |
|
473 | abort: '\n' cannot be used in a name | |
471 | [255] |
|
474 | [255] | |
472 |
|
475 | |||
473 | the bookmark extension should be ignored now that it is part of core |
|
476 | the bookmark extension should be ignored now that it is part of core | |
474 |
|
477 | |||
475 | $ echo "[extensions]" >> $HGRCPATH |
|
478 | $ echo "[extensions]" >> $HGRCPATH | |
476 | $ echo "bookmarks=" >> $HGRCPATH |
|
479 | $ echo "bookmarks=" >> $HGRCPATH | |
477 | $ hg bookmarks |
|
480 | $ hg bookmarks | |
478 | X2 1:925d80f479bb |
|
481 | X2 1:925d80f479bb | |
479 | Y 2:db815d6d32e6 |
|
482 | Y 2:db815d6d32e6 | |
480 | * Z 2:db815d6d32e6 |
|
483 | * Z 2:db815d6d32e6 | |
481 | x y 2:db815d6d32e6 |
|
484 | x y 2:db815d6d32e6 | |
482 |
|
485 | |||
483 | test summary |
|
486 | test summary | |
484 |
|
487 | |||
485 | $ hg summary |
|
488 | $ hg summary | |
486 | parent: 2:db815d6d32e6 tip |
|
489 | parent: 2:db815d6d32e6 tip | |
487 | 2 |
|
490 | 2 | |
488 | branch: default |
|
491 | branch: default | |
489 | bookmarks: *Z Y x y |
|
492 | bookmarks: *Z Y x y | |
490 | commit: (clean) |
|
493 | commit: (clean) | |
491 | update: 1 new changesets, 2 branch heads (merge) |
|
494 | update: 1 new changesets, 2 branch heads (merge) | |
492 | phases: 3 draft |
|
495 | phases: 3 draft | |
493 |
|
496 | |||
494 | test id |
|
497 | test id | |
495 |
|
498 | |||
496 | $ hg id |
|
499 | $ hg id | |
497 | db815d6d32e6 tip Y/Z/x y |
|
500 | db815d6d32e6 tip Y/Z/x y | |
498 |
|
501 | |||
499 | test rollback |
|
502 | test rollback | |
500 |
|
503 | |||
501 | $ echo foo > f1 |
|
504 | $ echo foo > f1 | |
502 | $ hg bookmark tmp-rollback |
|
505 | $ hg bookmark tmp-rollback | |
503 | $ hg ci -Amr |
|
506 | $ hg ci -Amr | |
504 | adding f1 |
|
507 | adding f1 | |
505 | $ hg bookmarks |
|
508 | $ hg bookmarks | |
506 | X2 1:925d80f479bb |
|
509 | X2 1:925d80f479bb | |
507 | Y 2:db815d6d32e6 |
|
510 | Y 2:db815d6d32e6 | |
508 | Z 2:db815d6d32e6 |
|
511 | Z 2:db815d6d32e6 | |
509 | * tmp-rollback 3:2bf5cfec5864 |
|
512 | * tmp-rollback 3:2bf5cfec5864 | |
510 | x y 2:db815d6d32e6 |
|
513 | x y 2:db815d6d32e6 | |
511 | $ hg rollback |
|
514 | $ hg rollback | |
512 | repository tip rolled back to revision 2 (undo commit) |
|
515 | repository tip rolled back to revision 2 (undo commit) | |
513 | working directory now based on revision 2 |
|
516 | working directory now based on revision 2 | |
514 | $ hg bookmarks |
|
517 | $ hg bookmarks | |
515 | X2 1:925d80f479bb |
|
518 | X2 1:925d80f479bb | |
516 | Y 2:db815d6d32e6 |
|
519 | Y 2:db815d6d32e6 | |
517 | Z 2:db815d6d32e6 |
|
520 | Z 2:db815d6d32e6 | |
518 | * tmp-rollback 2:db815d6d32e6 |
|
521 | * tmp-rollback 2:db815d6d32e6 | |
519 | x y 2:db815d6d32e6 |
|
522 | x y 2:db815d6d32e6 | |
520 | $ hg bookmark -f Z -r 1 |
|
523 | $ hg bookmark -f Z -r 1 | |
521 | $ hg rollback |
|
524 | $ hg rollback | |
522 | repository tip rolled back to revision 2 (undo bookmark) |
|
525 | repository tip rolled back to revision 2 (undo bookmark) | |
523 | $ hg bookmarks |
|
526 | $ hg bookmarks | |
524 | X2 1:925d80f479bb |
|
527 | X2 1:925d80f479bb | |
525 | Y 2:db815d6d32e6 |
|
528 | Y 2:db815d6d32e6 | |
526 | Z 2:db815d6d32e6 |
|
529 | Z 2:db815d6d32e6 | |
527 | * tmp-rollback 2:db815d6d32e6 |
|
530 | * tmp-rollback 2:db815d6d32e6 | |
528 | x y 2:db815d6d32e6 |
|
531 | x y 2:db815d6d32e6 | |
529 | $ hg bookmark -d tmp-rollback |
|
532 | $ hg bookmark -d tmp-rollback | |
530 |
|
533 | |||
531 | activate bookmark on working dir parent without --force |
|
534 | activate bookmark on working dir parent without --force | |
532 |
|
535 | |||
533 | $ hg bookmark --inactive Z |
|
536 | $ hg bookmark --inactive Z | |
534 | $ hg bookmark Z |
|
537 | $ hg bookmark Z | |
535 |
|
538 | |||
536 | test clone |
|
539 | test clone | |
537 |
|
540 | |||
538 | $ hg bookmark -r 2 -i @ |
|
541 | $ hg bookmark -r 2 -i @ | |
539 | $ hg bookmark -r 2 -i a@ |
|
542 | $ hg bookmark -r 2 -i a@ | |
540 | $ hg bookmarks |
|
543 | $ hg bookmarks | |
541 | @ 2:db815d6d32e6 |
|
544 | @ 2:db815d6d32e6 | |
542 | X2 1:925d80f479bb |
|
545 | X2 1:925d80f479bb | |
543 | Y 2:db815d6d32e6 |
|
546 | Y 2:db815d6d32e6 | |
544 | * Z 2:db815d6d32e6 |
|
547 | * Z 2:db815d6d32e6 | |
545 | a@ 2:db815d6d32e6 |
|
548 | a@ 2:db815d6d32e6 | |
546 | x y 2:db815d6d32e6 |
|
549 | x y 2:db815d6d32e6 | |
547 | $ hg clone . cloned-bookmarks |
|
550 | $ hg clone . cloned-bookmarks | |
548 | updating to bookmark @ |
|
551 | updating to bookmark @ | |
549 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
552 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
550 | $ hg -R cloned-bookmarks bookmarks |
|
553 | $ hg -R cloned-bookmarks bookmarks | |
551 | * @ 2:db815d6d32e6 |
|
554 | * @ 2:db815d6d32e6 | |
552 | X2 1:925d80f479bb |
|
555 | X2 1:925d80f479bb | |
553 | Y 2:db815d6d32e6 |
|
556 | Y 2:db815d6d32e6 | |
554 | Z 2:db815d6d32e6 |
|
557 | Z 2:db815d6d32e6 | |
555 | a@ 2:db815d6d32e6 |
|
558 | a@ 2:db815d6d32e6 | |
556 | x y 2:db815d6d32e6 |
|
559 | x y 2:db815d6d32e6 | |
557 |
|
560 | |||
558 | test clone with pull protocol |
|
561 | test clone with pull protocol | |
559 |
|
562 | |||
560 | $ hg clone --pull . cloned-bookmarks-pull |
|
563 | $ hg clone --pull . cloned-bookmarks-pull | |
561 | requesting all changes |
|
564 | requesting all changes | |
562 | adding changesets |
|
565 | adding changesets | |
563 | adding manifests |
|
566 | adding manifests | |
564 | adding file changes |
|
567 | adding file changes | |
565 | added 3 changesets with 3 changes to 3 files (+1 heads) |
|
568 | added 3 changesets with 3 changes to 3 files (+1 heads) | |
566 | new changesets f7b1eb17ad24:db815d6d32e6 |
|
569 | new changesets f7b1eb17ad24:db815d6d32e6 | |
567 | updating to bookmark @ |
|
570 | updating to bookmark @ | |
568 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
571 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
569 | $ hg -R cloned-bookmarks-pull bookmarks |
|
572 | $ hg -R cloned-bookmarks-pull bookmarks | |
570 | * @ 2:db815d6d32e6 |
|
573 | * @ 2:db815d6d32e6 | |
571 | X2 1:925d80f479bb |
|
574 | X2 1:925d80f479bb | |
572 | Y 2:db815d6d32e6 |
|
575 | Y 2:db815d6d32e6 | |
573 | Z 2:db815d6d32e6 |
|
576 | Z 2:db815d6d32e6 | |
574 | a@ 2:db815d6d32e6 |
|
577 | a@ 2:db815d6d32e6 | |
575 | x y 2:db815d6d32e6 |
|
578 | x y 2:db815d6d32e6 | |
576 |
|
579 | |||
577 | delete multiple bookmarks at once |
|
580 | delete multiple bookmarks at once | |
578 |
|
581 | |||
579 | $ hg bookmark -d @ a@ |
|
582 | $ hg bookmark -d @ a@ | |
580 |
|
583 | |||
581 | test clone with a bookmark named "default" (issue3677) |
|
584 | test clone with a bookmark named "default" (issue3677) | |
582 |
|
585 | |||
583 | $ hg bookmark -r 1 -f -i default |
|
586 | $ hg bookmark -r 1 -f -i default | |
584 | $ hg clone . cloned-bookmark-default |
|
587 | $ hg clone . cloned-bookmark-default | |
585 | updating to branch default |
|
588 | updating to branch default | |
586 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
589 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
587 | $ hg -R cloned-bookmark-default bookmarks |
|
590 | $ hg -R cloned-bookmark-default bookmarks | |
588 | X2 1:925d80f479bb |
|
591 | X2 1:925d80f479bb | |
589 | Y 2:db815d6d32e6 |
|
592 | Y 2:db815d6d32e6 | |
590 | Z 2:db815d6d32e6 |
|
593 | Z 2:db815d6d32e6 | |
591 | default 1:925d80f479bb |
|
594 | default 1:925d80f479bb | |
592 | x y 2:db815d6d32e6 |
|
595 | x y 2:db815d6d32e6 | |
593 | $ hg -R cloned-bookmark-default parents -q |
|
596 | $ hg -R cloned-bookmark-default parents -q | |
594 | 2:db815d6d32e6 |
|
597 | 2:db815d6d32e6 | |
595 | $ hg bookmark -d default |
|
598 | $ hg bookmark -d default | |
596 |
|
599 | |||
597 | test clone with a specific revision |
|
600 | test clone with a specific revision | |
598 |
|
601 | |||
599 | $ hg clone -r 925d80 . cloned-bookmarks-rev |
|
602 | $ hg clone -r 925d80 . cloned-bookmarks-rev | |
600 | adding changesets |
|
603 | adding changesets | |
601 | adding manifests |
|
604 | adding manifests | |
602 | adding file changes |
|
605 | adding file changes | |
603 | added 2 changesets with 2 changes to 2 files |
|
606 | added 2 changesets with 2 changes to 2 files | |
604 | new changesets f7b1eb17ad24:925d80f479bb |
|
607 | new changesets f7b1eb17ad24:925d80f479bb | |
605 | updating to branch default |
|
608 | updating to branch default | |
606 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
609 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
607 | $ hg -R cloned-bookmarks-rev bookmarks |
|
610 | $ hg -R cloned-bookmarks-rev bookmarks | |
608 | X2 1:925d80f479bb |
|
611 | X2 1:925d80f479bb | |
609 |
|
612 | |||
610 | test clone with update to a bookmark |
|
613 | test clone with update to a bookmark | |
611 |
|
614 | |||
612 | $ hg clone -u Z . ../cloned-bookmarks-update |
|
615 | $ hg clone -u Z . ../cloned-bookmarks-update | |
613 | updating to branch default |
|
616 | updating to branch default | |
614 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
617 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
615 | $ hg -R ../cloned-bookmarks-update bookmarks |
|
618 | $ hg -R ../cloned-bookmarks-update bookmarks | |
616 | X2 1:925d80f479bb |
|
619 | X2 1:925d80f479bb | |
617 | Y 2:db815d6d32e6 |
|
620 | Y 2:db815d6d32e6 | |
618 | * Z 2:db815d6d32e6 |
|
621 | * Z 2:db815d6d32e6 | |
619 | x y 2:db815d6d32e6 |
|
622 | x y 2:db815d6d32e6 | |
620 |
|
623 | |||
621 | create bundle with two heads |
|
624 | create bundle with two heads | |
622 |
|
625 | |||
623 | $ hg clone . tobundle |
|
626 | $ hg clone . tobundle | |
624 | updating to branch default |
|
627 | updating to branch default | |
625 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
628 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
626 | $ echo x > tobundle/x |
|
629 | $ echo x > tobundle/x | |
627 | $ hg -R tobundle add tobundle/x |
|
630 | $ hg -R tobundle add tobundle/x | |
628 | $ hg -R tobundle commit -m'x' |
|
631 | $ hg -R tobundle commit -m'x' | |
629 | $ hg -R tobundle update -r -2 |
|
632 | $ hg -R tobundle update -r -2 | |
630 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
633 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
631 | $ echo y > tobundle/y |
|
634 | $ echo y > tobundle/y | |
632 | $ hg -R tobundle branch test |
|
635 | $ hg -R tobundle branch test | |
633 | marked working directory as branch test |
|
636 | marked working directory as branch test | |
634 | (branches are permanent and global, did you want a bookmark?) |
|
637 | (branches are permanent and global, did you want a bookmark?) | |
635 | $ hg -R tobundle add tobundle/y |
|
638 | $ hg -R tobundle add tobundle/y | |
636 | $ hg -R tobundle commit -m'y' |
|
639 | $ hg -R tobundle commit -m'y' | |
637 | $ hg -R tobundle bundle tobundle.hg |
|
640 | $ hg -R tobundle bundle tobundle.hg | |
638 | searching for changes |
|
641 | searching for changes | |
639 | 2 changesets found |
|
642 | 2 changesets found | |
640 | $ hg unbundle tobundle.hg |
|
643 | $ hg unbundle tobundle.hg | |
641 | adding changesets |
|
644 | adding changesets | |
642 | adding manifests |
|
645 | adding manifests | |
643 | adding file changes |
|
646 | adding file changes | |
644 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
647 | added 2 changesets with 2 changes to 2 files (+1 heads) | |
645 | new changesets 125c9a1d6df6:9ba5f110a0b3 |
|
648 | new changesets 125c9a1d6df6:9ba5f110a0b3 | |
646 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
649 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
647 |
|
650 | |||
648 | update to active bookmark if it's not the parent |
|
651 | update to active bookmark if it's not the parent | |
649 |
|
652 | |||
650 | (it is known issue that fsmonitor can't handle nested repositories. In |
|
653 | (it is known issue that fsmonitor can't handle nested repositories. In | |
651 | this test scenario, cloned-bookmark-default and tobundle exist in the |
|
654 | this test scenario, cloned-bookmark-default and tobundle exist in the | |
652 | working directory of current repository) |
|
655 | working directory of current repository) | |
653 |
|
656 | |||
654 | $ hg summary |
|
657 | $ hg summary | |
655 | parent: 2:db815d6d32e6 |
|
658 | parent: 2:db815d6d32e6 | |
656 | 2 |
|
659 | 2 | |
657 | branch: default |
|
660 | branch: default | |
658 | bookmarks: *Z Y x y |
|
661 | bookmarks: *Z Y x y | |
659 | commit: 1 added, 1 unknown (new branch head) (no-fsmonitor !) |
|
662 | commit: 1 added, 1 unknown (new branch head) (no-fsmonitor !) | |
660 | commit: 1 added, * unknown (new branch head) (glob) (fsmonitor !) |
|
663 | commit: 1 added, * unknown (new branch head) (glob) (fsmonitor !) | |
661 | update: 2 new changesets (update) |
|
664 | update: 2 new changesets (update) | |
662 | phases: 5 draft |
|
665 | phases: 5 draft | |
663 | $ hg update |
|
666 | $ hg update | |
664 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
667 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
665 | updating bookmark Z |
|
668 | updating bookmark Z | |
666 | $ hg bookmarks |
|
669 | $ hg bookmarks | |
667 | X2 1:925d80f479bb |
|
670 | X2 1:925d80f479bb | |
668 | Y 2:db815d6d32e6 |
|
671 | Y 2:db815d6d32e6 | |
669 | * Z 3:125c9a1d6df6 |
|
672 | * Z 3:125c9a1d6df6 | |
670 | x y 2:db815d6d32e6 |
|
673 | x y 2:db815d6d32e6 | |
671 |
|
674 | |||
672 | pull --update works the same as pull && update |
|
675 | pull --update works the same as pull && update | |
673 |
|
676 | |||
674 | $ hg bookmark -r3 Y |
|
677 | $ hg bookmark -r3 Y | |
675 | moving bookmark 'Y' forward from db815d6d32e6 |
|
678 | moving bookmark 'Y' forward from db815d6d32e6 | |
676 | $ cp -R ../cloned-bookmarks-update ../cloned-bookmarks-manual-update |
|
679 | $ cp -R ../cloned-bookmarks-update ../cloned-bookmarks-manual-update | |
677 | $ cp -R ../cloned-bookmarks-update ../cloned-bookmarks-manual-update-with-divergence |
|
680 | $ cp -R ../cloned-bookmarks-update ../cloned-bookmarks-manual-update-with-divergence | |
678 |
|
681 | |||
679 | (manual version) |
|
682 | (manual version) | |
680 |
|
683 | |||
681 | $ hg -R ../cloned-bookmarks-manual-update update Y |
|
684 | $ hg -R ../cloned-bookmarks-manual-update update Y | |
682 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
685 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
683 | (activating bookmark Y) |
|
686 | (activating bookmark Y) | |
684 | $ hg -R ../cloned-bookmarks-manual-update pull . |
|
687 | $ hg -R ../cloned-bookmarks-manual-update pull . | |
685 | pulling from . |
|
688 | pulling from . | |
686 | searching for changes |
|
689 | searching for changes | |
687 | adding changesets |
|
690 | adding changesets | |
688 | adding manifests |
|
691 | adding manifests | |
689 | adding file changes |
|
692 | adding file changes | |
690 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
693 | added 2 changesets with 2 changes to 2 files (+1 heads) | |
691 | updating bookmark Y |
|
694 | updating bookmark Y | |
692 | updating bookmark Z |
|
695 | updating bookmark Z | |
693 | new changesets 125c9a1d6df6:9ba5f110a0b3 |
|
696 | new changesets 125c9a1d6df6:9ba5f110a0b3 | |
694 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
697 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
695 |
|
698 | |||
696 | (# tests strange but with --date crashing when bookmark have to move) |
|
699 | (# tests strange but with --date crashing when bookmark have to move) | |
697 |
|
700 | |||
698 | $ hg -R ../cloned-bookmarks-manual-update update -d 1986 |
|
701 | $ hg -R ../cloned-bookmarks-manual-update update -d 1986 | |
699 | abort: revision matching date not found |
|
702 | abort: revision matching date not found | |
700 | [255] |
|
703 | [255] | |
701 | $ hg -R ../cloned-bookmarks-manual-update update |
|
704 | $ hg -R ../cloned-bookmarks-manual-update update | |
702 | updating to active bookmark Y |
|
705 | updating to active bookmark Y | |
703 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
706 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
704 |
|
707 | |||
705 | (all in one version) |
|
708 | (all in one version) | |
706 |
|
709 | |||
707 | $ hg -R ../cloned-bookmarks-update update Y |
|
710 | $ hg -R ../cloned-bookmarks-update update Y | |
708 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
711 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
709 | (activating bookmark Y) |
|
712 | (activating bookmark Y) | |
710 | $ hg -R ../cloned-bookmarks-update pull --update . |
|
713 | $ hg -R ../cloned-bookmarks-update pull --update . | |
711 | pulling from . |
|
714 | pulling from . | |
712 | searching for changes |
|
715 | searching for changes | |
713 | adding changesets |
|
716 | adding changesets | |
714 | adding manifests |
|
717 | adding manifests | |
715 | adding file changes |
|
718 | adding file changes | |
716 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
719 | added 2 changesets with 2 changes to 2 files (+1 heads) | |
717 | updating bookmark Y |
|
720 | updating bookmark Y | |
718 | updating bookmark Z |
|
721 | updating bookmark Z | |
719 | new changesets 125c9a1d6df6:9ba5f110a0b3 |
|
722 | new changesets 125c9a1d6df6:9ba5f110a0b3 | |
720 | updating to active bookmark Y |
|
723 | updating to active bookmark Y | |
721 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
724 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
722 |
|
725 | |||
723 | We warn about divergent during bare update to the active bookmark |
|
726 | We warn about divergent during bare update to the active bookmark | |
724 |
|
727 | |||
725 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence update Y |
|
728 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence update Y | |
726 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
729 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
727 | (activating bookmark Y) |
|
730 | (activating bookmark Y) | |
728 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks -r X2 Y@1 |
|
731 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks -r X2 Y@1 | |
729 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks |
|
732 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks | |
730 | X2 1:925d80f479bb |
|
733 | X2 1:925d80f479bb | |
731 | * Y 2:db815d6d32e6 |
|
734 | * Y 2:db815d6d32e6 | |
732 | Y@1 1:925d80f479bb |
|
735 | Y@1 1:925d80f479bb | |
733 | Z 2:db815d6d32e6 |
|
736 | Z 2:db815d6d32e6 | |
734 | x y 2:db815d6d32e6 |
|
737 | x y 2:db815d6d32e6 | |
735 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence pull |
|
738 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence pull | |
736 | pulling from $TESTTMP/repo (glob) |
|
739 | pulling from $TESTTMP/repo (glob) | |
737 | searching for changes |
|
740 | searching for changes | |
738 | adding changesets |
|
741 | adding changesets | |
739 | adding manifests |
|
742 | adding manifests | |
740 | adding file changes |
|
743 | adding file changes | |
741 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
744 | added 2 changesets with 2 changes to 2 files (+1 heads) | |
742 | updating bookmark Y |
|
745 | updating bookmark Y | |
743 | updating bookmark Z |
|
746 | updating bookmark Z | |
744 | new changesets 125c9a1d6df6:9ba5f110a0b3 |
|
747 | new changesets 125c9a1d6df6:9ba5f110a0b3 | |
745 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
748 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
746 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence update |
|
749 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence update | |
747 | updating to active bookmark Y |
|
750 | updating to active bookmark Y | |
748 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
751 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
749 | 1 other divergent bookmarks for "Y" |
|
752 | 1 other divergent bookmarks for "Y" | |
750 |
|
753 | |||
751 | test wrongly formated bookmark |
|
754 | test wrongly formated bookmark | |
752 |
|
755 | |||
753 | $ echo '' >> .hg/bookmarks |
|
756 | $ echo '' >> .hg/bookmarks | |
754 | $ hg bookmarks |
|
757 | $ hg bookmarks | |
755 | X2 1:925d80f479bb |
|
758 | X2 1:925d80f479bb | |
756 | Y 3:125c9a1d6df6 |
|
759 | Y 3:125c9a1d6df6 | |
757 | * Z 3:125c9a1d6df6 |
|
760 | * Z 3:125c9a1d6df6 | |
758 | x y 2:db815d6d32e6 |
|
761 | x y 2:db815d6d32e6 | |
759 | $ echo "Ican'thasformatedlines" >> .hg/bookmarks |
|
762 | $ echo "Ican'thasformatedlines" >> .hg/bookmarks | |
760 | $ hg bookmarks |
|
763 | $ hg bookmarks | |
761 | malformed line in .hg/bookmarks: "Ican'thasformatedlines" |
|
764 | malformed line in .hg/bookmarks: "Ican'thasformatedlines" | |
762 | X2 1:925d80f479bb |
|
765 | X2 1:925d80f479bb | |
763 | Y 3:125c9a1d6df6 |
|
766 | Y 3:125c9a1d6df6 | |
764 | * Z 3:125c9a1d6df6 |
|
767 | * Z 3:125c9a1d6df6 | |
765 | x y 2:db815d6d32e6 |
|
768 | x y 2:db815d6d32e6 | |
766 |
|
769 | |||
767 | test missing revisions |
|
770 | test missing revisions | |
768 |
|
771 | |||
769 | $ echo "925d80f479b925d80f479bc925d80f479bccabab z" > .hg/bookmarks |
|
772 | $ echo "925d80f479b925d80f479bc925d80f479bccabab z" > .hg/bookmarks | |
770 | $ hg book |
|
773 | $ hg book | |
771 | no bookmarks set |
|
774 | no bookmarks set | |
772 |
|
775 | |||
773 | test stripping a non-checked-out but bookmarked revision |
|
776 | test stripping a non-checked-out but bookmarked revision | |
774 |
|
777 | |||
775 | $ hg log --graph |
|
778 | $ hg log --graph | |
776 | o changeset: 4:9ba5f110a0b3 |
|
779 | o changeset: 4:9ba5f110a0b3 | |
777 | | branch: test |
|
780 | | branch: test | |
778 | | tag: tip |
|
781 | | tag: tip | |
779 | | parent: 2:db815d6d32e6 |
|
782 | | parent: 2:db815d6d32e6 | |
780 | | user: test |
|
783 | | user: test | |
781 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
784 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
782 | | summary: y |
|
785 | | summary: y | |
783 | | |
|
786 | | | |
784 | | @ changeset: 3:125c9a1d6df6 |
|
787 | | @ changeset: 3:125c9a1d6df6 | |
785 | |/ user: test |
|
788 | |/ user: test | |
786 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
789 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
787 | | summary: x |
|
790 | | summary: x | |
788 | | |
|
791 | | | |
789 | o changeset: 2:db815d6d32e6 |
|
792 | o changeset: 2:db815d6d32e6 | |
790 | | parent: 0:f7b1eb17ad24 |
|
793 | | parent: 0:f7b1eb17ad24 | |
791 | | user: test |
|
794 | | user: test | |
792 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
795 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
793 | | summary: 2 |
|
796 | | summary: 2 | |
794 | | |
|
797 | | | |
795 | | o changeset: 1:925d80f479bb |
|
798 | | o changeset: 1:925d80f479bb | |
796 | |/ user: test |
|
799 | |/ user: test | |
797 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
800 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
798 | | summary: 1 |
|
801 | | summary: 1 | |
799 | | |
|
802 | | | |
800 | o changeset: 0:f7b1eb17ad24 |
|
803 | o changeset: 0:f7b1eb17ad24 | |
801 | user: test |
|
804 | user: test | |
802 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
805 | date: Thu Jan 01 00:00:00 1970 +0000 | |
803 | summary: 0 |
|
806 | summary: 0 | |
804 |
|
807 | |||
805 | $ hg book should-end-on-two |
|
808 | $ hg book should-end-on-two | |
806 | $ hg co --clean 4 |
|
809 | $ hg co --clean 4 | |
807 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
810 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
808 | (leaving bookmark should-end-on-two) |
|
811 | (leaving bookmark should-end-on-two) | |
809 | $ hg book four |
|
812 | $ hg book four | |
810 | $ hg --config extensions.mq= strip 3 |
|
813 | $ hg --config extensions.mq= strip 3 | |
811 | saved backup bundle to * (glob) |
|
814 | saved backup bundle to * (glob) | |
812 | should-end-on-two should end up pointing to revision 2, as that's the |
|
815 | should-end-on-two should end up pointing to revision 2, as that's the | |
813 | tipmost surviving ancestor of the stripped revision. |
|
816 | tipmost surviving ancestor of the stripped revision. | |
814 | $ hg log --graph |
|
817 | $ hg log --graph | |
815 | @ changeset: 3:9ba5f110a0b3 |
|
818 | @ changeset: 3:9ba5f110a0b3 | |
816 | | branch: test |
|
819 | | branch: test | |
817 | | bookmark: four |
|
820 | | bookmark: four | |
818 | | tag: tip |
|
821 | | tag: tip | |
819 | | user: test |
|
822 | | user: test | |
820 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
823 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
821 | | summary: y |
|
824 | | summary: y | |
822 | | |
|
825 | | | |
823 | o changeset: 2:db815d6d32e6 |
|
826 | o changeset: 2:db815d6d32e6 | |
824 | | bookmark: should-end-on-two |
|
827 | | bookmark: should-end-on-two | |
825 | | parent: 0:f7b1eb17ad24 |
|
828 | | parent: 0:f7b1eb17ad24 | |
826 | | user: test |
|
829 | | user: test | |
827 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
830 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
828 | | summary: 2 |
|
831 | | summary: 2 | |
829 | | |
|
832 | | | |
830 | | o changeset: 1:925d80f479bb |
|
833 | | o changeset: 1:925d80f479bb | |
831 | |/ user: test |
|
834 | |/ user: test | |
832 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
835 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
833 | | summary: 1 |
|
836 | | summary: 1 | |
834 | | |
|
837 | | | |
835 | o changeset: 0:f7b1eb17ad24 |
|
838 | o changeset: 0:f7b1eb17ad24 | |
836 | user: test |
|
839 | user: test | |
837 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
840 | date: Thu Jan 01 00:00:00 1970 +0000 | |
838 | summary: 0 |
|
841 | summary: 0 | |
839 |
|
842 | |||
840 |
|
843 | |||
841 | no-op update doesn't deactivate bookmarks |
|
844 | no-op update doesn't deactivate bookmarks | |
842 |
|
845 | |||
843 | (it is known issue that fsmonitor can't handle nested repositories. In |
|
846 | (it is known issue that fsmonitor can't handle nested repositories. In | |
844 | this test scenario, cloned-bookmark-default and tobundle exist in the |
|
847 | this test scenario, cloned-bookmark-default and tobundle exist in the | |
845 | working directory of current repository) |
|
848 | working directory of current repository) | |
846 |
|
849 | |||
847 | $ hg bookmarks |
|
850 | $ hg bookmarks | |
848 | * four 3:9ba5f110a0b3 |
|
851 | * four 3:9ba5f110a0b3 | |
849 | should-end-on-two 2:db815d6d32e6 |
|
852 | should-end-on-two 2:db815d6d32e6 | |
850 | $ hg up four |
|
853 | $ hg up four | |
851 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
854 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
852 | $ hg up |
|
855 | $ hg up | |
853 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
856 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
854 | $ hg sum |
|
857 | $ hg sum | |
855 | parent: 3:9ba5f110a0b3 tip |
|
858 | parent: 3:9ba5f110a0b3 tip | |
856 | y |
|
859 | y | |
857 | branch: test |
|
860 | branch: test | |
858 | bookmarks: *four |
|
861 | bookmarks: *four | |
859 | commit: 2 unknown (clean) (no-fsmonitor !) |
|
862 | commit: 2 unknown (clean) (no-fsmonitor !) | |
860 | commit: * unknown (clean) (glob) (fsmonitor !) |
|
863 | commit: * unknown (clean) (glob) (fsmonitor !) | |
861 | update: (current) |
|
864 | update: (current) | |
862 | phases: 4 draft |
|
865 | phases: 4 draft | |
863 |
|
866 | |||
864 | test clearing divergent bookmarks of linear ancestors |
|
867 | test clearing divergent bookmarks of linear ancestors | |
865 |
|
868 | |||
866 | $ hg bookmark Z -r 0 |
|
869 | $ hg bookmark Z -r 0 | |
867 | $ hg bookmark Z@1 -r 1 |
|
870 | $ hg bookmark Z@1 -r 1 | |
868 | $ hg bookmark Z@2 -r 2 |
|
871 | $ hg bookmark Z@2 -r 2 | |
869 | $ hg bookmark Z@3 -r 3 |
|
872 | $ hg bookmark Z@3 -r 3 | |
870 | $ hg book |
|
873 | $ hg book | |
871 | Z 0:f7b1eb17ad24 |
|
874 | Z 0:f7b1eb17ad24 | |
872 | Z@1 1:925d80f479bb |
|
875 | Z@1 1:925d80f479bb | |
873 | Z@2 2:db815d6d32e6 |
|
876 | Z@2 2:db815d6d32e6 | |
874 | Z@3 3:9ba5f110a0b3 |
|
877 | Z@3 3:9ba5f110a0b3 | |
875 | * four 3:9ba5f110a0b3 |
|
878 | * four 3:9ba5f110a0b3 | |
876 | should-end-on-two 2:db815d6d32e6 |
|
879 | should-end-on-two 2:db815d6d32e6 | |
877 | $ hg bookmark Z |
|
880 | $ hg bookmark Z | |
878 | moving bookmark 'Z' forward from f7b1eb17ad24 |
|
881 | moving bookmark 'Z' forward from f7b1eb17ad24 | |
879 | $ hg book |
|
882 | $ hg book | |
880 | * Z 3:9ba5f110a0b3 |
|
883 | * Z 3:9ba5f110a0b3 | |
881 | Z@1 1:925d80f479bb |
|
884 | Z@1 1:925d80f479bb | |
882 | four 3:9ba5f110a0b3 |
|
885 | four 3:9ba5f110a0b3 | |
883 | should-end-on-two 2:db815d6d32e6 |
|
886 | should-end-on-two 2:db815d6d32e6 | |
884 |
|
887 | |||
885 | test clearing only a single divergent bookmark across branches |
|
888 | test clearing only a single divergent bookmark across branches | |
886 |
|
889 | |||
887 | $ hg book foo -r 1 |
|
890 | $ hg book foo -r 1 | |
888 | $ hg book foo@1 -r 0 |
|
891 | $ hg book foo@1 -r 0 | |
889 | $ hg book foo@2 -r 2 |
|
892 | $ hg book foo@2 -r 2 | |
890 | $ hg book foo@3 -r 3 |
|
893 | $ hg book foo@3 -r 3 | |
891 | $ hg book foo -r foo@3 |
|
894 | $ hg book foo -r foo@3 | |
892 | $ hg book |
|
895 | $ hg book | |
893 | * Z 3:9ba5f110a0b3 |
|
896 | * Z 3:9ba5f110a0b3 | |
894 | Z@1 1:925d80f479bb |
|
897 | Z@1 1:925d80f479bb | |
895 | foo 3:9ba5f110a0b3 |
|
898 | foo 3:9ba5f110a0b3 | |
896 | foo@1 0:f7b1eb17ad24 |
|
899 | foo@1 0:f7b1eb17ad24 | |
897 | foo@2 2:db815d6d32e6 |
|
900 | foo@2 2:db815d6d32e6 | |
898 | four 3:9ba5f110a0b3 |
|
901 | four 3:9ba5f110a0b3 | |
899 | should-end-on-two 2:db815d6d32e6 |
|
902 | should-end-on-two 2:db815d6d32e6 | |
900 |
|
903 | |||
901 | pull --update works the same as pull && update (case #2) |
|
904 | pull --update works the same as pull && update (case #2) | |
902 |
|
905 | |||
903 | It is assumed that "hg pull" itself doesn't update current active |
|
906 | It is assumed that "hg pull" itself doesn't update current active | |
904 | bookmark ('Y' in tests below). |
|
907 | bookmark ('Y' in tests below). | |
905 |
|
908 | |||
906 | $ hg pull -q ../cloned-bookmarks-update |
|
909 | $ hg pull -q ../cloned-bookmarks-update | |
907 | divergent bookmark Z stored as Z@2 |
|
910 | divergent bookmark Z stored as Z@2 | |
908 |
|
911 | |||
909 | (pulling revision on another named branch with --update updates |
|
912 | (pulling revision on another named branch with --update updates | |
910 | neither the working directory nor current active bookmark: "no-op" |
|
913 | neither the working directory nor current active bookmark: "no-op" | |
911 | case) |
|
914 | case) | |
912 |
|
915 | |||
913 | $ echo yy >> y |
|
916 | $ echo yy >> y | |
914 | $ hg commit -m yy |
|
917 | $ hg commit -m yy | |
915 |
|
918 | |||
916 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' |
|
919 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' | |
917 | * Y 3:125c9a1d6df6 |
|
920 | * Y 3:125c9a1d6df6 | |
918 | $ hg -R ../cloned-bookmarks-update pull . --update |
|
921 | $ hg -R ../cloned-bookmarks-update pull . --update | |
919 | pulling from . |
|
922 | pulling from . | |
920 | searching for changes |
|
923 | searching for changes | |
921 | adding changesets |
|
924 | adding changesets | |
922 | adding manifests |
|
925 | adding manifests | |
923 | adding file changes |
|
926 | adding file changes | |
924 | added 1 changesets with 1 changes to 1 files |
|
927 | added 1 changesets with 1 changes to 1 files | |
925 | divergent bookmark Z stored as Z@default |
|
928 | divergent bookmark Z stored as Z@default | |
926 | adding remote bookmark foo |
|
929 | adding remote bookmark foo | |
927 | adding remote bookmark four |
|
930 | adding remote bookmark four | |
928 | adding remote bookmark should-end-on-two |
|
931 | adding remote bookmark should-end-on-two | |
929 | new changesets 5fb12f0f2d51 |
|
932 | new changesets 5fb12f0f2d51 | |
930 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
933 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
931 | $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n" |
|
934 | $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n" | |
932 | 3:125c9a1d6df6 |
|
935 | 3:125c9a1d6df6 | |
933 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' |
|
936 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' | |
934 | * Y 3:125c9a1d6df6 |
|
937 | * Y 3:125c9a1d6df6 | |
935 |
|
938 | |||
936 | (pulling revision on current named/topological branch with --update |
|
939 | (pulling revision on current named/topological branch with --update | |
937 | updates the working directory and current active bookmark) |
|
940 | updates the working directory and current active bookmark) | |
938 |
|
941 | |||
939 | $ hg update -C -q 125c9a1d6df6 |
|
942 | $ hg update -C -q 125c9a1d6df6 | |
940 | $ echo xx >> x |
|
943 | $ echo xx >> x | |
941 | $ hg commit -m xx |
|
944 | $ hg commit -m xx | |
942 |
|
945 | |||
943 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' |
|
946 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' | |
944 | * Y 3:125c9a1d6df6 |
|
947 | * Y 3:125c9a1d6df6 | |
945 | $ hg -R ../cloned-bookmarks-update pull . --update |
|
948 | $ hg -R ../cloned-bookmarks-update pull . --update | |
946 | pulling from . |
|
949 | pulling from . | |
947 | searching for changes |
|
950 | searching for changes | |
948 | adding changesets |
|
951 | adding changesets | |
949 | adding manifests |
|
952 | adding manifests | |
950 | adding file changes |
|
953 | adding file changes | |
951 | added 1 changesets with 1 changes to 1 files |
|
954 | added 1 changesets with 1 changes to 1 files | |
952 | divergent bookmark Z stored as Z@default |
|
955 | divergent bookmark Z stored as Z@default | |
953 | new changesets 81dcce76aa0b |
|
956 | new changesets 81dcce76aa0b | |
954 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
957 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
955 | updating bookmark Y |
|
958 | updating bookmark Y | |
956 | $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n" |
|
959 | $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n" | |
957 | 6:81dcce76aa0b |
|
960 | 6:81dcce76aa0b | |
958 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' |
|
961 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' | |
959 | * Y 6:81dcce76aa0b |
|
962 | * Y 6:81dcce76aa0b | |
960 |
|
963 | |||
961 | $ cd .. |
|
964 | $ cd .. | |
962 |
|
965 | |||
963 | ensure changelog is written before bookmarks |
|
966 | ensure changelog is written before bookmarks | |
964 | $ hg init orderrepo |
|
967 | $ hg init orderrepo | |
965 | $ cd orderrepo |
|
968 | $ cd orderrepo | |
966 | $ touch a |
|
969 | $ touch a | |
967 | $ hg commit -Aqm one |
|
970 | $ hg commit -Aqm one | |
968 | $ hg book mybook |
|
971 | $ hg book mybook | |
969 | $ echo a > a |
|
972 | $ echo a > a | |
970 |
|
973 | |||
971 | $ cat > $TESTTMP/pausefinalize.py <<EOF |
|
974 | $ cat > $TESTTMP/pausefinalize.py <<EOF | |
972 | > from __future__ import absolute_import |
|
975 | > from __future__ import absolute_import | |
973 | > import os |
|
976 | > import os | |
974 | > import time |
|
977 | > import time | |
975 | > from mercurial import extensions, localrepo |
|
978 | > from mercurial import extensions, localrepo | |
976 | > def transaction(orig, self, desc, report=None): |
|
979 | > def transaction(orig, self, desc, report=None): | |
977 | > tr = orig(self, desc, report) |
|
980 | > tr = orig(self, desc, report) | |
978 | > def sleep(*args, **kwargs): |
|
981 | > def sleep(*args, **kwargs): | |
979 | > retry = 20 |
|
982 | > retry = 20 | |
980 | > while retry > 0 and not os.path.exists("$TESTTMP/unpause"): |
|
983 | > while retry > 0 and not os.path.exists("$TESTTMP/unpause"): | |
981 | > retry -= 1 |
|
984 | > retry -= 1 | |
982 | > time.sleep(0.5) |
|
985 | > time.sleep(0.5) | |
983 | > if os.path.exists("$TESTTMP/unpause"): |
|
986 | > if os.path.exists("$TESTTMP/unpause"): | |
984 | > os.remove("$TESTTMP/unpause") |
|
987 | > os.remove("$TESTTMP/unpause") | |
985 | > # It is important that this finalizer start with 'a', so it runs before |
|
988 | > # It is important that this finalizer start with 'a', so it runs before | |
986 | > # the changelog finalizer appends to the changelog. |
|
989 | > # the changelog finalizer appends to the changelog. | |
987 | > tr.addfinalize('a-sleep', sleep) |
|
990 | > tr.addfinalize('a-sleep', sleep) | |
988 | > return tr |
|
991 | > return tr | |
989 | > |
|
992 | > | |
990 | > def extsetup(ui): |
|
993 | > def extsetup(ui): | |
991 | > # This extension inserts an artifical pause during the transaction |
|
994 | > # This extension inserts an artifical pause during the transaction | |
992 | > # finalizer, so we can run commands mid-transaction-close. |
|
995 | > # finalizer, so we can run commands mid-transaction-close. | |
993 | > extensions.wrapfunction(localrepo.localrepository, 'transaction', |
|
996 | > extensions.wrapfunction(localrepo.localrepository, 'transaction', | |
994 | > transaction) |
|
997 | > transaction) | |
995 | > EOF |
|
998 | > EOF | |
996 | $ hg commit -qm two --config extensions.pausefinalize=$TESTTMP/pausefinalize.py & |
|
999 | $ hg commit -qm two --config extensions.pausefinalize=$TESTTMP/pausefinalize.py & | |
997 | $ sleep 2 |
|
1000 | $ sleep 2 | |
998 | $ hg log -r . |
|
1001 | $ hg log -r . | |
999 | changeset: 0:867bc5792c8c |
|
1002 | changeset: 0:867bc5792c8c | |
1000 | bookmark: mybook |
|
1003 | bookmark: mybook | |
1001 | tag: tip |
|
1004 | tag: tip | |
1002 | user: test |
|
1005 | user: test | |
1003 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1006 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1004 | summary: one |
|
1007 | summary: one | |
1005 |
|
1008 | |||
1006 | $ hg bookmarks |
|
1009 | $ hg bookmarks | |
1007 | * mybook 0:867bc5792c8c |
|
1010 | * mybook 0:867bc5792c8c | |
1008 | $ touch $TESTTMP/unpause |
|
1011 | $ touch $TESTTMP/unpause | |
1009 |
|
1012 | |||
1010 | $ cd .. |
|
1013 | $ cd .. | |
1011 |
|
1014 | |||
1012 | check whether HG_PENDING makes pending changes only in related |
|
1015 | check whether HG_PENDING makes pending changes only in related | |
1013 | repositories visible to an external hook. |
|
1016 | repositories visible to an external hook. | |
1014 |
|
1017 | |||
1015 | (emulate a transaction running concurrently by copied |
|
1018 | (emulate a transaction running concurrently by copied | |
1016 | .hg/bookmarks.pending in subsequent test) |
|
1019 | .hg/bookmarks.pending in subsequent test) | |
1017 |
|
1020 | |||
1018 | $ cat > $TESTTMP/savepending.sh <<EOF |
|
1021 | $ cat > $TESTTMP/savepending.sh <<EOF | |
1019 | > cp .hg/bookmarks.pending .hg/bookmarks.pending.saved |
|
1022 | > cp .hg/bookmarks.pending .hg/bookmarks.pending.saved | |
1020 | > exit 1 # to avoid adding new bookmark for subsequent tests |
|
1023 | > exit 1 # to avoid adding new bookmark for subsequent tests | |
1021 | > EOF |
|
1024 | > EOF | |
1022 |
|
1025 | |||
1023 | $ hg init unrelated |
|
1026 | $ hg init unrelated | |
1024 | $ cd unrelated |
|
1027 | $ cd unrelated | |
1025 | $ echo a > a |
|
1028 | $ echo a > a | |
1026 | $ hg add a |
|
1029 | $ hg add a | |
1027 | $ hg commit -m '#0' |
|
1030 | $ hg commit -m '#0' | |
1028 | $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" bookmarks INVISIBLE |
|
1031 | $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" bookmarks INVISIBLE | |
1029 | transaction abort! |
|
1032 | transaction abort! | |
1030 | rollback completed |
|
1033 | rollback completed | |
1031 | abort: pretxnclose hook exited with status 1 |
|
1034 | abort: pretxnclose hook exited with status 1 | |
1032 | [255] |
|
1035 | [255] | |
1033 | $ cp .hg/bookmarks.pending.saved .hg/bookmarks.pending |
|
1036 | $ cp .hg/bookmarks.pending.saved .hg/bookmarks.pending | |
1034 |
|
1037 | |||
1035 | (check visible bookmarks while transaction running in repo) |
|
1038 | (check visible bookmarks while transaction running in repo) | |
1036 |
|
1039 | |||
1037 | $ cat > $TESTTMP/checkpending.sh <<EOF |
|
1040 | $ cat > $TESTTMP/checkpending.sh <<EOF | |
1038 | > echo "@repo" |
|
1041 | > echo "@repo" | |
1039 | > hg -R "$TESTTMP/repo" bookmarks |
|
1042 | > hg -R "$TESTTMP/repo" bookmarks | |
1040 | > echo "@unrelated" |
|
1043 | > echo "@unrelated" | |
1041 | > hg -R "$TESTTMP/unrelated" bookmarks |
|
1044 | > hg -R "$TESTTMP/unrelated" bookmarks | |
1042 | > exit 1 # to avoid adding new bookmark for subsequent tests |
|
1045 | > exit 1 # to avoid adding new bookmark for subsequent tests | |
1043 | > EOF |
|
1046 | > EOF | |
1044 |
|
1047 | |||
1045 | $ cd ../repo |
|
1048 | $ cd ../repo | |
1046 | $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" bookmarks NEW |
|
1049 | $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" bookmarks NEW | |
1047 | @repo |
|
1050 | @repo | |
1048 | * NEW 6:81dcce76aa0b |
|
1051 | * NEW 6:81dcce76aa0b | |
1049 | X2 1:925d80f479bb |
|
1052 | X2 1:925d80f479bb | |
1050 | Y 4:125c9a1d6df6 |
|
1053 | Y 4:125c9a1d6df6 | |
1051 | Z 5:5fb12f0f2d51 |
|
1054 | Z 5:5fb12f0f2d51 | |
1052 | Z@1 1:925d80f479bb |
|
1055 | Z@1 1:925d80f479bb | |
1053 | Z@2 4:125c9a1d6df6 |
|
1056 | Z@2 4:125c9a1d6df6 | |
1054 | foo 3:9ba5f110a0b3 |
|
1057 | foo 3:9ba5f110a0b3 | |
1055 | foo@1 0:f7b1eb17ad24 |
|
1058 | foo@1 0:f7b1eb17ad24 | |
1056 | foo@2 2:db815d6d32e6 |
|
1059 | foo@2 2:db815d6d32e6 | |
1057 | four 3:9ba5f110a0b3 |
|
1060 | four 3:9ba5f110a0b3 | |
1058 | should-end-on-two 2:db815d6d32e6 |
|
1061 | should-end-on-two 2:db815d6d32e6 | |
1059 | x y 2:db815d6d32e6 |
|
1062 | x y 2:db815d6d32e6 | |
1060 | @unrelated |
|
1063 | @unrelated | |
1061 | no bookmarks set |
|
1064 | no bookmarks set | |
1062 | transaction abort! |
|
1065 | transaction abort! | |
1063 | rollback completed |
|
1066 | rollback completed | |
1064 | abort: pretxnclose hook exited with status 1 |
|
1067 | abort: pretxnclose hook exited with status 1 | |
1065 | [255] |
|
1068 | [255] | |
1066 |
|
1069 | |||
1067 | Check pretxnclose-bookmark can abort a transaction |
|
1070 | Check pretxnclose-bookmark can abort a transaction | |
1068 | -------------------------------------------------- |
|
1071 | -------------------------------------------------- | |
1069 |
|
1072 | |||
1070 | add hooks: |
|
1073 | add hooks: | |
1071 |
|
1074 | |||
1072 | * to prevent NEW bookmark on a non-public changeset |
|
1075 | * to prevent NEW bookmark on a non-public changeset | |
1073 | * to prevent non-forward move of NEW bookmark |
|
1076 | * to prevent non-forward move of NEW bookmark | |
1074 |
|
1077 | |||
1075 | $ cat << EOF >> .hg/hgrc |
|
1078 | $ cat << EOF >> .hg/hgrc | |
1076 | > [hooks] |
|
1079 | > [hooks] | |
1077 |
> pretxnclose-bookmark.force-public = |
|
1080 | > pretxnclose-bookmark.force-public = sh -c "(echo \$HG_BOOKMARK| grep -v NEW > /dev/null) || [ -z \"\$HG_NODE\" ] || (hg log -r \"\$HG_NODE\" -T '{phase}' | grep public > /dev/null)" | |
1078 |
|
|
1081 | > pretxnclose-bookmark.force-forward = sh -c "(echo \$HG_BOOKMARK| grep -v NEW > /dev/null) || [ -z \"\$HG_NODE\" ] || (hg log -r \"max(\$HG_OLDNODE::\$HG_NODE)\" -T 'MATCH' | grep MATCH > /dev/null)" | |
1079 |
|
|
1082 | > EOF | |
1080 |
|
1083 | |||
1081 | $ hg log -G -T phases |
|
1084 | $ hg log -G -T phases | |
1082 | @ changeset: 6:81dcce76aa0b |
|
1085 | @ changeset: 6:81dcce76aa0b | |
1083 | | tag: tip |
|
1086 | | tag: tip | |
1084 | | phase: draft |
|
1087 | | phase: draft | |
1085 | | parent: 4:125c9a1d6df6 |
|
1088 | | parent: 4:125c9a1d6df6 | |
1086 | | user: test |
|
1089 | | user: test | |
1087 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1090 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1088 | | summary: xx |
|
1091 | | summary: xx | |
1089 | | |
|
1092 | | | |
1090 | | o changeset: 5:5fb12f0f2d51 |
|
1093 | | o changeset: 5:5fb12f0f2d51 | |
1091 | | | branch: test |
|
1094 | | | branch: test | |
1092 | | | bookmark: Z |
|
1095 | | | bookmark: Z | |
1093 | | | phase: draft |
|
1096 | | | phase: draft | |
1094 | | | parent: 3:9ba5f110a0b3 |
|
1097 | | | parent: 3:9ba5f110a0b3 | |
1095 | | | user: test |
|
1098 | | | user: test | |
1096 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1099 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1097 | | | summary: yy |
|
1100 | | | summary: yy | |
1098 | | | |
|
1101 | | | | |
1099 | o | changeset: 4:125c9a1d6df6 |
|
1102 | o | changeset: 4:125c9a1d6df6 | |
1100 | | | bookmark: Y |
|
1103 | | | bookmark: Y | |
1101 | | | bookmark: Z@2 |
|
1104 | | | bookmark: Z@2 | |
1102 | | | phase: public |
|
1105 | | | phase: public | |
1103 | | | parent: 2:db815d6d32e6 |
|
1106 | | | parent: 2:db815d6d32e6 | |
1104 | | | user: test |
|
1107 | | | user: test | |
1105 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1108 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1106 | | | summary: x |
|
1109 | | | summary: x | |
1107 | | | |
|
1110 | | | | |
1108 | | o changeset: 3:9ba5f110a0b3 |
|
1111 | | o changeset: 3:9ba5f110a0b3 | |
1109 | |/ branch: test |
|
1112 | |/ branch: test | |
1110 | | bookmark: foo |
|
1113 | | bookmark: foo | |
1111 | | bookmark: four |
|
1114 | | bookmark: four | |
1112 | | phase: public |
|
1115 | | phase: public | |
1113 | | user: test |
|
1116 | | user: test | |
1114 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1117 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1115 | | summary: y |
|
1118 | | summary: y | |
1116 | | |
|
1119 | | | |
1117 | o changeset: 2:db815d6d32e6 |
|
1120 | o changeset: 2:db815d6d32e6 | |
1118 | | bookmark: foo@2 |
|
1121 | | bookmark: foo@2 | |
1119 | | bookmark: should-end-on-two |
|
1122 | | bookmark: should-end-on-two | |
1120 | | bookmark: x y |
|
1123 | | bookmark: x y | |
1121 | | phase: public |
|
1124 | | phase: public | |
1122 | | parent: 0:f7b1eb17ad24 |
|
1125 | | parent: 0:f7b1eb17ad24 | |
1123 | | user: test |
|
1126 | | user: test | |
1124 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1127 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1125 | | summary: 2 |
|
1128 | | summary: 2 | |
1126 | | |
|
1129 | | | |
1127 | | o changeset: 1:925d80f479bb |
|
1130 | | o changeset: 1:925d80f479bb | |
1128 | |/ bookmark: X2 |
|
1131 | |/ bookmark: X2 | |
1129 | | bookmark: Z@1 |
|
1132 | | bookmark: Z@1 | |
1130 | | phase: public |
|
1133 | | phase: public | |
1131 | | user: test |
|
1134 | | user: test | |
1132 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1135 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1133 | | summary: 1 |
|
1136 | | summary: 1 | |
1134 | | |
|
1137 | | | |
1135 | o changeset: 0:f7b1eb17ad24 |
|
1138 | o changeset: 0:f7b1eb17ad24 | |
1136 | bookmark: foo@1 |
|
1139 | bookmark: foo@1 | |
1137 | phase: public |
|
1140 | phase: public | |
1138 | user: test |
|
1141 | user: test | |
1139 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1142 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1140 | summary: 0 |
|
1143 | summary: 0 | |
1141 |
|
1144 | |||
1142 |
|
1145 | |||
1143 | attempt to create on a default changeset |
|
1146 | attempt to create on a default changeset | |
1144 |
|
1147 | |||
1145 | $ hg bookmark -r 81dcce76aa0b NEW |
|
1148 | $ hg bookmark -r 81dcce76aa0b NEW | |
1146 | transaction abort! |
|
1149 | transaction abort! | |
1147 | rollback completed |
|
1150 | rollback completed | |
1148 | abort: pretxnclose-bookmark.force-public hook exited with status 1 |
|
1151 | abort: pretxnclose-bookmark.force-public hook exited with status 1 | |
1149 | [255] |
|
1152 | [255] | |
1150 |
|
1153 | |||
1151 | create on a public changeset |
|
1154 | create on a public changeset | |
1152 |
|
1155 | |||
1153 | $ hg bookmark -r 9ba5f110a0b3 NEW |
|
1156 | $ hg bookmark -r 9ba5f110a0b3 NEW | |
1154 |
|
1157 | |||
1155 | move to the other branch |
|
1158 | move to the other branch | |
1156 |
|
1159 | |||
1157 | $ hg bookmark -f -r 125c9a1d6df6 NEW |
|
1160 | $ hg bookmark -f -r 125c9a1d6df6 NEW | |
1158 | transaction abort! |
|
1161 | transaction abort! | |
1159 | rollback completed |
|
1162 | rollback completed | |
1160 | abort: pretxnclose-bookmark.force-forward hook exited with status 1 |
|
1163 | abort: pretxnclose-bookmark.force-forward hook exited with status 1 | |
1161 | [255] |
|
1164 | [255] |
@@ -1,825 +1,828 b'' | |||||
|
1 | $ cat > $TESTTMP/hook.sh << 'EOF' | |||
|
2 | > echo "test-hook-close-phase: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE" | |||
|
3 | > EOF | |||
1 |
|
4 | |||
2 | $ cat >> $HGRCPATH << EOF |
|
5 | $ cat >> $HGRCPATH << EOF | |
3 | > [extensions] |
|
6 | > [extensions] | |
4 | > phasereport=$TESTDIR/testlib/ext-phase-report.py |
|
7 | > phasereport=$TESTDIR/testlib/ext-phase-report.py | |
5 | > [hooks] |
|
8 | > [hooks] | |
6 | > txnclose-phase.test = echo "test-hook-close-phase: \$HG_NODE: \$HG_OLDPHASE -> \$HG_PHASE" |
|
9 | > txnclose-phase.test = sh $TESTTMP/hook.sh | |
7 | > EOF |
|
10 | > EOF | |
8 |
|
11 | |||
9 | $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; } |
|
12 | $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; } | |
10 | $ mkcommit() { |
|
13 | $ mkcommit() { | |
11 | > echo "$1" > "$1" |
|
14 | > echo "$1" > "$1" | |
12 | > hg add "$1" |
|
15 | > hg add "$1" | |
13 | > message="$1" |
|
16 | > message="$1" | |
14 | > shift |
|
17 | > shift | |
15 | > hg ci -m "$message" $* |
|
18 | > hg ci -m "$message" $* | |
16 | > } |
|
19 | > } | |
17 |
|
20 | |||
18 | $ hg init initialrepo |
|
21 | $ hg init initialrepo | |
19 | $ cd initialrepo |
|
22 | $ cd initialrepo | |
20 |
|
23 | |||
21 | Cannot change null revision phase |
|
24 | Cannot change null revision phase | |
22 |
|
25 | |||
23 | $ hg phase --force --secret null |
|
26 | $ hg phase --force --secret null | |
24 | abort: cannot change null revision phase |
|
27 | abort: cannot change null revision phase | |
25 | [255] |
|
28 | [255] | |
26 | $ hg phase null |
|
29 | $ hg phase null | |
27 | -1: public |
|
30 | -1: public | |
28 |
|
31 | |||
29 | $ mkcommit A |
|
32 | $ mkcommit A | |
30 | test-debug-phase: new rev 0: x -> 1 |
|
33 | test-debug-phase: new rev 0: x -> 1 | |
31 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft |
|
34 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft | |
32 |
|
35 | |||
33 | New commit are draft by default |
|
36 | New commit are draft by default | |
34 |
|
37 | |||
35 | $ hglog |
|
38 | $ hglog | |
36 | 0 1 A |
|
39 | 0 1 A | |
37 |
|
40 | |||
38 | Following commit are draft too |
|
41 | Following commit are draft too | |
39 |
|
42 | |||
40 | $ mkcommit B |
|
43 | $ mkcommit B | |
41 | test-debug-phase: new rev 1: x -> 1 |
|
44 | test-debug-phase: new rev 1: x -> 1 | |
42 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> draft |
|
45 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> draft | |
43 |
|
46 | |||
44 | $ hglog |
|
47 | $ hglog | |
45 | 1 1 B |
|
48 | 1 1 B | |
46 | 0 1 A |
|
49 | 0 1 A | |
47 |
|
50 | |||
48 | Draft commit are properly created over public one: |
|
51 | Draft commit are properly created over public one: | |
49 |
|
52 | |||
50 | $ hg phase --public . |
|
53 | $ hg phase --public . | |
51 | test-debug-phase: move rev 0: 1 -> 0 |
|
54 | test-debug-phase: move rev 0: 1 -> 0 | |
52 | test-debug-phase: move rev 1: 1 -> 0 |
|
55 | test-debug-phase: move rev 1: 1 -> 0 | |
53 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> public |
|
56 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> public | |
54 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public |
|
57 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public | |
55 | $ hg phase |
|
58 | $ hg phase | |
56 | 1: public |
|
59 | 1: public | |
57 | $ hglog |
|
60 | $ hglog | |
58 | 1 0 B |
|
61 | 1 0 B | |
59 | 0 0 A |
|
62 | 0 0 A | |
60 |
|
63 | |||
61 | $ mkcommit C |
|
64 | $ mkcommit C | |
62 | test-debug-phase: new rev 2: x -> 1 |
|
65 | test-debug-phase: new rev 2: x -> 1 | |
63 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft |
|
66 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft | |
64 | $ mkcommit D |
|
67 | $ mkcommit D | |
65 | test-debug-phase: new rev 3: x -> 1 |
|
68 | test-debug-phase: new rev 3: x -> 1 | |
66 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft |
|
69 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft | |
67 |
|
70 | |||
68 | $ hglog |
|
71 | $ hglog | |
69 | 3 1 D |
|
72 | 3 1 D | |
70 | 2 1 C |
|
73 | 2 1 C | |
71 | 1 0 B |
|
74 | 1 0 B | |
72 | 0 0 A |
|
75 | 0 0 A | |
73 |
|
76 | |||
74 | Test creating changeset as secret |
|
77 | Test creating changeset as secret | |
75 |
|
78 | |||
76 | $ mkcommit E --config phases.new-commit='secret' |
|
79 | $ mkcommit E --config phases.new-commit='secret' | |
77 | test-debug-phase: new rev 4: x -> 2 |
|
80 | test-debug-phase: new rev 4: x -> 2 | |
78 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> secret |
|
81 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> secret | |
79 | $ hglog |
|
82 | $ hglog | |
80 | 4 2 E |
|
83 | 4 2 E | |
81 | 3 1 D |
|
84 | 3 1 D | |
82 | 2 1 C |
|
85 | 2 1 C | |
83 | 1 0 B |
|
86 | 1 0 B | |
84 | 0 0 A |
|
87 | 0 0 A | |
85 |
|
88 | |||
86 | Test the secret property is inherited |
|
89 | Test the secret property is inherited | |
87 |
|
90 | |||
88 | $ mkcommit H |
|
91 | $ mkcommit H | |
89 | test-debug-phase: new rev 5: x -> 2 |
|
92 | test-debug-phase: new rev 5: x -> 2 | |
90 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret |
|
93 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret | |
91 | $ hglog |
|
94 | $ hglog | |
92 | 5 2 H |
|
95 | 5 2 H | |
93 | 4 2 E |
|
96 | 4 2 E | |
94 | 3 1 D |
|
97 | 3 1 D | |
95 | 2 1 C |
|
98 | 2 1 C | |
96 | 1 0 B |
|
99 | 1 0 B | |
97 | 0 0 A |
|
100 | 0 0 A | |
98 |
|
101 | |||
99 | Even on merge |
|
102 | Even on merge | |
100 |
|
103 | |||
101 | $ hg up -q 1 |
|
104 | $ hg up -q 1 | |
102 | $ mkcommit "B'" |
|
105 | $ mkcommit "B'" | |
103 | test-debug-phase: new rev 6: x -> 1 |
|
106 | test-debug-phase: new rev 6: x -> 1 | |
104 | created new head |
|
107 | created new head | |
105 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft |
|
108 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft | |
106 | $ hglog |
|
109 | $ hglog | |
107 | 6 1 B' |
|
110 | 6 1 B' | |
108 | 5 2 H |
|
111 | 5 2 H | |
109 | 4 2 E |
|
112 | 4 2 E | |
110 | 3 1 D |
|
113 | 3 1 D | |
111 | 2 1 C |
|
114 | 2 1 C | |
112 | 1 0 B |
|
115 | 1 0 B | |
113 | 0 0 A |
|
116 | 0 0 A | |
114 | $ hg merge 4 # E |
|
117 | $ hg merge 4 # E | |
115 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
118 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
116 | (branch merge, don't forget to commit) |
|
119 | (branch merge, don't forget to commit) | |
117 | $ hg phase |
|
120 | $ hg phase | |
118 | 6: draft |
|
121 | 6: draft | |
119 | 4: secret |
|
122 | 4: secret | |
120 | $ hg ci -m "merge B' and E" |
|
123 | $ hg ci -m "merge B' and E" | |
121 | test-debug-phase: new rev 7: x -> 2 |
|
124 | test-debug-phase: new rev 7: x -> 2 | |
122 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> secret |
|
125 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> secret | |
123 |
|
126 | |||
124 | $ hglog |
|
127 | $ hglog | |
125 | 7 2 merge B' and E |
|
128 | 7 2 merge B' and E | |
126 | 6 1 B' |
|
129 | 6 1 B' | |
127 | 5 2 H |
|
130 | 5 2 H | |
128 | 4 2 E |
|
131 | 4 2 E | |
129 | 3 1 D |
|
132 | 3 1 D | |
130 | 2 1 C |
|
133 | 2 1 C | |
131 | 1 0 B |
|
134 | 1 0 B | |
132 | 0 0 A |
|
135 | 0 0 A | |
133 |
|
136 | |||
134 | Test secret changeset are not pushed |
|
137 | Test secret changeset are not pushed | |
135 |
|
138 | |||
136 | $ hg init ../push-dest |
|
139 | $ hg init ../push-dest | |
137 | $ cat > ../push-dest/.hg/hgrc << EOF |
|
140 | $ cat > ../push-dest/.hg/hgrc << EOF | |
138 | > [phases] |
|
141 | > [phases] | |
139 | > publish=False |
|
142 | > publish=False | |
140 | > EOF |
|
143 | > EOF | |
141 | $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n' |
|
144 | $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n' | |
142 | comparing with ../push-dest |
|
145 | comparing with ../push-dest | |
143 | searching for changes |
|
146 | searching for changes | |
144 | 0 public A |
|
147 | 0 public A | |
145 | 1 public B |
|
148 | 1 public B | |
146 | 2 draft C |
|
149 | 2 draft C | |
147 | 3 draft D |
|
150 | 3 draft D | |
148 | 6 draft B' |
|
151 | 6 draft B' | |
149 | $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n' |
|
152 | $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n' | |
150 | comparing with ../push-dest |
|
153 | comparing with ../push-dest | |
151 | searching for changes |
|
154 | searching for changes | |
152 | 0 public A |
|
155 | 0 public A | |
153 | 1 public B |
|
156 | 1 public B | |
154 | 2 draft C |
|
157 | 2 draft C | |
155 | 3 draft D |
|
158 | 3 draft D | |
156 | 6 draft B' |
|
159 | 6 draft B' | |
157 |
|
160 | |||
158 | $ hg push ../push-dest -f # force because we push multiple heads |
|
161 | $ hg push ../push-dest -f # force because we push multiple heads | |
159 | pushing to ../push-dest |
|
162 | pushing to ../push-dest | |
160 | searching for changes |
|
163 | searching for changes | |
161 | adding changesets |
|
164 | adding changesets | |
162 | adding manifests |
|
165 | adding manifests | |
163 | adding file changes |
|
166 | adding file changes | |
164 | added 5 changesets with 5 changes to 5 files (+1 heads) |
|
167 | added 5 changesets with 5 changes to 5 files (+1 heads) | |
165 | test-debug-phase: new rev 0: x -> 0 |
|
168 | test-debug-phase: new rev 0: x -> 0 | |
166 | test-debug-phase: new rev 1: x -> 0 |
|
169 | test-debug-phase: new rev 1: x -> 0 | |
167 | test-debug-phase: new rev 2: x -> 1 |
|
170 | test-debug-phase: new rev 2: x -> 1 | |
168 | test-debug-phase: new rev 3: x -> 1 |
|
171 | test-debug-phase: new rev 3: x -> 1 | |
169 | test-debug-phase: new rev 4: x -> 1 |
|
172 | test-debug-phase: new rev 4: x -> 1 | |
170 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
|
173 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public | |
171 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
|
174 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public | |
172 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft |
|
175 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft | |
173 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft |
|
176 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft | |
174 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft |
|
177 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft | |
175 | $ hglog |
|
178 | $ hglog | |
176 | 7 2 merge B' and E |
|
179 | 7 2 merge B' and E | |
177 | 6 1 B' |
|
180 | 6 1 B' | |
178 | 5 2 H |
|
181 | 5 2 H | |
179 | 4 2 E |
|
182 | 4 2 E | |
180 | 3 1 D |
|
183 | 3 1 D | |
181 | 2 1 C |
|
184 | 2 1 C | |
182 | 1 0 B |
|
185 | 1 0 B | |
183 | 0 0 A |
|
186 | 0 0 A | |
184 | $ cd ../push-dest |
|
187 | $ cd ../push-dest | |
185 | $ hglog |
|
188 | $ hglog | |
186 | 4 1 B' |
|
189 | 4 1 B' | |
187 | 3 1 D |
|
190 | 3 1 D | |
188 | 2 1 C |
|
191 | 2 1 C | |
189 | 1 0 B |
|
192 | 1 0 B | |
190 | 0 0 A |
|
193 | 0 0 A | |
191 |
|
194 | |||
192 | (Issue3303) |
|
195 | (Issue3303) | |
193 | Check that remote secret changeset are ignore when checking creation of remote heads |
|
196 | Check that remote secret changeset are ignore when checking creation of remote heads | |
194 |
|
197 | |||
195 | We add a secret head into the push destination. This secret head shadows a |
|
198 | We add a secret head into the push destination. This secret head shadows a | |
196 | visible shared between the initial repo and the push destination. |
|
199 | visible shared between the initial repo and the push destination. | |
197 |
|
200 | |||
198 | $ hg up -q 4 # B' |
|
201 | $ hg up -q 4 # B' | |
199 | $ mkcommit Z --config phases.new-commit=secret |
|
202 | $ mkcommit Z --config phases.new-commit=secret | |
200 | test-debug-phase: new rev 5: x -> 2 |
|
203 | test-debug-phase: new rev 5: x -> 2 | |
201 | test-hook-close-phase: 2713879da13d6eea1ff22b442a5a87cb31a7ce6a: -> secret |
|
204 | test-hook-close-phase: 2713879da13d6eea1ff22b442a5a87cb31a7ce6a: -> secret | |
202 | $ hg phase . |
|
205 | $ hg phase . | |
203 | 5: secret |
|
206 | 5: secret | |
204 |
|
207 | |||
205 | We now try to push a new public changeset that descend from the common public |
|
208 | We now try to push a new public changeset that descend from the common public | |
206 | head shadowed by the remote secret head. |
|
209 | head shadowed by the remote secret head. | |
207 |
|
210 | |||
208 | $ cd ../initialrepo |
|
211 | $ cd ../initialrepo | |
209 | $ hg up -q 6 #B' |
|
212 | $ hg up -q 6 #B' | |
210 | $ mkcommit I |
|
213 | $ mkcommit I | |
211 | test-debug-phase: new rev 8: x -> 1 |
|
214 | test-debug-phase: new rev 8: x -> 1 | |
212 | created new head |
|
215 | created new head | |
213 | test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft |
|
216 | test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft | |
214 | $ hg push ../push-dest |
|
217 | $ hg push ../push-dest | |
215 | pushing to ../push-dest |
|
218 | pushing to ../push-dest | |
216 | searching for changes |
|
219 | searching for changes | |
217 | adding changesets |
|
220 | adding changesets | |
218 | adding manifests |
|
221 | adding manifests | |
219 | adding file changes |
|
222 | adding file changes | |
220 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
223 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
221 | test-debug-phase: new rev 6: x -> 1 |
|
224 | test-debug-phase: new rev 6: x -> 1 | |
222 | test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft |
|
225 | test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft | |
223 |
|
226 | |||
224 | :note: The "(+1 heads)" is wrong as we do not had any visible head |
|
227 | :note: The "(+1 heads)" is wrong as we do not had any visible head | |
225 |
|
228 | |||
226 | check that branch cache with "served" filter are properly computed and stored |
|
229 | check that branch cache with "served" filter are properly computed and stored | |
227 |
|
230 | |||
228 | $ ls ../push-dest/.hg/cache/branch2* |
|
231 | $ ls ../push-dest/.hg/cache/branch2* | |
229 | ../push-dest/.hg/cache/branch2-base |
|
232 | ../push-dest/.hg/cache/branch2-base | |
230 | ../push-dest/.hg/cache/branch2-served |
|
233 | ../push-dest/.hg/cache/branch2-served | |
231 | $ cat ../push-dest/.hg/cache/branch2-served |
|
234 | $ cat ../push-dest/.hg/cache/branch2-served | |
232 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722 |
|
235 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722 | |
233 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default |
|
236 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default | |
234 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default |
|
237 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default | |
235 | $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too |
|
238 | $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too | |
236 | 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft |
|
239 | 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft | |
237 | 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret |
|
240 | 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret | |
238 | 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft |
|
241 | 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft | |
239 | $ ls ../push-dest/.hg/cache/branch2* |
|
242 | $ ls ../push-dest/.hg/cache/branch2* | |
240 | ../push-dest/.hg/cache/branch2-base |
|
243 | ../push-dest/.hg/cache/branch2-base | |
241 | ../push-dest/.hg/cache/branch2-served |
|
244 | ../push-dest/.hg/cache/branch2-served | |
242 | ../push-dest/.hg/cache/branch2-visible |
|
245 | ../push-dest/.hg/cache/branch2-visible | |
243 | $ cat ../push-dest/.hg/cache/branch2-served |
|
246 | $ cat ../push-dest/.hg/cache/branch2-served | |
244 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722 |
|
247 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722 | |
245 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default |
|
248 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default | |
246 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default |
|
249 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default | |
247 | $ cat ../push-dest/.hg/cache/branch2-visible |
|
250 | $ cat ../push-dest/.hg/cache/branch2-visible | |
248 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 |
|
251 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 | |
249 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default |
|
252 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default | |
250 | 2713879da13d6eea1ff22b442a5a87cb31a7ce6a o default |
|
253 | 2713879da13d6eea1ff22b442a5a87cb31a7ce6a o default | |
251 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default |
|
254 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default | |
252 |
|
255 | |||
253 |
|
256 | |||
254 | Restore condition prior extra insertion. |
|
257 | Restore condition prior extra insertion. | |
255 | $ hg -q --config extensions.mq= strip . |
|
258 | $ hg -q --config extensions.mq= strip . | |
256 | $ hg up -q 7 |
|
259 | $ hg up -q 7 | |
257 | $ cd .. |
|
260 | $ cd .. | |
258 |
|
261 | |||
259 | Test secret changeset are not pull |
|
262 | Test secret changeset are not pull | |
260 |
|
263 | |||
261 | $ hg init pull-dest |
|
264 | $ hg init pull-dest | |
262 | $ cd pull-dest |
|
265 | $ cd pull-dest | |
263 | $ hg pull ../initialrepo |
|
266 | $ hg pull ../initialrepo | |
264 | pulling from ../initialrepo |
|
267 | pulling from ../initialrepo | |
265 | requesting all changes |
|
268 | requesting all changes | |
266 | adding changesets |
|
269 | adding changesets | |
267 | adding manifests |
|
270 | adding manifests | |
268 | adding file changes |
|
271 | adding file changes | |
269 | added 5 changesets with 5 changes to 5 files (+1 heads) |
|
272 | added 5 changesets with 5 changes to 5 files (+1 heads) | |
270 | new changesets 4a2df7238c3b:cf9fe039dfd6 |
|
273 | new changesets 4a2df7238c3b:cf9fe039dfd6 | |
271 | test-debug-phase: new rev 0: x -> 0 |
|
274 | test-debug-phase: new rev 0: x -> 0 | |
272 | test-debug-phase: new rev 1: x -> 0 |
|
275 | test-debug-phase: new rev 1: x -> 0 | |
273 | test-debug-phase: new rev 2: x -> 0 |
|
276 | test-debug-phase: new rev 2: x -> 0 | |
274 | test-debug-phase: new rev 3: x -> 0 |
|
277 | test-debug-phase: new rev 3: x -> 0 | |
275 | test-debug-phase: new rev 4: x -> 0 |
|
278 | test-debug-phase: new rev 4: x -> 0 | |
276 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
|
279 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public | |
277 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
|
280 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public | |
278 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public |
|
281 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public | |
279 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public |
|
282 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public | |
280 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public |
|
283 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public | |
281 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
284 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
282 | $ hglog |
|
285 | $ hglog | |
283 | 4 0 B' |
|
286 | 4 0 B' | |
284 | 3 0 D |
|
287 | 3 0 D | |
285 | 2 0 C |
|
288 | 2 0 C | |
286 | 1 0 B |
|
289 | 1 0 B | |
287 | 0 0 A |
|
290 | 0 0 A | |
288 | $ cd .. |
|
291 | $ cd .. | |
289 |
|
292 | |||
290 | But secret can still be bundled explicitly |
|
293 | But secret can still be bundled explicitly | |
291 |
|
294 | |||
292 | $ cd initialrepo |
|
295 | $ cd initialrepo | |
293 | $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg |
|
296 | $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg | |
294 | 4 changesets found |
|
297 | 4 changesets found | |
295 | $ cd .. |
|
298 | $ cd .. | |
296 |
|
299 | |||
297 | Test secret changeset are not cloned |
|
300 | Test secret changeset are not cloned | |
298 | (during local clone) |
|
301 | (during local clone) | |
299 |
|
302 | |||
300 | $ hg clone -qU initialrepo clone-dest |
|
303 | $ hg clone -qU initialrepo clone-dest | |
301 | test-debug-phase: new rev 0: x -> 0 |
|
304 | test-debug-phase: new rev 0: x -> 0 | |
302 | test-debug-phase: new rev 1: x -> 0 |
|
305 | test-debug-phase: new rev 1: x -> 0 | |
303 | test-debug-phase: new rev 2: x -> 0 |
|
306 | test-debug-phase: new rev 2: x -> 0 | |
304 | test-debug-phase: new rev 3: x -> 0 |
|
307 | test-debug-phase: new rev 3: x -> 0 | |
305 | test-debug-phase: new rev 4: x -> 0 |
|
308 | test-debug-phase: new rev 4: x -> 0 | |
306 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
|
309 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public | |
307 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
|
310 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public | |
308 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public |
|
311 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public | |
309 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public |
|
312 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public | |
310 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public |
|
313 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public | |
311 | $ hglog -R clone-dest |
|
314 | $ hglog -R clone-dest | |
312 | 4 0 B' |
|
315 | 4 0 B' | |
313 | 3 0 D |
|
316 | 3 0 D | |
314 | 2 0 C |
|
317 | 2 0 C | |
315 | 1 0 B |
|
318 | 1 0 B | |
316 | 0 0 A |
|
319 | 0 0 A | |
317 |
|
320 | |||
318 | Test summary |
|
321 | Test summary | |
319 |
|
322 | |||
320 | $ hg summary -R clone-dest --verbose |
|
323 | $ hg summary -R clone-dest --verbose | |
321 | parent: -1:000000000000 (no revision checked out) |
|
324 | parent: -1:000000000000 (no revision checked out) | |
322 | branch: default |
|
325 | branch: default | |
323 | commit: (clean) |
|
326 | commit: (clean) | |
324 | update: 5 new changesets (update) |
|
327 | update: 5 new changesets (update) | |
325 | $ hg summary -R initialrepo |
|
328 | $ hg summary -R initialrepo | |
326 | parent: 7:17a481b3bccb tip |
|
329 | parent: 7:17a481b3bccb tip | |
327 | merge B' and E |
|
330 | merge B' and E | |
328 | branch: default |
|
331 | branch: default | |
329 | commit: (clean) (secret) |
|
332 | commit: (clean) (secret) | |
330 | update: 1 new changesets, 2 branch heads (merge) |
|
333 | update: 1 new changesets, 2 branch heads (merge) | |
331 | phases: 3 draft, 3 secret |
|
334 | phases: 3 draft, 3 secret | |
332 | $ hg summary -R initialrepo --quiet |
|
335 | $ hg summary -R initialrepo --quiet | |
333 | parent: 7:17a481b3bccb tip |
|
336 | parent: 7:17a481b3bccb tip | |
334 | update: 1 new changesets, 2 branch heads (merge) |
|
337 | update: 1 new changesets, 2 branch heads (merge) | |
335 |
|
338 | |||
336 | Test revset |
|
339 | Test revset | |
337 |
|
340 | |||
338 | $ cd initialrepo |
|
341 | $ cd initialrepo | |
339 | $ hglog -r 'public()' |
|
342 | $ hglog -r 'public()' | |
340 | 0 0 A |
|
343 | 0 0 A | |
341 | 1 0 B |
|
344 | 1 0 B | |
342 | $ hglog -r 'draft()' |
|
345 | $ hglog -r 'draft()' | |
343 | 2 1 C |
|
346 | 2 1 C | |
344 | 3 1 D |
|
347 | 3 1 D | |
345 | 6 1 B' |
|
348 | 6 1 B' | |
346 | $ hglog -r 'secret()' |
|
349 | $ hglog -r 'secret()' | |
347 | 4 2 E |
|
350 | 4 2 E | |
348 | 5 2 H |
|
351 | 5 2 H | |
349 | 7 2 merge B' and E |
|
352 | 7 2 merge B' and E | |
350 |
|
353 | |||
351 | test that phase are displayed in log at debug level |
|
354 | test that phase are displayed in log at debug level | |
352 |
|
355 | |||
353 | $ hg log --debug |
|
356 | $ hg log --debug | |
354 | changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af |
|
357 | changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af | |
355 | tag: tip |
|
358 | tag: tip | |
356 | phase: secret |
|
359 | phase: secret | |
357 | parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519 |
|
360 | parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519 | |
358 | parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde |
|
361 | parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde | |
359 | manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8 |
|
362 | manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8 | |
360 | user: test |
|
363 | user: test | |
361 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
364 | date: Thu Jan 01 00:00:00 1970 +0000 | |
362 | files+: C D E |
|
365 | files+: C D E | |
363 | extra: branch=default |
|
366 | extra: branch=default | |
364 | description: |
|
367 | description: | |
365 | merge B' and E |
|
368 | merge B' and E | |
366 |
|
369 | |||
367 |
|
370 | |||
368 | changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519 |
|
371 | changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519 | |
369 | phase: draft |
|
372 | phase: draft | |
370 | parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 |
|
373 | parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 | |
371 | parent: -1:0000000000000000000000000000000000000000 |
|
374 | parent: -1:0000000000000000000000000000000000000000 | |
372 | manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a |
|
375 | manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a | |
373 | user: test |
|
376 | user: test | |
374 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
377 | date: Thu Jan 01 00:00:00 1970 +0000 | |
375 | files+: B' |
|
378 | files+: B' | |
376 | extra: branch=default |
|
379 | extra: branch=default | |
377 | description: |
|
380 | description: | |
378 | B' |
|
381 | B' | |
379 |
|
382 | |||
380 |
|
383 | |||
381 | changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8 |
|
384 | changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8 | |
382 | phase: secret |
|
385 | phase: secret | |
383 | parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde |
|
386 | parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde | |
384 | parent: -1:0000000000000000000000000000000000000000 |
|
387 | parent: -1:0000000000000000000000000000000000000000 | |
385 | manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a |
|
388 | manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a | |
386 | user: test |
|
389 | user: test | |
387 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
390 | date: Thu Jan 01 00:00:00 1970 +0000 | |
388 | files+: H |
|
391 | files+: H | |
389 | extra: branch=default |
|
392 | extra: branch=default | |
390 | description: |
|
393 | description: | |
391 | H |
|
394 | H | |
392 |
|
395 | |||
393 |
|
396 | |||
394 | changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde |
|
397 | changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde | |
395 | phase: secret |
|
398 | phase: secret | |
396 | parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e |
|
399 | parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e | |
397 | parent: -1:0000000000000000000000000000000000000000 |
|
400 | parent: -1:0000000000000000000000000000000000000000 | |
398 | manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc |
|
401 | manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc | |
399 | user: test |
|
402 | user: test | |
400 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
403 | date: Thu Jan 01 00:00:00 1970 +0000 | |
401 | files+: E |
|
404 | files+: E | |
402 | extra: branch=default |
|
405 | extra: branch=default | |
403 | description: |
|
406 | description: | |
404 | E |
|
407 | E | |
405 |
|
408 | |||
406 |
|
409 | |||
407 | changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e |
|
410 | changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e | |
408 | phase: draft |
|
411 | phase: draft | |
409 | parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757 |
|
412 | parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757 | |
410 | parent: -1:0000000000000000000000000000000000000000 |
|
413 | parent: -1:0000000000000000000000000000000000000000 | |
411 | manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c |
|
414 | manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c | |
412 | user: test |
|
415 | user: test | |
413 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
416 | date: Thu Jan 01 00:00:00 1970 +0000 | |
414 | files+: D |
|
417 | files+: D | |
415 | extra: branch=default |
|
418 | extra: branch=default | |
416 | description: |
|
419 | description: | |
417 | D |
|
420 | D | |
418 |
|
421 | |||
419 |
|
422 | |||
420 | changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757 |
|
423 | changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757 | |
421 | phase: draft |
|
424 | phase: draft | |
422 | parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 |
|
425 | parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 | |
423 | parent: -1:0000000000000000000000000000000000000000 |
|
426 | parent: -1:0000000000000000000000000000000000000000 | |
424 | manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4 |
|
427 | manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4 | |
425 | user: test |
|
428 | user: test | |
426 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
429 | date: Thu Jan 01 00:00:00 1970 +0000 | |
427 | files+: C |
|
430 | files+: C | |
428 | extra: branch=default |
|
431 | extra: branch=default | |
429 | description: |
|
432 | description: | |
430 | C |
|
433 | C | |
431 |
|
434 | |||
432 |
|
435 | |||
433 | changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 |
|
436 | changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 | |
434 | phase: public |
|
437 | phase: public | |
435 | parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256 |
|
438 | parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256 | |
436 | parent: -1:0000000000000000000000000000000000000000 |
|
439 | parent: -1:0000000000000000000000000000000000000000 | |
437 | manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd |
|
440 | manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd | |
438 | user: test |
|
441 | user: test | |
439 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
442 | date: Thu Jan 01 00:00:00 1970 +0000 | |
440 | files+: B |
|
443 | files+: B | |
441 | extra: branch=default |
|
444 | extra: branch=default | |
442 | description: |
|
445 | description: | |
443 | B |
|
446 | B | |
444 |
|
447 | |||
445 |
|
448 | |||
446 | changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256 |
|
449 | changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256 | |
447 | phase: public |
|
450 | phase: public | |
448 | parent: -1:0000000000000000000000000000000000000000 |
|
451 | parent: -1:0000000000000000000000000000000000000000 | |
449 | parent: -1:0000000000000000000000000000000000000000 |
|
452 | parent: -1:0000000000000000000000000000000000000000 | |
450 | manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83 |
|
453 | manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83 | |
451 | user: test |
|
454 | user: test | |
452 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
455 | date: Thu Jan 01 00:00:00 1970 +0000 | |
453 | files+: A |
|
456 | files+: A | |
454 | extra: branch=default |
|
457 | extra: branch=default | |
455 | description: |
|
458 | description: | |
456 | A |
|
459 | A | |
457 |
|
460 | |||
458 |
|
461 | |||
459 |
|
462 | |||
460 |
|
463 | |||
461 | (Issue3707) |
|
464 | (Issue3707) | |
462 | test invalid phase name |
|
465 | test invalid phase name | |
463 |
|
466 | |||
464 | $ mkcommit I --config phases.new-commit='babar' |
|
467 | $ mkcommit I --config phases.new-commit='babar' | |
465 | transaction abort! |
|
468 | transaction abort! | |
466 | rollback completed |
|
469 | rollback completed | |
467 | abort: phases.new-commit: not a valid phase name ('babar') |
|
470 | abort: phases.new-commit: not a valid phase name ('babar') | |
468 | [255] |
|
471 | [255] | |
469 | Test phase command |
|
472 | Test phase command | |
470 | =================== |
|
473 | =================== | |
471 |
|
474 | |||
472 | initial picture |
|
475 | initial picture | |
473 |
|
476 | |||
474 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
477 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
475 | @ 7 secret merge B' and E |
|
478 | @ 7 secret merge B' and E | |
476 | |\ |
|
479 | |\ | |
477 | | o 6 draft B' |
|
480 | | o 6 draft B' | |
478 | | | |
|
481 | | | | |
479 | +---o 5 secret H |
|
482 | +---o 5 secret H | |
480 | | | |
|
483 | | | | |
481 | o | 4 secret E |
|
484 | o | 4 secret E | |
482 | | | |
|
485 | | | | |
483 | o | 3 draft D |
|
486 | o | 3 draft D | |
484 | | | |
|
487 | | | | |
485 | o | 2 draft C |
|
488 | o | 2 draft C | |
486 | |/ |
|
489 | |/ | |
487 | o 1 public B |
|
490 | o 1 public B | |
488 | | |
|
491 | | | |
489 | o 0 public A |
|
492 | o 0 public A | |
490 |
|
493 | |||
491 |
|
494 | |||
492 | display changesets phase |
|
495 | display changesets phase | |
493 |
|
496 | |||
494 | (mixing -r and plain rev specification) |
|
497 | (mixing -r and plain rev specification) | |
495 |
|
498 | |||
496 | $ hg phase 1::4 -r 7 |
|
499 | $ hg phase 1::4 -r 7 | |
497 | 1: public |
|
500 | 1: public | |
498 | 2: draft |
|
501 | 2: draft | |
499 | 3: draft |
|
502 | 3: draft | |
500 | 4: secret |
|
503 | 4: secret | |
501 | 7: secret |
|
504 | 7: secret | |
502 |
|
505 | |||
503 |
|
506 | |||
504 | move changeset forward |
|
507 | move changeset forward | |
505 |
|
508 | |||
506 | (with -r option) |
|
509 | (with -r option) | |
507 |
|
510 | |||
508 | $ hg phase --public -r 2 |
|
511 | $ hg phase --public -r 2 | |
509 | test-debug-phase: move rev 2: 1 -> 0 |
|
512 | test-debug-phase: move rev 2: 1 -> 0 | |
510 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public |
|
513 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public | |
511 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
514 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
512 | @ 7 secret merge B' and E |
|
515 | @ 7 secret merge B' and E | |
513 | |\ |
|
516 | |\ | |
514 | | o 6 draft B' |
|
517 | | o 6 draft B' | |
515 | | | |
|
518 | | | | |
516 | +---o 5 secret H |
|
519 | +---o 5 secret H | |
517 | | | |
|
520 | | | | |
518 | o | 4 secret E |
|
521 | o | 4 secret E | |
519 | | | |
|
522 | | | | |
520 | o | 3 draft D |
|
523 | o | 3 draft D | |
521 | | | |
|
524 | | | | |
522 | o | 2 public C |
|
525 | o | 2 public C | |
523 | |/ |
|
526 | |/ | |
524 | o 1 public B |
|
527 | o 1 public B | |
525 | | |
|
528 | | | |
526 | o 0 public A |
|
529 | o 0 public A | |
527 |
|
530 | |||
528 |
|
531 | |||
529 | move changeset backward |
|
532 | move changeset backward | |
530 |
|
533 | |||
531 | (without -r option) |
|
534 | (without -r option) | |
532 |
|
535 | |||
533 | $ hg phase --draft --force 2 |
|
536 | $ hg phase --draft --force 2 | |
534 | test-debug-phase: move rev 2: 0 -> 1 |
|
537 | test-debug-phase: move rev 2: 0 -> 1 | |
535 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: public -> draft |
|
538 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: public -> draft | |
536 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
539 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
537 | @ 7 secret merge B' and E |
|
540 | @ 7 secret merge B' and E | |
538 | |\ |
|
541 | |\ | |
539 | | o 6 draft B' |
|
542 | | o 6 draft B' | |
540 | | | |
|
543 | | | | |
541 | +---o 5 secret H |
|
544 | +---o 5 secret H | |
542 | | | |
|
545 | | | | |
543 | o | 4 secret E |
|
546 | o | 4 secret E | |
544 | | | |
|
547 | | | | |
545 | o | 3 draft D |
|
548 | o | 3 draft D | |
546 | | | |
|
549 | | | | |
547 | o | 2 draft C |
|
550 | o | 2 draft C | |
548 | |/ |
|
551 | |/ | |
549 | o 1 public B |
|
552 | o 1 public B | |
550 | | |
|
553 | | | |
551 | o 0 public A |
|
554 | o 0 public A | |
552 |
|
555 | |||
553 |
|
556 | |||
554 | move changeset forward and backward |
|
557 | move changeset forward and backward | |
555 |
|
558 | |||
556 | $ hg phase --draft --force 1::4 |
|
559 | $ hg phase --draft --force 1::4 | |
557 | test-debug-phase: move rev 1: 0 -> 1 |
|
560 | test-debug-phase: move rev 1: 0 -> 1 | |
558 | test-debug-phase: move rev 4: 2 -> 1 |
|
561 | test-debug-phase: move rev 4: 2 -> 1 | |
559 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: public -> draft |
|
562 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: public -> draft | |
560 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft |
|
563 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft | |
561 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
564 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
562 | @ 7 secret merge B' and E |
|
565 | @ 7 secret merge B' and E | |
563 | |\ |
|
566 | |\ | |
564 | | o 6 draft B' |
|
567 | | o 6 draft B' | |
565 | | | |
|
568 | | | | |
566 | +---o 5 secret H |
|
569 | +---o 5 secret H | |
567 | | | |
|
570 | | | | |
568 | o | 4 draft E |
|
571 | o | 4 draft E | |
569 | | | |
|
572 | | | | |
570 | o | 3 draft D |
|
573 | o | 3 draft D | |
571 | | | |
|
574 | | | | |
572 | o | 2 draft C |
|
575 | o | 2 draft C | |
573 | |/ |
|
576 | |/ | |
574 | o 1 draft B |
|
577 | o 1 draft B | |
575 | | |
|
578 | | | |
576 | o 0 public A |
|
579 | o 0 public A | |
577 |
|
580 | |||
578 | test partial failure |
|
581 | test partial failure | |
579 |
|
582 | |||
580 | $ hg phase --public 7 |
|
583 | $ hg phase --public 7 | |
581 | test-debug-phase: move rev 1: 1 -> 0 |
|
584 | test-debug-phase: move rev 1: 1 -> 0 | |
582 | test-debug-phase: move rev 2: 1 -> 0 |
|
585 | test-debug-phase: move rev 2: 1 -> 0 | |
583 | test-debug-phase: move rev 3: 1 -> 0 |
|
586 | test-debug-phase: move rev 3: 1 -> 0 | |
584 | test-debug-phase: move rev 4: 1 -> 0 |
|
587 | test-debug-phase: move rev 4: 1 -> 0 | |
585 | test-debug-phase: move rev 6: 1 -> 0 |
|
588 | test-debug-phase: move rev 6: 1 -> 0 | |
586 | test-debug-phase: move rev 7: 2 -> 0 |
|
589 | test-debug-phase: move rev 7: 2 -> 0 | |
587 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public |
|
590 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public | |
588 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public |
|
591 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public | |
589 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: draft -> public |
|
592 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: draft -> public | |
590 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: draft -> public |
|
593 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: draft -> public | |
591 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: draft -> public |
|
594 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: draft -> public | |
592 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> public |
|
595 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> public | |
593 | $ hg phase --draft '5 or 7' |
|
596 | $ hg phase --draft '5 or 7' | |
594 | test-debug-phase: move rev 5: 2 -> 1 |
|
597 | test-debug-phase: move rev 5: 2 -> 1 | |
595 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: secret -> draft |
|
598 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: secret -> draft | |
596 | cannot move 1 changesets to a higher phase, use --force |
|
599 | cannot move 1 changesets to a higher phase, use --force | |
597 | phase changed for 1 changesets |
|
600 | phase changed for 1 changesets | |
598 | [1] |
|
601 | [1] | |
599 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
602 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
600 | @ 7 public merge B' and E |
|
603 | @ 7 public merge B' and E | |
601 | |\ |
|
604 | |\ | |
602 | | o 6 public B' |
|
605 | | o 6 public B' | |
603 | | | |
|
606 | | | | |
604 | +---o 5 draft H |
|
607 | +---o 5 draft H | |
605 | | | |
|
608 | | | | |
606 | o | 4 public E |
|
609 | o | 4 public E | |
607 | | | |
|
610 | | | | |
608 | o | 3 public D |
|
611 | o | 3 public D | |
609 | | | |
|
612 | | | | |
610 | o | 2 public C |
|
613 | o | 2 public C | |
611 | |/ |
|
614 | |/ | |
612 | o 1 public B |
|
615 | o 1 public B | |
613 | | |
|
616 | | | |
614 | o 0 public A |
|
617 | o 0 public A | |
615 |
|
618 | |||
616 |
|
619 | |||
617 | test complete failure |
|
620 | test complete failure | |
618 |
|
621 | |||
619 | $ hg phase --draft 7 |
|
622 | $ hg phase --draft 7 | |
620 | cannot move 1 changesets to a higher phase, use --force |
|
623 | cannot move 1 changesets to a higher phase, use --force | |
621 | no phases changed |
|
624 | no phases changed | |
622 | [1] |
|
625 | [1] | |
623 |
|
626 | |||
624 | $ cd .. |
|
627 | $ cd .. | |
625 |
|
628 | |||
626 | test hidden changeset are not cloned as public (issue3935) |
|
629 | test hidden changeset are not cloned as public (issue3935) | |
627 |
|
630 | |||
628 | $ cd initialrepo |
|
631 | $ cd initialrepo | |
629 |
|
632 | |||
630 | (enabling evolution) |
|
633 | (enabling evolution) | |
631 | $ cat >> $HGRCPATH << EOF |
|
634 | $ cat >> $HGRCPATH << EOF | |
632 | > [experimental] |
|
635 | > [experimental] | |
633 | > evolution.createmarkers=True |
|
636 | > evolution.createmarkers=True | |
634 | > EOF |
|
637 | > EOF | |
635 |
|
638 | |||
636 | (making a changeset hidden; H in that case) |
|
639 | (making a changeset hidden; H in that case) | |
637 | $ hg debugobsolete `hg id --debug -r 5` |
|
640 | $ hg debugobsolete `hg id --debug -r 5` | |
638 | obsoleted 1 changesets |
|
641 | obsoleted 1 changesets | |
639 |
|
642 | |||
640 | $ cd .. |
|
643 | $ cd .. | |
641 | $ hg clone initialrepo clonewithobs |
|
644 | $ hg clone initialrepo clonewithobs | |
642 | requesting all changes |
|
645 | requesting all changes | |
643 | adding changesets |
|
646 | adding changesets | |
644 | adding manifests |
|
647 | adding manifests | |
645 | adding file changes |
|
648 | adding file changes | |
646 | added 7 changesets with 6 changes to 6 files |
|
649 | added 7 changesets with 6 changes to 6 files | |
647 | new changesets 4a2df7238c3b:17a481b3bccb |
|
650 | new changesets 4a2df7238c3b:17a481b3bccb | |
648 | test-debug-phase: new rev 0: x -> 0 |
|
651 | test-debug-phase: new rev 0: x -> 0 | |
649 | test-debug-phase: new rev 1: x -> 0 |
|
652 | test-debug-phase: new rev 1: x -> 0 | |
650 | test-debug-phase: new rev 2: x -> 0 |
|
653 | test-debug-phase: new rev 2: x -> 0 | |
651 | test-debug-phase: new rev 3: x -> 0 |
|
654 | test-debug-phase: new rev 3: x -> 0 | |
652 | test-debug-phase: new rev 4: x -> 0 |
|
655 | test-debug-phase: new rev 4: x -> 0 | |
653 | test-debug-phase: new rev 5: x -> 0 |
|
656 | test-debug-phase: new rev 5: x -> 0 | |
654 | test-debug-phase: new rev 6: x -> 0 |
|
657 | test-debug-phase: new rev 6: x -> 0 | |
655 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
|
658 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public | |
656 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
|
659 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public | |
657 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public |
|
660 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public | |
658 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public |
|
661 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public | |
659 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> public |
|
662 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> public | |
660 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public |
|
663 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public | |
661 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> public |
|
664 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> public | |
662 | updating to branch default |
|
665 | updating to branch default | |
663 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
666 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
664 | $ cd clonewithobs |
|
667 | $ cd clonewithobs | |
665 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
668 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
666 | @ 6 public merge B' and E |
|
669 | @ 6 public merge B' and E | |
667 | |\ |
|
670 | |\ | |
668 | | o 5 public B' |
|
671 | | o 5 public B' | |
669 | | | |
|
672 | | | | |
670 | o | 4 public E |
|
673 | o | 4 public E | |
671 | | | |
|
674 | | | | |
672 | o | 3 public D |
|
675 | o | 3 public D | |
673 | | | |
|
676 | | | | |
674 | o | 2 public C |
|
677 | o | 2 public C | |
675 | |/ |
|
678 | |/ | |
676 | o 1 public B |
|
679 | o 1 public B | |
677 | | |
|
680 | | | |
678 | o 0 public A |
|
681 | o 0 public A | |
679 |
|
682 | |||
680 |
|
683 | |||
681 | test verify repo containing hidden changesets, which should not abort just |
|
684 | test verify repo containing hidden changesets, which should not abort just | |
682 | because repo.cancopy() is False |
|
685 | because repo.cancopy() is False | |
683 |
|
686 | |||
684 | $ cd ../initialrepo |
|
687 | $ cd ../initialrepo | |
685 | $ hg verify |
|
688 | $ hg verify | |
686 | checking changesets |
|
689 | checking changesets | |
687 | checking manifests |
|
690 | checking manifests | |
688 | crosschecking files in changesets and manifests |
|
691 | crosschecking files in changesets and manifests | |
689 | checking files |
|
692 | checking files | |
690 | 7 files, 8 changesets, 7 total revisions |
|
693 | 7 files, 8 changesets, 7 total revisions | |
691 |
|
694 | |||
692 | $ cd .. |
|
695 | $ cd .. | |
693 |
|
696 | |||
694 | check whether HG_PENDING makes pending changes only in related |
|
697 | check whether HG_PENDING makes pending changes only in related | |
695 | repositories visible to an external hook. |
|
698 | repositories visible to an external hook. | |
696 |
|
699 | |||
697 | (emulate a transaction running concurrently by copied |
|
700 | (emulate a transaction running concurrently by copied | |
698 | .hg/phaseroots.pending in subsequent test) |
|
701 | .hg/phaseroots.pending in subsequent test) | |
699 |
|
702 | |||
700 | $ cat > $TESTTMP/savepending.sh <<EOF |
|
703 | $ cat > $TESTTMP/savepending.sh <<EOF | |
701 | > cp .hg/store/phaseroots.pending .hg/store/phaseroots.pending.saved |
|
704 | > cp .hg/store/phaseroots.pending .hg/store/phaseroots.pending.saved | |
702 | > exit 1 # to avoid changing phase for subsequent tests |
|
705 | > exit 1 # to avoid changing phase for subsequent tests | |
703 | > EOF |
|
706 | > EOF | |
704 | $ cd push-dest |
|
707 | $ cd push-dest | |
705 | $ hg phase 6 |
|
708 | $ hg phase 6 | |
706 | 6: draft |
|
709 | 6: draft | |
707 | $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6 |
|
710 | $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6 | |
708 | transaction abort! |
|
711 | transaction abort! | |
709 | rollback completed |
|
712 | rollback completed | |
710 | abort: pretxnclose hook exited with status 1 |
|
713 | abort: pretxnclose hook exited with status 1 | |
711 | [255] |
|
714 | [255] | |
712 | $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending |
|
715 | $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending | |
713 |
|
716 | |||
714 | (check (in)visibility of phaseroot while transaction running in repo) |
|
717 | (check (in)visibility of phaseroot while transaction running in repo) | |
715 |
|
718 | |||
716 | $ cat > $TESTTMP/checkpending.sh <<EOF |
|
719 | $ cat > $TESTTMP/checkpending.sh <<EOF | |
717 | > echo '@initialrepo' |
|
720 | > echo '@initialrepo' | |
718 | > hg -R "$TESTTMP/initialrepo" phase 7 |
|
721 | > hg -R "$TESTTMP/initialrepo" phase 7 | |
719 | > echo '@push-dest' |
|
722 | > echo '@push-dest' | |
720 | > hg -R "$TESTTMP/push-dest" phase 6 |
|
723 | > hg -R "$TESTTMP/push-dest" phase 6 | |
721 | > exit 1 # to avoid changing phase for subsequent tests |
|
724 | > exit 1 # to avoid changing phase for subsequent tests | |
722 | > EOF |
|
725 | > EOF | |
723 | $ cd ../initialrepo |
|
726 | $ cd ../initialrepo | |
724 | $ hg phase 7 |
|
727 | $ hg phase 7 | |
725 | 7: public |
|
728 | 7: public | |
726 | $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" phase -f -s 7 |
|
729 | $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" phase -f -s 7 | |
727 | @initialrepo |
|
730 | @initialrepo | |
728 | 7: secret |
|
731 | 7: secret | |
729 | @push-dest |
|
732 | @push-dest | |
730 | 6: draft |
|
733 | 6: draft | |
731 | transaction abort! |
|
734 | transaction abort! | |
732 | rollback completed |
|
735 | rollback completed | |
733 | abort: pretxnclose hook exited with status 1 |
|
736 | abort: pretxnclose hook exited with status 1 | |
734 | [255] |
|
737 | [255] | |
735 |
|
738 | |||
736 | Check that pretxnclose-phase hook can control phase movement |
|
739 | Check that pretxnclose-phase hook can control phase movement | |
737 |
|
740 | |||
738 | $ hg phase --force b3325c91a4d9 --secret |
|
741 | $ hg phase --force b3325c91a4d9 --secret | |
739 | test-debug-phase: move rev 3: 0 -> 2 |
|
742 | test-debug-phase: move rev 3: 0 -> 2 | |
740 | test-debug-phase: move rev 4: 0 -> 2 |
|
743 | test-debug-phase: move rev 4: 0 -> 2 | |
741 | test-debug-phase: move rev 5: 1 -> 2 |
|
744 | test-debug-phase: move rev 5: 1 -> 2 | |
742 | test-debug-phase: move rev 7: 0 -> 2 |
|
745 | test-debug-phase: move rev 7: 0 -> 2 | |
743 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: public -> secret |
|
746 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: public -> secret | |
744 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: public -> secret |
|
747 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: public -> secret | |
745 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: draft -> secret |
|
748 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: draft -> secret | |
746 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: public -> secret |
|
749 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: public -> secret | |
747 | $ hg log -G -T phases |
|
750 | $ hg log -G -T phases | |
748 | @ changeset: 7:17a481b3bccb |
|
751 | @ changeset: 7:17a481b3bccb | |
749 | |\ tag: tip |
|
752 | |\ tag: tip | |
750 | | | phase: secret |
|
753 | | | phase: secret | |
751 | | | parent: 6:cf9fe039dfd6 |
|
754 | | | parent: 6:cf9fe039dfd6 | |
752 | | | parent: 4:a603bfb5a83e |
|
755 | | | parent: 4:a603bfb5a83e | |
753 | | | user: test |
|
756 | | | user: test | |
754 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
757 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
755 | | | summary: merge B' and E |
|
758 | | | summary: merge B' and E | |
756 | | | |
|
759 | | | | |
757 | | o changeset: 6:cf9fe039dfd6 |
|
760 | | o changeset: 6:cf9fe039dfd6 | |
758 | | | phase: public |
|
761 | | | phase: public | |
759 | | | parent: 1:27547f69f254 |
|
762 | | | parent: 1:27547f69f254 | |
760 | | | user: test |
|
763 | | | user: test | |
761 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
764 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
762 | | | summary: B' |
|
765 | | | summary: B' | |
763 | | | |
|
766 | | | | |
764 | o | changeset: 4:a603bfb5a83e |
|
767 | o | changeset: 4:a603bfb5a83e | |
765 | | | phase: secret |
|
768 | | | phase: secret | |
766 | | | user: test |
|
769 | | | user: test | |
767 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
770 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
768 | | | summary: E |
|
771 | | | summary: E | |
769 | | | |
|
772 | | | | |
770 | o | changeset: 3:b3325c91a4d9 |
|
773 | o | changeset: 3:b3325c91a4d9 | |
771 | | | phase: secret |
|
774 | | | phase: secret | |
772 | | | user: test |
|
775 | | | user: test | |
773 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
776 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
774 | | | summary: D |
|
777 | | | summary: D | |
775 | | | |
|
778 | | | | |
776 | o | changeset: 2:f838bfaca5c7 |
|
779 | o | changeset: 2:f838bfaca5c7 | |
777 | |/ phase: public |
|
780 | |/ phase: public | |
778 | | user: test |
|
781 | | user: test | |
779 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
782 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
780 | | summary: C |
|
783 | | summary: C | |
781 | | |
|
784 | | | |
782 | o changeset: 1:27547f69f254 |
|
785 | o changeset: 1:27547f69f254 | |
783 | | phase: public |
|
786 | | phase: public | |
784 | | user: test |
|
787 | | user: test | |
785 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
788 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
786 | | summary: B |
|
789 | | summary: B | |
787 | | |
|
790 | | | |
788 | o changeset: 0:4a2df7238c3b |
|
791 | o changeset: 0:4a2df7238c3b | |
789 | phase: public |
|
792 | phase: public | |
790 | user: test |
|
793 | user: test | |
791 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
794 | date: Thu Jan 01 00:00:00 1970 +0000 | |
792 | summary: A |
|
795 | summary: A | |
793 |
|
796 | |||
794 |
|
797 | |||
795 | Install a hook that prevent b3325c91a4d9 to become public |
|
798 | Install a hook that prevent b3325c91a4d9 to become public | |
796 |
|
799 | |||
797 | $ cat >> .hg/hgrc << EOF |
|
800 | $ cat >> .hg/hgrc << EOF | |
798 | > [hooks] |
|
801 | > [hooks] | |
799 |
> pretxnclose-phase.nopublish_D = |
|
802 | > pretxnclose-phase.nopublish_D = sh -c "(echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 'public' != \$HG_PHASE ]" | |
800 | > EOF |
|
803 | > EOF | |
801 |
|
804 | |||
802 | Try various actions. only the draft move should succeed |
|
805 | Try various actions. only the draft move should succeed | |
803 |
|
806 | |||
804 | $ hg phase --public b3325c91a4d9 |
|
807 | $ hg phase --public b3325c91a4d9 | |
805 | transaction abort! |
|
808 | transaction abort! | |
806 | rollback completed |
|
809 | rollback completed | |
807 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
|
810 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 | |
808 | [255] |
|
811 | [255] | |
809 | $ hg phase --public a603bfb5a83e |
|
812 | $ hg phase --public a603bfb5a83e | |
810 | transaction abort! |
|
813 | transaction abort! | |
811 | rollback completed |
|
814 | rollback completed | |
812 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
|
815 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 | |
813 | [255] |
|
816 | [255] | |
814 | $ hg phase --draft 17a481b3bccb |
|
817 | $ hg phase --draft 17a481b3bccb | |
815 | test-debug-phase: move rev 3: 2 -> 1 |
|
818 | test-debug-phase: move rev 3: 2 -> 1 | |
816 | test-debug-phase: move rev 4: 2 -> 1 |
|
819 | test-debug-phase: move rev 4: 2 -> 1 | |
817 | test-debug-phase: move rev 7: 2 -> 1 |
|
820 | test-debug-phase: move rev 7: 2 -> 1 | |
818 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: secret -> draft |
|
821 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: secret -> draft | |
819 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft |
|
822 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft | |
820 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> draft |
|
823 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> draft | |
821 | $ hg phase --public 17a481b3bccb |
|
824 | $ hg phase --public 17a481b3bccb | |
822 | transaction abort! |
|
825 | transaction abort! | |
823 | rollback completed |
|
826 | rollback completed | |
824 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
|
827 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 | |
825 | [255] |
|
828 | [255] |
@@ -1,198 +1,202 b'' | |||||
1 | #require killdaemons |
|
1 | #require killdaemons | |
2 |
|
2 | |||
3 | $ hg init test |
|
3 | $ hg init test | |
4 | $ cd test |
|
4 | $ cd test | |
5 | $ echo a > a |
|
5 | $ echo a > a | |
6 | $ hg ci -Ama |
|
6 | $ hg ci -Ama | |
7 | adding a |
|
7 | adding a | |
8 | $ cd .. |
|
8 | $ cd .. | |
9 | $ hg clone test test2 |
|
9 | $ hg clone test test2 | |
10 | updating to branch default |
|
10 | updating to branch default | |
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
12 | $ cd test2 |
|
12 | $ cd test2 | |
13 | $ echo a >> a |
|
13 | $ echo a >> a | |
14 | $ hg ci -mb |
|
14 | $ hg ci -mb | |
15 | $ req() { |
|
15 | $ req() { | |
16 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
16 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
17 | > cat hg.pid >> $DAEMON_PIDS |
|
17 | > cat hg.pid >> $DAEMON_PIDS | |
18 | > hg --cwd ../test2 push http://localhost:$HGPORT/ |
|
18 | > hg --cwd ../test2 push http://localhost:$HGPORT/ | |
19 | > exitstatus=$? |
|
19 | > exitstatus=$? | |
20 | > killdaemons.py |
|
20 | > killdaemons.py | |
21 | > echo % serve errors |
|
21 | > echo % serve errors | |
22 | > cat errors.log |
|
22 | > cat errors.log | |
23 | > return $exitstatus |
|
23 | > return $exitstatus | |
24 | > } |
|
24 | > } | |
25 | $ cd ../test |
|
25 | $ cd ../test | |
26 |
|
26 | |||
27 | expect ssl error |
|
27 | expect ssl error | |
28 |
|
28 | |||
29 | $ req |
|
29 | $ req | |
30 | pushing to http://localhost:$HGPORT/ |
|
30 | pushing to http://localhost:$HGPORT/ | |
31 | searching for changes |
|
31 | searching for changes | |
32 | abort: HTTP Error 403: ssl required |
|
32 | abort: HTTP Error 403: ssl required | |
33 | % serve errors |
|
33 | % serve errors | |
34 | [255] |
|
34 | [255] | |
35 |
|
35 | |||
36 | expect authorization error |
|
36 | expect authorization error | |
37 |
|
37 | |||
38 | $ echo '[web]' > .hg/hgrc |
|
38 | $ echo '[web]' > .hg/hgrc | |
39 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
39 | $ echo 'push_ssl = false' >> .hg/hgrc | |
40 | $ req |
|
40 | $ req | |
41 | pushing to http://localhost:$HGPORT/ |
|
41 | pushing to http://localhost:$HGPORT/ | |
42 | searching for changes |
|
42 | searching for changes | |
43 | abort: authorization failed |
|
43 | abort: authorization failed | |
44 | % serve errors |
|
44 | % serve errors | |
45 | [255] |
|
45 | [255] | |
46 |
|
46 | |||
47 | expect authorization error: must have authorized user |
|
47 | expect authorization error: must have authorized user | |
48 |
|
48 | |||
49 | $ echo 'allow_push = unperson' >> .hg/hgrc |
|
49 | $ echo 'allow_push = unperson' >> .hg/hgrc | |
50 | $ req |
|
50 | $ req | |
51 | pushing to http://localhost:$HGPORT/ |
|
51 | pushing to http://localhost:$HGPORT/ | |
52 | searching for changes |
|
52 | searching for changes | |
53 | abort: authorization failed |
|
53 | abort: authorization failed | |
54 | % serve errors |
|
54 | % serve errors | |
55 | [255] |
|
55 | [255] | |
56 |
|
56 | |||
57 | expect success |
|
57 | expect success | |
58 |
|
58 | |||
|
59 | $ cat > $TESTTMP/hook.sh <<'EOF' | |||
|
60 | > echo "phase-move: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE" | |||
|
61 | > EOF | |||
|
62 | ||||
59 | $ cat >> .hg/hgrc <<EOF |
|
63 | $ cat >> .hg/hgrc <<EOF | |
60 | > allow_push = * |
|
64 | > allow_push = * | |
61 | > [hooks] |
|
65 | > [hooks] | |
62 | > changegroup = sh -c "printenv.py changegroup 0" |
|
66 | > changegroup = sh -c "printenv.py changegroup 0" | |
63 | > pushkey = sh -c "printenv.py pushkey 0" |
|
67 | > pushkey = sh -c "printenv.py pushkey 0" | |
64 | > txnclose-phase.test = echo "phase-move: \$HG_NODE: \$HG_OLDPHASE -> \$HG_PHASE" |
|
68 | > txnclose-phase.test = sh $TESTTMP/hook.sh | |
65 | > EOF |
|
69 | > EOF | |
66 | $ req |
|
70 | $ req | |
67 | pushing to http://localhost:$HGPORT/ |
|
71 | pushing to http://localhost:$HGPORT/ | |
68 | searching for changes |
|
72 | searching for changes | |
69 | remote: adding changesets |
|
73 | remote: adding changesets | |
70 | remote: adding manifests |
|
74 | remote: adding manifests | |
71 | remote: adding file changes |
|
75 | remote: adding file changes | |
72 | remote: added 1 changesets with 1 changes to 1 files |
|
76 | remote: added 1 changesets with 1 changes to 1 files | |
73 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
77 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public | |
74 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
78 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public | |
75 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
79 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |
76 | % serve errors |
|
80 | % serve errors | |
77 | $ hg rollback |
|
81 | $ hg rollback | |
78 | repository tip rolled back to revision 0 (undo serve) |
|
82 | repository tip rolled back to revision 0 (undo serve) | |
79 |
|
83 | |||
80 | expect success, server lacks the httpheader capability |
|
84 | expect success, server lacks the httpheader capability | |
81 |
|
85 | |||
82 | $ CAP=httpheader |
|
86 | $ CAP=httpheader | |
83 | $ . "$TESTDIR/notcapable" |
|
87 | $ . "$TESTDIR/notcapable" | |
84 | $ req |
|
88 | $ req | |
85 | pushing to http://localhost:$HGPORT/ |
|
89 | pushing to http://localhost:$HGPORT/ | |
86 | searching for changes |
|
90 | searching for changes | |
87 | remote: adding changesets |
|
91 | remote: adding changesets | |
88 | remote: adding manifests |
|
92 | remote: adding manifests | |
89 | remote: adding file changes |
|
93 | remote: adding file changes | |
90 | remote: added 1 changesets with 1 changes to 1 files |
|
94 | remote: added 1 changesets with 1 changes to 1 files | |
91 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
95 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public | |
92 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
96 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public | |
93 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
97 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |
94 | % serve errors |
|
98 | % serve errors | |
95 | $ hg rollback |
|
99 | $ hg rollback | |
96 | repository tip rolled back to revision 0 (undo serve) |
|
100 | repository tip rolled back to revision 0 (undo serve) | |
97 |
|
101 | |||
98 | expect success, server lacks the unbundlehash capability |
|
102 | expect success, server lacks the unbundlehash capability | |
99 |
|
103 | |||
100 | $ CAP=unbundlehash |
|
104 | $ CAP=unbundlehash | |
101 | $ . "$TESTDIR/notcapable" |
|
105 | $ . "$TESTDIR/notcapable" | |
102 | $ req |
|
106 | $ req | |
103 | pushing to http://localhost:$HGPORT/ |
|
107 | pushing to http://localhost:$HGPORT/ | |
104 | searching for changes |
|
108 | searching for changes | |
105 | remote: adding changesets |
|
109 | remote: adding changesets | |
106 | remote: adding manifests |
|
110 | remote: adding manifests | |
107 | remote: adding file changes |
|
111 | remote: adding file changes | |
108 | remote: added 1 changesets with 1 changes to 1 files |
|
112 | remote: added 1 changesets with 1 changes to 1 files | |
109 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
113 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public | |
110 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
114 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public | |
111 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
115 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |
112 | % serve errors |
|
116 | % serve errors | |
113 | $ hg rollback |
|
117 | $ hg rollback | |
114 | repository tip rolled back to revision 0 (undo serve) |
|
118 | repository tip rolled back to revision 0 (undo serve) | |
115 |
|
119 | |||
116 | expect push success, phase change failure |
|
120 | expect push success, phase change failure | |
117 |
|
121 | |||
118 | $ cat > .hg/hgrc <<EOF |
|
122 | $ cat > .hg/hgrc <<EOF | |
119 | > [web] |
|
123 | > [web] | |
120 | > push_ssl = false |
|
124 | > push_ssl = false | |
121 | > allow_push = * |
|
125 | > allow_push = * | |
122 | > [hooks] |
|
126 | > [hooks] | |
123 | > prepushkey = sh -c "printenv.py prepushkey 1" |
|
127 | > prepushkey = sh -c "printenv.py prepushkey 1" | |
124 | > [devel] |
|
128 | > [devel] | |
125 | > legacy.exchange=phases |
|
129 | > legacy.exchange=phases | |
126 | > EOF |
|
130 | > EOF | |
127 | $ req |
|
131 | $ req | |
128 | pushing to http://localhost:$HGPORT/ |
|
132 | pushing to http://localhost:$HGPORT/ | |
129 | searching for changes |
|
133 | searching for changes | |
130 | remote: adding changesets |
|
134 | remote: adding changesets | |
131 | remote: adding manifests |
|
135 | remote: adding manifests | |
132 | remote: adding file changes |
|
136 | remote: adding file changes | |
133 | remote: added 1 changesets with 1 changes to 1 files |
|
137 | remote: added 1 changesets with 1 changes to 1 files | |
134 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
138 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |
135 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
139 | remote: pushkey-abort: prepushkey hook exited with status 1 | |
136 | remote: transaction abort! |
|
140 | remote: transaction abort! | |
137 | remote: rollback completed |
|
141 | remote: rollback completed | |
138 | abort: updating ba677d0156c1 to public failed |
|
142 | abort: updating ba677d0156c1 to public failed | |
139 | % serve errors |
|
143 | % serve errors | |
140 | [255] |
|
144 | [255] | |
141 |
|
145 | |||
142 | expect phase change success |
|
146 | expect phase change success | |
143 |
|
147 | |||
144 | $ cat >> .hg/hgrc <<EOF |
|
148 | $ cat >> .hg/hgrc <<EOF | |
145 | > prepushkey = sh -c "printenv.py prepushkey 0" |
|
149 | > prepushkey = sh -c "printenv.py prepushkey 0" | |
146 | > [devel] |
|
150 | > [devel] | |
147 | > legacy.exchange= |
|
151 | > legacy.exchange= | |
148 | > EOF |
|
152 | > EOF | |
149 | $ req |
|
153 | $ req | |
150 | pushing to http://localhost:$HGPORT/ |
|
154 | pushing to http://localhost:$HGPORT/ | |
151 | searching for changes |
|
155 | searching for changes | |
152 | remote: adding changesets |
|
156 | remote: adding changesets | |
153 | remote: adding manifests |
|
157 | remote: adding manifests | |
154 | remote: adding file changes |
|
158 | remote: adding file changes | |
155 | remote: added 1 changesets with 1 changes to 1 files |
|
159 | remote: added 1 changesets with 1 changes to 1 files | |
156 | % serve errors |
|
160 | % serve errors | |
157 | $ hg rollback |
|
161 | $ hg rollback | |
158 | repository tip rolled back to revision 0 (undo serve) |
|
162 | repository tip rolled back to revision 0 (undo serve) | |
159 |
|
163 | |||
160 | expect authorization error: all users denied |
|
164 | expect authorization error: all users denied | |
161 |
|
165 | |||
162 | $ echo '[web]' > .hg/hgrc |
|
166 | $ echo '[web]' > .hg/hgrc | |
163 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
167 | $ echo 'push_ssl = false' >> .hg/hgrc | |
164 | $ echo 'deny_push = *' >> .hg/hgrc |
|
168 | $ echo 'deny_push = *' >> .hg/hgrc | |
165 | $ req |
|
169 | $ req | |
166 | pushing to http://localhost:$HGPORT/ |
|
170 | pushing to http://localhost:$HGPORT/ | |
167 | searching for changes |
|
171 | searching for changes | |
168 | abort: authorization failed |
|
172 | abort: authorization failed | |
169 | % serve errors |
|
173 | % serve errors | |
170 | [255] |
|
174 | [255] | |
171 |
|
175 | |||
172 | expect authorization error: some users denied, users must be authenticated |
|
176 | expect authorization error: some users denied, users must be authenticated | |
173 |
|
177 | |||
174 | $ echo 'deny_push = unperson' >> .hg/hgrc |
|
178 | $ echo 'deny_push = unperson' >> .hg/hgrc | |
175 | $ req |
|
179 | $ req | |
176 | pushing to http://localhost:$HGPORT/ |
|
180 | pushing to http://localhost:$HGPORT/ | |
177 | searching for changes |
|
181 | searching for changes | |
178 | abort: authorization failed |
|
182 | abort: authorization failed | |
179 | % serve errors |
|
183 | % serve errors | |
180 | [255] |
|
184 | [255] | |
181 |
|
185 | |||
182 | $ cat > .hg/hgrc <<EOF |
|
186 | $ cat > .hg/hgrc <<EOF | |
183 | > [web] |
|
187 | > [web] | |
184 | > push_ssl = false |
|
188 | > push_ssl = false | |
185 | > allow_push = * |
|
189 | > allow_push = * | |
186 | > [experimental] |
|
190 | > [experimental] | |
187 | > httppostargs=true |
|
191 | > httppostargs=true | |
188 | > EOF |
|
192 | > EOF | |
189 | $ req |
|
193 | $ req | |
190 | pushing to http://localhost:$HGPORT/ |
|
194 | pushing to http://localhost:$HGPORT/ | |
191 | searching for changes |
|
195 | searching for changes | |
192 | remote: adding changesets |
|
196 | remote: adding changesets | |
193 | remote: adding manifests |
|
197 | remote: adding manifests | |
194 | remote: adding file changes |
|
198 | remote: adding file changes | |
195 | remote: added 1 changesets with 1 changes to 1 files |
|
199 | remote: added 1 changesets with 1 changes to 1 files | |
196 | % serve errors |
|
200 | % serve errors | |
197 |
|
201 | |||
198 | $ cd .. |
|
202 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now