##// END OF EJS Templates
tests: quote $PYTHON for Windows...
Matt Harbison -
r33335:72f051f9 default
parent child Browse files
Show More
@@ -1,1136 +1,1136
1 1 Test exchange of common information using bundle2
2 2
3 3
4 4 $ getmainid() {
5 5 > hg -R main log --template '{node}\n' --rev "$1"
6 6 > }
7 7
8 8 enable obsolescence
9 9
10 10 $ cp $HGRCPATH $TESTTMP/hgrc.orig
11 11 $ cat > $TESTTMP/bundle2-pushkey-hook.sh << EOF
12 12 > echo pushkey: lock state after \"\$HG_NAMESPACE\"
13 13 > hg debuglock
14 14 > EOF
15 15
16 16 $ cat >> $HGRCPATH << EOF
17 17 > [experimental]
18 18 > evolution=createmarkers,exchange
19 19 > bundle2-output-capture=True
20 20 > [ui]
21 > ssh=$PYTHON "$TESTDIR/dummyssh"
21 > ssh="$PYTHON" "$TESTDIR/dummyssh"
22 22 > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
23 23 > [web]
24 24 > push_ssl = false
25 25 > allow_push = *
26 26 > [phases]
27 27 > publish=False
28 28 > [hooks]
29 29 > pretxnclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n"
30 30 > txnclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n"
31 31 > txnclose.env = sh -c "HG_LOCAL= printenv.py txnclose"
32 32 > pushkey= sh "$TESTTMP/bundle2-pushkey-hook.sh"
33 33 > EOF
34 34
35 35 The extension requires a repo (currently unused)
36 36
37 37 $ hg init main
38 38 $ cd main
39 39 $ touch a
40 40 $ hg add a
41 41 $ hg commit -m 'a'
42 42 pre-close-tip:3903775176ed draft
43 43 postclose-tip:3903775176ed draft
44 44 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
45 45
46 46 $ hg unbundle $TESTDIR/bundles/rebase.hg
47 47 adding changesets
48 48 adding manifests
49 49 adding file changes
50 50 added 8 changesets with 7 changes to 7 files (+3 heads)
51 51 pre-close-tip:02de42196ebe draft
52 52 postclose-tip:02de42196ebe draft
53 53 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=unbundle HG_TXNID=TXN:$ID$ HG_TXNNAME=unbundle
54 54 bundle:*/tests/bundles/rebase.hg HG_URL=bundle:*/tests/bundles/rebase.hg (glob)
55 55 (run 'hg heads' to see heads, 'hg merge' to merge)
56 56
57 57 $ cd ..
58 58
59 59 Real world exchange
60 60 =====================
61 61
62 62 Add more obsolescence information
63 63
64 64 $ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc`
65 65 pre-close-tip:02de42196ebe draft
66 66 postclose-tip:02de42196ebe draft
67 67 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
68 68 $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c`
69 69 pre-close-tip:02de42196ebe draft
70 70 postclose-tip:02de42196ebe draft
71 71 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
72 72
73 73 clone --pull
74 74
75 75 $ hg -R main phase --public cd010b8cd998
76 76 pre-close-tip:02de42196ebe draft
77 77 postclose-tip:02de42196ebe draft
78 78 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
79 79 $ hg clone main other --pull --rev 9520eea781bc
80 80 adding changesets
81 81 adding manifests
82 82 adding file changes
83 83 added 2 changesets with 2 changes to 2 files
84 84 1 new obsolescence markers
85 85 pre-close-tip:9520eea781bc draft
86 86 postclose-tip:9520eea781bc draft
87 87 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=9520eea781bcca16c1e15acc0ba14335a0e8e5ba HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
88 88 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
89 89 updating to branch default
90 90 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 91 $ hg -R other log -G
92 92 @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
93 93 |
94 94 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
95 95
96 96 $ hg -R other debugobsolete
97 97 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
98 98
99 99 pull
100 100
101 101 $ hg -R main phase --public 9520eea781bc
102 102 pre-close-tip:02de42196ebe draft
103 103 postclose-tip:02de42196ebe draft
104 104 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
105 105 $ hg -R other pull -r 24b6387c8c8c
106 106 pulling from $TESTTMP/main (glob)
107 107 searching for changes
108 108 adding changesets
109 109 adding manifests
110 110 adding file changes
111 111 added 1 changesets with 1 changes to 1 files (+1 heads)
112 112 1 new obsolescence markers
113 113 pre-close-tip:24b6387c8c8c draft
114 114 postclose-tip:24b6387c8c8c draft
115 115 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_NODE_LAST=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
116 116 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
117 117 (run 'hg heads' to see heads, 'hg merge' to merge)
118 118 $ hg -R other log -G
119 119 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
120 120 |
121 121 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
122 122 |/
123 123 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
124 124
125 125 $ hg -R other debugobsolete
126 126 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
127 127 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
128 128
129 129 pull empty (with phase movement)
130 130
131 131 $ hg -R main phase --public 24b6387c8c8c
132 132 pre-close-tip:02de42196ebe draft
133 133 postclose-tip:02de42196ebe draft
134 134 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
135 135 $ hg -R other pull -r 24b6387c8c8c
136 136 pulling from $TESTTMP/main (glob)
137 137 no changes found
138 138 pre-close-tip:24b6387c8c8c public
139 139 postclose-tip:24b6387c8c8c public
140 140 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
141 141 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
142 142 $ hg -R other log -G
143 143 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
144 144 |
145 145 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
146 146 |/
147 147 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
148 148
149 149 $ hg -R other debugobsolete
150 150 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
151 151 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
152 152
153 153 pull empty
154 154
155 155 $ hg -R other pull -r 24b6387c8c8c
156 156 pulling from $TESTTMP/main (glob)
157 157 no changes found
158 158 pre-close-tip:24b6387c8c8c public
159 159 postclose-tip:24b6387c8c8c public
160 160 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
161 161 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
162 162 $ hg -R other log -G
163 163 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
164 164 |
165 165 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
166 166 |/
167 167 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
168 168
169 169 $ hg -R other debugobsolete
170 170 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
171 171 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
172 172
173 173 add extra data to test their exchange during push
174 174
175 175 $ hg -R main bookmark --rev eea13746799a book_eea1
176 176 pre-close-tip:02de42196ebe draft
177 177 postclose-tip:02de42196ebe draft
178 178 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
179 179 $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a`
180 180 pre-close-tip:02de42196ebe draft
181 181 postclose-tip:02de42196ebe draft
182 182 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
183 183 $ hg -R main bookmark --rev 02de42196ebe book_02de
184 184 pre-close-tip:02de42196ebe draft book_02de
185 185 postclose-tip:02de42196ebe draft book_02de
186 186 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
187 187 $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe`
188 188 pre-close-tip:02de42196ebe draft book_02de
189 189 postclose-tip:02de42196ebe draft book_02de
190 190 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
191 191 $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc
192 192 pre-close-tip:02de42196ebe draft book_02de
193 193 postclose-tip:02de42196ebe draft book_02de
194 194 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
195 195 $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16`
196 196 pre-close-tip:02de42196ebe draft book_02de
197 197 postclose-tip:02de42196ebe draft book_02de
198 198 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
199 199 $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd
200 200 pre-close-tip:02de42196ebe draft book_02de
201 201 postclose-tip:02de42196ebe draft book_02de
202 202 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
203 203 $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8`
204 204 pre-close-tip:02de42196ebe draft book_02de
205 205 postclose-tip:02de42196ebe draft book_02de
206 206 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
207 207 $ hg -R main bookmark --rev 32af7686d403 book_32af
208 208 pre-close-tip:02de42196ebe draft book_02de
209 209 postclose-tip:02de42196ebe draft book_02de
210 210 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
211 211 $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403`
212 212 pre-close-tip:02de42196ebe draft book_02de
213 213 postclose-tip:02de42196ebe draft book_02de
214 214 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
215 215
216 216 $ hg -R other bookmark --rev cd010b8cd998 book_eea1
217 217 pre-close-tip:24b6387c8c8c public
218 218 postclose-tip:24b6387c8c8c public
219 219 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
220 220 $ hg -R other bookmark --rev cd010b8cd998 book_02de
221 221 pre-close-tip:24b6387c8c8c public
222 222 postclose-tip:24b6387c8c8c public
223 223 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
224 224 $ hg -R other bookmark --rev cd010b8cd998 book_42cc
225 225 pre-close-tip:24b6387c8c8c public
226 226 postclose-tip:24b6387c8c8c public
227 227 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
228 228 $ hg -R other bookmark --rev cd010b8cd998 book_5fdd
229 229 pre-close-tip:24b6387c8c8c public
230 230 postclose-tip:24b6387c8c8c public
231 231 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
232 232 $ hg -R other bookmark --rev cd010b8cd998 book_32af
233 233 pre-close-tip:24b6387c8c8c public
234 234 postclose-tip:24b6387c8c8c public
235 235 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
236 236
237 237 $ hg -R main phase --public eea13746799a
238 238 pre-close-tip:02de42196ebe draft book_02de
239 239 postclose-tip:02de42196ebe draft book_02de
240 240 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
241 241
242 242 push
243 243 $ hg -R main push other --rev eea13746799a --bookmark book_eea1
244 244 pushing to other
245 245 searching for changes
246 246 remote: adding changesets
247 247 remote: adding manifests
248 248 remote: adding file changes
249 249 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
250 250 remote: 1 new obsolescence markers
251 251 remote: pre-close-tip:eea13746799a public book_eea1
252 252 remote: pushkey: lock state after "phases"
253 253 remote: lock: free
254 254 remote: wlock: free
255 255 remote: pushkey: lock state after "bookmarks"
256 256 remote: lock: free
257 257 remote: wlock: free
258 258 remote: postclose-tip:eea13746799a public book_eea1
259 259 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_NODE_LAST=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/other
260 260 updating bookmark book_eea1
261 261 pre-close-tip:02de42196ebe draft book_02de
262 262 postclose-tip:02de42196ebe draft book_02de
263 263 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
264 264 file:/*/$TESTTMP/other HG_URL=file:$TESTTMP/other (glob)
265 265 $ hg -R other log -G
266 266 o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
267 267 |\
268 268 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
269 269 | |
270 270 @ | 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
271 271 |/
272 272 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de book_32af book_42cc book_5fdd A
273 273
274 274 $ hg -R other debugobsolete
275 275 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
276 276 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
277 277 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
278 278
279 279 pull over ssh
280 280
281 281 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --bookmark book_02de
282 282 pulling from ssh://user@dummy/main
283 283 searching for changes
284 284 adding changesets
285 285 adding manifests
286 286 adding file changes
287 287 added 1 changesets with 1 changes to 1 files (+1 heads)
288 288 1 new obsolescence markers
289 289 updating bookmark book_02de
290 290 pre-close-tip:02de42196ebe draft book_02de
291 291 postclose-tip:02de42196ebe draft book_02de
292 292 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
293 293 ssh://user@dummy/main HG_URL=ssh://user@dummy/main
294 294 (run 'hg heads' to see heads, 'hg merge' to merge)
295 295 $ hg -R other debugobsolete
296 296 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
297 297 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
298 298 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
299 299 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
300 300
301 301 pull over http
302 302
303 303 $ hg serve -R main -p $HGPORT -d --pid-file=main.pid -E main-error.log
304 304 $ cat main.pid >> $DAEMON_PIDS
305 305
306 306 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16 --bookmark book_42cc
307 307 pulling from http://localhost:$HGPORT/
308 308 searching for changes
309 309 adding changesets
310 310 adding manifests
311 311 adding file changes
312 312 added 1 changesets with 1 changes to 1 files (+1 heads)
313 313 1 new obsolescence markers
314 314 updating bookmark book_42cc
315 315 pre-close-tip:42ccdea3bb16 draft book_42cc
316 316 postclose-tip:42ccdea3bb16 draft book_42cc
317 317 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_NODE_LAST=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
318 318 http://localhost:$HGPORT/ HG_URL=http://localhost:$HGPORT/
319 319 (run 'hg heads .' to see heads, 'hg merge' to merge)
320 320 $ cat main-error.log
321 321 $ hg -R other debugobsolete
322 322 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
323 323 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
324 324 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
325 325 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
326 326 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
327 327
328 328 push over ssh
329 329
330 330 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8 --bookmark book_5fdd
331 331 pushing to ssh://user@dummy/other
332 332 searching for changes
333 333 remote: adding changesets
334 334 remote: adding manifests
335 335 remote: adding file changes
336 336 remote: added 1 changesets with 1 changes to 1 files
337 337 remote: 1 new obsolescence markers
338 338 remote: pre-close-tip:5fddd98957c8 draft book_5fdd
339 339 remote: pushkey: lock state after "bookmarks"
340 340 remote: lock: free
341 341 remote: wlock: free
342 342 remote: postclose-tip:5fddd98957c8 draft book_5fdd
343 343 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_NODE_LAST=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:ssh:$LOCALIP
344 344 updating bookmark book_5fdd
345 345 pre-close-tip:02de42196ebe draft book_02de
346 346 postclose-tip:02de42196ebe draft book_02de
347 347 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
348 348 ssh://user@dummy/other HG_URL=ssh://user@dummy/other
349 349 $ hg -R other log -G
350 350 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
351 351 |
352 352 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
353 353 |
354 354 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
355 355 | |
356 356 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
357 357 | |/|
358 358 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
359 359 |/ /
360 360 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
361 361 |/
362 362 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af A
363 363
364 364 $ hg -R other debugobsolete
365 365 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
366 366 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
367 367 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
368 368 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
369 369 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
370 370 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
371 371
372 372 push over http
373 373
374 374 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
375 375 $ cat other.pid >> $DAEMON_PIDS
376 376
377 377 $ hg -R main phase --public 32af7686d403
378 378 pre-close-tip:02de42196ebe draft book_02de
379 379 postclose-tip:02de42196ebe draft book_02de
380 380 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
381 381 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af
382 382 pushing to http://localhost:$HGPORT2/
383 383 searching for changes
384 384 remote: adding changesets
385 385 remote: adding manifests
386 386 remote: adding file changes
387 387 remote: added 1 changesets with 1 changes to 1 files
388 388 remote: 1 new obsolescence markers
389 389 remote: pre-close-tip:32af7686d403 public book_32af
390 390 remote: pushkey: lock state after "phases"
391 391 remote: lock: free
392 392 remote: wlock: free
393 393 remote: pushkey: lock state after "bookmarks"
394 394 remote: lock: free
395 395 remote: wlock: free
396 396 remote: postclose-tip:32af7686d403 public book_32af
397 397 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=32af7686d403cf45b5d95f2d70cebea587ac806a HG_NODE_LAST=32af7686d403cf45b5d95f2d70cebea587ac806a HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:http:$LOCALIP: (glob)
398 398 updating bookmark book_32af
399 399 pre-close-tip:02de42196ebe draft book_02de
400 400 postclose-tip:02de42196ebe draft book_02de
401 401 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
402 402 http://localhost:$HGPORT2/ HG_URL=http://localhost:$HGPORT2/
403 403 $ cat other-error.log
404 404
405 405 Check final content.
406 406
407 407 $ hg -R other log -G
408 408 o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af D
409 409 |
410 410 o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
411 411 |
412 412 o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
413 413 |
414 414 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
415 415 | |
416 416 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
417 417 | |/|
418 418 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
419 419 |/ /
420 420 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
421 421 |/
422 422 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
423 423
424 424 $ hg -R other debugobsolete
425 425 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
426 426 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
427 427 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
428 428 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
429 429 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
430 430 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
431 431 7777777777777777777777777777777777777777 32af7686d403cf45b5d95f2d70cebea587ac806a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
432 432
433 433 (check that no 'pending' files remain)
434 434
435 435 $ ls -1 other/.hg/bookmarks*
436 436 other/.hg/bookmarks
437 437 $ ls -1 other/.hg/store/phaseroots*
438 438 other/.hg/store/phaseroots
439 439 $ ls -1 other/.hg/store/00changelog.i*
440 440 other/.hg/store/00changelog.i
441 441
442 442 Error Handling
443 443 ==============
444 444
445 445 Check that errors are properly returned to the client during push.
446 446
447 447 Setting up
448 448
449 449 $ cat > failpush.py << EOF
450 450 > """A small extension that makes push fails when using bundle2
451 451 >
452 452 > used to test error handling in bundle2
453 453 > """
454 454 >
455 455 > from mercurial import error
456 456 > from mercurial import bundle2
457 457 > from mercurial import exchange
458 458 > from mercurial import extensions
459 459 >
460 460 > def _pushbundle2failpart(pushop, bundler):
461 461 > reason = pushop.ui.config('failpush', 'reason', None)
462 462 > part = None
463 463 > if reason == 'abort':
464 464 > bundler.newpart('test:abort')
465 465 > if reason == 'unknown':
466 466 > bundler.newpart('test:unknown')
467 467 > if reason == 'race':
468 468 > # 20 Bytes of crap
469 469 > bundler.newpart('check:heads', data='01234567890123456789')
470 470 >
471 471 > @bundle2.parthandler("test:abort")
472 472 > def handleabort(op, part):
473 473 > raise error.Abort('Abandon ship!', hint="don't panic")
474 474 >
475 475 > def uisetup(ui):
476 476 > exchange.b2partsgenmapping['failpart'] = _pushbundle2failpart
477 477 > exchange.b2partsgenorder.insert(0, 'failpart')
478 478 >
479 479 > EOF
480 480
481 481 $ cd main
482 482 $ hg up tip
483 483 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
484 484 $ echo 'I' > I
485 485 $ hg add I
486 486 $ hg ci -m 'I'
487 487 pre-close-tip:e7ec4e813ba6 draft
488 488 postclose-tip:e7ec4e813ba6 draft
489 489 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
490 490 $ hg id
491 491 e7ec4e813ba6 tip
492 492 $ cd ..
493 493
494 494 $ cat << EOF >> $HGRCPATH
495 495 > [extensions]
496 496 > failpush=$TESTTMP/failpush.py
497 497 > EOF
498 498
499 499 $ killdaemons.py
500 500 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
501 501 $ cat other.pid >> $DAEMON_PIDS
502 502
503 503 Doing the actual push: Abort error
504 504
505 505 $ cat << EOF >> $HGRCPATH
506 506 > [failpush]
507 507 > reason = abort
508 508 > EOF
509 509
510 510 $ hg -R main push other -r e7ec4e813ba6
511 511 pushing to other
512 512 searching for changes
513 513 abort: Abandon ship!
514 514 (don't panic)
515 515 [255]
516 516
517 517 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
518 518 pushing to ssh://user@dummy/other
519 519 searching for changes
520 520 remote: Abandon ship!
521 521 remote: (don't panic)
522 522 abort: push failed on remote
523 523 [255]
524 524
525 525 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
526 526 pushing to http://localhost:$HGPORT2/
527 527 searching for changes
528 528 remote: Abandon ship!
529 529 remote: (don't panic)
530 530 abort: push failed on remote
531 531 [255]
532 532
533 533
534 534 Doing the actual push: unknown mandatory parts
535 535
536 536 $ cat << EOF >> $HGRCPATH
537 537 > [failpush]
538 538 > reason = unknown
539 539 > EOF
540 540
541 541 $ hg -R main push other -r e7ec4e813ba6
542 542 pushing to other
543 543 searching for changes
544 544 abort: missing support for test:unknown
545 545 [255]
546 546
547 547 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
548 548 pushing to ssh://user@dummy/other
549 549 searching for changes
550 550 abort: missing support for test:unknown
551 551 [255]
552 552
553 553 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
554 554 pushing to http://localhost:$HGPORT2/
555 555 searching for changes
556 556 abort: missing support for test:unknown
557 557 [255]
558 558
559 559 Doing the actual push: race
560 560
561 561 $ cat << EOF >> $HGRCPATH
562 562 > [failpush]
563 563 > reason = race
564 564 > EOF
565 565
566 566 $ hg -R main push other -r e7ec4e813ba6
567 567 pushing to other
568 568 searching for changes
569 569 abort: push failed:
570 570 'repository changed while pushing - please try again'
571 571 [255]
572 572
573 573 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
574 574 pushing to ssh://user@dummy/other
575 575 searching for changes
576 576 abort: push failed:
577 577 'repository changed while pushing - please try again'
578 578 [255]
579 579
580 580 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
581 581 pushing to http://localhost:$HGPORT2/
582 582 searching for changes
583 583 abort: push failed:
584 584 'repository changed while pushing - please try again'
585 585 [255]
586 586
587 587 Doing the actual push: hook abort
588 588
589 589 $ cat << EOF >> $HGRCPATH
590 590 > [failpush]
591 591 > reason =
592 592 > [hooks]
593 593 > pretxnclose.failpush = sh -c "echo 'You shall not pass!'; false"
594 594 > txnabort.failpush = sh -c "echo 'Cleaning up the mess...'"
595 595 > EOF
596 596
597 597 $ killdaemons.py
598 598 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
599 599 $ cat other.pid >> $DAEMON_PIDS
600 600
601 601 $ hg -R main push other -r e7ec4e813ba6
602 602 pushing to other
603 603 searching for changes
604 604 remote: adding changesets
605 605 remote: adding manifests
606 606 remote: adding file changes
607 607 remote: added 1 changesets with 1 changes to 1 files
608 608 remote: pre-close-tip:e7ec4e813ba6 draft
609 609 remote: You shall not pass!
610 610 remote: transaction abort!
611 611 remote: Cleaning up the mess...
612 612 remote: rollback completed
613 613 abort: pretxnclose.failpush hook exited with status 1
614 614 [255]
615 615
616 616 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
617 617 pushing to ssh://user@dummy/other
618 618 searching for changes
619 619 remote: adding changesets
620 620 remote: adding manifests
621 621 remote: adding file changes
622 622 remote: added 1 changesets with 1 changes to 1 files
623 623 remote: pre-close-tip:e7ec4e813ba6 draft
624 624 remote: You shall not pass!
625 625 remote: transaction abort!
626 626 remote: Cleaning up the mess...
627 627 remote: rollback completed
628 628 remote: pretxnclose.failpush hook exited with status 1
629 629 abort: push failed on remote
630 630 [255]
631 631
632 632 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
633 633 pushing to http://localhost:$HGPORT2/
634 634 searching for changes
635 635 remote: adding changesets
636 636 remote: adding manifests
637 637 remote: adding file changes
638 638 remote: added 1 changesets with 1 changes to 1 files
639 639 remote: pre-close-tip:e7ec4e813ba6 draft
640 640 remote: You shall not pass!
641 641 remote: transaction abort!
642 642 remote: Cleaning up the mess...
643 643 remote: rollback completed
644 644 remote: pretxnclose.failpush hook exited with status 1
645 645 abort: push failed on remote
646 646 [255]
647 647
648 648 (check that no 'pending' files remain)
649 649
650 650 $ ls -1 other/.hg/bookmarks*
651 651 other/.hg/bookmarks
652 652 $ ls -1 other/.hg/store/phaseroots*
653 653 other/.hg/store/phaseroots
654 654 $ ls -1 other/.hg/store/00changelog.i*
655 655 other/.hg/store/00changelog.i
656 656
657 657 Check error from hook during the unbundling process itself
658 658
659 659 $ cat << EOF >> $HGRCPATH
660 660 > pretxnchangegroup = sh -c "echo 'Fail early!'; false"
661 661 > EOF
662 662 $ killdaemons.py # reload http config
663 663 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
664 664 $ cat other.pid >> $DAEMON_PIDS
665 665
666 666 $ hg -R main push other -r e7ec4e813ba6
667 667 pushing to other
668 668 searching for changes
669 669 remote: adding changesets
670 670 remote: adding manifests
671 671 remote: adding file changes
672 672 remote: added 1 changesets with 1 changes to 1 files
673 673 remote: Fail early!
674 674 remote: transaction abort!
675 675 remote: Cleaning up the mess...
676 676 remote: rollback completed
677 677 abort: pretxnchangegroup hook exited with status 1
678 678 [255]
679 679 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
680 680 pushing to ssh://user@dummy/other
681 681 searching for changes
682 682 remote: adding changesets
683 683 remote: adding manifests
684 684 remote: adding file changes
685 685 remote: added 1 changesets with 1 changes to 1 files
686 686 remote: Fail early!
687 687 remote: transaction abort!
688 688 remote: Cleaning up the mess...
689 689 remote: rollback completed
690 690 remote: pretxnchangegroup hook exited with status 1
691 691 abort: push failed on remote
692 692 [255]
693 693 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
694 694 pushing to http://localhost:$HGPORT2/
695 695 searching for changes
696 696 remote: adding changesets
697 697 remote: adding manifests
698 698 remote: adding file changes
699 699 remote: added 1 changesets with 1 changes to 1 files
700 700 remote: Fail early!
701 701 remote: transaction abort!
702 702 remote: Cleaning up the mess...
703 703 remote: rollback completed
704 704 remote: pretxnchangegroup hook exited with status 1
705 705 abort: push failed on remote
706 706 [255]
707 707
708 708 Check output capture control.
709 709
710 710 (should be still forced for http, disabled for local and ssh)
711 711
712 712 $ cat >> $HGRCPATH << EOF
713 713 > [experimental]
714 714 > bundle2-output-capture=False
715 715 > EOF
716 716
717 717 $ hg -R main push other -r e7ec4e813ba6
718 718 pushing to other
719 719 searching for changes
720 720 adding changesets
721 721 adding manifests
722 722 adding file changes
723 723 added 1 changesets with 1 changes to 1 files
724 724 Fail early!
725 725 transaction abort!
726 726 Cleaning up the mess...
727 727 rollback completed
728 728 abort: pretxnchangegroup hook exited with status 1
729 729 [255]
730 730 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
731 731 pushing to ssh://user@dummy/other
732 732 searching for changes
733 733 remote: adding changesets
734 734 remote: adding manifests
735 735 remote: adding file changes
736 736 remote: added 1 changesets with 1 changes to 1 files
737 737 remote: Fail early!
738 738 remote: transaction abort!
739 739 remote: Cleaning up the mess...
740 740 remote: rollback completed
741 741 remote: pretxnchangegroup hook exited with status 1
742 742 abort: push failed on remote
743 743 [255]
744 744 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
745 745 pushing to http://localhost:$HGPORT2/
746 746 searching for changes
747 747 remote: adding changesets
748 748 remote: adding manifests
749 749 remote: adding file changes
750 750 remote: added 1 changesets with 1 changes to 1 files
751 751 remote: Fail early!
752 752 remote: transaction abort!
753 753 remote: Cleaning up the mess...
754 754 remote: rollback completed
755 755 remote: pretxnchangegroup hook exited with status 1
756 756 abort: push failed on remote
757 757 [255]
758 758
759 759 Check abort from mandatory pushkey
760 760
761 761 $ cat > mandatorypart.py << EOF
762 762 > from mercurial import exchange
763 763 > from mercurial import pushkey
764 764 > from mercurial import node
765 765 > from mercurial import error
766 766 > @exchange.b2partsgenerator('failingpuskey')
767 767 > def addfailingpushey(pushop, bundler):
768 768 > enc = pushkey.encode
769 769 > part = bundler.newpart('pushkey')
770 770 > part.addparam('namespace', enc('phases'))
771 771 > part.addparam('key', enc(pushop.repo['cd010b8cd998'].hex()))
772 772 > part.addparam('old', enc(str(0))) # successful update
773 773 > part.addparam('new', enc(str(0)))
774 774 > def fail(pushop, exc):
775 775 > raise error.Abort('Correct phase push failed (because hooks)')
776 776 > pushop.pkfailcb[part.id] = fail
777 777 > EOF
778 778 $ cat >> $HGRCPATH << EOF
779 779 > [hooks]
780 780 > pretxnchangegroup=
781 781 > pretxnclose.failpush=
782 782 > prepushkey.failpush = sh -c "echo 'do not push the key !'; false"
783 783 > [extensions]
784 784 > mandatorypart=$TESTTMP/mandatorypart.py
785 785 > EOF
786 786 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config
787 787 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
788 788 $ cat other.pid >> $DAEMON_PIDS
789 789
790 790 (Failure from a hook)
791 791
792 792 $ hg -R main push other -r e7ec4e813ba6
793 793 pushing to other
794 794 searching for changes
795 795 adding changesets
796 796 adding manifests
797 797 adding file changes
798 798 added 1 changesets with 1 changes to 1 files
799 799 do not push the key !
800 800 pushkey-abort: prepushkey.failpush hook exited with status 1
801 801 transaction abort!
802 802 Cleaning up the mess...
803 803 rollback completed
804 804 abort: Correct phase push failed (because hooks)
805 805 [255]
806 806 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
807 807 pushing to ssh://user@dummy/other
808 808 searching for changes
809 809 remote: adding changesets
810 810 remote: adding manifests
811 811 remote: adding file changes
812 812 remote: added 1 changesets with 1 changes to 1 files
813 813 remote: do not push the key !
814 814 remote: pushkey-abort: prepushkey.failpush hook exited with status 1
815 815 remote: transaction abort!
816 816 remote: Cleaning up the mess...
817 817 remote: rollback completed
818 818 abort: Correct phase push failed (because hooks)
819 819 [255]
820 820 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
821 821 pushing to http://localhost:$HGPORT2/
822 822 searching for changes
823 823 remote: adding changesets
824 824 remote: adding manifests
825 825 remote: adding file changes
826 826 remote: added 1 changesets with 1 changes to 1 files
827 827 remote: do not push the key !
828 828 remote: pushkey-abort: prepushkey.failpush hook exited with status 1
829 829 remote: transaction abort!
830 830 remote: Cleaning up the mess...
831 831 remote: rollback completed
832 832 abort: Correct phase push failed (because hooks)
833 833 [255]
834 834
835 835 (Failure from a the pushkey)
836 836
837 837 $ cat > mandatorypart.py << EOF
838 838 > from mercurial import exchange
839 839 > from mercurial import pushkey
840 840 > from mercurial import node
841 841 > from mercurial import error
842 842 > @exchange.b2partsgenerator('failingpuskey')
843 843 > def addfailingpushey(pushop, bundler):
844 844 > enc = pushkey.encode
845 845 > part = bundler.newpart('pushkey')
846 846 > part.addparam('namespace', enc('phases'))
847 847 > part.addparam('key', enc(pushop.repo['cd010b8cd998'].hex()))
848 848 > part.addparam('old', enc(str(4))) # will fail
849 849 > part.addparam('new', enc(str(3)))
850 850 > def fail(pushop, exc):
851 851 > raise error.Abort('Clown phase push failed')
852 852 > pushop.pkfailcb[part.id] = fail
853 853 > EOF
854 854 $ cat >> $HGRCPATH << EOF
855 855 > [hooks]
856 856 > prepushkey.failpush =
857 857 > EOF
858 858 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config
859 859 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
860 860 $ cat other.pid >> $DAEMON_PIDS
861 861
862 862 $ hg -R main push other -r e7ec4e813ba6
863 863 pushing to other
864 864 searching for changes
865 865 adding changesets
866 866 adding manifests
867 867 adding file changes
868 868 added 1 changesets with 1 changes to 1 files
869 869 transaction abort!
870 870 Cleaning up the mess...
871 871 rollback completed
872 872 pushkey: lock state after "phases"
873 873 lock: free
874 874 wlock: free
875 875 abort: Clown phase push failed
876 876 [255]
877 877 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
878 878 pushing to ssh://user@dummy/other
879 879 searching for changes
880 880 remote: adding changesets
881 881 remote: adding manifests
882 882 remote: adding file changes
883 883 remote: added 1 changesets with 1 changes to 1 files
884 884 remote: transaction abort!
885 885 remote: Cleaning up the mess...
886 886 remote: rollback completed
887 887 remote: pushkey: lock state after "phases"
888 888 remote: lock: free
889 889 remote: wlock: free
890 890 abort: Clown phase push failed
891 891 [255]
892 892 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
893 893 pushing to http://localhost:$HGPORT2/
894 894 searching for changes
895 895 remote: adding changesets
896 896 remote: adding manifests
897 897 remote: adding file changes
898 898 remote: added 1 changesets with 1 changes to 1 files
899 899 remote: transaction abort!
900 900 remote: Cleaning up the mess...
901 901 remote: rollback completed
902 902 remote: pushkey: lock state after "phases"
903 903 remote: lock: free
904 904 remote: wlock: free
905 905 abort: Clown phase push failed
906 906 [255]
907 907
908 908 Test lazily acquiring the lock during unbundle
909 909 $ cp $TESTTMP/hgrc.orig $HGRCPATH
910 910 $ cat >> $HGRCPATH <<EOF
911 911 > [ui]
912 > ssh=$PYTHON "$TESTDIR/dummyssh"
912 > ssh="$PYTHON" "$TESTDIR/dummyssh"
913 913 > EOF
914 914
915 915 $ cat >> $TESTTMP/locktester.py <<EOF
916 916 > import os
917 917 > from mercurial import extensions, bundle2, util
918 918 > def checklock(orig, repo, *args, **kwargs):
919 919 > if repo.svfs.lexists("lock"):
920 920 > raise util.Abort("Lock should not be taken")
921 921 > return orig(repo, *args, **kwargs)
922 922 > def extsetup(ui):
923 923 > extensions.wrapfunction(bundle2, 'processbundle', checklock)
924 924 > EOF
925 925
926 926 $ hg init lazylock
927 927 $ cat >> lazylock/.hg/hgrc <<EOF
928 928 > [extensions]
929 929 > locktester=$TESTTMP/locktester.py
930 930 > EOF
931 931
932 932 $ hg clone -q ssh://user@dummy/lazylock lazylockclient
933 933 $ cd lazylockclient
934 934 $ touch a && hg ci -Aqm a
935 935 $ hg push
936 936 pushing to ssh://user@dummy/lazylock
937 937 searching for changes
938 938 remote: Lock should not be taken
939 939 abort: push failed on remote
940 940 [255]
941 941
942 942 $ cat >> ../lazylock/.hg/hgrc <<EOF
943 943 > [experimental]
944 944 > bundle2lazylocking=True
945 945 > EOF
946 946 $ hg push
947 947 pushing to ssh://user@dummy/lazylock
948 948 searching for changes
949 949 remote: adding changesets
950 950 remote: adding manifests
951 951 remote: adding file changes
952 952 remote: added 1 changesets with 1 changes to 1 files
953 953
954 954 $ cd ..
955 955
956 956 Servers can disable bundle1 for clone/pull operations
957 957
958 958 $ killdaemons.py
959 959 $ hg init bundle2onlyserver
960 960 $ cd bundle2onlyserver
961 961 $ cat > .hg/hgrc << EOF
962 962 > [server]
963 963 > bundle1.pull = false
964 964 > EOF
965 965
966 966 $ touch foo
967 967 $ hg -q commit -A -m initial
968 968
969 969 $ hg serve -p $HGPORT -d --pid-file=hg.pid
970 970 $ cat hg.pid >> $DAEMON_PIDS
971 971
972 972 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
973 973 requesting all changes
974 974 abort: remote error:
975 975 incompatible Mercurial client; bundle2 required
976 976 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
977 977 [255]
978 978 $ killdaemons.py
979 979 $ cd ..
980 980
981 981 bundle1 can still pull non-generaldelta repos when generaldelta bundle1 disabled
982 982
983 983 $ hg --config format.usegeneraldelta=false init notgdserver
984 984 $ cd notgdserver
985 985 $ cat > .hg/hgrc << EOF
986 986 > [server]
987 987 > bundle1gd.pull = false
988 988 > EOF
989 989
990 990 $ touch foo
991 991 $ hg -q commit -A -m initial
992 992 $ hg serve -p $HGPORT -d --pid-file=hg.pid
993 993 $ cat hg.pid >> $DAEMON_PIDS
994 994
995 995 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-1
996 996 requesting all changes
997 997 adding changesets
998 998 adding manifests
999 999 adding file changes
1000 1000 added 1 changesets with 1 changes to 1 files
1001 1001 updating to branch default
1002 1002 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1003 1003
1004 1004 $ killdaemons.py
1005 1005 $ cd ../bundle2onlyserver
1006 1006
1007 1007 bundle1 pull can be disabled for generaldelta repos only
1008 1008
1009 1009 $ cat > .hg/hgrc << EOF
1010 1010 > [server]
1011 1011 > bundle1gd.pull = false
1012 1012 > EOF
1013 1013
1014 1014 $ hg serve -p $HGPORT -d --pid-file=hg.pid
1015 1015 $ cat hg.pid >> $DAEMON_PIDS
1016 1016 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
1017 1017 requesting all changes
1018 1018 abort: remote error:
1019 1019 incompatible Mercurial client; bundle2 required
1020 1020 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1021 1021 [255]
1022 1022
1023 1023 $ killdaemons.py
1024 1024
1025 1025 Verify the global server.bundle1 option works
1026 1026
1027 1027 $ cd ..
1028 1028 $ cat > bundle2onlyserver/.hg/hgrc << EOF
1029 1029 > [server]
1030 1030 > bundle1 = false
1031 1031 > EOF
1032 1032 $ hg -R bundle2onlyserver serve -p $HGPORT -d --pid-file=hg.pid
1033 1033 $ cat hg.pid >> $DAEMON_PIDS
1034 1034 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT not-bundle2
1035 1035 requesting all changes
1036 1036 abort: remote error:
1037 1037 incompatible Mercurial client; bundle2 required
1038 1038 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1039 1039 [255]
1040 1040 $ killdaemons.py
1041 1041
1042 1042 $ hg --config devel.legacy.exchange=bundle1 clone ssh://user@dummy/bundle2onlyserver not-bundle2-ssh
1043 1043 requesting all changes
1044 1044 adding changesets
1045 1045 remote: abort: incompatible Mercurial client; bundle2 required
1046 1046 remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1047 1047 transaction abort!
1048 1048 rollback completed
1049 1049 abort: stream ended unexpectedly (got 0 bytes, expected 4)
1050 1050 [255]
1051 1051
1052 1052 $ cat > bundle2onlyserver/.hg/hgrc << EOF
1053 1053 > [server]
1054 1054 > bundle1gd = false
1055 1055 > EOF
1056 1056 $ hg -R bundle2onlyserver serve -p $HGPORT -d --pid-file=hg.pid
1057 1057 $ cat hg.pid >> $DAEMON_PIDS
1058 1058
1059 1059 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
1060 1060 requesting all changes
1061 1061 abort: remote error:
1062 1062 incompatible Mercurial client; bundle2 required
1063 1063 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1064 1064 [255]
1065 1065
1066 1066 $ killdaemons.py
1067 1067
1068 1068 $ cd notgdserver
1069 1069 $ cat > .hg/hgrc << EOF
1070 1070 > [server]
1071 1071 > bundle1gd = false
1072 1072 > EOF
1073 1073 $ hg serve -p $HGPORT -d --pid-file=hg.pid
1074 1074 $ cat hg.pid >> $DAEMON_PIDS
1075 1075
1076 1076 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-2
1077 1077 requesting all changes
1078 1078 adding changesets
1079 1079 adding manifests
1080 1080 adding file changes
1081 1081 added 1 changesets with 1 changes to 1 files
1082 1082 updating to branch default
1083 1083 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1084 1084
1085 1085 $ killdaemons.py
1086 1086 $ cd ../bundle2onlyserver
1087 1087
1088 1088 Verify bundle1 pushes can be disabled
1089 1089
1090 1090 $ cat > .hg/hgrc << EOF
1091 1091 > [server]
1092 1092 > bundle1.push = false
1093 1093 > [web]
1094 1094 > allow_push = *
1095 1095 > push_ssl = false
1096 1096 > EOF
1097 1097
1098 1098 $ hg serve -p $HGPORT -d --pid-file=hg.pid -E error.log
1099 1099 $ cat hg.pid >> $DAEMON_PIDS
1100 1100 $ cd ..
1101 1101
1102 1102 $ hg clone http://localhost:$HGPORT bundle2-only
1103 1103 requesting all changes
1104 1104 adding changesets
1105 1105 adding manifests
1106 1106 adding file changes
1107 1107 added 1 changesets with 1 changes to 1 files
1108 1108 updating to branch default
1109 1109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1110 1110 $ cd bundle2-only
1111 1111 $ echo commit > foo
1112 1112 $ hg commit -m commit
1113 1113 $ hg --config devel.legacy.exchange=bundle1 push
1114 1114 pushing to http://localhost:$HGPORT/
1115 1115 searching for changes
1116 1116 abort: remote error:
1117 1117 incompatible Mercurial client; bundle2 required
1118 1118 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1119 1119 [255]
1120 1120
1121 1121 (also check with ssh)
1122 1122
1123 1123 $ hg --config devel.legacy.exchange=bundle1 push ssh://user@dummy/bundle2onlyserver
1124 1124 pushing to ssh://user@dummy/bundle2onlyserver
1125 1125 searching for changes
1126 1126 remote: abort: incompatible Mercurial client; bundle2 required
1127 1127 remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1128 1128 [1]
1129 1129
1130 1130 $ hg push
1131 1131 pushing to http://localhost:$HGPORT/
1132 1132 searching for changes
1133 1133 remote: adding changesets
1134 1134 remote: adding manifests
1135 1135 remote: adding file changes
1136 1136 remote: added 1 changesets with 1 changes to 1 files
@@ -1,1098 +1,1098
1 1 Prepare repo a:
2 2
3 3 $ hg init a
4 4 $ cd a
5 5 $ echo a > a
6 6 $ hg add a
7 7 $ hg commit -m test
8 8 $ echo first line > b
9 9 $ hg add b
10 10
11 11 Create a non-inlined filelog:
12 12
13 13 $ $PYTHON -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))'
14 14 $ for j in 0 1 2 3 4 5 6 7 8 9; do
15 15 > cat data1 >> b
16 16 > hg commit -m test
17 17 > done
18 18
19 19 List files in store/data (should show a 'b.d'):
20 20
21 21 $ for i in .hg/store/data/*; do
22 22 > echo $i
23 23 > done
24 24 .hg/store/data/a.i
25 25 .hg/store/data/b.d
26 26 .hg/store/data/b.i
27 27
28 28 Trigger branchcache creation:
29 29
30 30 $ hg branches
31 31 default 10:a7949464abda
32 32 $ ls .hg/cache
33 33 branch2-served
34 34 checkisexec (execbit !)
35 35 checklink (symlink !)
36 36 checklink-target (symlink !)
37 37 checknoexec (execbit !)
38 38 rbc-names-v1
39 39 rbc-revs-v1
40 40
41 41 Default operation:
42 42
43 43 $ hg clone . ../b
44 44 updating to branch default
45 45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 46 $ cd ../b
47 47
48 48 Ensure branchcache got copied over:
49 49
50 50 $ ls .hg/cache
51 51 branch2-served
52 52 checkisexec (execbit !)
53 53 checklink (symlink !)
54 54 checklink-target (symlink !)
55 55 rbc-names-v1
56 56 rbc-revs-v1
57 57
58 58 $ cat a
59 59 a
60 60 $ hg verify
61 61 checking changesets
62 62 checking manifests
63 63 crosschecking files in changesets and manifests
64 64 checking files
65 65 2 files, 11 changesets, 11 total revisions
66 66
67 67 Invalid dest '' must abort:
68 68
69 69 $ hg clone . ''
70 70 abort: empty destination path is not valid
71 71 [255]
72 72
73 73 No update, with debug option:
74 74
75 75 #if hardlink
76 76 $ hg --debug clone -U . ../c --config progress.debug=true
77 77 linking: 1
78 78 linking: 2
79 79 linking: 3
80 80 linking: 4
81 81 linking: 5
82 82 linking: 6
83 83 linking: 7
84 84 linking: 8
85 85 linked 8 files
86 86 #else
87 87 $ hg --debug clone -U . ../c --config progress.debug=true
88 88 linking: 1
89 89 copying: 2
90 90 copying: 3
91 91 copying: 4
92 92 copying: 5
93 93 copying: 6
94 94 copying: 7
95 95 copying: 8
96 96 copied 8 files
97 97 #endif
98 98 $ cd ../c
99 99
100 100 Ensure branchcache got copied over:
101 101
102 102 $ ls .hg/cache
103 103 branch2-served
104 104 rbc-names-v1
105 105 rbc-revs-v1
106 106
107 107 $ cat a 2>/dev/null || echo "a not present"
108 108 a not present
109 109 $ hg verify
110 110 checking changesets
111 111 checking manifests
112 112 crosschecking files in changesets and manifests
113 113 checking files
114 114 2 files, 11 changesets, 11 total revisions
115 115
116 116 Default destination:
117 117
118 118 $ mkdir ../d
119 119 $ cd ../d
120 120 $ hg clone ../a
121 121 destination directory: a
122 122 updating to branch default
123 123 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
124 124 $ cd a
125 125 $ hg cat a
126 126 a
127 127 $ cd ../..
128 128
129 129 Check that we drop the 'file:' from the path before writing the .hgrc:
130 130
131 131 $ hg clone file:a e
132 132 updating to branch default
133 133 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 134 $ grep 'file:' e/.hg/hgrc
135 135 [1]
136 136
137 137 Check that path aliases are expanded:
138 138
139 139 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
140 140 $ hg -R f showconfig paths.default
141 141 $TESTTMP/a#0 (glob)
142 142
143 143 Use --pull:
144 144
145 145 $ hg clone --pull a g
146 146 requesting all changes
147 147 adding changesets
148 148 adding manifests
149 149 adding file changes
150 150 added 11 changesets with 11 changes to 2 files
151 151 updating to branch default
152 152 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 153 $ hg -R g verify
154 154 checking changesets
155 155 checking manifests
156 156 crosschecking files in changesets and manifests
157 157 checking files
158 158 2 files, 11 changesets, 11 total revisions
159 159
160 160 Invalid dest '' with --pull must abort (issue2528):
161 161
162 162 $ hg clone --pull a ''
163 163 abort: empty destination path is not valid
164 164 [255]
165 165
166 166 Clone to '.':
167 167
168 168 $ mkdir h
169 169 $ cd h
170 170 $ hg clone ../a .
171 171 updating to branch default
172 172 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 173 $ cd ..
174 174
175 175
176 176 *** Tests for option -u ***
177 177
178 178 Adding some more history to repo a:
179 179
180 180 $ cd a
181 181 $ hg tag ref1
182 182 $ echo the quick brown fox >a
183 183 $ hg ci -m "hacked default"
184 184 $ hg up ref1
185 185 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
186 186 $ hg branch stable
187 187 marked working directory as branch stable
188 188 (branches are permanent and global, did you want a bookmark?)
189 189 $ echo some text >a
190 190 $ hg ci -m "starting branch stable"
191 191 $ hg tag ref2
192 192 $ echo some more text >a
193 193 $ hg ci -m "another change for branch stable"
194 194 $ hg up ref2
195 195 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
196 196 $ hg parents
197 197 changeset: 13:e8ece76546a6
198 198 branch: stable
199 199 tag: ref2
200 200 parent: 10:a7949464abda
201 201 user: test
202 202 date: Thu Jan 01 00:00:00 1970 +0000
203 203 summary: starting branch stable
204 204
205 205
206 206 Repo a has two heads:
207 207
208 208 $ hg heads
209 209 changeset: 15:0aae7cf88f0d
210 210 branch: stable
211 211 tag: tip
212 212 user: test
213 213 date: Thu Jan 01 00:00:00 1970 +0000
214 214 summary: another change for branch stable
215 215
216 216 changeset: 12:f21241060d6a
217 217 user: test
218 218 date: Thu Jan 01 00:00:00 1970 +0000
219 219 summary: hacked default
220 220
221 221
222 222 $ cd ..
223 223
224 224
225 225 Testing --noupdate with --updaterev (must abort):
226 226
227 227 $ hg clone --noupdate --updaterev 1 a ua
228 228 abort: cannot specify both --noupdate and --updaterev
229 229 [255]
230 230
231 231
232 232 Testing clone -u:
233 233
234 234 $ hg clone -u . a ua
235 235 updating to branch stable
236 236 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
237 237
238 238 Repo ua has both heads:
239 239
240 240 $ hg -R ua heads
241 241 changeset: 15:0aae7cf88f0d
242 242 branch: stable
243 243 tag: tip
244 244 user: test
245 245 date: Thu Jan 01 00:00:00 1970 +0000
246 246 summary: another change for branch stable
247 247
248 248 changeset: 12:f21241060d6a
249 249 user: test
250 250 date: Thu Jan 01 00:00:00 1970 +0000
251 251 summary: hacked default
252 252
253 253
254 254 Same revision checked out in repo a and ua:
255 255
256 256 $ hg -R a parents --template "{node|short}\n"
257 257 e8ece76546a6
258 258 $ hg -R ua parents --template "{node|short}\n"
259 259 e8ece76546a6
260 260
261 261 $ rm -r ua
262 262
263 263
264 264 Testing clone --pull -u:
265 265
266 266 $ hg clone --pull -u . a ua
267 267 requesting all changes
268 268 adding changesets
269 269 adding manifests
270 270 adding file changes
271 271 added 16 changesets with 16 changes to 3 files (+1 heads)
272 272 updating to branch stable
273 273 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 274
275 275 Repo ua has both heads:
276 276
277 277 $ hg -R ua heads
278 278 changeset: 15:0aae7cf88f0d
279 279 branch: stable
280 280 tag: tip
281 281 user: test
282 282 date: Thu Jan 01 00:00:00 1970 +0000
283 283 summary: another change for branch stable
284 284
285 285 changeset: 12:f21241060d6a
286 286 user: test
287 287 date: Thu Jan 01 00:00:00 1970 +0000
288 288 summary: hacked default
289 289
290 290
291 291 Same revision checked out in repo a and ua:
292 292
293 293 $ hg -R a parents --template "{node|short}\n"
294 294 e8ece76546a6
295 295 $ hg -R ua parents --template "{node|short}\n"
296 296 e8ece76546a6
297 297
298 298 $ rm -r ua
299 299
300 300
301 301 Testing clone -u <branch>:
302 302
303 303 $ hg clone -u stable a ua
304 304 updating to branch stable
305 305 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
306 306
307 307 Repo ua has both heads:
308 308
309 309 $ hg -R ua heads
310 310 changeset: 15:0aae7cf88f0d
311 311 branch: stable
312 312 tag: tip
313 313 user: test
314 314 date: Thu Jan 01 00:00:00 1970 +0000
315 315 summary: another change for branch stable
316 316
317 317 changeset: 12:f21241060d6a
318 318 user: test
319 319 date: Thu Jan 01 00:00:00 1970 +0000
320 320 summary: hacked default
321 321
322 322
323 323 Branch 'stable' is checked out:
324 324
325 325 $ hg -R ua parents
326 326 changeset: 15:0aae7cf88f0d
327 327 branch: stable
328 328 tag: tip
329 329 user: test
330 330 date: Thu Jan 01 00:00:00 1970 +0000
331 331 summary: another change for branch stable
332 332
333 333
334 334 $ rm -r ua
335 335
336 336
337 337 Testing default checkout:
338 338
339 339 $ hg clone a ua
340 340 updating to branch default
341 341 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
342 342
343 343 Repo ua has both heads:
344 344
345 345 $ hg -R ua heads
346 346 changeset: 15:0aae7cf88f0d
347 347 branch: stable
348 348 tag: tip
349 349 user: test
350 350 date: Thu Jan 01 00:00:00 1970 +0000
351 351 summary: another change for branch stable
352 352
353 353 changeset: 12:f21241060d6a
354 354 user: test
355 355 date: Thu Jan 01 00:00:00 1970 +0000
356 356 summary: hacked default
357 357
358 358
359 359 Branch 'default' is checked out:
360 360
361 361 $ hg -R ua parents
362 362 changeset: 12:f21241060d6a
363 363 user: test
364 364 date: Thu Jan 01 00:00:00 1970 +0000
365 365 summary: hacked default
366 366
367 367 Test clone with a branch named "@" (issue3677)
368 368
369 369 $ hg -R ua branch @
370 370 marked working directory as branch @
371 371 $ hg -R ua commit -m 'created branch @'
372 372 $ hg clone ua atbranch
373 373 updating to branch default
374 374 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 375 $ hg -R atbranch heads
376 376 changeset: 16:798b6d97153e
377 377 branch: @
378 378 tag: tip
379 379 parent: 12:f21241060d6a
380 380 user: test
381 381 date: Thu Jan 01 00:00:00 1970 +0000
382 382 summary: created branch @
383 383
384 384 changeset: 15:0aae7cf88f0d
385 385 branch: stable
386 386 user: test
387 387 date: Thu Jan 01 00:00:00 1970 +0000
388 388 summary: another change for branch stable
389 389
390 390 changeset: 12:f21241060d6a
391 391 user: test
392 392 date: Thu Jan 01 00:00:00 1970 +0000
393 393 summary: hacked default
394 394
395 395 $ hg -R atbranch parents
396 396 changeset: 12:f21241060d6a
397 397 user: test
398 398 date: Thu Jan 01 00:00:00 1970 +0000
399 399 summary: hacked default
400 400
401 401
402 402 $ rm -r ua atbranch
403 403
404 404
405 405 Testing #<branch>:
406 406
407 407 $ hg clone -u . a#stable ua
408 408 adding changesets
409 409 adding manifests
410 410 adding file changes
411 411 added 14 changesets with 14 changes to 3 files
412 412 updating to branch stable
413 413 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 414
415 415 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
416 416
417 417 $ hg -R ua heads
418 418 changeset: 13:0aae7cf88f0d
419 419 branch: stable
420 420 tag: tip
421 421 user: test
422 422 date: Thu Jan 01 00:00:00 1970 +0000
423 423 summary: another change for branch stable
424 424
425 425 changeset: 10:a7949464abda
426 426 user: test
427 427 date: Thu Jan 01 00:00:00 1970 +0000
428 428 summary: test
429 429
430 430
431 431 Same revision checked out in repo a and ua:
432 432
433 433 $ hg -R a parents --template "{node|short}\n"
434 434 e8ece76546a6
435 435 $ hg -R ua parents --template "{node|short}\n"
436 436 e8ece76546a6
437 437
438 438 $ rm -r ua
439 439
440 440
441 441 Testing -u -r <branch>:
442 442
443 443 $ hg clone -u . -r stable a ua
444 444 adding changesets
445 445 adding manifests
446 446 adding file changes
447 447 added 14 changesets with 14 changes to 3 files
448 448 updating to branch stable
449 449 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 450
451 451 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
452 452
453 453 $ hg -R ua heads
454 454 changeset: 13:0aae7cf88f0d
455 455 branch: stable
456 456 tag: tip
457 457 user: test
458 458 date: Thu Jan 01 00:00:00 1970 +0000
459 459 summary: another change for branch stable
460 460
461 461 changeset: 10:a7949464abda
462 462 user: test
463 463 date: Thu Jan 01 00:00:00 1970 +0000
464 464 summary: test
465 465
466 466
467 467 Same revision checked out in repo a and ua:
468 468
469 469 $ hg -R a parents --template "{node|short}\n"
470 470 e8ece76546a6
471 471 $ hg -R ua parents --template "{node|short}\n"
472 472 e8ece76546a6
473 473
474 474 $ rm -r ua
475 475
476 476
477 477 Testing -r <branch>:
478 478
479 479 $ hg clone -r stable a ua
480 480 adding changesets
481 481 adding manifests
482 482 adding file changes
483 483 added 14 changesets with 14 changes to 3 files
484 484 updating to branch stable
485 485 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
486 486
487 487 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
488 488
489 489 $ hg -R ua heads
490 490 changeset: 13:0aae7cf88f0d
491 491 branch: stable
492 492 tag: tip
493 493 user: test
494 494 date: Thu Jan 01 00:00:00 1970 +0000
495 495 summary: another change for branch stable
496 496
497 497 changeset: 10:a7949464abda
498 498 user: test
499 499 date: Thu Jan 01 00:00:00 1970 +0000
500 500 summary: test
501 501
502 502
503 503 Branch 'stable' is checked out:
504 504
505 505 $ hg -R ua parents
506 506 changeset: 13:0aae7cf88f0d
507 507 branch: stable
508 508 tag: tip
509 509 user: test
510 510 date: Thu Jan 01 00:00:00 1970 +0000
511 511 summary: another change for branch stable
512 512
513 513
514 514 $ rm -r ua
515 515
516 516
517 517 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
518 518 iterable in addbranchrevs()
519 519
520 520 $ cat <<EOF > simpleclone.py
521 521 > from mercurial import ui, hg
522 522 > myui = ui.ui.load()
523 523 > repo = hg.repository(myui, 'a')
524 524 > hg.clone(myui, {}, repo, dest="ua")
525 525 > EOF
526 526
527 527 $ $PYTHON simpleclone.py
528 528 updating to branch default
529 529 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
530 530
531 531 $ rm -r ua
532 532
533 533 $ cat <<EOF > branchclone.py
534 534 > from mercurial import ui, hg, extensions
535 535 > myui = ui.ui.load()
536 536 > extensions.loadall(myui)
537 537 > repo = hg.repository(myui, 'a')
538 538 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
539 539 > EOF
540 540
541 541 $ $PYTHON branchclone.py
542 542 adding changesets
543 543 adding manifests
544 544 adding file changes
545 545 added 14 changesets with 14 changes to 3 files
546 546 updating to branch stable
547 547 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
548 548 $ rm -r ua
549 549
550 550
551 551 Test clone with special '@' bookmark:
552 552 $ cd a
553 553 $ hg bookmark -r a7949464abda @ # branch point of stable from default
554 554 $ hg clone . ../i
555 555 updating to bookmark @
556 556 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
557 557 $ hg id -i ../i
558 558 a7949464abda
559 559 $ rm -r ../i
560 560
561 561 $ hg bookmark -f -r stable @
562 562 $ hg bookmarks
563 563 @ 15:0aae7cf88f0d
564 564 $ hg clone . ../i
565 565 updating to bookmark @ on branch stable
566 566 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
567 567 $ hg id -i ../i
568 568 0aae7cf88f0d
569 569 $ cd "$TESTTMP"
570 570
571 571
572 572 Testing failures:
573 573
574 574 $ mkdir fail
575 575 $ cd fail
576 576
577 577 No local source
578 578
579 579 $ hg clone a b
580 580 abort: repository a not found!
581 581 [255]
582 582
583 583 No remote source
584 584
585 585 #if windows
586 586 $ hg clone http://$LOCALIP:3121/a b
587 587 abort: error: * (glob)
588 588 [255]
589 589 #else
590 590 $ hg clone http://$LOCALIP:3121/a b
591 591 abort: error: *refused* (glob)
592 592 [255]
593 593 #endif
594 594 $ rm -rf b # work around bug with http clone
595 595
596 596
597 597 #if unix-permissions no-root
598 598
599 599 Inaccessible source
600 600
601 601 $ mkdir a
602 602 $ chmod 000 a
603 603 $ hg clone a b
604 604 abort: repository a not found!
605 605 [255]
606 606
607 607 Inaccessible destination
608 608
609 609 $ hg init b
610 610 $ cd b
611 611 $ hg clone . ../a
612 612 abort: Permission denied: '../a'
613 613 [255]
614 614 $ cd ..
615 615 $ chmod 700 a
616 616 $ rm -r a b
617 617
618 618 #endif
619 619
620 620
621 621 #if fifo
622 622
623 623 Source of wrong type
624 624
625 625 $ mkfifo a
626 626 $ hg clone a b
627 627 abort: repository a not found!
628 628 [255]
629 629 $ rm a
630 630
631 631 #endif
632 632
633 633 Default destination, same directory
634 634
635 635 $ hg init q
636 636 $ hg clone q
637 637 destination directory: q
638 638 abort: destination 'q' is not empty
639 639 [255]
640 640
641 641 destination directory not empty
642 642
643 643 $ mkdir a
644 644 $ echo stuff > a/a
645 645 $ hg clone q a
646 646 abort: destination 'a' is not empty
647 647 [255]
648 648
649 649
650 650 #if unix-permissions no-root
651 651
652 652 leave existing directory in place after clone failure
653 653
654 654 $ hg init c
655 655 $ cd c
656 656 $ echo c > c
657 657 $ hg commit -A -m test
658 658 adding c
659 659 $ chmod -rx .hg/store/data
660 660 $ cd ..
661 661 $ mkdir d
662 662 $ hg clone c d 2> err
663 663 [255]
664 664 $ test -d d
665 665 $ test -d d/.hg
666 666 [1]
667 667
668 668 re-enable perm to allow deletion
669 669
670 670 $ chmod +rx c/.hg/store/data
671 671
672 672 #endif
673 673
674 674 $ cd ..
675 675
676 676 Test clone from the repository in (emulated) revlog format 0 (issue4203):
677 677
678 678 $ mkdir issue4203
679 679 $ mkdir -p src/.hg
680 680 $ echo foo > src/foo
681 681 $ hg -R src add src/foo
682 682 $ hg -R src commit -m '#0'
683 683 $ hg -R src log -q
684 684 0:e1bab28bca43
685 685 $ hg clone -U -q src dst
686 686 $ hg -R dst log -q
687 687 0:e1bab28bca43
688 688
689 689 Create repositories to test auto sharing functionality
690 690
691 691 $ cat >> $HGRCPATH << EOF
692 692 > [extensions]
693 693 > share=
694 694 > EOF
695 695
696 696 $ hg init empty
697 697 $ hg init source1a
698 698 $ cd source1a
699 699 $ echo initial1 > foo
700 700 $ hg -q commit -A -m initial
701 701 $ echo second > foo
702 702 $ hg commit -m second
703 703 $ cd ..
704 704
705 705 $ hg init filteredrev0
706 706 $ cd filteredrev0
707 707 $ cat >> .hg/hgrc << EOF
708 708 > [experimental]
709 709 > evolution=createmarkers
710 710 > EOF
711 711 $ echo initial1 > foo
712 712 $ hg -q commit -A -m initial0
713 713 $ hg -q up -r null
714 714 $ echo initial2 > foo
715 715 $ hg -q commit -A -m initial1
716 716 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
717 717 $ cd ..
718 718
719 719 $ hg -q clone --pull source1a source1b
720 720 $ cd source1a
721 721 $ hg bookmark bookA
722 722 $ echo 1a > foo
723 723 $ hg commit -m 1a
724 724 $ cd ../source1b
725 725 $ hg -q up -r 0
726 726 $ echo head1 > foo
727 727 $ hg commit -m head1
728 728 created new head
729 729 $ hg bookmark head1
730 730 $ hg -q up -r 0
731 731 $ echo head2 > foo
732 732 $ hg commit -m head2
733 733 created new head
734 734 $ hg bookmark head2
735 735 $ hg -q up -r 0
736 736 $ hg branch branch1
737 737 marked working directory as branch branch1
738 738 (branches are permanent and global, did you want a bookmark?)
739 739 $ echo branch1 > foo
740 740 $ hg commit -m branch1
741 741 $ hg -q up -r 0
742 742 $ hg branch branch2
743 743 marked working directory as branch branch2
744 744 $ echo branch2 > foo
745 745 $ hg commit -m branch2
746 746 $ cd ..
747 747 $ hg init source2
748 748 $ cd source2
749 749 $ echo initial2 > foo
750 750 $ hg -q commit -A -m initial2
751 751 $ echo second > foo
752 752 $ hg commit -m second
753 753 $ cd ..
754 754
755 755 Clone with auto share from an empty repo should not result in share
756 756
757 757 $ mkdir share
758 758 $ hg --config share.pool=share clone empty share-empty
759 759 (not using pooled storage: remote appears to be empty)
760 760 updating to branch default
761 761 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
762 762 $ ls share
763 763 $ test -d share-empty/.hg/store
764 764 $ test -f share-empty/.hg/sharedpath
765 765 [1]
766 766
767 767 Clone with auto share from a repo with filtered revision 0 should not result in share
768 768
769 769 $ hg --config share.pool=share clone filteredrev0 share-filtered
770 770 (not using pooled storage: unable to resolve identity of remote)
771 771 requesting all changes
772 772 adding changesets
773 773 adding manifests
774 774 adding file changes
775 775 added 1 changesets with 1 changes to 1 files
776 776 updating to branch default
777 777 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
778 778
779 779 Clone from repo with content should result in shared store being created
780 780
781 781 $ hg --config share.pool=share clone source1a share-dest1a
782 782 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
783 783 requesting all changes
784 784 adding changesets
785 785 adding manifests
786 786 adding file changes
787 787 added 3 changesets with 3 changes to 1 files
788 788 searching for changes
789 789 no changes found
790 790 adding remote bookmark bookA
791 791 updating working directory
792 792 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
793 793
794 794 The shared repo should have been created
795 795
796 796 $ ls share
797 797 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
798 798
799 799 The destination should point to it
800 800
801 801 $ cat share-dest1a/.hg/sharedpath; echo
802 802 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg (glob)
803 803
804 804 The destination should have bookmarks
805 805
806 806 $ hg -R share-dest1a bookmarks
807 807 bookA 2:e5bfe23c0b47
808 808
809 809 The default path should be the remote, not the share
810 810
811 811 $ hg -R share-dest1a config paths.default
812 812 $TESTTMP/source1a (glob)
813 813
814 814 Clone with existing share dir should result in pull + share
815 815
816 816 $ hg --config share.pool=share clone source1b share-dest1b
817 817 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
818 818 searching for changes
819 819 adding changesets
820 820 adding manifests
821 821 adding file changes
822 822 added 4 changesets with 4 changes to 1 files (+4 heads)
823 823 adding remote bookmark head1
824 824 adding remote bookmark head2
825 825 updating working directory
826 826 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
827 827
828 828 $ ls share
829 829 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
830 830
831 831 $ cat share-dest1b/.hg/sharedpath; echo
832 832 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg (glob)
833 833
834 834 We only get bookmarks from the remote, not everything in the share
835 835
836 836 $ hg -R share-dest1b bookmarks
837 837 head1 3:4a8dc1ab4c13
838 838 head2 4:99f71071f117
839 839
840 840 Default path should be source, not share.
841 841
842 842 $ hg -R share-dest1b config paths.default
843 843 $TESTTMP/source1b (glob)
844 844
845 845 Checked out revision should be head of default branch
846 846
847 847 $ hg -R share-dest1b log -r .
848 848 changeset: 4:99f71071f117
849 849 bookmark: head2
850 850 parent: 0:b5f04eac9d8f
851 851 user: test
852 852 date: Thu Jan 01 00:00:00 1970 +0000
853 853 summary: head2
854 854
855 855
856 856 Clone from unrelated repo should result in new share
857 857
858 858 $ hg --config share.pool=share clone source2 share-dest2
859 859 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
860 860 requesting all changes
861 861 adding changesets
862 862 adding manifests
863 863 adding file changes
864 864 added 2 changesets with 2 changes to 1 files
865 865 searching for changes
866 866 no changes found
867 867 updating working directory
868 868 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
869 869
870 870 $ ls share
871 871 22aeff664783fd44c6d9b435618173c118c3448e
872 872 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
873 873
874 874 remote naming mode works as advertised
875 875
876 876 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
877 877 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
878 878 requesting all changes
879 879 adding changesets
880 880 adding manifests
881 881 adding file changes
882 882 added 3 changesets with 3 changes to 1 files
883 883 searching for changes
884 884 no changes found
885 885 adding remote bookmark bookA
886 886 updating working directory
887 887 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
888 888
889 889 $ ls shareremote
890 890 195bb1fcdb595c14a6c13e0269129ed78f6debde
891 891
892 892 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
893 893 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
894 894 requesting all changes
895 895 adding changesets
896 896 adding manifests
897 897 adding file changes
898 898 added 6 changesets with 6 changes to 1 files (+4 heads)
899 899 searching for changes
900 900 no changes found
901 901 adding remote bookmark head1
902 902 adding remote bookmark head2
903 903 updating working directory
904 904 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
905 905
906 906 $ ls shareremote
907 907 195bb1fcdb595c14a6c13e0269129ed78f6debde
908 908 c0d4f83847ca2a873741feb7048a45085fd47c46
909 909
910 910 request to clone a single revision is respected in sharing mode
911 911
912 912 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
913 913 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
914 914 adding changesets
915 915 adding manifests
916 916 adding file changes
917 917 added 2 changesets with 2 changes to 1 files
918 918 no changes found
919 919 adding remote bookmark head1
920 920 updating working directory
921 921 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
922 922
923 923 $ hg -R share-1arev log -G
924 924 @ changeset: 1:4a8dc1ab4c13
925 925 | bookmark: head1
926 926 | tag: tip
927 927 | user: test
928 928 | date: Thu Jan 01 00:00:00 1970 +0000
929 929 | summary: head1
930 930 |
931 931 o changeset: 0:b5f04eac9d8f
932 932 user: test
933 933 date: Thu Jan 01 00:00:00 1970 +0000
934 934 summary: initial
935 935
936 936
937 937 making another clone should only pull down requested rev
938 938
939 939 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
940 940 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
941 941 searching for changes
942 942 adding changesets
943 943 adding manifests
944 944 adding file changes
945 945 added 1 changesets with 1 changes to 1 files (+1 heads)
946 946 adding remote bookmark head1
947 947 adding remote bookmark head2
948 948 updating working directory
949 949 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
950 950
951 951 $ hg -R share-1brev log -G
952 952 @ changeset: 2:99f71071f117
953 953 | bookmark: head2
954 954 | tag: tip
955 955 | parent: 0:b5f04eac9d8f
956 956 | user: test
957 957 | date: Thu Jan 01 00:00:00 1970 +0000
958 958 | summary: head2
959 959 |
960 960 | o changeset: 1:4a8dc1ab4c13
961 961 |/ bookmark: head1
962 962 | user: test
963 963 | date: Thu Jan 01 00:00:00 1970 +0000
964 964 | summary: head1
965 965 |
966 966 o changeset: 0:b5f04eac9d8f
967 967 user: test
968 968 date: Thu Jan 01 00:00:00 1970 +0000
969 969 summary: initial
970 970
971 971
972 972 Request to clone a single branch is respected in sharing mode
973 973
974 974 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
975 975 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
976 976 adding changesets
977 977 adding manifests
978 978 adding file changes
979 979 added 2 changesets with 2 changes to 1 files
980 980 no changes found
981 981 updating working directory
982 982 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
983 983
984 984 $ hg -R share-1bbranch1 log -G
985 985 o changeset: 1:5f92a6c1a1b1
986 986 | branch: branch1
987 987 | tag: tip
988 988 | user: test
989 989 | date: Thu Jan 01 00:00:00 1970 +0000
990 990 | summary: branch1
991 991 |
992 992 @ changeset: 0:b5f04eac9d8f
993 993 user: test
994 994 date: Thu Jan 01 00:00:00 1970 +0000
995 995 summary: initial
996 996
997 997
998 998 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
999 999 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1000 1000 searching for changes
1001 1001 adding changesets
1002 1002 adding manifests
1003 1003 adding file changes
1004 1004 added 1 changesets with 1 changes to 1 files (+1 heads)
1005 1005 updating working directory
1006 1006 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1007 1007
1008 1008 $ hg -R share-1bbranch2 log -G
1009 1009 o changeset: 2:6bacf4683960
1010 1010 | branch: branch2
1011 1011 | tag: tip
1012 1012 | parent: 0:b5f04eac9d8f
1013 1013 | user: test
1014 1014 | date: Thu Jan 01 00:00:00 1970 +0000
1015 1015 | summary: branch2
1016 1016 |
1017 1017 | o changeset: 1:5f92a6c1a1b1
1018 1018 |/ branch: branch1
1019 1019 | user: test
1020 1020 | date: Thu Jan 01 00:00:00 1970 +0000
1021 1021 | summary: branch1
1022 1022 |
1023 1023 @ changeset: 0:b5f04eac9d8f
1024 1024 user: test
1025 1025 date: Thu Jan 01 00:00:00 1970 +0000
1026 1026 summary: initial
1027 1027
1028 1028
1029 1029 -U is respected in share clone mode
1030 1030
1031 1031 $ hg --config share.pool=share clone -U source1a share-1anowc
1032 1032 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1033 1033 searching for changes
1034 1034 no changes found
1035 1035 adding remote bookmark bookA
1036 1036
1037 1037 $ ls share-1anowc
1038 1038
1039 1039 Test that auto sharing doesn't cause failure of "hg clone local remote"
1040 1040
1041 1041 $ cd $TESTTMP
1042 1042 $ hg -R a id -r 0
1043 1043 acb14030fe0a
1044 1044 $ hg id -R remote -r 0
1045 1045 abort: repository remote not found!
1046 1046 [255]
1047 $ hg --config share.pool=share -q clone -e "$PYTHON \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1047 $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1048 1048 $ hg -R remote id -r 0
1049 1049 acb14030fe0a
1050 1050
1051 1051 Cloning into pooled storage doesn't race (issue5104)
1052 1052
1053 1053 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1054 1054 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1055 1055 $ wait
1056 1056
1057 1057 $ hg -R share-destrace1 log -r tip
1058 1058 changeset: 2:e5bfe23c0b47
1059 1059 bookmark: bookA
1060 1060 tag: tip
1061 1061 user: test
1062 1062 date: Thu Jan 01 00:00:00 1970 +0000
1063 1063 summary: 1a
1064 1064
1065 1065
1066 1066 $ hg -R share-destrace2 log -r tip
1067 1067 changeset: 2:e5bfe23c0b47
1068 1068 bookmark: bookA
1069 1069 tag: tip
1070 1070 user: test
1071 1071 date: Thu Jan 01 00:00:00 1970 +0000
1072 1072 summary: 1a
1073 1073
1074 1074 One repo should be new, the other should be shared from the pool. We
1075 1075 don't care which is which, so we just make sure we always print the
1076 1076 one containing "new pooled" first, then one one containing "existing
1077 1077 pooled".
1078 1078
1079 1079 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1080 1080 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1081 1081 requesting all changes
1082 1082 adding changesets
1083 1083 adding manifests
1084 1084 adding file changes
1085 1085 added 3 changesets with 3 changes to 1 files
1086 1086 searching for changes
1087 1087 no changes found
1088 1088 adding remote bookmark bookA
1089 1089 updating working directory
1090 1090 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1091 1091
1092 1092 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1093 1093 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1094 1094 searching for changes
1095 1095 no changes found
1096 1096 adding remote bookmark bookA
1097 1097 updating working directory
1098 1098 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -1,433 +1,433
1 1 Set up a server
2 2
3 3 $ cat >> $HGRCPATH << EOF
4 4 > [format]
5 5 > usegeneraldelta=yes
6 6 > EOF
7 7 $ hg init server
8 8 $ cd server
9 9 $ cat >> .hg/hgrc << EOF
10 10 > [extensions]
11 11 > clonebundles =
12 12 > EOF
13 13
14 14 $ touch foo
15 15 $ hg -q commit -A -m 'add foo'
16 16 $ touch bar
17 17 $ hg -q commit -A -m 'add bar'
18 18
19 19 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
20 20 $ cat hg.pid >> $DAEMON_PIDS
21 21 $ cd ..
22 22
23 23 Missing manifest should not result in server lookup
24 24
25 25 $ hg --verbose clone -U http://localhost:$HGPORT no-manifest
26 26 requesting all changes
27 27 adding changesets
28 28 adding manifests
29 29 adding file changes
30 30 added 2 changesets with 2 changes to 2 files
31 31
32 32 $ cat server/access.log
33 33 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
34 34 * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
35 35 * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
36 36
37 37 Empty manifest file results in retrieval
38 38 (the extension only checks if the manifest file exists)
39 39
40 40 $ touch server/.hg/clonebundles.manifest
41 41 $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest
42 42 no clone bundles available on remote; falling back to regular clone
43 43 requesting all changes
44 44 adding changesets
45 45 adding manifests
46 46 adding file changes
47 47 added 2 changesets with 2 changes to 2 files
48 48
49 49 Manifest file with invalid URL aborts
50 50
51 51 $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
52 52 $ hg clone http://localhost:$HGPORT 404-url
53 53 applying clone bundle from http://does.not.exist/bundle.hg
54 54 error fetching bundle: (.* not known|No address associated with hostname) (re) (no-windows !)
55 55 error fetching bundle: [Errno 11004] getaddrinfo failed (windows !)
56 56 abort: error applying bundle
57 57 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
58 58 [255]
59 59
60 60 Server is not running aborts
61 61
62 62 $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
63 63 $ hg clone http://localhost:$HGPORT server-not-runner
64 64 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
65 65 error fetching bundle: (.* refused.*|Protocol not supported|(.* )?Cannot assign requested address) (re)
66 66 abort: error applying bundle
67 67 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
68 68 [255]
69 69
70 70 Server returns 404
71 71
72 $ $PYTHON $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
72 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
73 73 $ cat http.pid >> $DAEMON_PIDS
74 74 $ hg clone http://localhost:$HGPORT running-404
75 75 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
76 76 HTTP error fetching bundle: HTTP Error 404: File not found
77 77 abort: error applying bundle
78 78 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
79 79 [255]
80 80
81 81 We can override failure to fall back to regular clone
82 82
83 83 $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback
84 84 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
85 85 HTTP error fetching bundle: HTTP Error 404: File not found
86 86 falling back to normal clone
87 87 requesting all changes
88 88 adding changesets
89 89 adding manifests
90 90 adding file changes
91 91 added 2 changesets with 2 changes to 2 files
92 92
93 93 Bundle with partial content works
94 94
95 95 $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg
96 96 1 changesets found
97 97
98 98 We verify exact bundle content as an extra check against accidental future
99 99 changes. If this output changes, we could break old clients.
100 100
101 101 $ f --size --hexdump partial.hg
102 102 partial.hg: size=207
103 103 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....|
104 104 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!|
105 105 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.|
106 106 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2|
107 107 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...|
108 108 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1|
109 109 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...|
110 110 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u|
111 111 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.|
112 112 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$|
113 113 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.|
114 114 00b0: 16 b2 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..|
115 115 00c0: 78 ed fc d5 76 f1 36 35 dc 05 00 36 ed 5e c7 |x...v.65...6.^.|
116 116
117 117 $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest
118 118 $ hg clone -U http://localhost:$HGPORT partial-bundle
119 119 applying clone bundle from http://localhost:$HGPORT1/partial.hg
120 120 adding changesets
121 121 adding manifests
122 122 adding file changes
123 123 added 1 changesets with 1 changes to 1 files
124 124 finished applying clone bundle
125 125 searching for changes
126 126 adding changesets
127 127 adding manifests
128 128 adding file changes
129 129 added 1 changesets with 1 changes to 1 files
130 130
131 131 Incremental pull doesn't fetch bundle
132 132
133 133 $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone
134 134 adding changesets
135 135 adding manifests
136 136 adding file changes
137 137 added 1 changesets with 1 changes to 1 files
138 138
139 139 $ cd partial-clone
140 140 $ hg pull
141 141 pulling from http://localhost:$HGPORT/
142 142 searching for changes
143 143 adding changesets
144 144 adding manifests
145 145 adding file changes
146 146 added 1 changesets with 1 changes to 1 files
147 147 (run 'hg update' to get a working copy)
148 148 $ cd ..
149 149
150 150 Bundle with full content works
151 151
152 152 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
153 153 2 changesets found
154 154
155 155 Again, we perform an extra check against bundle content changes. If this content
156 156 changes, clone bundles produced by new Mercurial versions may not be readable
157 157 by old clients.
158 158
159 159 $ f --size --hexdump full.hg
160 160 full.hg: size=396
161 161 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
162 162 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p|
163 163 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N|
164 164 0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........|
165 165 0040: f4 d4 62 23 06 06 e6 19 40 f9 4d c1 2a 31 09 cf |..b#....@.M.*1..|
166 166 0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............|
167 167 0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[|
168 168 0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z|
169 169 0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.|
170 170 0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..|
171 171 00a0: 28 00 19 20 17 af fa df ab ff 7b 3f fb 92 dc 8b |(.. ......{?....|
172 172 00b0: 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 89 2f b0 99 87 |.b......=ZD./...|
173 173 00c0: ec e2 54 63 43 e3 b4 64 43 73 23 33 43 53 0b 63 |..TcC..dCs#3CS.c|
174 174 00d0: d3 14 23 03 a0 fb 2c 2c 0c d3 80 1e 30 49 49 b1 |..#...,,....0II.|
175 175 00e0: 4c 4a 32 48 33 30 b0 34 42 b8 38 29 b1 08 e2 62 |LJ2H30.4B.8)...b|
176 176 00f0: 20 03 6a ca c2 2c db 2f f7 2c fa 6d fc fb 34 be | .j..,./.,.m..4.|
177 177 0100: fc 5c 21 a2 39 cb 66 77 7c 00 0d c3 59 17 14 58 |.\!.9.fw|...Y..X|
178 178 0110: 49 16 06 29 a9 a6 29 86 c6 16 e6 a6 16 a6 26 86 |I..)..).......&.|
179 179 0120: c9 a6 69 06 a6 46 66 a6 89 29 86 26 26 89 49 96 |..i..Ff..).&&.I.|
180 180 0130: 69 89 16 66 29 86 29 49 5c 20 07 3e 16 fe 23 ae |i..f).)I\ .>..#.|
181 181 0140: 26 da 1c ab 10 1f d1 f8 e3 b3 ef cd dd fc 0c 93 |&...............|
182 182 0150: 88 75 34 36 75 04 82 55 17 14 36 a4 38 10 04 d8 |.u46u..U..6.8...|
183 183 0160: 21 01 9a b1 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 |!......E..V....R|
184 184 0170: d7 8a 78 ed fc d5 76 f1 36 25 81 89 c7 ad ec 90 |..x...v.6%......|
185 185 0180: 54 47 75 2b 89 49 b1 00 d2 8a eb 92 |TGu+.I......|
186 186
187 187 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
188 188 $ hg clone -U http://localhost:$HGPORT full-bundle
189 189 applying clone bundle from http://localhost:$HGPORT1/full.hg
190 190 adding changesets
191 191 adding manifests
192 192 adding file changes
193 193 added 2 changesets with 2 changes to 2 files
194 194 finished applying clone bundle
195 195 searching for changes
196 196 no changes found
197 197
198 198 Feature works over SSH
199 199
200 $ hg clone -U -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/server ssh-full-clone
200 $ hg clone -U -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/server ssh-full-clone
201 201 applying clone bundle from http://localhost:$HGPORT1/full.hg
202 202 adding changesets
203 203 adding manifests
204 204 adding file changes
205 205 added 2 changesets with 2 changes to 2 files
206 206 finished applying clone bundle
207 207 searching for changes
208 208 no changes found
209 209
210 210 Entry with unknown BUNDLESPEC is filtered and not used
211 211
212 212 $ cat > server/.hg/clonebundles.manifest << EOF
213 213 > http://bad.entry1 BUNDLESPEC=UNKNOWN
214 214 > http://bad.entry2 BUNDLESPEC=xz-v1
215 215 > http://bad.entry3 BUNDLESPEC=none-v100
216 216 > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2
217 217 > EOF
218 218
219 219 $ hg clone -U http://localhost:$HGPORT filter-unknown-type
220 220 applying clone bundle from http://localhost:$HGPORT1/full.hg
221 221 adding changesets
222 222 adding manifests
223 223 adding file changes
224 224 added 2 changesets with 2 changes to 2 files
225 225 finished applying clone bundle
226 226 searching for changes
227 227 no changes found
228 228
229 229 Automatic fallback when all entries are filtered
230 230
231 231 $ cat > server/.hg/clonebundles.manifest << EOF
232 232 > http://bad.entry BUNDLESPEC=UNKNOWN
233 233 > EOF
234 234
235 235 $ hg clone -U http://localhost:$HGPORT filter-all
236 236 no compatible clone bundles available on server; falling back to regular clone
237 237 (you may want to report this to the server operator)
238 238 requesting all changes
239 239 adding changesets
240 240 adding manifests
241 241 adding file changes
242 242 added 2 changesets with 2 changes to 2 files
243 243
244 244 URLs requiring SNI are filtered in Python <2.7.9
245 245
246 246 $ cp full.hg sni.hg
247 247 $ cat > server/.hg/clonebundles.manifest << EOF
248 248 > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true
249 249 > http://localhost:$HGPORT1/full.hg
250 250 > EOF
251 251
252 252 #if sslcontext
253 253 Python 2.7.9+ support SNI
254 254
255 255 $ hg clone -U http://localhost:$HGPORT sni-supported
256 256 applying clone bundle from http://localhost:$HGPORT1/sni.hg
257 257 adding changesets
258 258 adding manifests
259 259 adding file changes
260 260 added 2 changesets with 2 changes to 2 files
261 261 finished applying clone bundle
262 262 searching for changes
263 263 no changes found
264 264 #else
265 265 Python <2.7.9 will filter SNI URLs
266 266
267 267 $ hg clone -U http://localhost:$HGPORT sni-unsupported
268 268 applying clone bundle from http://localhost:$HGPORT1/full.hg
269 269 adding changesets
270 270 adding manifests
271 271 adding file changes
272 272 added 2 changesets with 2 changes to 2 files
273 273 finished applying clone bundle
274 274 searching for changes
275 275 no changes found
276 276 #endif
277 277
278 278 Stream clone bundles are supported
279 279
280 280 $ hg -R server debugcreatestreamclonebundle packed.hg
281 281 writing 613 bytes for 4 files
282 282 bundle requirements: generaldelta, revlogv1
283 283
284 284 No bundle spec should work
285 285
286 286 $ cat > server/.hg/clonebundles.manifest << EOF
287 287 > http://localhost:$HGPORT1/packed.hg
288 288 > EOF
289 289
290 290 $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec
291 291 applying clone bundle from http://localhost:$HGPORT1/packed.hg
292 292 4 files to transfer, 613 bytes of data
293 293 transferred 613 bytes in *.* seconds (*) (glob)
294 294 finished applying clone bundle
295 295 searching for changes
296 296 no changes found
297 297
298 298 Bundle spec without parameters should work
299 299
300 300 $ cat > server/.hg/clonebundles.manifest << EOF
301 301 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
302 302 > EOF
303 303
304 304 $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec
305 305 applying clone bundle from http://localhost:$HGPORT1/packed.hg
306 306 4 files to transfer, 613 bytes of data
307 307 transferred 613 bytes in *.* seconds (*) (glob)
308 308 finished applying clone bundle
309 309 searching for changes
310 310 no changes found
311 311
312 312 Bundle spec with format requirements should work
313 313
314 314 $ cat > server/.hg/clonebundles.manifest << EOF
315 315 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
316 316 > EOF
317 317
318 318 $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements
319 319 applying clone bundle from http://localhost:$HGPORT1/packed.hg
320 320 4 files to transfer, 613 bytes of data
321 321 transferred 613 bytes in *.* seconds (*) (glob)
322 322 finished applying clone bundle
323 323 searching for changes
324 324 no changes found
325 325
326 326 Stream bundle spec with unknown requirements should be filtered out
327 327
328 328 $ cat > server/.hg/clonebundles.manifest << EOF
329 329 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
330 330 > EOF
331 331
332 332 $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements
333 333 no compatible clone bundles available on server; falling back to regular clone
334 334 (you may want to report this to the server operator)
335 335 requesting all changes
336 336 adding changesets
337 337 adding manifests
338 338 adding file changes
339 339 added 2 changesets with 2 changes to 2 files
340 340
341 341 Set up manifest for testing preferences
342 342 (Remember, the TYPE does not have to match reality - the URL is
343 343 important)
344 344
345 345 $ cp full.hg gz-a.hg
346 346 $ cp full.hg gz-b.hg
347 347 $ cp full.hg bz2-a.hg
348 348 $ cp full.hg bz2-b.hg
349 349 $ cat > server/.hg/clonebundles.manifest << EOF
350 350 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a
351 351 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a
352 352 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
353 353 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
354 354 > EOF
355 355
356 356 Preferring an undefined attribute will take first entry
357 357
358 358 $ hg --config ui.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
359 359 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
360 360 adding changesets
361 361 adding manifests
362 362 adding file changes
363 363 added 2 changesets with 2 changes to 2 files
364 364 finished applying clone bundle
365 365 searching for changes
366 366 no changes found
367 367
368 368 Preferring bz2 type will download first entry of that type
369 369
370 370 $ hg --config ui.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
371 371 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
372 372 adding changesets
373 373 adding manifests
374 374 adding file changes
375 375 added 2 changesets with 2 changes to 2 files
376 376 finished applying clone bundle
377 377 searching for changes
378 378 no changes found
379 379
380 380 Preferring multiple values of an option works
381 381
382 382 $ hg --config ui.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
383 383 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
384 384 adding changesets
385 385 adding manifests
386 386 adding file changes
387 387 added 2 changesets with 2 changes to 2 files
388 388 finished applying clone bundle
389 389 searching for changes
390 390 no changes found
391 391
392 392 Sorting multiple values should get us back to original first entry
393 393
394 394 $ hg --config ui.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
395 395 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
396 396 adding changesets
397 397 adding manifests
398 398 adding file changes
399 399 added 2 changesets with 2 changes to 2 files
400 400 finished applying clone bundle
401 401 searching for changes
402 402 no changes found
403 403
404 404 Preferring multiple attributes has correct order
405 405
406 406 $ hg --config ui.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
407 407 applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
408 408 adding changesets
409 409 adding manifests
410 410 adding file changes
411 411 added 2 changesets with 2 changes to 2 files
412 412 finished applying clone bundle
413 413 searching for changes
414 414 no changes found
415 415
416 416 Test where attribute is missing from some entries
417 417
418 418 $ cat > server/.hg/clonebundles.manifest << EOF
419 419 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
420 420 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2
421 421 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
422 422 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
423 423 > EOF
424 424
425 425 $ hg --config ui.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
426 426 applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
427 427 adding changesets
428 428 adding manifests
429 429 adding file changes
430 430 added 2 changesets with 2 changes to 2 files
431 431 finished applying clone bundle
432 432 searching for changes
433 433 no changes found
@@ -1,96 +1,96
1 1 #require killdaemons
2 2
3 3 $ hgserve() {
4 4 > hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid \
5 5 > -E errors.log -v $@ > startup.log
6 6 > # Grepping hg serve stdout would hang on Windows
7 7 > grep -v 'listening at' startup.log
8 8 > cat hg.pid >> "$DAEMON_PIDS"
9 9 > }
10 10 $ hg init a
11 11 $ hg --encoding utf-8 -R a branch Γ¦
12 12 marked working directory as branch \xc3\xa6 (esc)
13 13 (branches are permanent and global, did you want a bookmark?)
14 14 $ echo foo > a/foo
15 15 $ hg -R a ci -Am foo
16 16 adding foo
17 17 $ hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1
18 18 $ hg --encoding utf-8 clone http://localhost:$HGPORT1 b
19 19 requesting all changes
20 20 adding changesets
21 21 adding manifests
22 22 adding file changes
23 23 added 1 changesets with 1 changes to 1 files
24 24 updating to branch \xc3\xa6 (esc)
25 25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 26 $ hg --encoding utf-8 -R b log
27 27 changeset: 0:867c11ce77b8
28 28 branch: \xc3\xa6 (esc)
29 29 tag: tip
30 30 user: test
31 31 date: Thu Jan 01 00:00:00 1970 +0000
32 32 summary: foo
33 33
34 34 $ echo bar >> b/foo
35 35 $ hg -R b ci -m bar
36 36 $ hg --encoding utf-8 -R b push
37 37 pushing to http://localhost:$HGPORT1/
38 38 searching for changes
39 39 remote: adding changesets
40 40 remote: adding manifests
41 41 remote: adding file changes
42 42 remote: added 1 changesets with 1 changes to 1 files
43 43 $ hg -R a --encoding utf-8 log
44 44 changeset: 1:58e7c90d67cb
45 45 branch: \xc3\xa6 (esc)
46 46 tag: tip
47 47 user: test
48 48 date: Thu Jan 01 00:00:00 1970 +0000
49 49 summary: bar
50 50
51 51 changeset: 0:867c11ce77b8
52 52 branch: \xc3\xa6 (esc)
53 53 user: test
54 54 date: Thu Jan 01 00:00:00 1970 +0000
55 55 summary: foo
56 56
57 57 $ killdaemons.py hg.pid
58 58
59 59 verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
60 60
61 61 $ cat <<EOF > oldhg
62 62 > import sys
63 63 > from mercurial import ui, hg, commands
64 64 >
65 65 > class StdoutWrapper(object):
66 66 > def __init__(self, stdout):
67 67 > self._file = stdout
68 68 >
69 69 > def write(self, data):
70 70 > if data == '47\n':
71 71 > # latin1 encoding is one %xx (3 bytes) shorter
72 72 > data = '44\n'
73 73 > elif data.startswith('%C3%A6 '):
74 74 > # translate to latin1 encoding
75 75 > data = '%%E6 %s' % data[7:]
76 76 > self._file.write(data)
77 77 >
78 78 > def __getattr__(self, name):
79 79 > return getattr(self._file, name)
80 80 >
81 81 > sys.stdout = StdoutWrapper(sys.stdout)
82 82 > sys.stderr = StdoutWrapper(sys.stderr)
83 83 >
84 84 > myui = ui.ui.load()
85 85 > repo = hg.repository(myui, 'a')
86 86 > commands.serve(myui, repo, stdio=True, cmdserver=False)
87 87 > EOF
88 88 $ echo baz >> b/foo
89 89 $ hg -R b ci -m baz
90 $ hg push -R b -e '$PYTHON oldhg' ssh://dummy/ --encoding latin1
90 $ hg push -R b -e "\"$PYTHON\" oldhg" ssh://dummy/ --encoding latin1
91 91 pushing to ssh://dummy/
92 92 searching for changes
93 93 remote: adding changesets
94 94 remote: adding manifests
95 95 remote: adding file changes
96 96 remote: added 1 changesets with 1 changes to 1 files
@@ -1,262 +1,262
1 1 This test tries to exercise the ssh functionality with a dummy script
2 2
3 3 (enable general delta early)
4 4
5 5 $ cat << EOF >> $HGRCPATH
6 6 > [format]
7 7 > usegeneraldelta=yes
8 8 > EOF
9 9
10 10 $ checknewrepo()
11 11 > {
12 12 > name=$1
13 13 > if [ -d "$name"/.hg/store ]; then
14 14 > echo store created
15 15 > fi
16 16 > if [ -f "$name"/.hg/00changelog.i ]; then
17 17 > echo 00changelog.i created
18 18 > fi
19 19 > cat "$name"/.hg/requires
20 20 > }
21 21
22 22 creating 'local'
23 23
24 24 $ hg init local
25 25 $ checknewrepo local
26 26 store created
27 27 00changelog.i created
28 28 dotencode
29 29 fncache
30 30 generaldelta
31 31 revlogv1
32 32 store
33 33 $ echo this > local/foo
34 34 $ hg ci --cwd local -A -m "init"
35 35 adding foo
36 36
37 37 test custom revlog chunk cache sizes
38 38
39 39 $ hg --config format.chunkcachesize=0 log -R local -pv
40 40 abort: revlog chunk cache size 0 is not greater than 0!
41 41 [255]
42 42 $ hg --config format.chunkcachesize=1023 log -R local -pv
43 43 abort: revlog chunk cache size 1023 is not a power of 2!
44 44 [255]
45 45 $ hg --config format.chunkcachesize=1024 log -R local -pv
46 46 changeset: 0:08b9e9f63b32
47 47 tag: tip
48 48 user: test
49 49 date: Thu Jan 01 00:00:00 1970 +0000
50 50 files: foo
51 51 description:
52 52 init
53 53
54 54
55 55 diff -r 000000000000 -r 08b9e9f63b32 foo
56 56 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
57 57 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
58 58 @@ -0,0 +1,1 @@
59 59 +this
60 60
61 61
62 62 creating repo with format.usestore=false
63 63
64 64 $ hg --config format.usestore=false init old
65 65 $ checknewrepo old
66 66 generaldelta
67 67 revlogv1
68 68
69 69 creating repo with format.usefncache=false
70 70
71 71 $ hg --config format.usefncache=false init old2
72 72 $ checknewrepo old2
73 73 store created
74 74 00changelog.i created
75 75 generaldelta
76 76 revlogv1
77 77 store
78 78
79 79 creating repo with format.dotencode=false
80 80
81 81 $ hg --config format.dotencode=false init old3
82 82 $ checknewrepo old3
83 83 store created
84 84 00changelog.i created
85 85 fncache
86 86 generaldelta
87 87 revlogv1
88 88 store
89 89
90 90 creating repo with format.dotencode=false
91 91
92 92 $ hg --config format.generaldelta=false --config format.usegeneraldelta=false init old4
93 93 $ checknewrepo old4
94 94 store created
95 95 00changelog.i created
96 96 dotencode
97 97 fncache
98 98 revlogv1
99 99 store
100 100
101 101 test failure
102 102
103 103 $ hg init local
104 104 abort: repository local already exists!
105 105 [255]
106 106
107 107 init+push to remote2
108 108
109 $ hg init -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
109 $ hg init -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
110 110 $ hg incoming -R remote2 local
111 111 comparing with local
112 112 changeset: 0:08b9e9f63b32
113 113 tag: tip
114 114 user: test
115 115 date: Thu Jan 01 00:00:00 1970 +0000
116 116 summary: init
117 117
118 118
119 $ hg push -R local -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
119 $ hg push -R local -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
120 120 pushing to ssh://user@dummy/remote2
121 121 searching for changes
122 122 remote: adding changesets
123 123 remote: adding manifests
124 124 remote: adding file changes
125 125 remote: added 1 changesets with 1 changes to 1 files
126 126
127 127 clone to remote1
128 128
129 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
129 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
130 130 searching for changes
131 131 remote: adding changesets
132 132 remote: adding manifests
133 133 remote: adding file changes
134 134 remote: added 1 changesets with 1 changes to 1 files
135 135
136 136 The largefiles extension doesn't crash
137 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remotelf --config extensions.largefiles=
137 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remotelf --config extensions.largefiles=
138 138 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
139 139 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
140 140 searching for changes
141 141 remote: adding changesets
142 142 remote: adding manifests
143 143 remote: adding file changes
144 144 remote: added 1 changesets with 1 changes to 1 files
145 145
146 146 init to existing repo
147 147
148 $ hg init -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
148 $ hg init -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
149 149 abort: repository remote1 already exists!
150 150 abort: could not create remote repo!
151 151 [255]
152 152
153 153 clone to existing repo
154 154
155 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
155 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
156 156 abort: repository remote1 already exists!
157 157 abort: could not create remote repo!
158 158 [255]
159 159
160 160 output of dummyssh
161 161
162 162 $ cat dummylog
163 163 Got arguments 1:user@dummy 2:hg init remote2
164 164 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
165 165 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
166 166 Got arguments 1:user@dummy 2:hg init remote1
167 167 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
168 168 Got arguments 1:user@dummy 2:hg init remotelf
169 169 Got arguments 1:user@dummy 2:hg -R remotelf serve --stdio
170 170 Got arguments 1:user@dummy 2:hg init remote1
171 171 Got arguments 1:user@dummy 2:hg init remote1
172 172
173 173 comparing repositories
174 174
175 175 $ hg tip -q -R local
176 176 0:08b9e9f63b32
177 177 $ hg tip -q -R remote1
178 178 0:08b9e9f63b32
179 179 $ hg tip -q -R remote2
180 180 0:08b9e9f63b32
181 181
182 182 check names for repositories (clashes with URL schemes, special chars)
183 183
184 184 $ for i in bundle file hg http https old-http ssh static-http "with space"; do
185 185 > printf "hg init \"$i\"... "
186 186 > hg init "$i"
187 187 > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
188 188 > done
189 189 hg init "bundle"... ok
190 190 hg init "file"... ok
191 191 hg init "hg"... ok
192 192 hg init "http"... ok
193 193 hg init "https"... ok
194 194 hg init "old-http"... ok
195 195 hg init "ssh"... ok
196 196 hg init "static-http"... ok
197 197 hg init "with space"... ok
198 198 #if eol-in-paths
199 199 /* " " is not a valid name for a directory on Windows */
200 200 $ hg init " "
201 201 $ test -d " "
202 202 $ test -d " /.hg"
203 203 #endif
204 204
205 205 creating 'local/sub/repo'
206 206
207 207 $ hg init local/sub/repo
208 208 $ checknewrepo local/sub/repo
209 209 store created
210 210 00changelog.i created
211 211 dotencode
212 212 fncache
213 213 generaldelta
214 214 revlogv1
215 215 store
216 216
217 217 prepare test of init of url configured from paths
218 218
219 219 $ echo '[paths]' >> $HGRCPATH
220 220 $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
221 221 $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
222 222
223 223 init should (for consistency with clone) expand the url
224 224
225 225 $ hg init somewhere
226 226 $ checknewrepo "url from paths"
227 227 store created
228 228 00changelog.i created
229 229 dotencode
230 230 fncache
231 231 generaldelta
232 232 revlogv1
233 233 store
234 234
235 235 verify that clone also expand urls
236 236
237 237 $ hg clone somewhere elsewhere
238 238 updating to branch default
239 239 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
240 240 $ checknewrepo "another paths url"
241 241 store created
242 242 00changelog.i created
243 243 dotencode
244 244 fncache
245 245 generaldelta
246 246 revlogv1
247 247 store
248 248
249 249 clone bookmarks
250 250
251 251 $ hg -R local bookmark test
252 252 $ hg -R local bookmarks
253 253 * test 0:08b9e9f63b32
254 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
254 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
255 255 searching for changes
256 256 remote: adding changesets
257 257 remote: adding manifests
258 258 remote: adding file changes
259 259 remote: added 1 changesets with 1 changes to 1 files
260 260 exporting bookmark test
261 261 $ hg -R remote-bookmarks bookmarks
262 262 test 0:08b9e9f63b32
@@ -1,447 +1,447
1 1 This file contains testcases that tend to be related to the wire protocol part
2 2 of largefiles.
3 3
4 4 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
5 5 $ mkdir "${USERCACHE}"
6 6 $ cat >> $HGRCPATH <<EOF
7 7 > [extensions]
8 8 > largefiles=
9 9 > purge=
10 10 > rebase=
11 11 > transplant=
12 12 > [phases]
13 13 > publish=False
14 14 > [largefiles]
15 15 > minsize=2
16 16 > patterns=glob:**.dat
17 17 > usercache=${USERCACHE}
18 18 > [web]
19 19 > allow_archive = zip
20 20 > [hooks]
21 21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 22 > EOF
23 23
24 24
25 25 #if serve
26 26 vanilla clients not locked out from largefiles servers on vanilla repos
27 27 $ mkdir r1
28 28 $ cd r1
29 29 $ hg init
30 30 $ echo c1 > f1
31 31 $ hg add f1
32 32 $ hg commit -m "m1"
33 33 Invoking status precommit hook
34 34 A f1
35 35 $ cd ..
36 36 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
37 37 $ cat hg.pid >> $DAEMON_PIDS
38 38 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
39 39 requesting all changes
40 40 adding changesets
41 41 adding manifests
42 42 adding file changes
43 43 added 1 changesets with 1 changes to 1 files
44 44 updating to branch default
45 45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 46
47 47 largefiles clients still work with vanilla servers
48 48 $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid
49 49 $ cat hg.pid >> $DAEMON_PIDS
50 50 $ hg clone http://localhost:$HGPORT1 r3
51 51 requesting all changes
52 52 adding changesets
53 53 adding manifests
54 54 adding file changes
55 55 added 1 changesets with 1 changes to 1 files
56 56 updating to branch default
57 57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 58 #endif
59 59
60 60 vanilla clients locked out from largefiles http repos
61 61 $ mkdir r4
62 62 $ cd r4
63 63 $ hg init
64 64 $ echo c1 > f1
65 65 $ hg add --large f1
66 66 $ hg commit -m "m1"
67 67 Invoking status precommit hook
68 68 A f1
69 69 $ cd ..
70 70
71 71 largefiles can be pushed locally (issue3583)
72 72 $ hg init dest
73 73 $ cd r4
74 74 $ hg outgoing ../dest
75 75 comparing with ../dest
76 76 searching for changes
77 77 changeset: 0:639881c12b4c
78 78 tag: tip
79 79 user: test
80 80 date: Thu Jan 01 00:00:00 1970 +0000
81 81 summary: m1
82 82
83 83 $ hg push ../dest
84 84 pushing to ../dest
85 85 searching for changes
86 86 adding changesets
87 87 adding manifests
88 88 adding file changes
89 89 added 1 changesets with 1 changes to 1 files
90 90
91 91 exit code with nothing outgoing (issue3611)
92 92 $ hg outgoing ../dest
93 93 comparing with ../dest
94 94 searching for changes
95 95 no changes found
96 96 [1]
97 97 $ cd ..
98 98
99 99 #if serve
100 100 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
101 101 $ cat hg.pid >> $DAEMON_PIDS
102 102 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
103 103 abort: remote error:
104 104
105 105 This repository uses the largefiles extension.
106 106
107 107 Please enable it in your Mercurial config file.
108 108 [255]
109 109
110 110 used all HGPORTs, kill all daemons
111 111 $ killdaemons.py
112 112 #endif
113 113
114 114 vanilla clients locked out from largefiles ssh repos
115 $ hg --config extensions.largefiles=! clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
115 $ hg --config extensions.largefiles=! clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
116 116 remote:
117 117 remote: This repository uses the largefiles extension.
118 118 remote:
119 119 remote: Please enable it in your Mercurial config file.
120 120 remote:
121 121 remote: -
122 122 abort: remote error
123 123 (check previous remote output)
124 124 [255]
125 125
126 126 #if serve
127 127
128 128 largefiles clients refuse to push largefiles repos to vanilla servers
129 129 $ mkdir r6
130 130 $ cd r6
131 131 $ hg init
132 132 $ echo c1 > f1
133 133 $ hg add f1
134 134 $ hg commit -m "m1"
135 135 Invoking status precommit hook
136 136 A f1
137 137 $ cat >> .hg/hgrc <<!
138 138 > [web]
139 139 > push_ssl = false
140 140 > allow_push = *
141 141 > !
142 142 $ cd ..
143 143 $ hg clone r6 r7
144 144 updating to branch default
145 145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 146 $ cd r7
147 147 $ echo c2 > f2
148 148 $ hg add --large f2
149 149 $ hg commit -m "m2"
150 150 Invoking status precommit hook
151 151 A f2
152 152 $ hg verify --large
153 153 checking changesets
154 154 checking manifests
155 155 crosschecking files in changesets and manifests
156 156 checking files
157 157 2 files, 2 changesets, 2 total revisions
158 158 searching 1 changesets for largefiles
159 159 verified existence of 1 revisions of 1 largefiles
160 160 $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid
161 161 $ cat ../hg.pid >> $DAEMON_PIDS
162 162 $ hg push http://localhost:$HGPORT
163 163 pushing to http://localhost:$HGPORT/
164 164 searching for changes
165 165 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
166 166 [255]
167 167 $ cd ..
168 168
169 169 putlfile errors are shown (issue3123)
170 170 Corrupt the cached largefile in r7 and move it out of the servers usercache
171 171 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
172 172 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
173 173 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
174 174 $ hg init empty
175 175 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
176 176 > --config 'web.allow_push=*' --config web.push_ssl=False
177 177 $ cat hg.pid >> $DAEMON_PIDS
178 178 $ hg push -R r7 http://localhost:$HGPORT1
179 179 pushing to http://localhost:$HGPORT1/
180 180 searching for changes
181 181 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
182 182 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
183 183 [255]
184 184 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
185 185 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
186 186 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
187 187 $ hg push -R r7 http://localhost:$HGPORT1
188 188 pushing to http://localhost:$HGPORT1/
189 189 searching for changes
190 190 remote: adding changesets
191 191 remote: adding manifests
192 192 remote: adding file changes
193 193 remote: added 2 changesets with 2 changes to 2 files
194 194 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
195 195 server side corruption
196 196 $ rm -rf empty
197 197
198 198 Push a largefiles repository to a served empty repository
199 199 $ hg init r8
200 200 $ echo c3 > r8/f1
201 201 $ hg add --large r8/f1 -R r8
202 202 $ hg commit -m "m1" -R r8
203 203 Invoking status precommit hook
204 204 A f1
205 205 $ hg init empty
206 206 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
207 207 > --config 'web.allow_push=*' --config web.push_ssl=False
208 208 $ cat hg.pid >> $DAEMON_PIDS
209 209 $ rm "${USERCACHE}"/*
210 210 $ hg push -R r8 http://localhost:$HGPORT2/#default
211 211 pushing to http://localhost:$HGPORT2/
212 212 searching for changes
213 213 remote: adding changesets
214 214 remote: adding manifests
215 215 remote: adding file changes
216 216 remote: added 1 changesets with 1 changes to 1 files
217 217 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
218 218 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
219 219
220 220 Clone over http, no largefiles pulled on clone.
221 221
222 222 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
223 223 adding changesets
224 224 adding manifests
225 225 adding file changes
226 226 added 1 changesets with 1 changes to 1 files
227 227
228 228 Archive contains largefiles
229 229 >>> import urllib2, os
230 230 >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
231 231 >>> with open('archive.zip', 'w') as f:
232 232 ... f.write(urllib2.urlopen(u).read())
233 233 $ unzip -t archive.zip
234 234 Archive: archive.zip
235 235 testing: empty-default/.hg_archival.txt*OK (glob)
236 236 testing: empty-default/f1*OK (glob)
237 237 No errors detected in compressed data of archive.zip.
238 238
239 239 test 'verify' with remotestore:
240 240
241 241 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
242 242 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
243 243 $ hg -R http-clone verify --large --lfa
244 244 checking changesets
245 245 checking manifests
246 246 crosschecking files in changesets and manifests
247 247 checking files
248 248 1 files, 1 changesets, 1 total revisions
249 249 searching 1 changesets for largefiles
250 250 changeset 0:cf03e5bb9936: f1 missing
251 251 verified existence of 1 revisions of 1 largefiles
252 252 [1]
253 253 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
254 254 $ hg -R http-clone -q verify --large --lfa
255 255
256 256 largefiles pulled on update - a largefile missing on the server:
257 257 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
258 258 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
259 259 getting changed largefiles
260 260 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
261 261 0 largefiles updated, 0 removed
262 262 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 263 $ hg -R http-clone st
264 264 ! f1
265 265 $ hg -R http-clone up -Cqr null
266 266
267 267 largefiles pulled on update - a largefile corrupted on the server:
268 268 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
269 269 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
270 270 getting changed largefiles
271 271 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
272 272 0 largefiles updated, 0 removed
273 273 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 274 $ hg -R http-clone st
275 275 ! f1
276 276 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
277 277 $ [ ! -f http-clone/f1 ]
278 278 $ [ ! -f http-clone-usercache ]
279 279 $ hg -R http-clone verify --large --lfc
280 280 checking changesets
281 281 checking manifests
282 282 crosschecking files in changesets and manifests
283 283 checking files
284 284 1 files, 1 changesets, 1 total revisions
285 285 searching 1 changesets for largefiles
286 286 verified contents of 1 revisions of 1 largefiles
287 287 $ hg -R http-clone up -Cqr null
288 288
289 289 largefiles pulled on update - no server side problems:
290 290 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
291 291 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true
292 292 resolving manifests
293 293 branchmerge: False, force: False, partial: False
294 294 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
295 295 .hglf/f1: remote created -> g
296 296 getting .hglf/f1
297 297 updating: .hglf/f1 1/1 files (100.00%)
298 298 getting changed largefiles
299 299 using http://localhost:$HGPORT2/
300 300 sending capabilities command
301 301 sending batch command
302 302 getting largefiles: 0/1 files (0.00%)
303 303 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
304 304 sending getlfile command
305 305 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
306 306 1 largefiles updated, 0 removed
307 307 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
308 308
309 309 $ ls http-clone-usercache/*
310 310 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
311 311
312 312 $ rm -rf empty http-clone*
313 313
314 314 used all HGPORTs, kill all daemons
315 315 $ killdaemons.py
316 316
317 317 largefiles should batch verify remote calls
318 318
319 319 $ hg init batchverifymain
320 320 $ cd batchverifymain
321 321 $ echo "aaa" >> a
322 322 $ hg add --large a
323 323 $ hg commit -m "a"
324 324 Invoking status precommit hook
325 325 A a
326 326 $ echo "bbb" >> b
327 327 $ hg add --large b
328 328 $ hg commit -m "b"
329 329 Invoking status precommit hook
330 330 A b
331 331 $ cd ..
332 332 $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \
333 333 > -A access.log
334 334 $ cat hg.pid >> $DAEMON_PIDS
335 335 $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone
336 336 requesting all changes
337 337 adding changesets
338 338 adding manifests
339 339 adding file changes
340 340 added 2 changesets with 2 changes to 2 files
341 341 $ hg -R batchverifyclone verify --large --lfa
342 342 checking changesets
343 343 checking manifests
344 344 crosschecking files in changesets and manifests
345 345 checking files
346 346 2 files, 2 changesets, 2 total revisions
347 347 searching 2 changesets for largefiles
348 348 verified existence of 2 revisions of 2 largefiles
349 349 $ tail -1 access.log
350 350 $LOCALIP - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
351 351 $ hg -R batchverifyclone update
352 352 getting changed largefiles
353 353 2 largefiles updated, 0 removed
354 354 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 355
356 356 Clear log file before next test
357 357
358 358 $ printf "" > access.log
359 359
360 360 Verify should check file on remote server only when file is not
361 361 available locally.
362 362
363 363 $ echo "ccc" >> batchverifymain/c
364 364 $ hg -R batchverifymain status
365 365 ? c
366 366 $ hg -R batchverifymain add --large batchverifymain/c
367 367 $ hg -R batchverifymain commit -m "c"
368 368 Invoking status precommit hook
369 369 A c
370 370 $ hg -R batchverifyclone pull
371 371 pulling from http://localhost:$HGPORT/
372 372 searching for changes
373 373 adding changesets
374 374 adding manifests
375 375 adding file changes
376 376 added 1 changesets with 1 changes to 1 files
377 377 (run 'hg update' to get a working copy)
378 378 $ hg -R batchverifyclone verify --lfa
379 379 checking changesets
380 380 checking manifests
381 381 crosschecking files in changesets and manifests
382 382 checking files
383 383 3 files, 3 changesets, 3 total revisions
384 384 searching 3 changesets for largefiles
385 385 verified existence of 3 revisions of 3 largefiles
386 386 $ tail -1 access.log
387 387 $LOCALIP - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3Dc8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
388 388
389 389 $ killdaemons.py
390 390
391 391 largefiles should not ask for password again after successful authorization
392 392
393 393 $ hg init credentialmain
394 394 $ cd credentialmain
395 395 $ echo "aaa" >> a
396 396 $ hg add --large a
397 397 $ hg commit -m "a"
398 398 Invoking status precommit hook
399 399 A a
400 400
401 401 Before running server clear the user cache to force clone to download
402 402 a large file from the server rather than to get it from the cache
403 403
404 404 $ rm "${USERCACHE}"/*
405 405
406 406 $ cd ..
407 407 $ cat << EOT > userpass.py
408 408 > import base64
409 409 > from mercurial.hgweb import common
410 410 > def perform_authentication(hgweb, req, op):
411 411 > auth = req.env.get('HTTP_AUTHORIZATION')
412 412 > if not auth:
413 413 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
414 414 > [('WWW-Authenticate', 'Basic Realm="mercurial"')])
415 415 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
416 416 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
417 417 > def extsetup():
418 418 > common.permhooks.insert(0, perform_authentication)
419 419 > EOT
420 420 $ hg serve --config extensions.x=userpass.py -R credentialmain \
421 421 > -d -p $HGPORT --pid-file hg.pid -A access.log
422 422 $ cat hg.pid >> $DAEMON_PIDS
423 423 $ cat << EOF > get_pass.py
424 424 > import getpass
425 425 > def newgetpass(arg):
426 426 > return "pass"
427 427 > getpass.getpass = newgetpass
428 428 > EOF
429 429 $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \
430 430 > http://user@localhost:$HGPORT credentialclone
431 431 requesting all changes
432 432 http authorization required for http://localhost:$HGPORT/
433 433 realm: mercurial
434 434 user: user
435 435 password: adding changesets
436 436 adding manifests
437 437 adding file changes
438 438 added 1 changesets with 1 changes to 1 files
439 439 updating to branch default
440 440 getting changed largefiles
441 441 1 largefiles updated, 0 removed
442 442 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
443 443
444 444 $ killdaemons.py
445 445 $ rm hg.pid access.log
446 446
447 447 #endif
@@ -1,562 +1,562
1 1 This test is a duplicate of 'test-http.t' feel free to factor out
2 2 parts that are not bundle1/bundle2 specific.
3 3
4 4 $ cat << EOF >> $HGRCPATH
5 5 > [devel]
6 6 > # This test is dedicated to interaction through old bundle
7 7 > legacy.exchange = bundle1
8 8 > [format] # temporary settings
9 9 > usegeneraldelta=yes
10 10 > EOF
11 11
12 12
13 13 This test tries to exercise the ssh functionality with a dummy script
14 14
15 15 creating 'remote' repo
16 16
17 17 $ hg init remote
18 18 $ cd remote
19 19 $ echo this > foo
20 20 $ echo this > fooO
21 21 $ hg ci -A -m "init" foo fooO
22 22
23 23 insert a closed branch (issue4428)
24 24
25 25 $ hg up null
26 26 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
27 27 $ hg branch closed
28 28 marked working directory as branch closed
29 29 (branches are permanent and global, did you want a bookmark?)
30 30 $ hg ci -mc0
31 31 $ hg ci --close-branch -mc1
32 32 $ hg up -q default
33 33
34 34 configure for serving
35 35
36 36 $ cat <<EOF > .hg/hgrc
37 37 > [server]
38 38 > uncompressed = True
39 39 >
40 40 > [hooks]
41 41 > changegroup = sh -c "printenv.py changegroup-in-remote 0 ../dummylog"
42 42 > EOF
43 43 $ cd ..
44 44
45 45 repo not found error
46 46
47 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
47 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
48 48 remote: abort: repository nonexistent not found!
49 49 abort: no suitable response from remote hg!
50 50 [255]
51 51
52 52 non-existent absolute path
53 53
54 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy//`pwd`/nonexistent local
54 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy//`pwd`/nonexistent local
55 55 remote: abort: repository /$TESTTMP/nonexistent not found!
56 56 abort: no suitable response from remote hg!
57 57 [255]
58 58
59 59 clone remote via stream
60 60
61 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream
61 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream
62 62 streaming all changes
63 63 4 files to transfer, 602 bytes of data
64 64 transferred 602 bytes in * seconds (*) (glob)
65 65 searching for changes
66 66 no changes found
67 67 updating to branch default
68 68 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 69 $ cd local-stream
70 70 $ hg verify
71 71 checking changesets
72 72 checking manifests
73 73 crosschecking files in changesets and manifests
74 74 checking files
75 75 2 files, 3 changesets, 2 total revisions
76 76 $ hg branches
77 77 default 0:1160648e36ce
78 78 $ cd ..
79 79
80 80 clone bookmarks via stream
81 81
82 82 $ hg -R local-stream book mybook
83 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2
83 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2
84 84 streaming all changes
85 85 4 files to transfer, 602 bytes of data
86 86 transferred 602 bytes in * seconds (*) (glob)
87 87 searching for changes
88 88 no changes found
89 89 updating to branch default
90 90 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 91 $ cd stream2
92 92 $ hg book
93 93 mybook 0:1160648e36ce
94 94 $ cd ..
95 95 $ rm -rf local-stream stream2
96 96
97 97 clone remote via pull
98 98
99 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local
99 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local
100 100 requesting all changes
101 101 adding changesets
102 102 adding manifests
103 103 adding file changes
104 104 added 3 changesets with 2 changes to 2 files
105 105 updating to branch default
106 106 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 107
108 108 verify
109 109
110 110 $ cd local
111 111 $ hg verify
112 112 checking changesets
113 113 checking manifests
114 114 crosschecking files in changesets and manifests
115 115 checking files
116 116 2 files, 3 changesets, 2 total revisions
117 117 $ cat >> .hg/hgrc <<EOF
118 118 > [hooks]
119 119 > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog"
120 120 > EOF
121 121
122 122 empty default pull
123 123
124 124 $ hg paths
125 125 default = ssh://user@dummy/remote
126 $ hg pull -e "$PYTHON \"$TESTDIR/dummyssh\""
126 $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\""
127 127 pulling from ssh://user@dummy/remote
128 128 searching for changes
129 129 no changes found
130 130
131 131 pull from wrong ssh URL
132 132
133 $ hg pull -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
133 $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
134 134 pulling from ssh://user@dummy/doesnotexist
135 135 remote: abort: repository doesnotexist not found!
136 136 abort: no suitable response from remote hg!
137 137 [255]
138 138
139 139 local change
140 140
141 141 $ echo bleah > foo
142 142 $ hg ci -m "add"
143 143
144 144 updating rc
145 145
146 146 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
147 147 $ echo "[ui]" >> .hg/hgrc
148 $ echo "ssh = $PYTHON \"$TESTDIR/dummyssh\"" >> .hg/hgrc
148 $ echo "ssh = \"$PYTHON\" \"$TESTDIR/dummyssh\"" >> .hg/hgrc
149 149
150 150 find outgoing
151 151
152 152 $ hg out ssh://user@dummy/remote
153 153 comparing with ssh://user@dummy/remote
154 154 searching for changes
155 155 changeset: 3:a28a9d1a809c
156 156 tag: tip
157 157 parent: 0:1160648e36ce
158 158 user: test
159 159 date: Thu Jan 01 00:00:00 1970 +0000
160 160 summary: add
161 161
162 162
163 163 find incoming on the remote side
164 164
165 $ hg incoming -R ../remote -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/local
165 $ hg incoming -R ../remote -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/local
166 166 comparing with ssh://user@dummy/local
167 167 searching for changes
168 168 changeset: 3:a28a9d1a809c
169 169 tag: tip
170 170 parent: 0:1160648e36ce
171 171 user: test
172 172 date: Thu Jan 01 00:00:00 1970 +0000
173 173 summary: add
174 174
175 175
176 176 find incoming on the remote side (using absolute path)
177 177
178 $ hg incoming -R ../remote -e "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`"
178 $ hg incoming -R ../remote -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`"
179 179 comparing with ssh://user@dummy/$TESTTMP/local
180 180 searching for changes
181 181 changeset: 3:a28a9d1a809c
182 182 tag: tip
183 183 parent: 0:1160648e36ce
184 184 user: test
185 185 date: Thu Jan 01 00:00:00 1970 +0000
186 186 summary: add
187 187
188 188
189 189 push
190 190
191 191 $ hg push
192 192 pushing to ssh://user@dummy/remote
193 193 searching for changes
194 194 remote: adding changesets
195 195 remote: adding manifests
196 196 remote: adding file changes
197 197 remote: added 1 changesets with 1 changes to 1 files
198 198 $ cd ../remote
199 199
200 200 check remote tip
201 201
202 202 $ hg tip
203 203 changeset: 3:a28a9d1a809c
204 204 tag: tip
205 205 parent: 0:1160648e36ce
206 206 user: test
207 207 date: Thu Jan 01 00:00:00 1970 +0000
208 208 summary: add
209 209
210 210 $ hg verify
211 211 checking changesets
212 212 checking manifests
213 213 crosschecking files in changesets and manifests
214 214 checking files
215 215 2 files, 4 changesets, 3 total revisions
216 216 $ hg cat -r tip foo
217 217 bleah
218 218 $ echo z > z
219 219 $ hg ci -A -m z z
220 220 created new head
221 221
222 222 test pushkeys and bookmarks
223 223
224 224 $ cd ../local
225 $ hg debugpushkey --config ui.ssh="$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces
225 $ hg debugpushkey --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces
226 226 bookmarks
227 227 namespaces
228 228 phases
229 229 $ hg book foo -r 0
230 230 $ hg out -B
231 231 comparing with ssh://user@dummy/remote
232 232 searching for changed bookmarks
233 233 foo 1160648e36ce
234 234 $ hg push -B foo
235 235 pushing to ssh://user@dummy/remote
236 236 searching for changes
237 237 no changes found
238 238 exporting bookmark foo
239 239 [1]
240 $ hg debugpushkey --config ui.ssh="$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks
240 $ hg debugpushkey --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks
241 241 foo 1160648e36cec0054048a7edc4110c6f84fde594
242 242 $ hg book -f foo
243 243 $ hg push --traceback
244 244 pushing to ssh://user@dummy/remote
245 245 searching for changes
246 246 no changes found
247 247 updating bookmark foo
248 248 [1]
249 249 $ hg book -d foo
250 250 $ hg in -B
251 251 comparing with ssh://user@dummy/remote
252 252 searching for changed bookmarks
253 253 foo a28a9d1a809c
254 254 $ hg book -f -r 0 foo
255 255 $ hg pull -B foo
256 256 pulling from ssh://user@dummy/remote
257 257 no changes found
258 258 updating bookmark foo
259 259 $ hg book -d foo
260 260 $ hg push -B foo
261 261 pushing to ssh://user@dummy/remote
262 262 searching for changes
263 263 no changes found
264 264 deleting remote bookmark foo
265 265 [1]
266 266
267 267 a bad, evil hook that prints to stdout
268 268
269 269 $ cat <<EOF > $TESTTMP/badhook
270 270 > import sys
271 271 > sys.stdout.write("KABOOM\n")
272 272 > EOF
273 273
274 274 $ echo '[hooks]' >> ../remote/.hg/hgrc
275 $ echo "changegroup.stdout = $PYTHON $TESTTMP/badhook" >> ../remote/.hg/hgrc
275 $ echo "changegroup.stdout = \"$PYTHON\" $TESTTMP/badhook" >> ../remote/.hg/hgrc
276 276 $ echo r > r
277 277 $ hg ci -A -m z r
278 278
279 279 push should succeed even though it has an unexpected response
280 280
281 281 $ hg push
282 282 pushing to ssh://user@dummy/remote
283 283 searching for changes
284 284 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
285 285 remote: adding changesets
286 286 remote: adding manifests
287 287 remote: adding file changes
288 288 remote: added 1 changesets with 1 changes to 1 files
289 289 remote: KABOOM
290 290 $ hg -R ../remote heads
291 291 changeset: 5:1383141674ec
292 292 tag: tip
293 293 parent: 3:a28a9d1a809c
294 294 user: test
295 295 date: Thu Jan 01 00:00:00 1970 +0000
296 296 summary: z
297 297
298 298 changeset: 4:6c0482d977a3
299 299 parent: 0:1160648e36ce
300 300 user: test
301 301 date: Thu Jan 01 00:00:00 1970 +0000
302 302 summary: z
303 303
304 304
305 305 clone bookmarks
306 306
307 307 $ hg -R ../remote bookmark test
308 308 $ hg -R ../remote bookmarks
309 309 * test 4:6c0482d977a3
310 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks
310 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks
311 311 requesting all changes
312 312 adding changesets
313 313 adding manifests
314 314 adding file changes
315 315 added 6 changesets with 5 changes to 4 files (+1 heads)
316 316 updating to branch default
317 317 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
318 318 $ hg -R local-bookmarks bookmarks
319 319 test 4:6c0482d977a3
320 320
321 321 passwords in ssh urls are not supported
322 322 (we use a glob here because different Python versions give different
323 323 results here)
324 324
325 325 $ hg push ssh://user:erroneouspwd@dummy/remote
326 326 pushing to ssh://user:*@dummy/remote (glob)
327 327 abort: password in URL not supported!
328 328 [255]
329 329
330 330 $ cd ..
331 331
332 332 hide outer repo
333 333 $ hg init
334 334
335 335 Test remote paths with spaces (issue2983):
336 336
337 $ hg init --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
337 $ hg init --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
338 338 $ touch "$TESTTMP/a repo/test"
339 339 $ hg -R 'a repo' commit -A -m "test"
340 340 adding test
341 341 $ hg -R 'a repo' tag tag
342 $ hg id --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
342 $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
343 343 73649e48688a
344 344
345 $ hg id --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
345 $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
346 346 abort: unknown revision 'noNoNO'!
347 347 [255]
348 348
349 349 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
350 350
351 $ hg clone --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
351 $ hg clone --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
352 352 destination directory: a repo
353 353 abort: destination 'a repo' is not empty
354 354 [255]
355 355
356 356 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
357 357 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
358 358 parameters:
359 359
360 360 $ cat > ssh.sh << EOF
361 361 > userhost="\$1"
362 362 > SSH_ORIGINAL_COMMAND="\$2"
363 363 > export SSH_ORIGINAL_COMMAND
364 364 > PYTHONPATH="$PYTHONPATH"
365 365 > export PYTHONPATH
366 > $PYTHON "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
366 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
367 367 > EOF
368 368
369 369 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
370 370 73649e48688a
371 371
372 372 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
373 373 remote: Illegal repository "$TESTTMP/a'repo" (glob)
374 374 abort: no suitable response from remote hg!
375 375 [255]
376 376
377 377 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
378 378 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
379 379 abort: no suitable response from remote hg!
380 380 [255]
381 381
382 382 $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" $PYTHON "$TESTDIR/../contrib/hg-ssh"
383 383 Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation
384 384 [255]
385 385
386 386 Test hg-ssh in read-only mode:
387 387
388 388 $ cat > ssh.sh << EOF
389 389 > userhost="\$1"
390 390 > SSH_ORIGINAL_COMMAND="\$2"
391 391 > export SSH_ORIGINAL_COMMAND
392 392 > PYTHONPATH="$PYTHONPATH"
393 393 > export PYTHONPATH
394 > $PYTHON "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
394 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
395 395 > EOF
396 396
397 397 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
398 398 requesting all changes
399 399 adding changesets
400 400 adding manifests
401 401 adding file changes
402 402 added 6 changesets with 5 changes to 4 files (+1 heads)
403 403 updating to branch default
404 404 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
405 405
406 406 $ cd read-only-local
407 407 $ echo "baz" > bar
408 408 $ hg ci -A -m "unpushable commit" bar
409 409 $ hg push --ssh "sh ../ssh.sh"
410 410 pushing to ssh://user@dummy/*/remote (glob)
411 411 searching for changes
412 412 remote: Permission denied
413 413 remote: abort: pretxnopen.hg-ssh hook failed
414 414 remote: Permission denied
415 415 remote: pushkey-abort: prepushkey.hg-ssh hook failed
416 416 updating 6c0482d977a3 to public failed!
417 417 [1]
418 418
419 419 $ cd ..
420 420
421 421 stderr from remote commands should be printed before stdout from local code (issue4336)
422 422
423 423 $ hg clone remote stderr-ordering
424 424 updating to branch default
425 425 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
426 426 $ cd stderr-ordering
427 427 $ cat >> localwrite.py << EOF
428 428 > from mercurial import exchange, extensions
429 429 >
430 430 > def wrappedpush(orig, repo, *args, **kwargs):
431 431 > res = orig(repo, *args, **kwargs)
432 432 > repo.ui.write('local stdout\n')
433 433 > return res
434 434 >
435 435 > def extsetup(ui):
436 436 > extensions.wrapfunction(exchange, 'push', wrappedpush)
437 437 > EOF
438 438
439 439 $ cat >> .hg/hgrc << EOF
440 440 > [paths]
441 441 > default-push = ssh://user@dummy/remote
442 442 > [ui]
443 > ssh = $PYTHON "$TESTDIR/dummyssh"
443 > ssh = "$PYTHON" "$TESTDIR/dummyssh"
444 444 > [extensions]
445 445 > localwrite = localwrite.py
446 446 > EOF
447 447
448 448 $ echo localwrite > foo
449 449 $ hg commit -m 'testing localwrite'
450 450 $ hg push
451 451 pushing to ssh://user@dummy/remote
452 452 searching for changes
453 453 remote: adding changesets
454 454 remote: adding manifests
455 455 remote: adding file changes
456 456 remote: added 1 changesets with 1 changes to 1 files
457 457 remote: KABOOM
458 458 local stdout
459 459
460 460 debug output
461 461
462 462 $ hg pull --debug ssh://user@dummy/remote
463 463 pulling from ssh://user@dummy/remote
464 464 running .* ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
465 465 sending hello command
466 466 sending between command
467 467 remote: 355
468 468 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN
469 469 remote: 1
470 470 preparing listkeys for "bookmarks"
471 471 sending listkeys command
472 472 received listkey for "bookmarks": 45 bytes
473 473 query 1; heads
474 474 sending batch command
475 475 searching for changes
476 476 all remote heads known locally
477 477 no changes found
478 478 preparing listkeys for "phases"
479 479 sending listkeys command
480 480 received listkey for "phases": 15 bytes
481 481 checking for updated bookmarks
482 482
483 483 $ cd ..
484 484
485 485 $ cat dummylog
486 486 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
487 487 Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio
488 488 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
489 489 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio
490 490 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
491 491 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
492 492 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
493 493 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
494 494 Got arguments 1:user@dummy 2:hg -R local serve --stdio
495 495 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
496 496 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
497 497 changegroup-in-remote hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
498 498 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
499 499 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
500 500 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
501 501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
502 502 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
503 503 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
504 504 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
505 505 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
506 506 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
507 507 changegroup-in-remote hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
508 508 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
509 509 Got arguments 1:user@dummy 2:hg init 'a repo'
510 510 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
511 511 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
512 512 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
513 513 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
514 514 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
515 515 changegroup-in-remote hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
516 516 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
517 517
518 518 remote hook failure is attributed to remote
519 519
520 520 $ cat > $TESTTMP/failhook << EOF
521 521 > def hook(ui, repo, **kwargs):
522 522 > ui.write('hook failure!\n')
523 523 > ui.flush()
524 524 > return 1
525 525 > EOF
526 526
527 527 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
528 528
529 $ hg -q --config ui.ssh="$PYTHON $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout
529 $ hg -q --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout
530 530 $ cd hookout
531 531 $ touch hookfailure
532 532 $ hg -q commit -A -m 'remote hook failure'
533 $ hg --config ui.ssh="$PYTHON $TESTDIR/dummyssh" push
533 $ hg --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" push
534 534 pushing to ssh://user@dummy/remote
535 535 searching for changes
536 536 remote: adding changesets
537 537 remote: adding manifests
538 538 remote: adding file changes
539 539 remote: added 1 changesets with 1 changes to 1 files
540 540 remote: hook failure!
541 541 remote: transaction abort!
542 542 remote: rollback completed
543 543 remote: abort: pretxnchangegroup.fail hook failed
544 544 [1]
545 545
546 546 abort during pull is properly reported as such
547 547
548 548 $ echo morefoo >> ../remote/foo
549 549 $ hg -R ../remote commit --message "more foo to be pulled"
550 550 $ cat >> ../remote/.hg/hgrc << EOF
551 551 > [extensions]
552 552 > crash = ${TESTDIR}/crashgetbundler.py
553 553 > EOF
554 $ hg --config ui.ssh="$PYTHON $TESTDIR/dummyssh" pull
554 $ hg --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" pull
555 555 pulling from ssh://user@dummy/remote
556 556 searching for changes
557 557 adding changesets
558 558 remote: abort: this is an exercise
559 559 transaction abort!
560 560 rollback completed
561 561 abort: stream ended unexpectedly (got 0 bytes, expected 4)
562 562 [255]
@@ -1,195 +1,195
1 1 This test tries to exercise the ssh functionality with a dummy script
2 2
3 3 creating 'remote' repo
4 4
5 5 $ hg init remote
6 6 $ cd remote
7 7 $ hg unbundle "$TESTDIR/bundles/remote.hg"
8 8 adding changesets
9 9 adding manifests
10 10 adding file changes
11 11 added 9 changesets with 7 changes to 4 files (+1 heads)
12 12 (run 'hg heads' to see heads, 'hg merge' to merge)
13 13 $ hg up tip
14 14 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 15 $ cd ..
16 16
17 17 clone remote via stream
18 18
19 19 $ for i in 0 1 2 3 4 5 6 7 8; do
20 > hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" --uncompressed -r "$i" ssh://user@dummy/remote test-"$i"
20 > hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --uncompressed -r "$i" ssh://user@dummy/remote test-"$i"
21 21 > if cd test-"$i"; then
22 22 > hg verify
23 23 > cd ..
24 24 > fi
25 25 > done
26 26 adding changesets
27 27 adding manifests
28 28 adding file changes
29 29 added 1 changesets with 1 changes to 1 files
30 30 updating to branch default
31 31 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 32 checking changesets
33 33 checking manifests
34 34 crosschecking files in changesets and manifests
35 35 checking files
36 36 1 files, 1 changesets, 1 total revisions
37 37 adding changesets
38 38 adding manifests
39 39 adding file changes
40 40 added 2 changesets with 2 changes to 1 files
41 41 updating to branch default
42 42 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 43 checking changesets
44 44 checking manifests
45 45 crosschecking files in changesets and manifests
46 46 checking files
47 47 1 files, 2 changesets, 2 total revisions
48 48 adding changesets
49 49 adding manifests
50 50 adding file changes
51 51 added 3 changesets with 3 changes to 1 files
52 52 updating to branch default
53 53 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 54 checking changesets
55 55 checking manifests
56 56 crosschecking files in changesets and manifests
57 57 checking files
58 58 1 files, 3 changesets, 3 total revisions
59 59 adding changesets
60 60 adding manifests
61 61 adding file changes
62 62 added 4 changesets with 4 changes to 1 files
63 63 updating to branch default
64 64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 65 checking changesets
66 66 checking manifests
67 67 crosschecking files in changesets and manifests
68 68 checking files
69 69 1 files, 4 changesets, 4 total revisions
70 70 adding changesets
71 71 adding manifests
72 72 adding file changes
73 73 added 2 changesets with 2 changes to 1 files
74 74 updating to branch default
75 75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 76 checking changesets
77 77 checking manifests
78 78 crosschecking files in changesets and manifests
79 79 checking files
80 80 1 files, 2 changesets, 2 total revisions
81 81 adding changesets
82 82 adding manifests
83 83 adding file changes
84 84 added 3 changesets with 3 changes to 1 files
85 85 updating to branch default
86 86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 87 checking changesets
88 88 checking manifests
89 89 crosschecking files in changesets and manifests
90 90 checking files
91 91 1 files, 3 changesets, 3 total revisions
92 92 adding changesets
93 93 adding manifests
94 94 adding file changes
95 95 added 4 changesets with 5 changes to 2 files
96 96 updating to branch default
97 97 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 98 checking changesets
99 99 checking manifests
100 100 crosschecking files in changesets and manifests
101 101 checking files
102 102 2 files, 4 changesets, 5 total revisions
103 103 adding changesets
104 104 adding manifests
105 105 adding file changes
106 106 added 5 changesets with 6 changes to 3 files
107 107 updating to branch default
108 108 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 109 checking changesets
110 110 checking manifests
111 111 crosschecking files in changesets and manifests
112 112 checking files
113 113 3 files, 5 changesets, 6 total revisions
114 114 adding changesets
115 115 adding manifests
116 116 adding file changes
117 117 added 5 changesets with 5 changes to 2 files
118 118 updating to branch default
119 119 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
120 120 checking changesets
121 121 checking manifests
122 122 crosschecking files in changesets and manifests
123 123 checking files
124 124 2 files, 5 changesets, 5 total revisions
125 125 $ cd test-8
126 126 $ hg pull ../test-7
127 127 pulling from ../test-7
128 128 searching for changes
129 129 adding changesets
130 130 adding manifests
131 131 adding file changes
132 132 added 4 changesets with 2 changes to 3 files (+1 heads)
133 133 (run 'hg heads' to see heads, 'hg merge' to merge)
134 134 $ hg verify
135 135 checking changesets
136 136 checking manifests
137 137 crosschecking files in changesets and manifests
138 138 checking files
139 139 4 files, 9 changesets, 7 total revisions
140 140 $ cd ..
141 141 $ cd test-1
142 $ hg pull -e "$PYTHON \"$TESTDIR/dummyssh\"" -r 4 ssh://user@dummy/remote
142 $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" -r 4 ssh://user@dummy/remote
143 143 pulling from ssh://user@dummy/remote
144 144 searching for changes
145 145 adding changesets
146 146 adding manifests
147 147 adding file changes
148 148 added 1 changesets with 0 changes to 0 files (+1 heads)
149 149 (run 'hg heads' to see heads, 'hg merge' to merge)
150 150 $ hg verify
151 151 checking changesets
152 152 checking manifests
153 153 crosschecking files in changesets and manifests
154 154 checking files
155 155 1 files, 3 changesets, 2 total revisions
156 $ hg pull -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote
156 $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote
157 157 pulling from ssh://user@dummy/remote
158 158 searching for changes
159 159 adding changesets
160 160 adding manifests
161 161 adding file changes
162 162 added 6 changesets with 5 changes to 4 files
163 163 (run 'hg update' to get a working copy)
164 164 $ cd ..
165 165 $ cd test-2
166 $ hg pull -e "$PYTHON \"$TESTDIR/dummyssh\"" -r 5 ssh://user@dummy/remote
166 $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" -r 5 ssh://user@dummy/remote
167 167 pulling from ssh://user@dummy/remote
168 168 searching for changes
169 169 adding changesets
170 170 adding manifests
171 171 adding file changes
172 172 added 2 changesets with 0 changes to 0 files (+1 heads)
173 173 (run 'hg heads' to see heads, 'hg merge' to merge)
174 174 $ hg verify
175 175 checking changesets
176 176 checking manifests
177 177 crosschecking files in changesets and manifests
178 178 checking files
179 179 1 files, 5 changesets, 3 total revisions
180 $ hg pull -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote
180 $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote
181 181 pulling from ssh://user@dummy/remote
182 182 searching for changes
183 183 adding changesets
184 184 adding manifests
185 185 adding file changes
186 186 added 4 changesets with 4 changes to 4 files
187 187 (run 'hg update' to get a working copy)
188 188 $ hg verify
189 189 checking changesets
190 190 checking manifests
191 191 crosschecking files in changesets and manifests
192 192 checking files
193 193 4 files, 9 changesets, 7 total revisions
194 194
195 195 $ cd ..
@@ -1,577 +1,577
1 1
2 2 This test tries to exercise the ssh functionality with a dummy script
3 3
4 4 $ cat <<EOF >> $HGRCPATH
5 5 > [format]
6 6 > usegeneraldelta=yes
7 7 > EOF
8 8
9 9 creating 'remote' repo
10 10
11 11 $ hg init remote
12 12 $ cd remote
13 13 $ echo this > foo
14 14 $ echo this > fooO
15 15 $ hg ci -A -m "init" foo fooO
16 16
17 17 insert a closed branch (issue4428)
18 18
19 19 $ hg up null
20 20 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
21 21 $ hg branch closed
22 22 marked working directory as branch closed
23 23 (branches are permanent and global, did you want a bookmark?)
24 24 $ hg ci -mc0
25 25 $ hg ci --close-branch -mc1
26 26 $ hg up -q default
27 27
28 28 configure for serving
29 29
30 30 $ cat <<EOF > .hg/hgrc
31 31 > [server]
32 32 > uncompressed = True
33 33 >
34 34 > [hooks]
35 35 > changegroup = sh -c "printenv.py changegroup-in-remote 0 ../dummylog"
36 36 > EOF
37 37 $ cd ..
38 38
39 39 repo not found error
40 40
41 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
41 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
42 42 remote: abort: repository nonexistent not found!
43 43 abort: no suitable response from remote hg!
44 44 [255]
45 45
46 46 non-existent absolute path
47 47
48 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/nonexistent local
48 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/nonexistent local
49 49 remote: abort: repository $TESTTMP/nonexistent not found!
50 50 abort: no suitable response from remote hg!
51 51 [255]
52 52
53 53 clone remote via stream
54 54
55 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream
55 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream
56 56 streaming all changes
57 57 4 files to transfer, 602 bytes of data
58 58 transferred 602 bytes in * seconds (*) (glob)
59 59 searching for changes
60 60 no changes found
61 61 updating to branch default
62 62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 63 $ cd local-stream
64 64 $ hg verify
65 65 checking changesets
66 66 checking manifests
67 67 crosschecking files in changesets and manifests
68 68 checking files
69 69 2 files, 3 changesets, 2 total revisions
70 70 $ hg branches
71 71 default 0:1160648e36ce
72 72 $ cd ..
73 73
74 74 clone bookmarks via stream
75 75
76 76 $ hg -R local-stream book mybook
77 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2
77 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2
78 78 streaming all changes
79 79 4 files to transfer, 602 bytes of data
80 80 transferred 602 bytes in * seconds (*) (glob)
81 81 searching for changes
82 82 no changes found
83 83 updating to branch default
84 84 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 85 $ cd stream2
86 86 $ hg book
87 87 mybook 0:1160648e36ce
88 88 $ cd ..
89 89 $ rm -rf local-stream stream2
90 90
91 91 clone remote via pull
92 92
93 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local
93 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local
94 94 requesting all changes
95 95 adding changesets
96 96 adding manifests
97 97 adding file changes
98 98 added 3 changesets with 2 changes to 2 files
99 99 updating to branch default
100 100 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 101
102 102 verify
103 103
104 104 $ cd local
105 105 $ hg verify
106 106 checking changesets
107 107 checking manifests
108 108 crosschecking files in changesets and manifests
109 109 checking files
110 110 2 files, 3 changesets, 2 total revisions
111 111 $ cat >> .hg/hgrc <<EOF
112 112 > [hooks]
113 113 > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog"
114 114 > EOF
115 115
116 116 empty default pull
117 117
118 118 $ hg paths
119 119 default = ssh://user@dummy/remote
120 $ hg pull -e "$PYTHON \"$TESTDIR/dummyssh\""
120 $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\""
121 121 pulling from ssh://user@dummy/remote
122 122 searching for changes
123 123 no changes found
124 124
125 125 pull from wrong ssh URL
126 126
127 $ hg pull -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
127 $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
128 128 pulling from ssh://user@dummy/doesnotexist
129 129 remote: abort: repository doesnotexist not found!
130 130 abort: no suitable response from remote hg!
131 131 [255]
132 132
133 133 local change
134 134
135 135 $ echo bleah > foo
136 136 $ hg ci -m "add"
137 137
138 138 updating rc
139 139
140 140 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
141 141 $ echo "[ui]" >> .hg/hgrc
142 $ echo "ssh = $PYTHON \"$TESTDIR/dummyssh\"" >> .hg/hgrc
142 $ echo "ssh = \"$PYTHON\" \"$TESTDIR/dummyssh\"" >> .hg/hgrc
143 143
144 144 find outgoing
145 145
146 146 $ hg out ssh://user@dummy/remote
147 147 comparing with ssh://user@dummy/remote
148 148 searching for changes
149 149 changeset: 3:a28a9d1a809c
150 150 tag: tip
151 151 parent: 0:1160648e36ce
152 152 user: test
153 153 date: Thu Jan 01 00:00:00 1970 +0000
154 154 summary: add
155 155
156 156
157 157 find incoming on the remote side
158 158
159 $ hg incoming -R ../remote -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/local
159 $ hg incoming -R ../remote -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/local
160 160 comparing with ssh://user@dummy/local
161 161 searching for changes
162 162 changeset: 3:a28a9d1a809c
163 163 tag: tip
164 164 parent: 0:1160648e36ce
165 165 user: test
166 166 date: Thu Jan 01 00:00:00 1970 +0000
167 167 summary: add
168 168
169 169
170 170 find incoming on the remote side (using absolute path)
171 171
172 $ hg incoming -R ../remote -e "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`"
172 $ hg incoming -R ../remote -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`"
173 173 comparing with ssh://user@dummy/$TESTTMP/local
174 174 searching for changes
175 175 changeset: 3:a28a9d1a809c
176 176 tag: tip
177 177 parent: 0:1160648e36ce
178 178 user: test
179 179 date: Thu Jan 01 00:00:00 1970 +0000
180 180 summary: add
181 181
182 182
183 183 push
184 184
185 185 $ hg push
186 186 pushing to ssh://user@dummy/remote
187 187 searching for changes
188 188 remote: adding changesets
189 189 remote: adding manifests
190 190 remote: adding file changes
191 191 remote: added 1 changesets with 1 changes to 1 files
192 192 $ cd ../remote
193 193
194 194 check remote tip
195 195
196 196 $ hg tip
197 197 changeset: 3:a28a9d1a809c
198 198 tag: tip
199 199 parent: 0:1160648e36ce
200 200 user: test
201 201 date: Thu Jan 01 00:00:00 1970 +0000
202 202 summary: add
203 203
204 204 $ hg verify
205 205 checking changesets
206 206 checking manifests
207 207 crosschecking files in changesets and manifests
208 208 checking files
209 209 2 files, 4 changesets, 3 total revisions
210 210 $ hg cat -r tip foo
211 211 bleah
212 212 $ echo z > z
213 213 $ hg ci -A -m z z
214 214 created new head
215 215
216 216 test pushkeys and bookmarks
217 217
218 218 $ cd ../local
219 $ hg debugpushkey --config ui.ssh="$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces
219 $ hg debugpushkey --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces
220 220 bookmarks
221 221 namespaces
222 222 phases
223 223 $ hg book foo -r 0
224 224 $ hg out -B
225 225 comparing with ssh://user@dummy/remote
226 226 searching for changed bookmarks
227 227 foo 1160648e36ce
228 228 $ hg push -B foo
229 229 pushing to ssh://user@dummy/remote
230 230 searching for changes
231 231 no changes found
232 232 exporting bookmark foo
233 233 [1]
234 $ hg debugpushkey --config ui.ssh="$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks
234 $ hg debugpushkey --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks
235 235 foo 1160648e36cec0054048a7edc4110c6f84fde594
236 236 $ hg book -f foo
237 237 $ hg push --traceback
238 238 pushing to ssh://user@dummy/remote
239 239 searching for changes
240 240 no changes found
241 241 updating bookmark foo
242 242 [1]
243 243 $ hg book -d foo
244 244 $ hg in -B
245 245 comparing with ssh://user@dummy/remote
246 246 searching for changed bookmarks
247 247 foo a28a9d1a809c
248 248 $ hg book -f -r 0 foo
249 249 $ hg pull -B foo
250 250 pulling from ssh://user@dummy/remote
251 251 no changes found
252 252 updating bookmark foo
253 253 $ hg book -d foo
254 254 $ hg push -B foo
255 255 pushing to ssh://user@dummy/remote
256 256 searching for changes
257 257 no changes found
258 258 deleting remote bookmark foo
259 259 [1]
260 260
261 261 a bad, evil hook that prints to stdout
262 262
263 263 $ cat <<EOF > $TESTTMP/badhook
264 264 > import sys
265 265 > sys.stdout.write("KABOOM\n")
266 266 > EOF
267 267
268 268 $ cat <<EOF > $TESTTMP/badpyhook.py
269 269 > import sys
270 270 > def hook(ui, repo, hooktype, **kwargs):
271 271 > sys.stdout.write("KABOOM IN PROCESS\n")
272 272 > EOF
273 273
274 274 $ cat <<EOF >> ../remote/.hg/hgrc
275 275 > [hooks]
276 276 > changegroup.stdout = $PYTHON $TESTTMP/badhook
277 277 > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook
278 278 > EOF
279 279 $ echo r > r
280 280 $ hg ci -A -m z r
281 281
282 282 push should succeed even though it has an unexpected response
283 283
284 284 $ hg push
285 285 pushing to ssh://user@dummy/remote
286 286 searching for changes
287 287 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
288 288 remote: adding changesets
289 289 remote: adding manifests
290 290 remote: adding file changes
291 291 remote: added 1 changesets with 1 changes to 1 files
292 292 remote: KABOOM
293 293 remote: KABOOM IN PROCESS
294 294 $ hg -R ../remote heads
295 295 changeset: 5:1383141674ec
296 296 tag: tip
297 297 parent: 3:a28a9d1a809c
298 298 user: test
299 299 date: Thu Jan 01 00:00:00 1970 +0000
300 300 summary: z
301 301
302 302 changeset: 4:6c0482d977a3
303 303 parent: 0:1160648e36ce
304 304 user: test
305 305 date: Thu Jan 01 00:00:00 1970 +0000
306 306 summary: z
307 307
308 308
309 309 clone bookmarks
310 310
311 311 $ hg -R ../remote bookmark test
312 312 $ hg -R ../remote bookmarks
313 313 * test 4:6c0482d977a3
314 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks
314 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks
315 315 requesting all changes
316 316 adding changesets
317 317 adding manifests
318 318 adding file changes
319 319 added 6 changesets with 5 changes to 4 files (+1 heads)
320 320 updating to branch default
321 321 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
322 322 $ hg -R local-bookmarks bookmarks
323 323 test 4:6c0482d977a3
324 324
325 325 passwords in ssh urls are not supported
326 326 (we use a glob here because different Python versions give different
327 327 results here)
328 328
329 329 $ hg push ssh://user:erroneouspwd@dummy/remote
330 330 pushing to ssh://user:*@dummy/remote (glob)
331 331 abort: password in URL not supported!
332 332 [255]
333 333
334 334 $ cd ..
335 335
336 336 hide outer repo
337 337 $ hg init
338 338
339 339 Test remote paths with spaces (issue2983):
340 340
341 $ hg init --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
341 $ hg init --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
342 342 $ touch "$TESTTMP/a repo/test"
343 343 $ hg -R 'a repo' commit -A -m "test"
344 344 adding test
345 345 $ hg -R 'a repo' tag tag
346 $ hg id --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
346 $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
347 347 73649e48688a
348 348
349 $ hg id --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
349 $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
350 350 abort: unknown revision 'noNoNO'!
351 351 [255]
352 352
353 353 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
354 354
355 $ hg clone --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
355 $ hg clone --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
356 356 destination directory: a repo
357 357 abort: destination 'a repo' is not empty
358 358 [255]
359 359
360 360 Make sure hg is really paranoid in serve --stdio mode. It used to be
361 361 possible to get a debugger REPL by specifying a repo named --debugger.
362 362 $ hg -R --debugger serve --stdio
363 363 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio']
364 364 [255]
365 365 $ hg -R --config=ui.debugger=yes serve --stdio
366 366 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio']
367 367 [255]
368 368 Abbreviations of 'serve' also don't work, to avoid shenanigans.
369 369 $ hg -R narf serv --stdio
370 370 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
371 371 [255]
372 372
373 373 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
374 374 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
375 375 parameters:
376 376
377 377 $ cat > ssh.sh << EOF
378 378 > userhost="\$1"
379 379 > SSH_ORIGINAL_COMMAND="\$2"
380 380 > export SSH_ORIGINAL_COMMAND
381 381 > PYTHONPATH="$PYTHONPATH"
382 382 > export PYTHONPATH
383 > $PYTHON "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
383 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
384 384 > EOF
385 385
386 386 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
387 387 73649e48688a
388 388
389 389 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
390 390 remote: Illegal repository "$TESTTMP/a'repo" (glob)
391 391 abort: no suitable response from remote hg!
392 392 [255]
393 393
394 394 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
395 395 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
396 396 abort: no suitable response from remote hg!
397 397 [255]
398 398
399 399 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" $PYTHON "$TESTDIR/../contrib/hg-ssh"
400 400 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
401 401 [255]
402 402
403 403 Test hg-ssh in read-only mode:
404 404
405 405 $ cat > ssh.sh << EOF
406 406 > userhost="\$1"
407 407 > SSH_ORIGINAL_COMMAND="\$2"
408 408 > export SSH_ORIGINAL_COMMAND
409 409 > PYTHONPATH="$PYTHONPATH"
410 410 > export PYTHONPATH
411 > $PYTHON "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
411 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
412 412 > EOF
413 413
414 414 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
415 415 requesting all changes
416 416 adding changesets
417 417 adding manifests
418 418 adding file changes
419 419 added 6 changesets with 5 changes to 4 files (+1 heads)
420 420 updating to branch default
421 421 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
422 422
423 423 $ cd read-only-local
424 424 $ echo "baz" > bar
425 425 $ hg ci -A -m "unpushable commit" bar
426 426 $ hg push --ssh "sh ../ssh.sh"
427 427 pushing to ssh://user@dummy/*/remote (glob)
428 428 searching for changes
429 429 remote: Permission denied
430 430 remote: pretxnopen.hg-ssh hook failed
431 431 abort: push failed on remote
432 432 [255]
433 433
434 434 $ cd ..
435 435
436 436 stderr from remote commands should be printed before stdout from local code (issue4336)
437 437
438 438 $ hg clone remote stderr-ordering
439 439 updating to branch default
440 440 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
441 441 $ cd stderr-ordering
442 442 $ cat >> localwrite.py << EOF
443 443 > from mercurial import exchange, extensions
444 444 >
445 445 > def wrappedpush(orig, repo, *args, **kwargs):
446 446 > res = orig(repo, *args, **kwargs)
447 447 > repo.ui.write('local stdout\n')
448 448 > return res
449 449 >
450 450 > def extsetup(ui):
451 451 > extensions.wrapfunction(exchange, 'push', wrappedpush)
452 452 > EOF
453 453
454 454 $ cat >> .hg/hgrc << EOF
455 455 > [paths]
456 456 > default-push = ssh://user@dummy/remote
457 457 > [ui]
458 > ssh = $PYTHON "$TESTDIR/dummyssh"
458 > ssh = "$PYTHON" "$TESTDIR/dummyssh"
459 459 > [extensions]
460 460 > localwrite = localwrite.py
461 461 > EOF
462 462
463 463 $ echo localwrite > foo
464 464 $ hg commit -m 'testing localwrite'
465 465 $ hg push
466 466 pushing to ssh://user@dummy/remote
467 467 searching for changes
468 468 remote: adding changesets
469 469 remote: adding manifests
470 470 remote: adding file changes
471 471 remote: added 1 changesets with 1 changes to 1 files
472 472 remote: KABOOM
473 473 remote: KABOOM IN PROCESS
474 474 local stdout
475 475
476 476 debug output
477 477
478 478 $ hg pull --debug ssh://user@dummy/remote
479 479 pulling from ssh://user@dummy/remote
480 480 running .* ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
481 481 sending hello command
482 482 sending between command
483 483 remote: 355
484 484 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN
485 485 remote: 1
486 486 query 1; heads
487 487 sending batch command
488 488 searching for changes
489 489 all remote heads known locally
490 490 no changes found
491 491 sending getbundle command
492 492 bundle2-input-bundle: with-transaction
493 493 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
494 494 bundle2-input-part: total payload size 15
495 495 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
496 496 bundle2-input-part: total payload size 45
497 497 bundle2-input-bundle: 1 parts total
498 498 checking for updated bookmarks
499 499
500 500 $ cd ..
501 501
502 502 $ cat dummylog
503 503 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
504 504 Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio
505 505 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
506 506 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio
507 507 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
508 508 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
509 509 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
510 510 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
511 511 Got arguments 1:user@dummy 2:hg -R local serve --stdio
512 512 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
513 513 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
514 514 changegroup-in-remote hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
515 515 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
516 516 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
517 517 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
518 518 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
519 519 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
520 520 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
521 521 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
522 522 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
523 523 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
524 524 changegroup-in-remote hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
525 525 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
526 526 Got arguments 1:user@dummy 2:hg init 'a repo'
527 527 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
528 528 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
529 529 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
530 530 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
531 531 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
532 532 changegroup-in-remote hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
533 533 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
534 534
535 535 remote hook failure is attributed to remote
536 536
537 537 $ cat > $TESTTMP/failhook << EOF
538 538 > def hook(ui, repo, **kwargs):
539 539 > ui.write('hook failure!\n')
540 540 > ui.flush()
541 541 > return 1
542 542 > EOF
543 543
544 544 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
545 545
546 $ hg -q --config ui.ssh="$PYTHON $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout
546 $ hg -q --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout
547 547 $ cd hookout
548 548 $ touch hookfailure
549 549 $ hg -q commit -A -m 'remote hook failure'
550 $ hg --config ui.ssh="$PYTHON $TESTDIR/dummyssh" push
550 $ hg --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" push
551 551 pushing to ssh://user@dummy/remote
552 552 searching for changes
553 553 remote: adding changesets
554 554 remote: adding manifests
555 555 remote: adding file changes
556 556 remote: added 1 changesets with 1 changes to 1 files
557 557 remote: hook failure!
558 558 remote: transaction abort!
559 559 remote: rollback completed
560 560 remote: pretxnchangegroup.fail hook failed
561 561 abort: push failed on remote
562 562 [255]
563 563
564 564 abort during pull is properly reported as such
565 565
566 566 $ echo morefoo >> ../remote/foo
567 567 $ hg -R ../remote commit --message "more foo to be pulled"
568 568 $ cat >> ../remote/.hg/hgrc << EOF
569 569 > [extensions]
570 570 > crash = ${TESTDIR}/crashgetbundler.py
571 571 > EOF
572 $ hg --config ui.ssh="$PYTHON $TESTDIR/dummyssh" pull
572 $ hg --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" pull
573 573 pulling from ssh://user@dummy/remote
574 574 searching for changes
575 575 remote: abort: this is an exercise
576 576 abort: pull failed on remote
577 577 [255]
@@ -1,105 +1,105
1 1 #require killdaemons
2 2
3 3 Preparing the subrepository 'sub'
4 4
5 5 $ hg init sub
6 6 $ echo sub > sub/sub
7 7 $ hg add -R sub
8 8 adding sub/sub (glob)
9 9 $ hg commit -R sub -m "sub import"
10 10
11 11 Preparing the 'main' repo which depends on the subrepo 'sub'
12 12
13 13 $ hg init main
14 14 $ echo main > main/main
15 15 $ echo "sub = ../sub" > main/.hgsub
16 16 $ hg clone sub main/sub
17 17 updating to branch default
18 18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 19 $ hg add -R main
20 20 adding main/.hgsub (glob)
21 21 adding main/main (glob)
22 22 $ hg commit -R main -m "main import"
23 23
24 24 Cleaning both repositories, just as a clone -U
25 25
26 26 $ hg up -C -R sub null
27 27 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28 28 $ hg up -C -R main null
29 29 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
30 30 $ rm -rf main/sub
31 31
32 32 hide outer repo
33 33 $ hg init
34 34
35 35 Serving them both using hgweb
36 36
37 37 $ printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf
38 38 $ hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \
39 39 > -A /dev/null -E /dev/null --pid-file hg.pid -d
40 40 $ cat hg.pid >> $DAEMON_PIDS
41 41
42 42 Clone main from hgweb
43 43
44 44 $ hg clone "http://localhost:$HGPORT/main" cloned
45 45 requesting all changes
46 46 adding changesets
47 47 adding manifests
48 48 adding file changes
49 49 added 1 changesets with 3 changes to 3 files
50 50 updating to branch default
51 51 cloning subrepo sub from http://localhost:$HGPORT/sub
52 52 requesting all changes
53 53 adding changesets
54 54 adding manifests
55 55 adding file changes
56 56 added 1 changesets with 1 changes to 1 files
57 57 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 58
59 59 Checking cloned repo ids
60 60
61 61 $ hg id -R cloned
62 62 fdfeeb3e979e tip
63 63 $ hg id -R cloned/sub
64 64 863c1745b441 tip
65 65
66 66 subrepo debug for 'main' clone
67 67
68 68 $ hg debugsub -R cloned
69 69 path sub
70 70 source ../sub
71 71 revision 863c1745b441bd97a8c4a096e87793073f4fb215
72 72
73 73 $ killdaemons.py
74 74
75 75 subrepo paths with ssh urls
76 76
77 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/cloned sshclone
77 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/cloned sshclone
78 78 requesting all changes
79 79 adding changesets
80 80 adding manifests
81 81 adding file changes
82 82 added 1 changesets with 3 changes to 3 files
83 83 updating to branch default
84 84 cloning subrepo sub from ssh://user@dummy/sub
85 85 requesting all changes
86 86 adding changesets
87 87 adding manifests
88 88 adding file changes
89 89 added 1 changesets with 1 changes to 1 files
90 90 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 91
92 $ hg -R sshclone push -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/cloned
92 $ hg -R sshclone push -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/cloned
93 93 pushing to ssh://user@dummy/$TESTTMP/cloned
94 94 pushing subrepo sub to ssh://user@dummy/$TESTTMP/sub
95 95 searching for changes
96 96 no changes found
97 97 searching for changes
98 98 no changes found
99 99 [1]
100 100
101 101 $ cat dummylog
102 102 Got arguments 1:user@dummy 2:hg -R cloned serve --stdio
103 103 Got arguments 1:user@dummy 2:hg -R sub serve --stdio
104 104 Got arguments 1:user@dummy 2:hg -R $TESTTMP/cloned serve --stdio
105 105 Got arguments 1:user@dummy 2:hg -R $TESTTMP/sub serve --stdio
@@ -1,162 +1,162
1 1 #require killdaemons
2 2
3 3 Test wire protocol argument passing
4 4
5 5 Setup repo:
6 6
7 7 $ hg init repo
8 8
9 9 Local:
10 10
11 11 $ hg debugwireargs repo eins zwei --three drei --four vier
12 12 eins zwei drei vier None
13 13 $ hg debugwireargs repo eins zwei --four vier
14 14 eins zwei None vier None
15 15 $ hg debugwireargs repo eins zwei
16 16 eins zwei None None None
17 17 $ hg debugwireargs repo eins zwei --five fuenf
18 18 eins zwei None None fuenf
19 19
20 20 HTTP:
21 21
22 22 $ hg serve -R repo -p $HGPORT -d --pid-file=hg1.pid \
23 23 > -E error.log -A access.log \
24 24 > --config experimental.httppostargs=yes
25 25 $ cat hg1.pid >> $DAEMON_PIDS
26 26
27 27 $ hg debugwireargs http://localhost:$HGPORT/ un deux trois quatre
28 28 un deux trois quatre None
29 29 $ hg debugwireargs http://localhost:$HGPORT/ \ un deux trois\ qu\ \ atre
30 30 un deux trois qu atre None
31 31 $ hg debugwireargs http://localhost:$HGPORT/ eins zwei --four vier
32 32 eins zwei None vier None
33 33 $ hg debugwireargs http://localhost:$HGPORT/ eins zwei
34 34 eins zwei None None None
35 35 $ hg debugwireargs http://localhost:$HGPORT/ eins zwei --five fuenf
36 36 eins zwei None None None
37 37 $ hg debugwireargs http://localhost:$HGPORT/ un deux trois onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
38 38 un deux trois onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx None
39 39 $ cat error.log
40 40 $ cat access.log
41 41 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
42 42 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:39* (glob)
43 43 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:39* (glob)
44 44 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
45 45 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:43* (glob)
46 46 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:43* (glob)
47 47 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
48 48 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:27* (glob)
49 49 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:27* (glob)
50 50 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
51 51 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob)
52 52 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob)
53 53 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
54 54 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob)
55 55 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob)
56 56 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
57 57 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:1033* (glob)
58 58 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:1033* (glob)
59 59
60 60 HTTP without args-in-POST:
61 61 $ hg serve -R repo -p $HGPORT1 -d --pid-file=hg1.pid -E error.log -A access.log
62 62 $ cat hg1.pid >> $DAEMON_PIDS
63 63
64 64 $ hg debugwireargs http://localhost:$HGPORT1/ un deux trois quatre
65 65 un deux trois quatre None
66 66 $ hg debugwireargs http://localhost:$HGPORT1/ \ un deux trois\ qu\ \ atre
67 67 un deux trois qu atre None
68 68 $ hg debugwireargs http://localhost:$HGPORT1/ eins zwei --four vier
69 69 eins zwei None vier None
70 70 $ hg debugwireargs http://localhost:$HGPORT1/ eins zwei
71 71 eins zwei None None None
72 72 $ hg debugwireargs http://localhost:$HGPORT1/ eins zwei --five fuenf
73 73 eins zwei None None None
74 74 $ hg debugwireargs http://localhost:$HGPORT1/ un deux trois onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
75 75 un deux trois onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx None
76 76 $ cat error.log
77 77 $ cat access.log
78 78 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
79 79 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:39* (glob)
80 80 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:39* (glob)
81 81 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
82 82 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:43* (glob)
83 83 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:43* (glob)
84 84 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
85 85 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:27* (glob)
86 86 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:27* (glob)
87 87 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
88 88 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob)
89 89 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob)
90 90 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
91 91 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob)
92 92 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob)
93 93 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
94 94 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:1033* (glob)
95 95 * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:1033* (glob)
96 96 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
97 97 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=quatre&one=un&three=trois&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
98 98 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=quatre&one=un&three=trois&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
99 99 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
100 100 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=qu++atre&one=+un&three=trois+&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
101 101 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=qu++atre&one=+un&three=trois+&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
102 102 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
103 103 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=vier&one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
104 104 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=vier&one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
105 105 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
106 106 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
107 107 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
108 108 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
109 109 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
110 110 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
111 111 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
112 112 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&one x-hgarg-2:=un&three=trois&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
113 113 * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&one x-hgarg-2:=un&three=trois&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
114 114
115 115 HTTP without the httpheader capability:
116 116
117 117 $ HGRCPATH="`pwd`/repo/.hgrc"
118 118 $ export HGRCPATH
119 119 $ CAP=httpheader
120 120 $ . "$TESTDIR/notcapable"
121 121
122 122 $ hg serve -R repo -p $HGPORT2 -d --pid-file=hg2.pid -E error2.log -A access2.log
123 123 $ cat hg2.pid >> $DAEMON_PIDS
124 124
125 125 $ hg debugwireargs http://localhost:$HGPORT2/ un deux trois quatre
126 126 un deux trois quatre None
127 127 $ hg debugwireargs http://localhost:$HGPORT2/ eins zwei --four vier
128 128 eins zwei None vier None
129 129 $ hg debugwireargs http://localhost:$HGPORT2/ eins zwei
130 130 eins zwei None None None
131 131 $ hg debugwireargs http://localhost:$HGPORT2/ eins zwei --five fuenf
132 132 eins zwei None None None
133 133 $ cat error2.log
134 134 $ cat access2.log
135 135 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
136 136 * - - [*] "GET /?cmd=debugwireargs&four=quatre&one=un&three=trois&two=deux HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
137 137 * - - [*] "GET /?cmd=debugwireargs&four=quatre&one=un&three=trois&two=deux HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
138 138 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
139 139 * - - [*] "GET /?cmd=debugwireargs&four=vier&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
140 140 * - - [*] "GET /?cmd=debugwireargs&four=vier&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
141 141 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
142 142 * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
143 143 * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
144 144 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
145 145 * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
146 146 * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
147 147
148 148 SSH (try to exercise the ssh functionality with a dummy script):
149 149
150 $ hg debugwireargs --ssh "$PYTHON $TESTDIR/dummyssh" ssh://user@dummy/repo uno due tre quattro
150 $ hg debugwireargs --ssh "\"$PYTHON\" $TESTDIR/dummyssh" ssh://user@dummy/repo uno due tre quattro
151 151 uno due tre quattro None
152 $ hg debugwireargs --ssh "$PYTHON $TESTDIR/dummyssh" ssh://user@dummy/repo eins zwei --four vier
152 $ hg debugwireargs --ssh "\"$PYTHON\" $TESTDIR/dummyssh" ssh://user@dummy/repo eins zwei --four vier
153 153 eins zwei None vier None
154 $ hg debugwireargs --ssh "$PYTHON $TESTDIR/dummyssh" ssh://user@dummy/repo eins zwei
154 $ hg debugwireargs --ssh "\"$PYTHON\" $TESTDIR/dummyssh" ssh://user@dummy/repo eins zwei
155 155 eins zwei None None None
156 $ hg debugwireargs --ssh "$PYTHON $TESTDIR/dummyssh" ssh://user@dummy/repo eins zwei --five fuenf
156 $ hg debugwireargs --ssh "\"$PYTHON\" $TESTDIR/dummyssh" ssh://user@dummy/repo eins zwei --five fuenf
157 157 eins zwei None None None
158 158
159 159 Explicitly kill daemons to let the test exit on Windows
160 160
161 161 $ killdaemons.py
162 162
General Comments 0
You need to be logged in to leave comments. Login now