Show More
@@ -1,525 +1,525 | |||
|
1 | 1 | # discovery.py - protocol changeset discovery functions |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2010 Matt Mackall <mpm@selenic.com> |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | 8 | from __future__ import absolute_import |
|
9 | 9 | |
|
10 | 10 | import functools |
|
11 | 11 | |
|
12 | 12 | from .i18n import _ |
|
13 | 13 | from .node import ( |
|
14 | 14 | hex, |
|
15 | 15 | nullid, |
|
16 | 16 | short, |
|
17 | 17 | ) |
|
18 | 18 | |
|
19 | 19 | from . import ( |
|
20 | 20 | bookmarks, |
|
21 | 21 | branchmap, |
|
22 | 22 | error, |
|
23 | 23 | phases, |
|
24 | 24 | scmutil, |
|
25 | 25 | setdiscovery, |
|
26 | 26 | treediscovery, |
|
27 | 27 | util, |
|
28 | 28 | ) |
|
29 | 29 | |
|
30 | 30 | def findcommonincoming(repo, remote, heads=None, force=False, ancestorsof=None): |
|
31 | 31 | """Return a tuple (common, anyincoming, heads) used to identify the common |
|
32 | 32 | subset of nodes between repo and remote. |
|
33 | 33 | |
|
34 | 34 | "common" is a list of (at least) the heads of the common subset. |
|
35 | 35 | "anyincoming" is testable as a boolean indicating if any nodes are missing |
|
36 | 36 | locally. If remote does not support getbundle, this actually is a list of |
|
37 | 37 | roots of the nodes that would be incoming, to be supplied to |
|
38 | 38 | changegroupsubset. No code except for pull should be relying on this fact |
|
39 | 39 | any longer. |
|
40 | 40 | "heads" is either the supplied heads, or else the remote's heads. |
|
41 | 41 | "ancestorsof" if not None, restrict the discovery to a subset defined by |
|
42 | 42 | these nodes. Changeset outside of this set won't be considered (and |
|
43 | 43 | won't appears in "common") |
|
44 | 44 | |
|
45 | 45 | If you pass heads and they are all known locally, the response lists just |
|
46 | 46 | these heads in "common" and in "heads". |
|
47 | 47 | |
|
48 | 48 | Please use findcommonoutgoing to compute the set of outgoing nodes to give |
|
49 | 49 | extensions a good hook into outgoing. |
|
50 | 50 | """ |
|
51 | 51 | |
|
52 | 52 | if not remote.capable('getbundle'): |
|
53 | 53 | return treediscovery.findcommonincoming(repo, remote, heads, force) |
|
54 | 54 | |
|
55 | 55 | if heads: |
|
56 | 56 | knownnode = repo.changelog.hasnode # no nodemap until it is filtered |
|
57 | 57 | if all(knownnode(h) for h in heads): |
|
58 | 58 | return (heads, False, heads) |
|
59 | 59 | |
|
60 | 60 | res = setdiscovery.findcommonheads(repo.ui, repo, remote, |
|
61 | 61 | abortwhenunrelated=not force, |
|
62 | 62 | ancestorsof=ancestorsof) |
|
63 | 63 | common, anyinc, srvheads = res |
|
64 | 64 | return (list(common), anyinc, heads or list(srvheads)) |
|
65 | 65 | |
|
66 | 66 | class outgoing(object): |
|
67 | 67 | '''Represents the set of nodes present in a local repo but not in a |
|
68 | 68 | (possibly) remote one. |
|
69 | 69 | |
|
70 | 70 | Members: |
|
71 | 71 | |
|
72 | 72 | missing is a list of all nodes present in local but not in remote. |
|
73 | 73 | common is a list of all nodes shared between the two repos. |
|
74 | 74 | excluded is the list of missing changeset that shouldn't be sent remotely. |
|
75 | 75 | missingheads is the list of heads of missing. |
|
76 | 76 | commonheads is the list of heads of common. |
|
77 | 77 | |
|
78 | 78 | The sets are computed on demand from the heads, unless provided upfront |
|
79 | 79 | by discovery.''' |
|
80 | 80 | |
|
81 | 81 | def __init__(self, repo, commonheads=None, missingheads=None, |
|
82 | 82 | missingroots=None): |
|
83 | 83 | # at least one of them must not be set |
|
84 | 84 | assert None in (commonheads, missingroots) |
|
85 | 85 | cl = repo.changelog |
|
86 | 86 | if missingheads is None: |
|
87 | 87 | missingheads = cl.heads() |
|
88 | 88 | if missingroots: |
|
89 | 89 | discbases = [] |
|
90 | 90 | for n in missingroots: |
|
91 | 91 | discbases.extend([p for p in cl.parents(n) if p != nullid]) |
|
92 | 92 | # TODO remove call to nodesbetween. |
|
93 | 93 | # TODO populate attributes on outgoing instance instead of setting |
|
94 | 94 | # discbases. |
|
95 | 95 | csets, roots, heads = cl.nodesbetween(missingroots, missingheads) |
|
96 | 96 | included = set(csets) |
|
97 | 97 | missingheads = heads |
|
98 | 98 | commonheads = [n for n in discbases if n not in included] |
|
99 | 99 | elif not commonheads: |
|
100 | 100 | commonheads = [nullid] |
|
101 | 101 | self.commonheads = commonheads |
|
102 | 102 | self.missingheads = missingheads |
|
103 | 103 | self._revlog = cl |
|
104 | 104 | self._common = None |
|
105 | 105 | self._missing = None |
|
106 | 106 | self.excluded = [] |
|
107 | 107 | |
|
108 | 108 | def _computecommonmissing(self): |
|
109 | 109 | sets = self._revlog.findcommonmissing(self.commonheads, |
|
110 | 110 | self.missingheads) |
|
111 | 111 | self._common, self._missing = sets |
|
112 | 112 | |
|
113 | 113 | @util.propertycache |
|
114 | 114 | def common(self): |
|
115 | 115 | if self._common is None: |
|
116 | 116 | self._computecommonmissing() |
|
117 | 117 | return self._common |
|
118 | 118 | |
|
119 | 119 | @util.propertycache |
|
120 | 120 | def missing(self): |
|
121 | 121 | if self._missing is None: |
|
122 | 122 | self._computecommonmissing() |
|
123 | 123 | return self._missing |
|
124 | 124 | |
|
125 | 125 | def findcommonoutgoing(repo, other, onlyheads=None, force=False, |
|
126 | 126 | commoninc=None, portable=False): |
|
127 | 127 | '''Return an outgoing instance to identify the nodes present in repo but |
|
128 | 128 | not in other. |
|
129 | 129 | |
|
130 | 130 | If onlyheads is given, only nodes ancestral to nodes in onlyheads |
|
131 | 131 | (inclusive) are included. If you already know the local repo's heads, |
|
132 | 132 | passing them in onlyheads is faster than letting them be recomputed here. |
|
133 | 133 | |
|
134 | 134 | If commoninc is given, it must be the result of a prior call to |
|
135 | 135 | findcommonincoming(repo, other, force) to avoid recomputing it here. |
|
136 | 136 | |
|
137 | 137 | If portable is given, compute more conservative common and missingheads, |
|
138 | 138 | to make bundles created from the instance more portable.''' |
|
139 | 139 | # declare an empty outgoing object to be filled later |
|
140 | 140 | og = outgoing(repo, None, None) |
|
141 | 141 | |
|
142 | 142 | # get common set if not provided |
|
143 | 143 | if commoninc is None: |
|
144 | 144 | commoninc = findcommonincoming(repo, other, force=force, |
|
145 | 145 | ancestorsof=onlyheads) |
|
146 | 146 | og.commonheads, _any, _hds = commoninc |
|
147 | 147 | |
|
148 | 148 | # compute outgoing |
|
149 | 149 | mayexclude = (repo._phasecache.phaseroots[phases.secret] or repo.obsstore) |
|
150 | 150 | if not mayexclude: |
|
151 | 151 | og.missingheads = onlyheads or repo.heads() |
|
152 | 152 | elif onlyheads is None: |
|
153 | 153 | # use visible heads as it should be cached |
|
154 | 154 | og.missingheads = repo.filtered("served").heads() |
|
155 | 155 | og.excluded = [ctx.node() for ctx in repo.set('secret() or extinct()')] |
|
156 | 156 | else: |
|
157 | 157 | # compute common, missing and exclude secret stuff |
|
158 | 158 | sets = repo.changelog.findcommonmissing(og.commonheads, onlyheads) |
|
159 | 159 | og._common, allmissing = sets |
|
160 | 160 | og._missing = missing = [] |
|
161 | 161 | og.excluded = excluded = [] |
|
162 | 162 | for node in allmissing: |
|
163 | 163 | ctx = repo[node] |
|
164 | 164 | if ctx.phase() >= phases.secret or ctx.extinct(): |
|
165 | 165 | excluded.append(node) |
|
166 | 166 | else: |
|
167 | 167 | missing.append(node) |
|
168 | 168 | if len(missing) == len(allmissing): |
|
169 | 169 | missingheads = onlyheads |
|
170 | 170 | else: # update missing heads |
|
171 | 171 | missingheads = phases.newheads(repo, onlyheads, excluded) |
|
172 | 172 | og.missingheads = missingheads |
|
173 | 173 | if portable: |
|
174 | 174 | # recompute common and missingheads as if -r<rev> had been given for |
|
175 | 175 | # each head of missing, and --base <rev> for each head of the proper |
|
176 | 176 | # ancestors of missing |
|
177 | 177 | og._computecommonmissing() |
|
178 | 178 | cl = repo.changelog |
|
179 | 179 | missingrevs = set(cl.rev(n) for n in og._missing) |
|
180 | 180 | og._common = set(cl.ancestors(missingrevs)) - missingrevs |
|
181 | 181 | commonheads = set(og.commonheads) |
|
182 | 182 | og.missingheads = [h for h in og.missingheads if h not in commonheads] |
|
183 | 183 | |
|
184 | 184 | return og |
|
185 | 185 | |
|
186 | 186 | def _headssummary(pushop): |
|
187 | 187 | """compute a summary of branch and heads status before and after push |
|
188 | 188 | |
|
189 | 189 | return {'branch': ([remoteheads], [newheads], |
|
190 | 190 | [unsyncedheads], [discardedheads])} mapping |
|
191 | 191 | |
|
192 | 192 | - branch: the branch name, |
|
193 | 193 | - remoteheads: the list of remote heads known locally |
|
194 | 194 | None if the branch is new, |
|
195 | 195 | - newheads: the new remote heads (known locally) with outgoing pushed, |
|
196 | 196 | - unsyncedheads: the list of remote heads unknown locally, |
|
197 | 197 | - discardedheads: the list of heads made obsolete by the push. |
|
198 | 198 | """ |
|
199 | 199 | repo = pushop.repo.unfiltered() |
|
200 | 200 | remote = pushop.remote |
|
201 | 201 | outgoing = pushop.outgoing |
|
202 | 202 | cl = repo.changelog |
|
203 | 203 | headssum = {} |
|
204 | 204 | # A. Create set of branches involved in the push. |
|
205 | 205 | branches = set(repo[n].branch() for n in outgoing.missing) |
|
206 | 206 | remotemap = remote.branchmap() |
|
207 | 207 | newbranches = branches - set(remotemap) |
|
208 | 208 | branches.difference_update(newbranches) |
|
209 | 209 | |
|
210 | 210 | # A. register remote heads |
|
211 | 211 | remotebranches = set() |
|
212 |
for branch, heads in remote |
|
|
212 | for branch, heads in remotemap.iteritems(): | |
|
213 | 213 | remotebranches.add(branch) |
|
214 | 214 | known = [] |
|
215 | 215 | unsynced = [] |
|
216 | 216 | knownnode = cl.hasnode # do not use nodemap until it is filtered |
|
217 | 217 | for h in heads: |
|
218 | 218 | if knownnode(h): |
|
219 | 219 | known.append(h) |
|
220 | 220 | else: |
|
221 | 221 | unsynced.append(h) |
|
222 | 222 | headssum[branch] = (known, list(known), unsynced) |
|
223 | 223 | # B. add new branch data |
|
224 | 224 | missingctx = list(repo[n] for n in outgoing.missing) |
|
225 | 225 | touchedbranches = set() |
|
226 | 226 | for ctx in missingctx: |
|
227 | 227 | branch = ctx.branch() |
|
228 | 228 | touchedbranches.add(branch) |
|
229 | 229 | if branch not in headssum: |
|
230 | 230 | headssum[branch] = (None, [], []) |
|
231 | 231 | |
|
232 | 232 | # C drop data about untouched branches: |
|
233 | 233 | for branch in remotebranches - touchedbranches: |
|
234 | 234 | del headssum[branch] |
|
235 | 235 | |
|
236 | 236 | # D. Update newmap with outgoing changes. |
|
237 | 237 | # This will possibly add new heads and remove existing ones. |
|
238 | 238 | newmap = branchmap.branchcache((branch, heads[1]) |
|
239 | 239 | for branch, heads in headssum.iteritems() |
|
240 | 240 | if heads[0] is not None) |
|
241 | 241 | newmap.update(repo, (ctx.rev() for ctx in missingctx)) |
|
242 | 242 | for branch, newheads in newmap.iteritems(): |
|
243 | 243 | headssum[branch][1][:] = newheads |
|
244 | 244 | for branch, items in headssum.iteritems(): |
|
245 | 245 | for l in items: |
|
246 | 246 | if l is not None: |
|
247 | 247 | l.sort() |
|
248 | 248 | headssum[branch] = items + ([],) |
|
249 | 249 | |
|
250 | 250 | # If there are no obsstore, no post processing are needed. |
|
251 | 251 | if repo.obsstore: |
|
252 | 252 | torev = repo.changelog.rev |
|
253 | 253 | futureheads = set(torev(h) for h in outgoing.missingheads) |
|
254 | 254 | futureheads |= set(torev(h) for h in outgoing.commonheads) |
|
255 | 255 | allfuturecommon = repo.changelog.ancestors(futureheads, inclusive=True) |
|
256 | 256 | for branch, heads in sorted(headssum.iteritems()): |
|
257 | 257 | remoteheads, newheads, unsyncedheads, placeholder = heads |
|
258 | 258 | result = _postprocessobsolete(pushop, allfuturecommon, newheads) |
|
259 | 259 | headssum[branch] = (remoteheads, sorted(result[0]), unsyncedheads, |
|
260 | 260 | sorted(result[1])) |
|
261 | 261 | return headssum |
|
262 | 262 | |
|
263 | 263 | def _oldheadssummary(repo, remoteheads, outgoing, inc=False): |
|
264 | 264 | """Compute branchmapsummary for repo without branchmap support""" |
|
265 | 265 | |
|
266 | 266 | # 1-4b. old servers: Check for new topological heads. |
|
267 | 267 | # Construct {old,new}map with branch = None (topological branch). |
|
268 | 268 | # (code based on update) |
|
269 | 269 | knownnode = repo.changelog.hasnode # no nodemap until it is filtered |
|
270 | 270 | oldheads = sorted(h for h in remoteheads if knownnode(h)) |
|
271 | 271 | # all nodes in outgoing.missing are children of either: |
|
272 | 272 | # - an element of oldheads |
|
273 | 273 | # - another element of outgoing.missing |
|
274 | 274 | # - nullrev |
|
275 | 275 | # This explains why the new head are very simple to compute. |
|
276 | 276 | r = repo.set('heads(%ln + %ln)', oldheads, outgoing.missing) |
|
277 | 277 | newheads = sorted(c.node() for c in r) |
|
278 | 278 | # set some unsynced head to issue the "unsynced changes" warning |
|
279 | 279 | if inc: |
|
280 | 280 | unsynced = [None] |
|
281 | 281 | else: |
|
282 | 282 | unsynced = [] |
|
283 | 283 | return {None: (oldheads, newheads, unsynced, [])} |
|
284 | 284 | |
|
285 | 285 | def _nowarnheads(pushop): |
|
286 | 286 | # Compute newly pushed bookmarks. We don't warn about bookmarked heads. |
|
287 | 287 | repo = pushop.repo.unfiltered() |
|
288 | 288 | remote = pushop.remote |
|
289 | 289 | localbookmarks = repo._bookmarks |
|
290 | 290 | remotebookmarks = remote.listkeys('bookmarks') |
|
291 | 291 | bookmarkedheads = set() |
|
292 | 292 | |
|
293 | 293 | # internal config: bookmarks.pushing |
|
294 | 294 | newbookmarks = [localbookmarks.expandname(b) |
|
295 | 295 | for b in pushop.ui.configlist('bookmarks', 'pushing')] |
|
296 | 296 | |
|
297 | 297 | for bm in localbookmarks: |
|
298 | 298 | rnode = remotebookmarks.get(bm) |
|
299 | 299 | if rnode and rnode in repo: |
|
300 | 300 | lctx, rctx = localbookmarks.changectx(bm), repo[rnode] |
|
301 | 301 | if bookmarks.validdest(repo, rctx, lctx): |
|
302 | 302 | bookmarkedheads.add(lctx.node()) |
|
303 | 303 | else: |
|
304 | 304 | if bm in newbookmarks and bm not in remotebookmarks: |
|
305 | 305 | bookmarkedheads.add(localbookmarks[bm]) |
|
306 | 306 | |
|
307 | 307 | return bookmarkedheads |
|
308 | 308 | |
|
309 | 309 | def checkheads(pushop): |
|
310 | 310 | """Check that a push won't add any outgoing head |
|
311 | 311 | |
|
312 | 312 | raise Abort error and display ui message as needed. |
|
313 | 313 | """ |
|
314 | 314 | |
|
315 | 315 | repo = pushop.repo.unfiltered() |
|
316 | 316 | remote = pushop.remote |
|
317 | 317 | outgoing = pushop.outgoing |
|
318 | 318 | remoteheads = pushop.remoteheads |
|
319 | 319 | newbranch = pushop.newbranch |
|
320 | 320 | inc = bool(pushop.incoming) |
|
321 | 321 | |
|
322 | 322 | # Check for each named branch if we're creating new remote heads. |
|
323 | 323 | # To be a remote head after push, node must be either: |
|
324 | 324 | # - unknown locally |
|
325 | 325 | # - a local outgoing head descended from update |
|
326 | 326 | # - a remote head that's known locally and not |
|
327 | 327 | # ancestral to an outgoing head |
|
328 | 328 | if remoteheads == [nullid]: |
|
329 | 329 | # remote is empty, nothing to check. |
|
330 | 330 | return |
|
331 | 331 | |
|
332 | 332 | if remote.capable('branchmap'): |
|
333 | 333 | headssum = _headssummary(pushop) |
|
334 | 334 | else: |
|
335 | 335 | headssum = _oldheadssummary(repo, remoteheads, outgoing, inc) |
|
336 | 336 | pushop.pushbranchmap = headssum |
|
337 | 337 | newbranches = [branch for branch, heads in headssum.iteritems() |
|
338 | 338 | if heads[0] is None] |
|
339 | 339 | # 1. Check for new branches on the remote. |
|
340 | 340 | if newbranches and not newbranch: # new branch requires --new-branch |
|
341 | 341 | branchnames = ', '.join(sorted(newbranches)) |
|
342 | 342 | raise error.Abort(_("push creates new remote branches: %s!") |
|
343 | 343 | % branchnames, |
|
344 | 344 | hint=_("use 'hg push --new-branch' to create" |
|
345 | 345 | " new remote branches")) |
|
346 | 346 | |
|
347 | 347 | # 2. Find heads that we need not warn about |
|
348 | 348 | nowarnheads = _nowarnheads(pushop) |
|
349 | 349 | |
|
350 | 350 | # 3. Check for new heads. |
|
351 | 351 | # If there are more heads after the push than before, a suitable |
|
352 | 352 | # error message, depending on unsynced status, is displayed. |
|
353 | 353 | errormsg = None |
|
354 | 354 | for branch, heads in sorted(headssum.iteritems()): |
|
355 | 355 | remoteheads, newheads, unsyncedheads, discardedheads = heads |
|
356 | 356 | # add unsynced data |
|
357 | 357 | if remoteheads is None: |
|
358 | 358 | oldhs = set() |
|
359 | 359 | else: |
|
360 | 360 | oldhs = set(remoteheads) |
|
361 | 361 | oldhs.update(unsyncedheads) |
|
362 | 362 | dhs = None # delta heads, the new heads on branch |
|
363 | 363 | newhs = set(newheads) |
|
364 | 364 | newhs.update(unsyncedheads) |
|
365 | 365 | if unsyncedheads: |
|
366 | 366 | if None in unsyncedheads: |
|
367 | 367 | # old remote, no heads data |
|
368 | 368 | heads = None |
|
369 | 369 | else: |
|
370 | 370 | heads = scmutil.nodesummaries(repo, unsyncedheads) |
|
371 | 371 | if heads is None: |
|
372 | 372 | repo.ui.status(_("remote has heads that are " |
|
373 | 373 | "not known locally\n")) |
|
374 | 374 | elif branch is None: |
|
375 | 375 | repo.ui.status(_("remote has heads that are " |
|
376 | 376 | "not known locally: %s\n") % heads) |
|
377 | 377 | else: |
|
378 | 378 | repo.ui.status(_("remote has heads on branch '%s' that are " |
|
379 | 379 | "not known locally: %s\n") % (branch, heads)) |
|
380 | 380 | if remoteheads is None: |
|
381 | 381 | if len(newhs) > 1: |
|
382 | 382 | dhs = list(newhs) |
|
383 | 383 | if errormsg is None: |
|
384 | 384 | errormsg = (_("push creates new branch '%s' " |
|
385 | 385 | "with multiple heads") % (branch)) |
|
386 | 386 | hint = _("merge or" |
|
387 | 387 | " see 'hg help push' for details about" |
|
388 | 388 | " pushing new heads") |
|
389 | 389 | elif len(newhs) > len(oldhs): |
|
390 | 390 | # remove bookmarked or existing remote heads from the new heads list |
|
391 | 391 | dhs = sorted(newhs - nowarnheads - oldhs) |
|
392 | 392 | if dhs: |
|
393 | 393 | if errormsg is None: |
|
394 | 394 | if branch not in ('default', None): |
|
395 | 395 | errormsg = _("push creates new remote head %s " |
|
396 | 396 | "on branch '%s'!") % (short(dhs[0]), branch) |
|
397 | 397 | elif repo[dhs[0]].bookmarks(): |
|
398 | 398 | errormsg = _("push creates new remote head %s " |
|
399 | 399 | "with bookmark '%s'!") % ( |
|
400 | 400 | short(dhs[0]), repo[dhs[0]].bookmarks()[0]) |
|
401 | 401 | else: |
|
402 | 402 | errormsg = _("push creates new remote head %s!" |
|
403 | 403 | ) % short(dhs[0]) |
|
404 | 404 | if unsyncedheads: |
|
405 | 405 | hint = _("pull and merge or" |
|
406 | 406 | " see 'hg help push' for details about" |
|
407 | 407 | " pushing new heads") |
|
408 | 408 | else: |
|
409 | 409 | hint = _("merge or" |
|
410 | 410 | " see 'hg help push' for details about" |
|
411 | 411 | " pushing new heads") |
|
412 | 412 | if branch is None: |
|
413 | 413 | repo.ui.note(_("new remote heads:\n")) |
|
414 | 414 | else: |
|
415 | 415 | repo.ui.note(_("new remote heads on branch '%s':\n") % branch) |
|
416 | 416 | for h in dhs: |
|
417 | 417 | repo.ui.note((" %s\n") % short(h)) |
|
418 | 418 | if errormsg: |
|
419 | 419 | raise error.Abort(errormsg, hint=hint) |
|
420 | 420 | |
|
421 | 421 | def _postprocessobsolete(pushop, futurecommon, candidate_newhs): |
|
422 | 422 | """post process the list of new heads with obsolescence information |
|
423 | 423 | |
|
424 | 424 | Exists as a sub-function to contain the complexity and allow extensions to |
|
425 | 425 | experiment with smarter logic. |
|
426 | 426 | |
|
427 | 427 | Returns (newheads, discarded_heads) tuple |
|
428 | 428 | """ |
|
429 | 429 | # known issue |
|
430 | 430 | # |
|
431 | 431 | # * We "silently" skip processing on all changeset unknown locally |
|
432 | 432 | # |
|
433 | 433 | # * if <nh> is public on the remote, it won't be affected by obsolete |
|
434 | 434 | # marker and a new is created |
|
435 | 435 | |
|
436 | 436 | # define various utilities and containers |
|
437 | 437 | repo = pushop.repo |
|
438 | 438 | unfi = repo.unfiltered() |
|
439 | 439 | tonode = unfi.changelog.node |
|
440 | 440 | torev = unfi.changelog.nodemap.get |
|
441 | 441 | public = phases.public |
|
442 | 442 | getphase = unfi._phasecache.phase |
|
443 | 443 | ispublic = (lambda r: getphase(unfi, r) == public) |
|
444 | 444 | ispushed = (lambda n: torev(n) in futurecommon) |
|
445 | 445 | hasoutmarker = functools.partial(pushingmarkerfor, unfi.obsstore, ispushed) |
|
446 | 446 | successorsmarkers = unfi.obsstore.successors |
|
447 | 447 | newhs = set() # final set of new heads |
|
448 | 448 | discarded = set() # new head of fully replaced branch |
|
449 | 449 | |
|
450 | 450 | localcandidate = set() # candidate heads known locally |
|
451 | 451 | unknownheads = set() # candidate heads unknown locally |
|
452 | 452 | for h in candidate_newhs: |
|
453 | 453 | if h in unfi: |
|
454 | 454 | localcandidate.add(h) |
|
455 | 455 | else: |
|
456 | 456 | if successorsmarkers.get(h) is not None: |
|
457 | 457 | msg = ('checkheads: remote head unknown locally has' |
|
458 | 458 | ' local marker: %s\n') |
|
459 | 459 | repo.ui.debug(msg % hex(h)) |
|
460 | 460 | unknownheads.add(h) |
|
461 | 461 | |
|
462 | 462 | # fast path the simple case |
|
463 | 463 | if len(localcandidate) == 1: |
|
464 | 464 | return unknownheads | set(candidate_newhs), set() |
|
465 | 465 | |
|
466 | 466 | # actually process branch replacement |
|
467 | 467 | while localcandidate: |
|
468 | 468 | nh = localcandidate.pop() |
|
469 | 469 | # run this check early to skip the evaluation of the whole branch |
|
470 | 470 | if (torev(nh) in futurecommon or ispublic(torev(nh))): |
|
471 | 471 | newhs.add(nh) |
|
472 | 472 | continue |
|
473 | 473 | |
|
474 | 474 | # Get all revs/nodes on the branch exclusive to this head |
|
475 | 475 | # (already filtered heads are "ignored")) |
|
476 | 476 | branchrevs = unfi.revs('only(%n, (%ln+%ln))', |
|
477 | 477 | nh, localcandidate, newhs) |
|
478 | 478 | branchnodes = [tonode(r) for r in branchrevs] |
|
479 | 479 | |
|
480 | 480 | # The branch won't be hidden on the remote if |
|
481 | 481 | # * any part of it is public, |
|
482 | 482 | # * any part of it is considered part of the result by previous logic, |
|
483 | 483 | # * if we have no markers to push to obsolete it. |
|
484 | 484 | if (any(ispublic(r) for r in branchrevs) |
|
485 | 485 | or any(torev(n) in futurecommon for n in branchnodes) |
|
486 | 486 | or any(not hasoutmarker(n) for n in branchnodes)): |
|
487 | 487 | newhs.add(nh) |
|
488 | 488 | else: |
|
489 | 489 | # note: there is a corner case if there is a merge in the branch. |
|
490 | 490 | # we might end up with -more- heads. However, these heads are not |
|
491 | 491 | # "added" by the push, but more by the "removal" on the remote so I |
|
492 | 492 | # think is a okay to ignore them, |
|
493 | 493 | discarded.add(nh) |
|
494 | 494 | newhs |= unknownheads |
|
495 | 495 | return newhs, discarded |
|
496 | 496 | |
|
497 | 497 | def pushingmarkerfor(obsstore, ispushed, node): |
|
498 | 498 | """true if some markers are to be pushed for node |
|
499 | 499 | |
|
500 | 500 | We cannot just look in to the pushed obsmarkers from the pushop because |
|
501 | 501 | discovery might have filtered relevant markers. In addition listing all |
|
502 | 502 | markers relevant to all changesets in the pushed set would be too expensive |
|
503 | 503 | (O(len(repo))) |
|
504 | 504 | |
|
505 | 505 | (note: There are cache opportunity in this function. but it would requires |
|
506 | 506 | a two dimensional stack.) |
|
507 | 507 | """ |
|
508 | 508 | successorsmarkers = obsstore.successors |
|
509 | 509 | stack = [node] |
|
510 | 510 | seen = set(stack) |
|
511 | 511 | while stack: |
|
512 | 512 | current = stack.pop() |
|
513 | 513 | if ispushed(current): |
|
514 | 514 | return True |
|
515 | 515 | markers = successorsmarkers.get(current, ()) |
|
516 | 516 | # markers fields = ('prec', 'succs', 'flag', 'meta', 'date', 'parents') |
|
517 | 517 | for m in markers: |
|
518 | 518 | nexts = m[1] # successors |
|
519 | 519 | if not nexts: # this is a prune marker |
|
520 | 520 | nexts = m[5] or () # parents |
|
521 | 521 | for n in nexts: |
|
522 | 522 | if n not in seen: |
|
523 | 523 | seen.add(n) |
|
524 | 524 | stack.append(n) |
|
525 | 525 | return False |
@@ -1,413 +1,412 | |||
|
1 | 1 | #require serve |
|
2 | 2 | |
|
3 | 3 | This test is a duplicate of 'test-http.t', feel free to factor out |
|
4 | 4 | parts that are not bundle1/bundle2 specific. |
|
5 | 5 | |
|
6 | 6 | $ cat << EOF >> $HGRCPATH |
|
7 | 7 | > [devel] |
|
8 | 8 | > # This test is dedicated to interaction through old bundle |
|
9 | 9 | > legacy.exchange = bundle1 |
|
10 | 10 | > EOF |
|
11 | 11 | |
|
12 | 12 | $ hg init test |
|
13 | 13 | $ cd test |
|
14 | 14 | $ echo foo>foo |
|
15 | 15 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
16 | 16 | $ echo foo>foo.d/foo |
|
17 | 17 | $ echo bar>foo.d/bAr.hg.d/BaR |
|
18 | 18 | $ echo bar>foo.d/baR.d.hg/bAR |
|
19 | 19 | $ hg commit -A -m 1 |
|
20 | 20 | adding foo |
|
21 | 21 | adding foo.d/bAr.hg.d/BaR |
|
22 | 22 | adding foo.d/baR.d.hg/bAR |
|
23 | 23 | adding foo.d/foo |
|
24 | 24 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log |
|
25 | 25 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid |
|
26 | 26 | |
|
27 | 27 | Test server address cannot be reused |
|
28 | 28 | |
|
29 | 29 | $ hg serve -p $HGPORT1 2>&1 |
|
30 | 30 | abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$ |
|
31 | 31 | [255] |
|
32 | 32 | |
|
33 | 33 | $ cd .. |
|
34 | 34 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
35 | 35 | |
|
36 | 36 | clone via stream |
|
37 | 37 | |
|
38 | 38 | #if no-reposimplestore |
|
39 | 39 | $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1 |
|
40 | 40 | streaming all changes |
|
41 | 41 | 6 files to transfer, 606 bytes of data |
|
42 | 42 | transferred * bytes in * seconds (*/sec) (glob) |
|
43 | 43 | searching for changes |
|
44 | 44 | no changes found |
|
45 | 45 | updating to branch default |
|
46 | 46 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
47 | 47 | $ hg verify -R copy |
|
48 | 48 | checking changesets |
|
49 | 49 | checking manifests |
|
50 | 50 | crosschecking files in changesets and manifests |
|
51 | 51 | checking files |
|
52 | 52 | 4 files, 1 changesets, 4 total revisions |
|
53 | 53 | #endif |
|
54 | 54 | |
|
55 | 55 | try to clone via stream, should use pull instead |
|
56 | 56 | |
|
57 | 57 | $ hg clone --stream http://localhost:$HGPORT1/ copy2 |
|
58 | 58 | warning: stream clone requested but server has them disabled |
|
59 | 59 | requesting all changes |
|
60 | 60 | adding changesets |
|
61 | 61 | adding manifests |
|
62 | 62 | adding file changes |
|
63 | 63 | added 1 changesets with 4 changes to 4 files |
|
64 | 64 | new changesets 8b6053c928fe |
|
65 | 65 | updating to branch default |
|
66 | 66 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
67 | 67 | |
|
68 | 68 | try to clone via stream but missing requirements, so should use pull instead |
|
69 | 69 | |
|
70 | 70 | $ cat > $TESTTMP/removesupportedformat.py << EOF |
|
71 | 71 | > from mercurial import localrepo |
|
72 | 72 | > def extsetup(ui): |
|
73 | 73 | > localrepo.localrepository.supportedformats.remove(b'generaldelta') |
|
74 | 74 | > EOF |
|
75 | 75 | |
|
76 | 76 | $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3 |
|
77 | 77 | warning: stream clone requested but client is missing requirements: generaldelta |
|
78 | 78 | (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information) |
|
79 | 79 | requesting all changes |
|
80 | 80 | adding changesets |
|
81 | 81 | adding manifests |
|
82 | 82 | adding file changes |
|
83 | 83 | added 1 changesets with 4 changes to 4 files |
|
84 | 84 | new changesets 8b6053c928fe |
|
85 | 85 | updating to branch default |
|
86 | 86 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
87 | 87 | |
|
88 | 88 | clone via pull |
|
89 | 89 | |
|
90 | 90 | $ hg clone http://localhost:$HGPORT1/ copy-pull |
|
91 | 91 | requesting all changes |
|
92 | 92 | adding changesets |
|
93 | 93 | adding manifests |
|
94 | 94 | adding file changes |
|
95 | 95 | added 1 changesets with 4 changes to 4 files |
|
96 | 96 | new changesets 8b6053c928fe |
|
97 | 97 | updating to branch default |
|
98 | 98 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
99 | 99 | $ hg verify -R copy-pull |
|
100 | 100 | checking changesets |
|
101 | 101 | checking manifests |
|
102 | 102 | crosschecking files in changesets and manifests |
|
103 | 103 | checking files |
|
104 | 104 | 4 files, 1 changesets, 4 total revisions |
|
105 | 105 | $ cd test |
|
106 | 106 | $ echo bar > bar |
|
107 | 107 | $ hg commit -A -d '1 0' -m 2 |
|
108 | 108 | adding bar |
|
109 | 109 | $ cd .. |
|
110 | 110 | |
|
111 | 111 | clone over http with --update |
|
112 | 112 | |
|
113 | 113 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 |
|
114 | 114 | requesting all changes |
|
115 | 115 | adding changesets |
|
116 | 116 | adding manifests |
|
117 | 117 | adding file changes |
|
118 | 118 | added 2 changesets with 5 changes to 5 files |
|
119 | 119 | new changesets 8b6053c928fe:5fed3813f7f5 |
|
120 | 120 | updating to branch default |
|
121 | 121 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
122 | 122 | $ hg log -r . -R updated |
|
123 | 123 | changeset: 0:8b6053c928fe |
|
124 | 124 | user: test |
|
125 | 125 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
126 | 126 | summary: 1 |
|
127 | 127 | |
|
128 | 128 | $ rm -rf updated |
|
129 | 129 | |
|
130 | 130 | incoming via HTTP |
|
131 | 131 | |
|
132 | 132 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
|
133 | 133 | adding changesets |
|
134 | 134 | adding manifests |
|
135 | 135 | adding file changes |
|
136 | 136 | added 1 changesets with 4 changes to 4 files |
|
137 | 137 | new changesets 8b6053c928fe |
|
138 | 138 | updating to branch default |
|
139 | 139 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
140 | 140 | $ cd partial |
|
141 | 141 | $ touch LOCAL |
|
142 | 142 | $ hg ci -qAm LOCAL |
|
143 | 143 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' |
|
144 | 144 | comparing with http://localhost:$HGPORT1/ |
|
145 | 145 | searching for changes |
|
146 | 146 | 2 |
|
147 | 147 | $ cd .. |
|
148 | 148 | |
|
149 | 149 | pull |
|
150 | 150 | |
|
151 | 151 | $ cd copy-pull |
|
152 | 152 | $ cat >> .hg/hgrc <<EOF |
|
153 | 153 | > [hooks] |
|
154 | 154 | > changegroup = sh -c "printenv.py changegroup" |
|
155 | 155 | > EOF |
|
156 | 156 | $ hg pull |
|
157 | 157 | pulling from http://localhost:$HGPORT1/ |
|
158 | 158 | searching for changes |
|
159 | 159 | adding changesets |
|
160 | 160 | adding manifests |
|
161 | 161 | adding file changes |
|
162 | 162 | added 1 changesets with 1 changes to 1 files |
|
163 | 163 | new changesets 5fed3813f7f5 |
|
164 | 164 | changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/ |
|
165 | 165 | (run 'hg update' to get a working copy) |
|
166 | 166 | $ cd .. |
|
167 | 167 | |
|
168 | 168 | clone from invalid URL |
|
169 | 169 | |
|
170 | 170 | $ hg clone http://localhost:$HGPORT/bad |
|
171 | 171 | abort: HTTP Error 404: Not Found |
|
172 | 172 | [255] |
|
173 | 173 | |
|
174 | 174 | test http authentication |
|
175 | 175 | + use the same server to test server side streaming preference |
|
176 | 176 | |
|
177 | 177 | $ cd test |
|
178 | 178 | $ cat << EOT > userpass.py |
|
179 | 179 | > import base64 |
|
180 | 180 | > from mercurial.hgweb import common |
|
181 | 181 | > def perform_authentication(hgweb, req, op): |
|
182 | 182 | > auth = req.headers.get('Authorization') |
|
183 | 183 | > if not auth: |
|
184 | 184 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
185 | 185 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
186 | 186 | > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', |
|
187 | 187 | > b'pass']: |
|
188 | 188 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
189 | 189 | > def extsetup(): |
|
190 | 190 | > common.permhooks.insert(0, perform_authentication) |
|
191 | 191 | > EOT |
|
192 | 192 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ |
|
193 | 193 | > --config server.preferuncompressed=True \ |
|
194 | 194 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log |
|
195 | 195 | $ cat pid >> $DAEMON_PIDS |
|
196 | 196 | |
|
197 | 197 | $ cat << EOF > get_pass.py |
|
198 | 198 | > import getpass |
|
199 | 199 | > def newgetpass(arg): |
|
200 | 200 | > return "pass" |
|
201 | 201 | > getpass.getpass = newgetpass |
|
202 | 202 | > EOF |
|
203 | 203 | |
|
204 | 204 | $ hg id http://localhost:$HGPORT2/ |
|
205 | 205 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
206 | 206 | [255] |
|
207 | 207 | $ hg id http://localhost:$HGPORT2/ |
|
208 | 208 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
209 | 209 | [255] |
|
210 | 210 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ |
|
211 | 211 | http authorization required for http://localhost:$HGPORT2/ |
|
212 | 212 | realm: mercurial |
|
213 | 213 | user: user |
|
214 | 214 | password: 5fed3813f7f5 |
|
215 | 215 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
216 | 216 | 5fed3813f7f5 |
|
217 | 217 | $ echo '[auth]' >> .hg/hgrc |
|
218 | 218 | $ echo 'l.schemes=http' >> .hg/hgrc |
|
219 | 219 | $ echo 'l.prefix=lo' >> .hg/hgrc |
|
220 | 220 | $ echo 'l.username=user' >> .hg/hgrc |
|
221 | 221 | $ echo 'l.password=pass' >> .hg/hgrc |
|
222 | 222 | $ hg id http://localhost:$HGPORT2/ |
|
223 | 223 | 5fed3813f7f5 |
|
224 | 224 | $ hg id http://localhost:$HGPORT2/ |
|
225 | 225 | 5fed3813f7f5 |
|
226 | 226 | $ hg id http://user@localhost:$HGPORT2/ |
|
227 | 227 | 5fed3813f7f5 |
|
228 | 228 | |
|
229 | 229 | #if no-reposimplestore |
|
230 | 230 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 |
|
231 | 231 | streaming all changes |
|
232 | 232 | 7 files to transfer, 916 bytes of data |
|
233 | 233 | transferred * bytes in * seconds (*/sec) (glob) |
|
234 | 234 | searching for changes |
|
235 | 235 | no changes found |
|
236 | 236 | updating to branch default |
|
237 | 237 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
238 | 238 | #endif |
|
239 | 239 | |
|
240 | 240 | --pull should override server's preferuncompressed |
|
241 | 241 | |
|
242 | 242 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 |
|
243 | 243 | requesting all changes |
|
244 | 244 | adding changesets |
|
245 | 245 | adding manifests |
|
246 | 246 | adding file changes |
|
247 | 247 | added 2 changesets with 5 changes to 5 files |
|
248 | 248 | new changesets 8b6053c928fe:5fed3813f7f5 |
|
249 | 249 | updating to branch default |
|
250 | 250 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
251 | 251 | |
|
252 | 252 | $ hg id http://user2@localhost:$HGPORT2/ |
|
253 | 253 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
254 | 254 | [255] |
|
255 | 255 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
256 | 256 | abort: HTTP Error 403: no |
|
257 | 257 | [255] |
|
258 | 258 | |
|
259 | 259 | $ hg -R dest-pull tag -r tip top |
|
260 | 260 | $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ |
|
261 | 261 | pushing to http://user:***@localhost:$HGPORT2/ |
|
262 | 262 | searching for changes |
|
263 | 263 | remote: adding changesets |
|
264 | 264 | remote: adding manifests |
|
265 | 265 | remote: adding file changes |
|
266 | 266 | remote: added 1 changesets with 1 changes to 1 files |
|
267 | 267 | $ hg rollback -q |
|
268 | 268 | |
|
269 | 269 | $ sed 's/.*] "/"/' < ../access.log |
|
270 | 270 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
271 | 271 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
272 | 272 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
273 | 273 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
274 | 274 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
275 | 275 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
276 | 276 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
277 | 277 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
278 | 278 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
279 | 279 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
280 | 280 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
281 | 281 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
282 | 282 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
283 | 283 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
284 | 284 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
285 | 285 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
286 | 286 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
287 | 287 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
288 | 288 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
289 | 289 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
290 | 290 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
291 | 291 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
292 | 292 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
293 | 293 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
294 | 294 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
295 | 295 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
296 | 296 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
297 | 297 | "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !) |
|
298 | 298 | "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !) |
|
299 | 299 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
300 | 300 | "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
301 | 301 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
302 | 302 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
303 | 303 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
304 | 304 | "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !) |
|
305 | 305 | "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !) |
|
306 | 306 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
307 | 307 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
308 | 308 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
309 | 309 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
310 | 310 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
311 | 311 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
312 | 312 | "GET /?cmd=capabilities HTTP/1.1" 403 - |
|
313 | 313 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
314 | 314 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
315 | 315 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
316 | 316 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
317 | 317 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
318 | 318 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
319 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
|
320 | 319 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
321 | 320 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob) |
|
322 | 321 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
323 | 322 | |
|
324 | 323 | $ cd .. |
|
325 | 324 | |
|
326 | 325 | clone of serve with repo in root and unserved subrepo (issue2970) |
|
327 | 326 | |
|
328 | 327 | $ hg --cwd test init sub |
|
329 | 328 | $ echo empty > test/sub/empty |
|
330 | 329 | $ hg --cwd test/sub add empty |
|
331 | 330 | $ hg --cwd test/sub commit -qm 'add empty' |
|
332 | 331 | $ hg --cwd test/sub tag -r 0 something |
|
333 | 332 | $ echo sub = sub > test/.hgsub |
|
334 | 333 | $ hg --cwd test add .hgsub |
|
335 | 334 | $ hg --cwd test commit -qm 'add subrepo' |
|
336 | 335 | $ hg clone http://localhost:$HGPORT noslash-clone |
|
337 | 336 | requesting all changes |
|
338 | 337 | adding changesets |
|
339 | 338 | adding manifests |
|
340 | 339 | adding file changes |
|
341 | 340 | added 3 changesets with 7 changes to 7 files |
|
342 | 341 | new changesets 8b6053c928fe:56f9bc90cce6 |
|
343 | 342 | updating to branch default |
|
344 | 343 | abort: HTTP Error 404: Not Found |
|
345 | 344 | [255] |
|
346 | 345 | $ hg clone http://localhost:$HGPORT/ slash-clone |
|
347 | 346 | requesting all changes |
|
348 | 347 | adding changesets |
|
349 | 348 | adding manifests |
|
350 | 349 | adding file changes |
|
351 | 350 | added 3 changesets with 7 changes to 7 files |
|
352 | 351 | new changesets 8b6053c928fe:56f9bc90cce6 |
|
353 | 352 | updating to branch default |
|
354 | 353 | abort: HTTP Error 404: Not Found |
|
355 | 354 | [255] |
|
356 | 355 | |
|
357 | 356 | check error log |
|
358 | 357 | |
|
359 | 358 | $ cat error.log |
|
360 | 359 | |
|
361 | 360 | Check error reporting while pulling/cloning |
|
362 | 361 | |
|
363 | 362 | $ $RUNTESTDIR/killdaemons.py |
|
364 | 363 | $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py |
|
365 | 364 | $ cat hg3.pid >> $DAEMON_PIDS |
|
366 | 365 | $ hg clone http://localhost:$HGPORT/ abort-clone |
|
367 | 366 | requesting all changes |
|
368 | 367 | abort: remote error: |
|
369 | 368 | this is an exercise |
|
370 | 369 | [255] |
|
371 | 370 | $ cat error.log |
|
372 | 371 | |
|
373 | 372 | disable pull-based clones |
|
374 | 373 | |
|
375 | 374 | $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True |
|
376 | 375 | $ cat hg4.pid >> $DAEMON_PIDS |
|
377 | 376 | $ hg clone http://localhost:$HGPORT1/ disable-pull-clone |
|
378 | 377 | requesting all changes |
|
379 | 378 | abort: remote error: |
|
380 | 379 | server has pull-based clones disabled |
|
381 | 380 | [255] |
|
382 | 381 | |
|
383 | 382 | #if no-reposimplestore |
|
384 | 383 | ... but keep stream clones working |
|
385 | 384 | |
|
386 | 385 | $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone |
|
387 | 386 | streaming all changes |
|
388 | 387 | * files to transfer, * of data (glob) |
|
389 | 388 | transferred * in * seconds (* KB/sec) (glob) |
|
390 | 389 | searching for changes |
|
391 | 390 | no changes found |
|
392 | 391 | #endif |
|
393 | 392 | |
|
394 | 393 | ... and also keep partial clones and pulls working |
|
395 | 394 | $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone |
|
396 | 395 | adding changesets |
|
397 | 396 | adding manifests |
|
398 | 397 | adding file changes |
|
399 | 398 | added 1 changesets with 4 changes to 4 files |
|
400 | 399 | new changesets 8b6053c928fe |
|
401 | 400 | updating to branch default |
|
402 | 401 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
403 | 402 | $ hg pull -R test-partial-clone |
|
404 | 403 | pulling from http://localhost:$HGPORT1/ |
|
405 | 404 | searching for changes |
|
406 | 405 | adding changesets |
|
407 | 406 | adding manifests |
|
408 | 407 | adding file changes |
|
409 | 408 | added 2 changesets with 3 changes to 3 files |
|
410 | 409 | new changesets 5fed3813f7f5:56f9bc90cce6 |
|
411 | 410 | (run 'hg update' to get a working copy) |
|
412 | 411 | |
|
413 | 412 | $ cat error.log |
@@ -1,563 +1,556 | |||
|
1 | 1 | #require killdaemons serve |
|
2 | 2 | |
|
3 | 3 | $ hg init test |
|
4 | 4 | $ cd test |
|
5 | 5 | $ echo foo>foo |
|
6 | 6 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
7 | 7 | $ echo foo>foo.d/foo |
|
8 | 8 | $ echo bar>foo.d/bAr.hg.d/BaR |
|
9 | 9 | $ echo bar>foo.d/baR.d.hg/bAR |
|
10 | 10 | $ hg commit -A -m 1 |
|
11 | 11 | adding foo |
|
12 | 12 | adding foo.d/bAr.hg.d/BaR |
|
13 | 13 | adding foo.d/baR.d.hg/bAR |
|
14 | 14 | adding foo.d/foo |
|
15 | 15 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log |
|
16 | 16 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid |
|
17 | 17 | |
|
18 | 18 | Test server address cannot be reused |
|
19 | 19 | |
|
20 | 20 | $ hg serve -p $HGPORT1 2>&1 |
|
21 | 21 | abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$ |
|
22 | 22 | [255] |
|
23 | 23 | |
|
24 | 24 | $ cd .. |
|
25 | 25 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
26 | 26 | |
|
27 | 27 | clone via stream |
|
28 | 28 | |
|
29 | 29 | #if no-reposimplestore |
|
30 | 30 | $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1 |
|
31 | 31 | streaming all changes |
|
32 | 32 | 6 files to transfer, 606 bytes of data |
|
33 | 33 | transferred * bytes in * seconds (*/sec) (glob) |
|
34 | 34 | searching for changes |
|
35 | 35 | no changes found |
|
36 | 36 | updating to branch default |
|
37 | 37 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
38 | 38 | $ hg verify -R copy |
|
39 | 39 | checking changesets |
|
40 | 40 | checking manifests |
|
41 | 41 | crosschecking files in changesets and manifests |
|
42 | 42 | checking files |
|
43 | 43 | 4 files, 1 changesets, 4 total revisions |
|
44 | 44 | #endif |
|
45 | 45 | |
|
46 | 46 | try to clone via stream, should use pull instead |
|
47 | 47 | |
|
48 | 48 | $ hg clone --stream http://localhost:$HGPORT1/ copy2 |
|
49 | 49 | warning: stream clone requested but server has them disabled |
|
50 | 50 | requesting all changes |
|
51 | 51 | adding changesets |
|
52 | 52 | adding manifests |
|
53 | 53 | adding file changes |
|
54 | 54 | added 1 changesets with 4 changes to 4 files |
|
55 | 55 | new changesets 8b6053c928fe |
|
56 | 56 | updating to branch default |
|
57 | 57 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
58 | 58 | |
|
59 | 59 | try to clone via stream but missing requirements, so should use pull instead |
|
60 | 60 | |
|
61 | 61 | $ cat > $TESTTMP/removesupportedformat.py << EOF |
|
62 | 62 | > from mercurial import localrepo |
|
63 | 63 | > def extsetup(ui): |
|
64 | 64 | > localrepo.localrepository.supportedformats.remove('generaldelta') |
|
65 | 65 | > EOF |
|
66 | 66 | |
|
67 | 67 | $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3 |
|
68 | 68 | warning: stream clone requested but client is missing requirements: generaldelta |
|
69 | 69 | (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information) |
|
70 | 70 | requesting all changes |
|
71 | 71 | adding changesets |
|
72 | 72 | adding manifests |
|
73 | 73 | adding file changes |
|
74 | 74 | added 1 changesets with 4 changes to 4 files |
|
75 | 75 | new changesets 8b6053c928fe |
|
76 | 76 | updating to branch default |
|
77 | 77 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
78 | 78 | |
|
79 | 79 | clone via pull |
|
80 | 80 | |
|
81 | 81 | $ hg clone http://localhost:$HGPORT1/ copy-pull |
|
82 | 82 | requesting all changes |
|
83 | 83 | adding changesets |
|
84 | 84 | adding manifests |
|
85 | 85 | adding file changes |
|
86 | 86 | added 1 changesets with 4 changes to 4 files |
|
87 | 87 | new changesets 8b6053c928fe |
|
88 | 88 | updating to branch default |
|
89 | 89 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
90 | 90 | $ hg verify -R copy-pull |
|
91 | 91 | checking changesets |
|
92 | 92 | checking manifests |
|
93 | 93 | crosschecking files in changesets and manifests |
|
94 | 94 | checking files |
|
95 | 95 | 4 files, 1 changesets, 4 total revisions |
|
96 | 96 | $ cd test |
|
97 | 97 | $ echo bar > bar |
|
98 | 98 | $ hg commit -A -d '1 0' -m 2 |
|
99 | 99 | adding bar |
|
100 | 100 | $ cd .. |
|
101 | 101 | |
|
102 | 102 | clone over http with --update |
|
103 | 103 | |
|
104 | 104 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 |
|
105 | 105 | requesting all changes |
|
106 | 106 | adding changesets |
|
107 | 107 | adding manifests |
|
108 | 108 | adding file changes |
|
109 | 109 | added 2 changesets with 5 changes to 5 files |
|
110 | 110 | new changesets 8b6053c928fe:5fed3813f7f5 |
|
111 | 111 | updating to branch default |
|
112 | 112 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
113 | 113 | $ hg log -r . -R updated |
|
114 | 114 | changeset: 0:8b6053c928fe |
|
115 | 115 | user: test |
|
116 | 116 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
117 | 117 | summary: 1 |
|
118 | 118 | |
|
119 | 119 | $ rm -rf updated |
|
120 | 120 | |
|
121 | 121 | incoming via HTTP |
|
122 | 122 | |
|
123 | 123 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
|
124 | 124 | adding changesets |
|
125 | 125 | adding manifests |
|
126 | 126 | adding file changes |
|
127 | 127 | added 1 changesets with 4 changes to 4 files |
|
128 | 128 | new changesets 8b6053c928fe |
|
129 | 129 | updating to branch default |
|
130 | 130 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
131 | 131 | $ cd partial |
|
132 | 132 | $ touch LOCAL |
|
133 | 133 | $ hg ci -qAm LOCAL |
|
134 | 134 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' |
|
135 | 135 | comparing with http://localhost:$HGPORT1/ |
|
136 | 136 | searching for changes |
|
137 | 137 | 2 |
|
138 | 138 | $ cd .. |
|
139 | 139 | |
|
140 | 140 | pull |
|
141 | 141 | |
|
142 | 142 | $ cd copy-pull |
|
143 | 143 | $ cat >> .hg/hgrc <<EOF |
|
144 | 144 | > [hooks] |
|
145 | 145 | > changegroup = sh -c "printenv.py changegroup" |
|
146 | 146 | > EOF |
|
147 | 147 | $ hg pull |
|
148 | 148 | pulling from http://localhost:$HGPORT1/ |
|
149 | 149 | searching for changes |
|
150 | 150 | adding changesets |
|
151 | 151 | adding manifests |
|
152 | 152 | adding file changes |
|
153 | 153 | added 1 changesets with 1 changes to 1 files |
|
154 | 154 | new changesets 5fed3813f7f5 |
|
155 | 155 | changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/ |
|
156 | 156 | (run 'hg update' to get a working copy) |
|
157 | 157 | $ cd .. |
|
158 | 158 | |
|
159 | 159 | clone from invalid URL |
|
160 | 160 | |
|
161 | 161 | $ hg clone http://localhost:$HGPORT/bad |
|
162 | 162 | abort: HTTP Error 404: Not Found |
|
163 | 163 | [255] |
|
164 | 164 | |
|
165 | 165 | test http authentication |
|
166 | 166 | + use the same server to test server side streaming preference |
|
167 | 167 | |
|
168 | 168 | $ cd test |
|
169 | 169 | $ cat << EOT > userpass.py |
|
170 | 170 | > import base64 |
|
171 | 171 | > from mercurial.hgweb import common |
|
172 | 172 | > def perform_authentication(hgweb, req, op): |
|
173 | 173 | > auth = req.headers.get('Authorization') |
|
174 | 174 | > if not auth: |
|
175 | 175 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
176 | 176 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
177 | 177 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
|
178 | 178 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
179 | 179 | > def extsetup(): |
|
180 | 180 | > common.permhooks.insert(0, perform_authentication) |
|
181 | 181 | > EOT |
|
182 | 182 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ |
|
183 | 183 | > --config server.preferuncompressed=True \ |
|
184 | 184 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log |
|
185 | 185 | $ cat pid >> $DAEMON_PIDS |
|
186 | 186 | |
|
187 | 187 | $ cat << EOF > get_pass.py |
|
188 | 188 | > import getpass |
|
189 | 189 | > def newgetpass(arg): |
|
190 | 190 | > return "pass" |
|
191 | 191 | > getpass.getpass = newgetpass |
|
192 | 192 | > EOF |
|
193 | 193 | |
|
194 | 194 | $ hg id http://localhost:$HGPORT2/ |
|
195 | 195 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
196 | 196 | [255] |
|
197 | 197 | $ hg id http://localhost:$HGPORT2/ |
|
198 | 198 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
199 | 199 | [255] |
|
200 | 200 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ |
|
201 | 201 | http authorization required for http://localhost:$HGPORT2/ |
|
202 | 202 | realm: mercurial |
|
203 | 203 | user: user |
|
204 | 204 | password: 5fed3813f7f5 |
|
205 | 205 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
206 | 206 | 5fed3813f7f5 |
|
207 | 207 | $ echo '[auth]' >> .hg/hgrc |
|
208 | 208 | $ echo 'l.schemes=http' >> .hg/hgrc |
|
209 | 209 | $ echo 'l.prefix=lo' >> .hg/hgrc |
|
210 | 210 | $ echo 'l.username=user' >> .hg/hgrc |
|
211 | 211 | $ echo 'l.password=pass' >> .hg/hgrc |
|
212 | 212 | $ hg id http://localhost:$HGPORT2/ |
|
213 | 213 | 5fed3813f7f5 |
|
214 | 214 | $ hg id http://localhost:$HGPORT2/ |
|
215 | 215 | 5fed3813f7f5 |
|
216 | 216 | $ hg id http://user@localhost:$HGPORT2/ |
|
217 | 217 | 5fed3813f7f5 |
|
218 | 218 | |
|
219 | 219 | #if no-reposimplestore |
|
220 | 220 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 |
|
221 | 221 | streaming all changes |
|
222 | 222 | 7 files to transfer, 916 bytes of data |
|
223 | 223 | transferred * bytes in * seconds (*/sec) (glob) |
|
224 | 224 | searching for changes |
|
225 | 225 | no changes found |
|
226 | 226 | updating to branch default |
|
227 | 227 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
228 | 228 | #endif |
|
229 | 229 | |
|
230 | 230 | --pull should override server's preferuncompressed |
|
231 | 231 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 |
|
232 | 232 | requesting all changes |
|
233 | 233 | adding changesets |
|
234 | 234 | adding manifests |
|
235 | 235 | adding file changes |
|
236 | 236 | added 2 changesets with 5 changes to 5 files |
|
237 | 237 | new changesets 8b6053c928fe:5fed3813f7f5 |
|
238 | 238 | updating to branch default |
|
239 | 239 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
240 | 240 | |
|
241 | 241 | $ hg id http://user2@localhost:$HGPORT2/ |
|
242 | 242 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
243 | 243 | [255] |
|
244 | 244 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
245 | 245 | abort: HTTP Error 403: no |
|
246 | 246 | [255] |
|
247 | 247 | |
|
248 | 248 | $ hg -R dest-pull tag -r tip top |
|
249 | 249 | $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ |
|
250 | 250 | pushing to http://user:***@localhost:$HGPORT2/ |
|
251 | 251 | searching for changes |
|
252 | 252 | remote: adding changesets |
|
253 | 253 | remote: adding manifests |
|
254 | 254 | remote: adding file changes |
|
255 | 255 | remote: added 1 changesets with 1 changes to 1 files |
|
256 | 256 | $ hg rollback -q |
|
257 | 257 | $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes |
|
258 | 258 | pushing to http://user:***@localhost:$HGPORT2/ |
|
259 | 259 | using http://localhost:$HGPORT2/ |
|
260 | 260 | http auth: user user, password **** |
|
261 | 261 | sending capabilities command |
|
262 | 262 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities |
|
263 | 263 | http auth: user user, password **** |
|
264 | 264 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
265 | 265 | query 1; heads |
|
266 | 266 | devel-peer-request: batched-content |
|
267 | 267 | devel-peer-request: - heads (0 arguments) |
|
268 | 268 | devel-peer-request: - known (1 arguments) |
|
269 | 269 | sending batch command |
|
270 | 270 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch |
|
271 | 271 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
272 | 272 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
273 | 273 | devel-peer-request: 68 bytes of commands arguments in headers |
|
274 | 274 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
275 | 275 | searching for changes |
|
276 | 276 | all remote heads known locally |
|
277 | 277 | preparing listkeys for "phases" |
|
278 | 278 | sending listkeys command |
|
279 | 279 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys |
|
280 | 280 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
281 | 281 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
282 | 282 | devel-peer-request: 16 bytes of commands arguments in headers |
|
283 | 283 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
284 | 284 | received listkey for "phases": 58 bytes |
|
285 | 285 | checking for updated bookmarks |
|
286 | 286 | preparing listkeys for "bookmarks" |
|
287 | 287 | sending listkeys command |
|
288 | 288 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys |
|
289 | 289 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
290 | 290 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
291 | 291 | devel-peer-request: 19 bytes of commands arguments in headers |
|
292 | 292 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
293 | 293 | received listkey for "bookmarks": 0 bytes |
|
294 | 294 | sending branchmap command |
|
295 | 295 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap |
|
296 | 296 | devel-peer-request: Vary X-HgProto-1 |
|
297 | 297 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
298 | 298 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
299 | sending branchmap command | |
|
300 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap | |
|
301 | devel-peer-request: Vary X-HgProto-1 | |
|
302 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
|
303 | devel-peer-request: finished in *.???? seconds (200) (glob) | |
|
304 | 299 | preparing listkeys for "bookmarks" |
|
305 | 300 | sending listkeys command |
|
306 | 301 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys |
|
307 | 302 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
308 | 303 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
309 | 304 | devel-peer-request: 19 bytes of commands arguments in headers |
|
310 | 305 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
311 | 306 | received listkey for "bookmarks": 0 bytes |
|
312 | 307 | 1 changesets found |
|
313 | 308 | list of changesets: |
|
314 | 309 | 7f4e523d01f2cc3765ac8934da3d14db775ff872 |
|
315 | 310 | bundle2-output-bundle: "HG20", 5 parts total |
|
316 | 311 | bundle2-output-part: "replycaps" 205 bytes payload |
|
317 | 312 | bundle2-output-part: "check:phases" 24 bytes payload |
|
318 | 313 | bundle2-output-part: "check:heads" streamed payload |
|
319 | 314 | bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload |
|
320 | 315 | bundle2-output-part: "phase-heads" 24 bytes payload |
|
321 | 316 | sending unbundle command |
|
322 | 317 | sending 1013 bytes |
|
323 | 318 | devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle |
|
324 | 319 | devel-peer-request: Content-length 1013 |
|
325 | 320 | devel-peer-request: Content-type application/mercurial-0.1 |
|
326 | 321 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
327 | 322 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
328 | 323 | devel-peer-request: 16 bytes of commands arguments in headers |
|
329 | 324 | devel-peer-request: 1013 bytes of data |
|
330 | 325 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
331 | 326 | bundle2-input-bundle: no-transaction |
|
332 | 327 | bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported |
|
333 | 328 | bundle2-input-part: "output" (advisory) (params: 0 advisory) supported |
|
334 | 329 | bundle2-input-part: total payload size 100 |
|
335 | 330 | remote: adding changesets |
|
336 | 331 | remote: adding manifests |
|
337 | 332 | remote: adding file changes |
|
338 | 333 | remote: added 1 changesets with 1 changes to 1 files |
|
339 | 334 | bundle2-input-part: "output" (advisory) supported |
|
340 | 335 | bundle2-input-bundle: 2 parts total |
|
341 | 336 | preparing listkeys for "phases" |
|
342 | 337 | sending listkeys command |
|
343 | 338 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys |
|
344 | 339 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
345 | 340 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
346 | 341 | devel-peer-request: 16 bytes of commands arguments in headers |
|
347 | 342 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
348 | 343 | received listkey for "phases": 15 bytes |
|
349 | 344 | $ hg rollback -q |
|
350 | 345 | |
|
351 | 346 | $ sed 's/.*] "/"/' < ../access.log |
|
352 | 347 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
353 | 348 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
354 | 349 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
355 | 350 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
356 | 351 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
357 | 352 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
358 | 353 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
359 | 354 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
360 | 355 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
361 | 356 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
362 | 357 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
363 | 358 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
364 | 359 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
365 | 360 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
366 | 361 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
367 | 362 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
368 | 363 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
369 | 364 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
370 | 365 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
371 | 366 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
372 | 367 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
373 | 368 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
374 | 369 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
375 | 370 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
376 | 371 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
377 | 372 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
378 | 373 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
379 | 374 | "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !) |
|
380 | 375 | "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !) |
|
381 | 376 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
382 | 377 | "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
383 | 378 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
384 | 379 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
385 | 380 | "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !) |
|
386 | 381 | "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !) |
|
387 | 382 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
388 | 383 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
389 | 384 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
390 | 385 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
391 | 386 | "GET /?cmd=capabilities HTTP/1.1" 403 - |
|
392 | 387 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
393 | 388 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
394 | 389 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
395 | 390 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
396 | 391 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
397 | 392 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
398 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
|
399 | 393 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
400 | 394 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob) |
|
401 | 395 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
402 | 396 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
403 | 397 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
404 | 398 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
405 | 399 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
406 | 400 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
407 | 401 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
408 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
|
409 | 402 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
410 | 403 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
411 | 404 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
412 | 405 | |
|
413 | 406 | $ cd .. |
|
414 | 407 | |
|
415 | 408 | clone of serve with repo in root and unserved subrepo (issue2970) |
|
416 | 409 | |
|
417 | 410 | $ hg --cwd test init sub |
|
418 | 411 | $ echo empty > test/sub/empty |
|
419 | 412 | $ hg --cwd test/sub add empty |
|
420 | 413 | $ hg --cwd test/sub commit -qm 'add empty' |
|
421 | 414 | $ hg --cwd test/sub tag -r 0 something |
|
422 | 415 | $ echo sub = sub > test/.hgsub |
|
423 | 416 | $ hg --cwd test add .hgsub |
|
424 | 417 | $ hg --cwd test commit -qm 'add subrepo' |
|
425 | 418 | $ hg clone http://localhost:$HGPORT noslash-clone |
|
426 | 419 | requesting all changes |
|
427 | 420 | adding changesets |
|
428 | 421 | adding manifests |
|
429 | 422 | adding file changes |
|
430 | 423 | added 3 changesets with 7 changes to 7 files |
|
431 | 424 | new changesets 8b6053c928fe:56f9bc90cce6 |
|
432 | 425 | updating to branch default |
|
433 | 426 | abort: HTTP Error 404: Not Found |
|
434 | 427 | [255] |
|
435 | 428 | $ hg clone http://localhost:$HGPORT/ slash-clone |
|
436 | 429 | requesting all changes |
|
437 | 430 | adding changesets |
|
438 | 431 | adding manifests |
|
439 | 432 | adding file changes |
|
440 | 433 | added 3 changesets with 7 changes to 7 files |
|
441 | 434 | new changesets 8b6053c928fe:56f9bc90cce6 |
|
442 | 435 | updating to branch default |
|
443 | 436 | abort: HTTP Error 404: Not Found |
|
444 | 437 | [255] |
|
445 | 438 | |
|
446 | 439 | check error log |
|
447 | 440 | |
|
448 | 441 | $ cat error.log |
|
449 | 442 | |
|
450 | 443 | check abort error reporting while pulling/cloning |
|
451 | 444 | |
|
452 | 445 | $ $RUNTESTDIR/killdaemons.py |
|
453 | 446 | $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py |
|
454 | 447 | $ cat hg3.pid >> $DAEMON_PIDS |
|
455 | 448 | $ hg clone http://localhost:$HGPORT/ abort-clone |
|
456 | 449 | requesting all changes |
|
457 | 450 | remote: abort: this is an exercise |
|
458 | 451 | abort: pull failed on remote |
|
459 | 452 | [255] |
|
460 | 453 | $ cat error.log |
|
461 | 454 | |
|
462 | 455 | disable pull-based clones |
|
463 | 456 | |
|
464 | 457 | $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True |
|
465 | 458 | $ cat hg4.pid >> $DAEMON_PIDS |
|
466 | 459 | $ hg clone http://localhost:$HGPORT1/ disable-pull-clone |
|
467 | 460 | requesting all changes |
|
468 | 461 | remote: abort: server has pull-based clones disabled |
|
469 | 462 | abort: pull failed on remote |
|
470 | 463 | (remove --pull if specified or upgrade Mercurial) |
|
471 | 464 | [255] |
|
472 | 465 | |
|
473 | 466 | #if no-reposimplestore |
|
474 | 467 | ... but keep stream clones working |
|
475 | 468 | |
|
476 | 469 | $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone |
|
477 | 470 | streaming all changes |
|
478 | 471 | * files to transfer, * of data (glob) |
|
479 | 472 | transferred * in * seconds (*/sec) (glob) |
|
480 | 473 | searching for changes |
|
481 | 474 | no changes found |
|
482 | 475 | $ cat error.log |
|
483 | 476 | #endif |
|
484 | 477 | |
|
485 | 478 | ... and also keep partial clones and pulls working |
|
486 | 479 | $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone |
|
487 | 480 | adding changesets |
|
488 | 481 | adding manifests |
|
489 | 482 | adding file changes |
|
490 | 483 | added 1 changesets with 4 changes to 4 files |
|
491 | 484 | new changesets 8b6053c928fe |
|
492 | 485 | updating to branch default |
|
493 | 486 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
494 | 487 | $ hg pull -R test-partial-clone |
|
495 | 488 | pulling from http://localhost:$HGPORT1/ |
|
496 | 489 | searching for changes |
|
497 | 490 | adding changesets |
|
498 | 491 | adding manifests |
|
499 | 492 | adding file changes |
|
500 | 493 | added 2 changesets with 3 changes to 3 files |
|
501 | 494 | new changesets 5fed3813f7f5:56f9bc90cce6 |
|
502 | 495 | (run 'hg update' to get a working copy) |
|
503 | 496 | |
|
504 | 497 | corrupt cookies file should yield a warning |
|
505 | 498 | |
|
506 | 499 | $ cat > $TESTTMP/cookies.txt << EOF |
|
507 | 500 | > bad format |
|
508 | 501 | > EOF |
|
509 | 502 | |
|
510 | 503 | $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/ |
|
511 | 504 | (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob) |
|
512 | 505 | 56f9bc90cce6 |
|
513 | 506 | |
|
514 | 507 | $ killdaemons.py |
|
515 | 508 | |
|
516 | 509 | Create dummy authentication handler that looks for cookies. It doesn't do anything |
|
517 | 510 | useful. It just raises an HTTP 500 with details about the Cookie request header. |
|
518 | 511 | We raise HTTP 500 because its message is printed in the abort message. |
|
519 | 512 | |
|
520 | 513 | $ cat > cookieauth.py << EOF |
|
521 | 514 | > from mercurial import util |
|
522 | 515 | > from mercurial.hgweb import common |
|
523 | 516 | > def perform_authentication(hgweb, req, op): |
|
524 | 517 | > cookie = req.headers.get('Cookie') |
|
525 | 518 | > if not cookie: |
|
526 | 519 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'no-cookie') |
|
527 | 520 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'Cookie: %s' % cookie) |
|
528 | 521 | > def extsetup(): |
|
529 | 522 | > common.permhooks.insert(0, perform_authentication) |
|
530 | 523 | > EOF |
|
531 | 524 | |
|
532 | 525 | $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid |
|
533 | 526 | $ cat pid > $DAEMON_PIDS |
|
534 | 527 | |
|
535 | 528 | Request without cookie sent should fail due to lack of cookie |
|
536 | 529 | |
|
537 | 530 | $ hg id http://localhost:$HGPORT |
|
538 | 531 | abort: HTTP Error 500: no-cookie |
|
539 | 532 | [255] |
|
540 | 533 | |
|
541 | 534 | Populate a cookies file |
|
542 | 535 | |
|
543 | 536 | $ cat > cookies.txt << EOF |
|
544 | 537 | > # HTTP Cookie File |
|
545 | 538 | > # Expiration is 2030-01-01 at midnight |
|
546 | 539 | > .example.com TRUE / FALSE 1893456000 hgkey examplevalue |
|
547 | 540 | > EOF |
|
548 | 541 | |
|
549 | 542 | Should not send a cookie for another domain |
|
550 | 543 | |
|
551 | 544 | $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ |
|
552 | 545 | abort: HTTP Error 500: no-cookie |
|
553 | 546 | [255] |
|
554 | 547 | |
|
555 | 548 | Add a cookie entry for our test server and verify it is sent |
|
556 | 549 | |
|
557 | 550 | $ cat >> cookies.txt << EOF |
|
558 | 551 | > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue |
|
559 | 552 | > EOF |
|
560 | 553 | |
|
561 | 554 | $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ |
|
562 | 555 | abort: HTTP Error 500: Cookie: hgkey=localhostvalue |
|
563 | 556 | [255] |
@@ -1,580 +1,579 | |||
|
1 | 1 | #require killdaemons |
|
2 | 2 | |
|
3 | 3 | Tests discovery against servers without getbundle support: |
|
4 | 4 | |
|
5 | 5 | $ CAP="getbundle bundle2" |
|
6 | 6 | $ . "$TESTDIR/notcapable" |
|
7 | 7 | $ cat >> $HGRCPATH <<EOF |
|
8 | 8 | > [ui] |
|
9 | 9 | > logtemplate="{rev} {node|short}: {desc} {branches}\n" |
|
10 | 10 | > EOF |
|
11 | 11 | |
|
12 | 12 | Setup HTTP server control: |
|
13 | 13 | |
|
14 | 14 | $ remote=http://localhost:$HGPORT/ |
|
15 | 15 | $ export remote |
|
16 | 16 | $ tstart() { |
|
17 | 17 | > echo '[web]' > $1/.hg/hgrc |
|
18 | 18 | > echo 'push_ssl = false' >> $1/.hg/hgrc |
|
19 | 19 | > echo 'allow_push = *' >> $1/.hg/hgrc |
|
20 | 20 | > hg serve -R $1 -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
21 | 21 | > cat hg.pid >> $DAEMON_PIDS |
|
22 | 22 | > } |
|
23 | 23 | $ tstop() { |
|
24 | 24 | > killdaemons.py |
|
25 | 25 | > [ "$1" ] && cut -d' ' -f6- access.log && cat errors.log |
|
26 | 26 | > rm access.log errors.log |
|
27 | 27 | > } |
|
28 | 28 | |
|
29 | 29 | Both are empty: |
|
30 | 30 | |
|
31 | 31 | $ hg init empty1 |
|
32 | 32 | $ hg init empty2 |
|
33 | 33 | $ tstart empty2 |
|
34 | 34 | $ hg incoming -R empty1 $remote |
|
35 | 35 | comparing with http://localhost:$HGPORT/ |
|
36 | 36 | no changes found |
|
37 | 37 | [1] |
|
38 | 38 | $ hg outgoing -R empty1 $remote |
|
39 | 39 | comparing with http://localhost:$HGPORT/ |
|
40 | 40 | no changes found |
|
41 | 41 | [1] |
|
42 | 42 | $ hg pull -R empty1 $remote |
|
43 | 43 | pulling from http://localhost:$HGPORT/ |
|
44 | 44 | no changes found |
|
45 | 45 | $ hg push -R empty1 $remote |
|
46 | 46 | pushing to http://localhost:$HGPORT/ |
|
47 | 47 | no changes found |
|
48 | 48 | [1] |
|
49 | 49 | $ tstop |
|
50 | 50 | |
|
51 | 51 | Base repo: |
|
52 | 52 | |
|
53 | 53 | $ hg init main |
|
54 | 54 | $ cd main |
|
55 | 55 | $ hg debugbuilddag -mo '+2:tbase @name1 +3:thead1 <tbase @name2 +4:thead2 @both /thead1 +2:tmaintip' |
|
56 | 56 | $ hg log -G |
|
57 | 57 | o 11 a19bfa7e7328: r11 both |
|
58 | 58 | | |
|
59 | 59 | o 10 8b6bad1512e1: r10 both |
|
60 | 60 | | |
|
61 | 61 | o 9 025829e08038: r9 both |
|
62 | 62 | |\ |
|
63 | 63 | | o 8 d8f638ac69e9: r8 name2 |
|
64 | 64 | | | |
|
65 | 65 | | o 7 b6b4d315a2ac: r7 name2 |
|
66 | 66 | | | |
|
67 | 67 | | o 6 6c6f5d5f3c11: r6 name2 |
|
68 | 68 | | | |
|
69 | 69 | | o 5 70314b29987d: r5 name2 |
|
70 | 70 | | | |
|
71 | 71 | o | 4 e71dbbc70e03: r4 name1 |
|
72 | 72 | | | |
|
73 | 73 | o | 3 2c8d5d5ec612: r3 name1 |
|
74 | 74 | | | |
|
75 | 75 | o | 2 a7892891da29: r2 name1 |
|
76 | 76 | |/ |
|
77 | 77 | o 1 0019a3b924fd: r1 |
|
78 | 78 | | |
|
79 | 79 | o 0 d57206cc072a: r0 |
|
80 | 80 | |
|
81 | 81 | $ cd .. |
|
82 | 82 | $ tstart main |
|
83 | 83 | |
|
84 | 84 | Full clone: |
|
85 | 85 | |
|
86 | 86 | $ hg clone main full |
|
87 | 87 | updating to branch default |
|
88 | 88 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
89 | 89 | $ cd full |
|
90 | 90 | $ hg incoming $remote |
|
91 | 91 | comparing with http://localhost:$HGPORT/ |
|
92 | 92 | searching for changes |
|
93 | 93 | no changes found |
|
94 | 94 | [1] |
|
95 | 95 | $ hg outgoing $remote |
|
96 | 96 | comparing with http://localhost:$HGPORT/ |
|
97 | 97 | searching for changes |
|
98 | 98 | no changes found |
|
99 | 99 | [1] |
|
100 | 100 | $ hg pull $remote |
|
101 | 101 | pulling from http://localhost:$HGPORT/ |
|
102 | 102 | searching for changes |
|
103 | 103 | no changes found |
|
104 | 104 | $ hg push $remote |
|
105 | 105 | pushing to http://localhost:$HGPORT/ |
|
106 | 106 | searching for changes |
|
107 | 107 | no changes found |
|
108 | 108 | [1] |
|
109 | 109 | $ cd .. |
|
110 | 110 | |
|
111 | 111 | Local is empty: |
|
112 | 112 | |
|
113 | 113 | $ cd empty1 |
|
114 | 114 | $ hg incoming $remote |
|
115 | 115 | comparing with http://localhost:$HGPORT/ |
|
116 | 116 | 0 d57206cc072a: r0 |
|
117 | 117 | 1 0019a3b924fd: r1 |
|
118 | 118 | 2 a7892891da29: r2 name1 |
|
119 | 119 | 3 2c8d5d5ec612: r3 name1 |
|
120 | 120 | 4 e71dbbc70e03: r4 name1 |
|
121 | 121 | 5 70314b29987d: r5 name2 |
|
122 | 122 | 6 6c6f5d5f3c11: r6 name2 |
|
123 | 123 | 7 b6b4d315a2ac: r7 name2 |
|
124 | 124 | 8 d8f638ac69e9: r8 name2 |
|
125 | 125 | 9 025829e08038: r9 both |
|
126 | 126 | 10 8b6bad1512e1: r10 both |
|
127 | 127 | 11 a19bfa7e7328: r11 both |
|
128 | 128 | $ hg outgoing $remote |
|
129 | 129 | comparing with http://localhost:$HGPORT/ |
|
130 | 130 | no changes found |
|
131 | 131 | [1] |
|
132 | 132 | $ hg push $remote |
|
133 | 133 | pushing to http://localhost:$HGPORT/ |
|
134 | 134 | no changes found |
|
135 | 135 | [1] |
|
136 | 136 | $ hg pull $remote |
|
137 | 137 | pulling from http://localhost:$HGPORT/ |
|
138 | 138 | requesting all changes |
|
139 | 139 | adding changesets |
|
140 | 140 | adding manifests |
|
141 | 141 | adding file changes |
|
142 | 142 | added 12 changesets with 24 changes to 2 files |
|
143 | 143 | new changesets d57206cc072a:a19bfa7e7328 |
|
144 | 144 | (run 'hg update' to get a working copy) |
|
145 | 145 | $ hg incoming $remote |
|
146 | 146 | comparing with http://localhost:$HGPORT/ |
|
147 | 147 | searching for changes |
|
148 | 148 | no changes found |
|
149 | 149 | [1] |
|
150 | 150 | $ cd .. |
|
151 | 151 | |
|
152 | 152 | Local is subset: |
|
153 | 153 | |
|
154 | 154 | $ hg clone main subset --rev name2 ; cd subset |
|
155 | 155 | adding changesets |
|
156 | 156 | adding manifests |
|
157 | 157 | adding file changes |
|
158 | 158 | added 6 changesets with 12 changes to 2 files |
|
159 | 159 | new changesets d57206cc072a:d8f638ac69e9 |
|
160 | 160 | updating to branch name2 |
|
161 | 161 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
162 | 162 | $ hg incoming $remote |
|
163 | 163 | comparing with http://localhost:$HGPORT/ |
|
164 | 164 | searching for changes |
|
165 | 165 | 6 a7892891da29: r2 name1 |
|
166 | 166 | 7 2c8d5d5ec612: r3 name1 |
|
167 | 167 | 8 e71dbbc70e03: r4 name1 |
|
168 | 168 | 9 025829e08038: r9 both |
|
169 | 169 | 10 8b6bad1512e1: r10 both |
|
170 | 170 | 11 a19bfa7e7328: r11 both |
|
171 | 171 | $ hg outgoing $remote |
|
172 | 172 | comparing with http://localhost:$HGPORT/ |
|
173 | 173 | searching for changes |
|
174 | 174 | no changes found |
|
175 | 175 | [1] |
|
176 | 176 | $ hg push $remote |
|
177 | 177 | pushing to http://localhost:$HGPORT/ |
|
178 | 178 | searching for changes |
|
179 | 179 | no changes found |
|
180 | 180 | [1] |
|
181 | 181 | $ hg pull $remote |
|
182 | 182 | pulling from http://localhost:$HGPORT/ |
|
183 | 183 | searching for changes |
|
184 | 184 | adding changesets |
|
185 | 185 | adding manifests |
|
186 | 186 | adding file changes |
|
187 | 187 | added 6 changesets with 12 changes to 2 files |
|
188 | 188 | new changesets a7892891da29:a19bfa7e7328 |
|
189 | 189 | (run 'hg update' to get a working copy) |
|
190 | 190 | $ hg incoming $remote |
|
191 | 191 | comparing with http://localhost:$HGPORT/ |
|
192 | 192 | searching for changes |
|
193 | 193 | no changes found |
|
194 | 194 | [1] |
|
195 | 195 | $ cd .. |
|
196 | 196 | $ tstop |
|
197 | 197 | |
|
198 | 198 | Remote is empty: |
|
199 | 199 | |
|
200 | 200 | $ tstart empty2 |
|
201 | 201 | $ cd main |
|
202 | 202 | $ hg incoming $remote |
|
203 | 203 | comparing with http://localhost:$HGPORT/ |
|
204 | 204 | searching for changes |
|
205 | 205 | no changes found |
|
206 | 206 | [1] |
|
207 | 207 | $ hg outgoing $remote |
|
208 | 208 | comparing with http://localhost:$HGPORT/ |
|
209 | 209 | searching for changes |
|
210 | 210 | 0 d57206cc072a: r0 |
|
211 | 211 | 1 0019a3b924fd: r1 |
|
212 | 212 | 2 a7892891da29: r2 name1 |
|
213 | 213 | 3 2c8d5d5ec612: r3 name1 |
|
214 | 214 | 4 e71dbbc70e03: r4 name1 |
|
215 | 215 | 5 70314b29987d: r5 name2 |
|
216 | 216 | 6 6c6f5d5f3c11: r6 name2 |
|
217 | 217 | 7 b6b4d315a2ac: r7 name2 |
|
218 | 218 | 8 d8f638ac69e9: r8 name2 |
|
219 | 219 | 9 025829e08038: r9 both |
|
220 | 220 | 10 8b6bad1512e1: r10 both |
|
221 | 221 | 11 a19bfa7e7328: r11 both |
|
222 | 222 | $ hg pull $remote |
|
223 | 223 | pulling from http://localhost:$HGPORT/ |
|
224 | 224 | searching for changes |
|
225 | 225 | no changes found |
|
226 | 226 | $ hg push $remote |
|
227 | 227 | pushing to http://localhost:$HGPORT/ |
|
228 | 228 | searching for changes |
|
229 | 229 | remote: adding changesets |
|
230 | 230 | remote: adding manifests |
|
231 | 231 | remote: adding file changes |
|
232 | 232 | remote: added 12 changesets with 24 changes to 2 files |
|
233 | 233 | $ hg outgoing $remote |
|
234 | 234 | comparing with http://localhost:$HGPORT/ |
|
235 | 235 | searching for changes |
|
236 | 236 | no changes found |
|
237 | 237 | [1] |
|
238 | 238 | $ cd .. |
|
239 | 239 | $ tstop |
|
240 | 240 | |
|
241 | 241 | Local is superset: |
|
242 | 242 | |
|
243 | 243 | $ hg clone main subset2 --rev name2 |
|
244 | 244 | adding changesets |
|
245 | 245 | adding manifests |
|
246 | 246 | adding file changes |
|
247 | 247 | added 6 changesets with 12 changes to 2 files |
|
248 | 248 | new changesets d57206cc072a:d8f638ac69e9 |
|
249 | 249 | updating to branch name2 |
|
250 | 250 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
251 | 251 | $ tstart subset2 |
|
252 | 252 | $ cd main |
|
253 | 253 | $ hg incoming $remote |
|
254 | 254 | comparing with http://localhost:$HGPORT/ |
|
255 | 255 | searching for changes |
|
256 | 256 | no changes found |
|
257 | 257 | [1] |
|
258 | 258 | $ hg outgoing $remote |
|
259 | 259 | comparing with http://localhost:$HGPORT/ |
|
260 | 260 | searching for changes |
|
261 | 261 | 2 a7892891da29: r2 name1 |
|
262 | 262 | 3 2c8d5d5ec612: r3 name1 |
|
263 | 263 | 4 e71dbbc70e03: r4 name1 |
|
264 | 264 | 9 025829e08038: r9 both |
|
265 | 265 | 10 8b6bad1512e1: r10 both |
|
266 | 266 | 11 a19bfa7e7328: r11 both |
|
267 | 267 | $ hg pull $remote |
|
268 | 268 | pulling from http://localhost:$HGPORT/ |
|
269 | 269 | searching for changes |
|
270 | 270 | no changes found |
|
271 | 271 | $ hg push $remote |
|
272 | 272 | pushing to http://localhost:$HGPORT/ |
|
273 | 273 | searching for changes |
|
274 | 274 | abort: push creates new remote branches: both, name1! |
|
275 | 275 | (use 'hg push --new-branch' to create new remote branches) |
|
276 | 276 | [255] |
|
277 | 277 | $ hg push $remote --new-branch |
|
278 | 278 | pushing to http://localhost:$HGPORT/ |
|
279 | 279 | searching for changes |
|
280 | 280 | remote: adding changesets |
|
281 | 281 | remote: adding manifests |
|
282 | 282 | remote: adding file changes |
|
283 | 283 | remote: added 6 changesets with 12 changes to 2 files |
|
284 | 284 | $ hg outgoing $remote |
|
285 | 285 | comparing with http://localhost:$HGPORT/ |
|
286 | 286 | searching for changes |
|
287 | 287 | no changes found |
|
288 | 288 | [1] |
|
289 | 289 | $ cd .. |
|
290 | 290 | $ tstop |
|
291 | 291 | |
|
292 | 292 | Partial pull: |
|
293 | 293 | |
|
294 | 294 | $ tstart main |
|
295 | 295 | $ hg clone $remote partial --rev name2 |
|
296 | 296 | adding changesets |
|
297 | 297 | adding manifests |
|
298 | 298 | adding file changes |
|
299 | 299 | added 6 changesets with 12 changes to 2 files |
|
300 | 300 | new changesets d57206cc072a:d8f638ac69e9 |
|
301 | 301 | updating to branch name2 |
|
302 | 302 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
303 | 303 | $ cd partial |
|
304 | 304 | $ hg incoming $remote |
|
305 | 305 | comparing with http://localhost:$HGPORT/ |
|
306 | 306 | searching for changes |
|
307 | 307 | 6 a7892891da29: r2 name1 |
|
308 | 308 | 7 2c8d5d5ec612: r3 name1 |
|
309 | 309 | 8 e71dbbc70e03: r4 name1 |
|
310 | 310 | 9 025829e08038: r9 both |
|
311 | 311 | 10 8b6bad1512e1: r10 both |
|
312 | 312 | 11 a19bfa7e7328: r11 both |
|
313 | 313 | $ hg incoming $remote --rev name1 |
|
314 | 314 | comparing with http://localhost:$HGPORT/ |
|
315 | 315 | searching for changes |
|
316 | 316 | 6 a7892891da29: r2 name1 |
|
317 | 317 | 7 2c8d5d5ec612: r3 name1 |
|
318 | 318 | 8 e71dbbc70e03: r4 name1 |
|
319 | 319 | $ hg pull $remote --rev name1 |
|
320 | 320 | pulling from http://localhost:$HGPORT/ |
|
321 | 321 | searching for changes |
|
322 | 322 | adding changesets |
|
323 | 323 | adding manifests |
|
324 | 324 | adding file changes |
|
325 | 325 | added 3 changesets with 6 changes to 2 files (+1 heads) |
|
326 | 326 | new changesets a7892891da29:e71dbbc70e03 |
|
327 | 327 | (run 'hg heads' to see heads) |
|
328 | 328 | $ hg incoming $remote |
|
329 | 329 | comparing with http://localhost:$HGPORT/ |
|
330 | 330 | searching for changes |
|
331 | 331 | 9 025829e08038: r9 both |
|
332 | 332 | 10 8b6bad1512e1: r10 both |
|
333 | 333 | 11 a19bfa7e7328: r11 both |
|
334 | 334 | $ cd .. |
|
335 | 335 | $ tstop |
|
336 | 336 | |
|
337 | 337 | Both have new stuff in new named branches: |
|
338 | 338 | |
|
339 | 339 | $ hg clone main repo1a --rev name1 -q |
|
340 | 340 | $ hg clone repo1a repo1b -q |
|
341 | 341 | $ hg clone main repo2a --rev name2 -q |
|
342 | 342 | $ hg clone repo2a repo2b -q |
|
343 | 343 | $ tstart repo1a |
|
344 | 344 | |
|
345 | 345 | $ cd repo2a |
|
346 | 346 | $ hg incoming $remote |
|
347 | 347 | comparing with http://localhost:$HGPORT/ |
|
348 | 348 | searching for changes |
|
349 | 349 | 6 a7892891da29: r2 name1 |
|
350 | 350 | 7 2c8d5d5ec612: r3 name1 |
|
351 | 351 | 8 e71dbbc70e03: r4 name1 |
|
352 | 352 | $ hg outgoing $remote |
|
353 | 353 | comparing with http://localhost:$HGPORT/ |
|
354 | 354 | searching for changes |
|
355 | 355 | 2 70314b29987d: r5 name2 |
|
356 | 356 | 3 6c6f5d5f3c11: r6 name2 |
|
357 | 357 | 4 b6b4d315a2ac: r7 name2 |
|
358 | 358 | 5 d8f638ac69e9: r8 name2 |
|
359 | 359 | $ hg push $remote --new-branch |
|
360 | 360 | pushing to http://localhost:$HGPORT/ |
|
361 | 361 | searching for changes |
|
362 | 362 | remote: adding changesets |
|
363 | 363 | remote: adding manifests |
|
364 | 364 | remote: adding file changes |
|
365 | 365 | remote: added 4 changesets with 8 changes to 2 files (+1 heads) |
|
366 | 366 | $ hg pull $remote |
|
367 | 367 | pulling from http://localhost:$HGPORT/ |
|
368 | 368 | searching for changes |
|
369 | 369 | adding changesets |
|
370 | 370 | adding manifests |
|
371 | 371 | adding file changes |
|
372 | 372 | added 3 changesets with 6 changes to 2 files (+1 heads) |
|
373 | 373 | new changesets a7892891da29:e71dbbc70e03 |
|
374 | 374 | (run 'hg heads' to see heads) |
|
375 | 375 | $ hg incoming $remote |
|
376 | 376 | comparing with http://localhost:$HGPORT/ |
|
377 | 377 | searching for changes |
|
378 | 378 | no changes found |
|
379 | 379 | [1] |
|
380 | 380 | $ hg outgoing $remote |
|
381 | 381 | comparing with http://localhost:$HGPORT/ |
|
382 | 382 | searching for changes |
|
383 | 383 | no changes found |
|
384 | 384 | [1] |
|
385 | 385 | $ cd .. |
|
386 | 386 | $ tstop |
|
387 | 387 | |
|
388 | 388 | $ tstart repo1b |
|
389 | 389 | $ cd repo2b |
|
390 | 390 | $ hg incoming $remote |
|
391 | 391 | comparing with http://localhost:$HGPORT/ |
|
392 | 392 | searching for changes |
|
393 | 393 | 6 a7892891da29: r2 name1 |
|
394 | 394 | 7 2c8d5d5ec612: r3 name1 |
|
395 | 395 | 8 e71dbbc70e03: r4 name1 |
|
396 | 396 | $ hg outgoing $remote |
|
397 | 397 | comparing with http://localhost:$HGPORT/ |
|
398 | 398 | searching for changes |
|
399 | 399 | 2 70314b29987d: r5 name2 |
|
400 | 400 | 3 6c6f5d5f3c11: r6 name2 |
|
401 | 401 | 4 b6b4d315a2ac: r7 name2 |
|
402 | 402 | 5 d8f638ac69e9: r8 name2 |
|
403 | 403 | $ hg pull $remote |
|
404 | 404 | pulling from http://localhost:$HGPORT/ |
|
405 | 405 | searching for changes |
|
406 | 406 | adding changesets |
|
407 | 407 | adding manifests |
|
408 | 408 | adding file changes |
|
409 | 409 | added 3 changesets with 6 changes to 2 files (+1 heads) |
|
410 | 410 | new changesets a7892891da29:e71dbbc70e03 |
|
411 | 411 | (run 'hg heads' to see heads) |
|
412 | 412 | $ hg push $remote --new-branch |
|
413 | 413 | pushing to http://localhost:$HGPORT/ |
|
414 | 414 | searching for changes |
|
415 | 415 | remote: adding changesets |
|
416 | 416 | remote: adding manifests |
|
417 | 417 | remote: adding file changes |
|
418 | 418 | remote: added 4 changesets with 8 changes to 2 files (+1 heads) |
|
419 | 419 | $ hg incoming $remote |
|
420 | 420 | comparing with http://localhost:$HGPORT/ |
|
421 | 421 | searching for changes |
|
422 | 422 | no changes found |
|
423 | 423 | [1] |
|
424 | 424 | $ hg outgoing $remote |
|
425 | 425 | comparing with http://localhost:$HGPORT/ |
|
426 | 426 | searching for changes |
|
427 | 427 | no changes found |
|
428 | 428 | [1] |
|
429 | 429 | $ cd .. |
|
430 | 430 | $ tstop |
|
431 | 431 | |
|
432 | 432 | Both have new stuff in existing named branches: |
|
433 | 433 | |
|
434 | 434 | $ rm -r repo1a repo1b repo2a repo2b |
|
435 | 435 | $ hg clone main repo1a --rev 3 --rev 8 -q |
|
436 | 436 | $ hg clone repo1a repo1b -q |
|
437 | 437 | $ hg clone main repo2a --rev 4 --rev 7 -q |
|
438 | 438 | $ hg clone repo2a repo2b -q |
|
439 | 439 | $ tstart repo1a |
|
440 | 440 | |
|
441 | 441 | $ cd repo2a |
|
442 | 442 | $ hg incoming $remote |
|
443 | 443 | comparing with http://localhost:$HGPORT/ |
|
444 | 444 | searching for changes |
|
445 | 445 | 8 d8f638ac69e9: r8 name2 |
|
446 | 446 | $ hg outgoing $remote |
|
447 | 447 | comparing with http://localhost:$HGPORT/ |
|
448 | 448 | searching for changes |
|
449 | 449 | 4 e71dbbc70e03: r4 name1 |
|
450 | 450 | $ hg push $remote --new-branch |
|
451 | 451 | pushing to http://localhost:$HGPORT/ |
|
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 2 changes to 2 files |
|
457 | 457 | $ hg pull $remote |
|
458 | 458 | pulling from http://localhost:$HGPORT/ |
|
459 | 459 | searching for changes |
|
460 | 460 | adding changesets |
|
461 | 461 | adding manifests |
|
462 | 462 | adding file changes |
|
463 | 463 | added 1 changesets with 2 changes to 2 files |
|
464 | 464 | new changesets d8f638ac69e9 |
|
465 | 465 | (run 'hg update' to get a working copy) |
|
466 | 466 | $ hg incoming $remote |
|
467 | 467 | comparing with http://localhost:$HGPORT/ |
|
468 | 468 | searching for changes |
|
469 | 469 | no changes found |
|
470 | 470 | [1] |
|
471 | 471 | $ hg outgoing $remote |
|
472 | 472 | comparing with http://localhost:$HGPORT/ |
|
473 | 473 | searching for changes |
|
474 | 474 | no changes found |
|
475 | 475 | [1] |
|
476 | 476 | $ cd .. |
|
477 | 477 | $ tstop |
|
478 | 478 | |
|
479 | 479 | $ tstart repo1b |
|
480 | 480 | $ cd repo2b |
|
481 | 481 | $ hg incoming $remote |
|
482 | 482 | comparing with http://localhost:$HGPORT/ |
|
483 | 483 | searching for changes |
|
484 | 484 | 8 d8f638ac69e9: r8 name2 |
|
485 | 485 | $ hg outgoing $remote |
|
486 | 486 | comparing with http://localhost:$HGPORT/ |
|
487 | 487 | searching for changes |
|
488 | 488 | 4 e71dbbc70e03: r4 name1 |
|
489 | 489 | $ hg pull $remote |
|
490 | 490 | pulling from http://localhost:$HGPORT/ |
|
491 | 491 | searching for changes |
|
492 | 492 | adding changesets |
|
493 | 493 | adding manifests |
|
494 | 494 | adding file changes |
|
495 | 495 | added 1 changesets with 2 changes to 2 files |
|
496 | 496 | new changesets d8f638ac69e9 |
|
497 | 497 | (run 'hg update' to get a working copy) |
|
498 | 498 | $ hg push $remote --new-branch |
|
499 | 499 | pushing to http://localhost:$HGPORT/ |
|
500 | 500 | searching for changes |
|
501 | 501 | remote: adding changesets |
|
502 | 502 | remote: adding manifests |
|
503 | 503 | remote: adding file changes |
|
504 | 504 | remote: added 1 changesets with 2 changes to 2 files |
|
505 | 505 | $ hg incoming $remote |
|
506 | 506 | comparing with http://localhost:$HGPORT/ |
|
507 | 507 | searching for changes |
|
508 | 508 | no changes found |
|
509 | 509 | [1] |
|
510 | 510 | $ hg outgoing $remote |
|
511 | 511 | comparing with http://localhost:$HGPORT/ |
|
512 | 512 | searching for changes |
|
513 | 513 | no changes found |
|
514 | 514 | [1] |
|
515 | 515 | $ cd .. |
|
516 | 516 | #if zstd |
|
517 | 517 | $ tstop show |
|
518 | 518 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
519 | 519 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
520 | 520 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
521 | 521 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
522 | 522 | "GET /?cmd=changegroupsubset HTTP/1.1" 200 - x-hgarg-1:bases=d8f638ac69e9ae8dea4f09f11d696546a912d961&heads=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
523 | 523 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
524 | 524 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
525 | 525 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
526 | 526 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
527 | 527 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
528 | 528 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
529 | 529 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
530 | 530 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
531 | 531 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
532 | 532 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
533 | 533 | "GET /?cmd=changegroupsubset HTTP/1.1" 200 - x-hgarg-1:bases=d8f638ac69e9ae8dea4f09f11d696546a912d961&heads=d8f638ac69e9ae8dea4f09f11d696546a912d961+2c8d5d5ec612be65cdfdeac78b7662ab1696324a x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
534 | 534 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
535 | 535 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
536 | 536 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
537 | 537 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
538 | 538 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
539 | 539 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
540 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
|
541 | 540 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
542 | 541 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+1827a5bb63e602382eb89dd58f2ac9f3b007ad91* (glob) |
|
543 | 542 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
544 | 543 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
545 | 544 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
546 | 545 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
547 | 546 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
548 | 547 | #else |
|
549 | 548 | $ tstop show |
|
550 | 549 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
551 | 550 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
552 | 551 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
553 | 552 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
554 | 553 | "GET /?cmd=changegroupsubset HTTP/1.1" 200 - x-hgarg-1:bases=d8f638ac69e9ae8dea4f09f11d696546a912d961&heads=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
555 | 554 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
556 | 555 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
557 | 556 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
558 | 557 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
559 | 558 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
560 | 559 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
561 | 560 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
562 | 561 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
563 | 562 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
564 | 563 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
565 | 564 | "GET /?cmd=changegroupsubset HTTP/1.1" 200 - x-hgarg-1:bases=d8f638ac69e9ae8dea4f09f11d696546a912d961&heads=d8f638ac69e9ae8dea4f09f11d696546a912d961+2c8d5d5ec612be65cdfdeac78b7662ab1696324a x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
566 | 565 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
567 | 566 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
568 | 567 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
569 | 568 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
570 | 569 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
571 | 570 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
572 | 571 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
573 | 572 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
574 | 573 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+1827a5bb63e602382eb89dd58f2ac9f3b007ad91* (glob) |
|
575 | 574 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
576 | 575 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
577 | 576 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
578 | 577 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
579 | 578 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
580 | 579 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now