Show More
@@ -1,178 +1,193 b'' | |||
|
1 | 1 | # setdiscovery.py - improved discovery of common nodeset for mercurial |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2010 Benoit Boissinot <bboissin@gmail.com> |
|
4 | 4 | # and Peter Arrenbrecht <peter@arrenbrecht.ch> |
|
5 | 5 | # |
|
6 | 6 | # This software may be used and distributed according to the terms of the |
|
7 | 7 | # GNU General Public License version 2 or any later version. |
|
8 | 8 | |
|
9 | 9 | from node import nullid |
|
10 | 10 | from i18n import _ |
|
11 | 11 | import random, collections, util, dagutil |
|
12 | 12 | |
|
13 | 13 | def _updatesample(dag, nodes, sample, always, quicksamplesize=0): |
|
14 | 14 | # if nodes is empty we scan the entire graph |
|
15 | 15 | if nodes: |
|
16 | 16 | heads = dag.headsetofconnecteds(nodes) |
|
17 | 17 | else: |
|
18 | 18 | heads = dag.heads() |
|
19 | 19 | dist = {} |
|
20 | 20 | visit = collections.deque(heads) |
|
21 | 21 | seen = set() |
|
22 | 22 | factor = 1 |
|
23 | 23 | while visit: |
|
24 | 24 | curr = visit.popleft() |
|
25 | 25 | if curr in seen: |
|
26 | 26 | continue |
|
27 | 27 | d = dist.setdefault(curr, 1) |
|
28 | 28 | if d > factor: |
|
29 | 29 | factor *= 2 |
|
30 | 30 | if d == factor: |
|
31 | 31 | if curr not in always: # need this check for the early exit below |
|
32 | 32 | sample.add(curr) |
|
33 | 33 | if quicksamplesize and (len(sample) >= quicksamplesize): |
|
34 | 34 | return |
|
35 | 35 | seen.add(curr) |
|
36 | 36 | for p in dag.parents(curr): |
|
37 | 37 | if not nodes or p in nodes: |
|
38 | 38 | dist.setdefault(p, d + 1) |
|
39 | 39 | visit.append(p) |
|
40 | 40 | |
|
41 | 41 | def _setupsample(dag, nodes, size): |
|
42 | 42 | if len(nodes) <= size: |
|
43 | 43 | return set(nodes), None, 0 |
|
44 | 44 | always = set(dag.heads()) |
|
45 | 45 | desiredlen = size - len(always) |
|
46 | 46 | if desiredlen <= 0: |
|
47 | 47 | # This could be bad if there are very many heads, all unknown to the |
|
48 | 48 | # server. We're counting on long request support here. |
|
49 | 49 | return always, None, desiredlen |
|
50 | 50 | return always, set(), desiredlen |
|
51 | 51 | |
|
52 | 52 | def _takequicksample(dag, nodes, size, initial): |
|
53 | 53 | always, sample, desiredlen = _setupsample(dag, nodes, size) |
|
54 | 54 | if sample is None: |
|
55 | 55 | return always |
|
56 | 56 | if initial: |
|
57 | 57 | fromset = None |
|
58 | 58 | else: |
|
59 | 59 | fromset = nodes |
|
60 | 60 | _updatesample(dag, fromset, sample, always, quicksamplesize=desiredlen) |
|
61 | 61 | sample.update(always) |
|
62 | 62 | return sample |
|
63 | 63 | |
|
64 | 64 | def _takefullsample(dag, nodes, size): |
|
65 | 65 | always, sample, desiredlen = _setupsample(dag, nodes, size) |
|
66 | 66 | if sample is None: |
|
67 | 67 | return always |
|
68 | 68 | # update from heads |
|
69 | 69 | _updatesample(dag, nodes, sample, always) |
|
70 | 70 | # update from roots |
|
71 | 71 | _updatesample(dag.inverse(), nodes, sample, always) |
|
72 | 72 | assert sample |
|
73 | 73 | if len(sample) > desiredlen: |
|
74 | 74 | sample = set(random.sample(sample, desiredlen)) |
|
75 | 75 | elif len(sample) < desiredlen: |
|
76 | 76 | more = desiredlen - len(sample) |
|
77 | 77 | sample.update(random.sample(list(nodes - sample - always), more)) |
|
78 | 78 | sample.update(always) |
|
79 | 79 | return sample |
|
80 | 80 | |
|
81 | 81 | def findcommonheads(ui, local, remote, |
|
82 | 82 | initialsamplesize=100, |
|
83 | 83 | fullsamplesize=200, |
|
84 | 84 | abortwhenunrelated=True): |
|
85 | 85 | '''Return a tuple (common, anyincoming, remoteheads) used to identify |
|
86 | 86 | missing nodes from or in remote. |
|
87 | 87 | |
|
88 | 88 | shortcutlocal determines whether we try use direct access to localrepo if |
|
89 | 89 | remote is actually local. |
|
90 | 90 | ''' |
|
91 | 91 | roundtrips = 0 |
|
92 | 92 | cl = local.changelog |
|
93 | 93 | dag = dagutil.revlogdag(cl) |
|
94 | nodes = dag.nodeset() | |
|
95 | 94 | |
|
96 |
# early exit if we know all the specified |
|
|
95 | # early exit if we know all the specified remote heads already | |
|
97 | 96 | ui.debug("query 1; heads\n") |
|
98 | 97 | roundtrips += 1 |
|
99 |
|
|
|
100 | ||
|
101 | ## TODO We might want to request an additional random sample of the server's | |
|
102 | ## nodes batched with the heads query here. | |
|
98 | ownheads = dag.heads() | |
|
99 | sample = ownheads | |
|
100 | if remote.local(): | |
|
101 | # stopgap until we have a proper localpeer that supports batch() | |
|
102 | srvheadhashes = remote.heads() | |
|
103 | yesno = remote.known(dag.externalizeall(sample)) | |
|
104 | elif remote.capable('batch'): | |
|
105 | batch = remote.batch() | |
|
106 | srvheadhashesref = batch.heads() | |
|
107 | yesnoref = batch.known(dag.externalizeall(sample)) | |
|
108 | batch.submit() | |
|
109 | srvheadhashes = srvheadhashesref.value | |
|
110 | yesno = yesnoref.value | |
|
111 | else: | |
|
112 | # compatibitity with pre-batch, but post-known remotes during 1.9 devel | |
|
113 | srvheadhashes = remote.heads() | |
|
114 | sample = [] | |
|
103 | 115 | |
|
104 | 116 | if cl.tip() == nullid: |
|
105 | 117 | if srvheadhashes != [nullid]: |
|
106 | 118 | return [nullid], True, srvheadhashes |
|
107 | 119 | return [nullid], False, [] |
|
108 | 120 | |
|
109 | 121 | # start actual discovery (we note this before the next "if" for |
|
110 | 122 | # compatibility reasons) |
|
111 | 123 | ui.status(_("searching for changes\n")) |
|
112 | 124 | |
|
113 | 125 | srvheads = dag.internalizeall(srvheadhashes, filterunknown=True) |
|
114 | 126 | if len(srvheads) == len(srvheadhashes): |
|
115 | 127 | ui.note("all remote heads known locally\n") |
|
116 | 128 | return (srvheadhashes, False, srvheadhashes,) |
|
117 | 129 | |
|
130 | if sample and util.all(yesno): | |
|
131 | ui.note("all local heads known remotely\n") | |
|
132 | ownheadhashes = dag.externalizeall(ownheads) | |
|
133 | return (ownheadhashes, True, srvheadhashes,) | |
|
134 | ||
|
118 | 135 | # full blown discovery |
|
119 |
undecided = nodes # own nodes where I don't know if |
|
|
136 | undecided = dag.nodeset() # own nodes where I don't know if remote knows them | |
|
120 | 137 | common = set() # own nodes I know we both know |
|
121 |
missing = set() # own nodes I know |
|
|
138 | missing = set() # own nodes I know remote lacks | |
|
122 | 139 | |
|
123 | # treat remote heads as a first implicit sample response | |
|
140 | # treat remote heads (and maybe own heads) as a first implicit sample response | |
|
124 | 141 | common.update(dag.ancestorset(srvheads)) |
|
125 | 142 | undecided.difference_update(common) |
|
126 | # use cheapish initial sample | |
|
127 | if common: | |
|
128 | ui.debug("taking initial sample\n") | |
|
129 | sample = _takefullsample(dag, undecided, size=fullsamplesize) | |
|
130 | else: | |
|
131 | ui.debug("taking quick initial sample\n") | |
|
132 | sample = _takequicksample(dag, nodes, size=initialsamplesize, | |
|
133 | initial=True) | |
|
143 | ||
|
144 | full = False | |
|
145 | while undecided: | |
|
134 | 146 | |
|
135 | roundtrips += 1 | |
|
136 | ui.progress(_('searching'), roundtrips, unit=_('queries')) | |
|
137 | ui.debug("query %i; still undecided: %i, sample size is: %i\n" | |
|
138 | % (roundtrips, len(undecided), len(sample))) | |
|
139 | # indices between sample and externalized version must match | |
|
140 | sample = list(sample) | |
|
141 | yesno = remote.known(dag.externalizeall(sample)) | |
|
147 | if sample: | |
|
148 | commoninsample = set(n for i, n in enumerate(sample) if yesno[i]) | |
|
149 | common.update(dag.ancestorset(commoninsample, common)) | |
|
142 | 150 | |
|
143 | while undecided: | |
|
144 | commoninsample = set(n for i, n in enumerate(sample) if yesno[i]) | |
|
145 | common.update(dag.ancestorset(commoninsample, common)) | |
|
151 | missinginsample = [n for i, n in enumerate(sample) if not yesno[i]] | |
|
152 | missing.update(dag.descendantset(missinginsample, missing)) | |
|
146 | 153 | |
|
147 | missinginsample = [n for i, n in enumerate(sample) if not yesno[i]] | |
|
148 | missing.update(dag.descendantset(missinginsample, missing)) | |
|
149 | ||
|
150 | undecided.difference_update(missing) | |
|
151 | undecided.difference_update(common) | |
|
154 | undecided.difference_update(missing) | |
|
155 | undecided.difference_update(common) | |
|
152 | 156 | |
|
153 | 157 | if not undecided: |
|
154 | 158 | break |
|
155 | 159 | |
|
156 | ui.note("sampling from both directions\n") | |
|
157 | sample = _takefullsample(dag, undecided, size=fullsamplesize) | |
|
160 | if full: | |
|
161 | ui.note("sampling from both directions\n") | |
|
162 | sample = _takefullsample(dag, undecided, size=fullsamplesize) | |
|
163 | elif common: | |
|
164 | # use cheapish initial sample | |
|
165 | ui.debug("taking initial sample\n") | |
|
166 | sample = _takefullsample(dag, undecided, size=fullsamplesize) | |
|
167 | else: | |
|
168 | # use even cheaper initial sample | |
|
169 | ui.debug("taking quick initial sample\n") | |
|
170 | sample = _takequicksample(dag, undecided, size=initialsamplesize, | |
|
171 | initial=True) | |
|
158 | 172 | |
|
159 | 173 | roundtrips += 1 |
|
160 | 174 | ui.progress(_('searching'), roundtrips, unit=_('queries')) |
|
161 | 175 | ui.debug("query %i; still undecided: %i, sample size is: %i\n" |
|
162 | 176 | % (roundtrips, len(undecided), len(sample))) |
|
163 | 177 | # indices between sample and externalized version must match |
|
164 | 178 | sample = list(sample) |
|
165 | 179 | yesno = remote.known(dag.externalizeall(sample)) |
|
180 | full = True | |
|
166 | 181 | |
|
167 | 182 | result = dag.headsetofconnecteds(common) |
|
168 | 183 | ui.progress(_('searching'), None) |
|
169 | 184 | ui.debug("%d total queries\n" % roundtrips) |
|
170 | 185 | |
|
171 | 186 | if not result and srvheadhashes != [nullid]: |
|
172 | 187 | if abortwhenunrelated: |
|
173 | 188 | raise util.Abort(_("repository is unrelated")) |
|
174 | 189 | else: |
|
175 | 190 | ui.warn(_("warning: repository is unrelated\n")) |
|
176 | 191 | return (set([nullid]), True, srvheadhashes,) |
|
177 | 192 | |
|
178 | 193 | return (dag.externalizeall(result), True, srvheadhashes,) |
@@ -1,120 +1,120 b'' | |||
|
1 | 1 | |
|
2 | 2 | $ hg init a |
|
3 | 3 | $ cd a |
|
4 | 4 | $ echo a > a |
|
5 | 5 | $ hg ci -Ama -d '1123456789 0' |
|
6 | 6 | adding a |
|
7 | 7 | $ hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=hg.pid |
|
8 | 8 | $ cat hg.pid >> $DAEMON_PIDS |
|
9 | 9 | $ cd .. |
|
10 | 10 | $ ("$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null & |
|
11 | 11 | $ echo $! > proxy.pid) |
|
12 | 12 | $ cat proxy.pid >> $DAEMON_PIDS |
|
13 | 13 | $ sleep 2 |
|
14 | 14 | |
|
15 | 15 | url for proxy, stream |
|
16 | 16 | |
|
17 | 17 | $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --uncompressed http://localhost:$HGPORT/ b |
|
18 | 18 | streaming all changes |
|
19 | 19 | 3 files to transfer, 303 bytes of data |
|
20 | 20 | transferred * bytes in * seconds (*/sec) (glob) |
|
21 | 21 | updating to branch default |
|
22 | 22 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
23 | 23 | $ cd b |
|
24 | 24 | $ hg verify |
|
25 | 25 | checking changesets |
|
26 | 26 | checking manifests |
|
27 | 27 | crosschecking files in changesets and manifests |
|
28 | 28 | checking files |
|
29 | 29 | 1 files, 1 changesets, 1 total revisions |
|
30 | 30 | $ cd .. |
|
31 | 31 | |
|
32 | 32 | url for proxy, pull |
|
33 | 33 | |
|
34 | 34 | $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull |
|
35 | 35 | requesting all changes |
|
36 | 36 | adding changesets |
|
37 | 37 | adding manifests |
|
38 | 38 | adding file changes |
|
39 | 39 | added 1 changesets with 1 changes to 1 files |
|
40 | 40 | updating to branch default |
|
41 | 41 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
42 | 42 | $ cd b-pull |
|
43 | 43 | $ hg verify |
|
44 | 44 | checking changesets |
|
45 | 45 | checking manifests |
|
46 | 46 | crosschecking files in changesets and manifests |
|
47 | 47 | checking files |
|
48 | 48 | 1 files, 1 changesets, 1 total revisions |
|
49 | 49 | $ cd .. |
|
50 | 50 | |
|
51 | 51 | host:port for proxy |
|
52 | 52 | |
|
53 | 53 | $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c |
|
54 | 54 | requesting all changes |
|
55 | 55 | adding changesets |
|
56 | 56 | adding manifests |
|
57 | 57 | adding file changes |
|
58 | 58 | added 1 changesets with 1 changes to 1 files |
|
59 | 59 | updating to branch default |
|
60 | 60 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
61 | 61 | |
|
62 | 62 | proxy url with user name and password |
|
63 | 63 | |
|
64 | 64 | $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d |
|
65 | 65 | requesting all changes |
|
66 | 66 | adding changesets |
|
67 | 67 | adding manifests |
|
68 | 68 | adding file changes |
|
69 | 69 | added 1 changesets with 1 changes to 1 files |
|
70 | 70 | updating to branch default |
|
71 | 71 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
72 | 72 | |
|
73 | 73 | url with user name and password |
|
74 | 74 | |
|
75 | 75 | $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e |
|
76 | 76 | requesting all changes |
|
77 | 77 | adding changesets |
|
78 | 78 | adding manifests |
|
79 | 79 | adding file changes |
|
80 | 80 | added 1 changesets with 1 changes to 1 files |
|
81 | 81 | updating to branch default |
|
82 | 82 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
83 | 83 | |
|
84 | 84 | bad host:port for proxy |
|
85 | 85 | |
|
86 | 86 | $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f |
|
87 | 87 | abort: error: Connection refused |
|
88 | 88 | [255] |
|
89 | 89 | |
|
90 | 90 | do not use the proxy if it is in the no list |
|
91 | 91 | |
|
92 | 92 | $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g |
|
93 | 93 | requesting all changes |
|
94 | 94 | adding changesets |
|
95 | 95 | adding manifests |
|
96 | 96 | adding file changes |
|
97 | 97 | added 1 changesets with 1 changes to 1 files |
|
98 | 98 | updating to branch default |
|
99 | 99 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
100 | 100 | $ cat proxy.log |
|
101 | 101 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
102 | 102 | * - - [*] "GET http://localhost:$HGPORT/?cmd=stream_out HTTP/1.1" - - (glob) |
|
103 | 103 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) |
|
104 | 104 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
105 |
* - - [*] "GET http://localhost:$HGPORT/?cmd= |
|
|
105 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
|
106 | 106 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) |
|
107 | 107 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) |
|
108 | 108 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
109 |
* - - [*] "GET http://localhost:$HGPORT/?cmd= |
|
|
109 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
|
110 | 110 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) |
|
111 | 111 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) |
|
112 | 112 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
113 |
* - - [*] "GET http://localhost:$HGPORT/?cmd= |
|
|
113 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
|
114 | 114 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) |
|
115 | 115 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) |
|
116 | 116 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
117 |
* - - [*] "GET http://localhost:$HGPORT/?cmd= |
|
|
117 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
|
118 | 118 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) |
|
119 | 119 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) |
|
120 | 120 |
@@ -1,720 +1,720 b'' | |||
|
1 | 1 | $ echo "[extensions]" >> $HGRCPATH |
|
2 | 2 | $ echo "graphlog=" >> $HGRCPATH |
|
3 | 3 | |
|
4 | 4 | $ hg init a |
|
5 | 5 | $ cd a |
|
6 | 6 | $ echo foo > t1 |
|
7 | 7 | $ hg add t1 |
|
8 | 8 | $ hg commit -m "1" |
|
9 | 9 | |
|
10 | 10 | $ cd .. |
|
11 | 11 | $ hg clone a b |
|
12 | 12 | updating to branch default |
|
13 | 13 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
14 | 14 | |
|
15 | 15 | $ cd a |
|
16 | 16 | $ echo foo > t2 |
|
17 | 17 | $ hg add t2 |
|
18 | 18 | $ hg commit -m "2" |
|
19 | 19 | |
|
20 | 20 | $ cd ../b |
|
21 | 21 | $ echo foo > t3 |
|
22 | 22 | $ hg add t3 |
|
23 | 23 | $ hg commit -m "3" |
|
24 | 24 | |
|
25 | 25 | $ hg push ../a |
|
26 | 26 | pushing to ../a |
|
27 | 27 | searching for changes |
|
28 | 28 | abort: push creates new remote head 1e108cc5548c! |
|
29 | 29 | (you should pull and merge or use push -f to force) |
|
30 | 30 | [255] |
|
31 | 31 | |
|
32 | 32 | $ hg push --debug ../a |
|
33 | 33 | pushing to ../a |
|
34 | 34 | query 1; heads |
|
35 | 35 | searching for changes |
|
36 | 36 | taking quick initial sample |
|
37 | 37 | searching: 2 queries |
|
38 |
query 2; still undecided: |
|
|
38 | query 2; still undecided: 1, sample size is: 1 | |
|
39 | 39 | 2 total queries |
|
40 | 40 | new remote heads on branch 'default' |
|
41 | 41 | new remote head 1e108cc5548c |
|
42 | 42 | abort: push creates new remote head 1e108cc5548c! |
|
43 | 43 | (you should pull and merge or use push -f to force) |
|
44 | 44 | [255] |
|
45 | 45 | |
|
46 | 46 | $ hg pull ../a |
|
47 | 47 | pulling from ../a |
|
48 | 48 | searching for changes |
|
49 | 49 | adding changesets |
|
50 | 50 | adding manifests |
|
51 | 51 | adding file changes |
|
52 | 52 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
53 | 53 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
54 | 54 | |
|
55 | 55 | $ hg push ../a |
|
56 | 56 | pushing to ../a |
|
57 | 57 | searching for changes |
|
58 | 58 | abort: push creates new remote head 1e108cc5548c! |
|
59 | 59 | (did you forget to merge? use push -f to force) |
|
60 | 60 | [255] |
|
61 | 61 | |
|
62 | 62 | $ hg merge |
|
63 | 63 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
64 | 64 | (branch merge, don't forget to commit) |
|
65 | 65 | |
|
66 | 66 | $ hg commit -m "4" |
|
67 | 67 | $ hg push ../a |
|
68 | 68 | pushing to ../a |
|
69 | 69 | searching for changes |
|
70 | 70 | adding changesets |
|
71 | 71 | adding manifests |
|
72 | 72 | adding file changes |
|
73 | 73 | added 2 changesets with 1 changes to 1 files |
|
74 | 74 | |
|
75 | 75 | $ cd .. |
|
76 | 76 | |
|
77 | 77 | $ hg init c |
|
78 | 78 | $ cd c |
|
79 | 79 | $ for i in 0 1 2; do |
|
80 | 80 | > echo $i >> foo |
|
81 | 81 | > hg ci -Am $i |
|
82 | 82 | > done |
|
83 | 83 | adding foo |
|
84 | 84 | $ cd .. |
|
85 | 85 | |
|
86 | 86 | $ hg clone c d |
|
87 | 87 | updating to branch default |
|
88 | 88 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
89 | 89 | |
|
90 | 90 | $ cd d |
|
91 | 91 | $ for i in 0 1; do |
|
92 | 92 | > hg co -C $i |
|
93 | 93 | > echo d-$i >> foo |
|
94 | 94 | > hg ci -m d-$i |
|
95 | 95 | > done |
|
96 | 96 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
97 | 97 | created new head |
|
98 | 98 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
99 | 99 | created new head |
|
100 | 100 | |
|
101 | 101 | $ HGMERGE=true hg merge 3 |
|
102 | 102 | merging foo |
|
103 | 103 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
104 | 104 | (branch merge, don't forget to commit) |
|
105 | 105 | |
|
106 | 106 | $ hg ci -m c-d |
|
107 | 107 | |
|
108 | 108 | $ hg push ../c |
|
109 | 109 | pushing to ../c |
|
110 | 110 | searching for changes |
|
111 | 111 | abort: push creates new remote head 6346d66eb9f5! |
|
112 | 112 | (did you forget to merge? use push -f to force) |
|
113 | 113 | [255] |
|
114 | 114 | |
|
115 | 115 | $ hg push -r 2 ../c |
|
116 | 116 | pushing to ../c |
|
117 | 117 | searching for changes |
|
118 | 118 | no changes found |
|
119 | 119 | |
|
120 | 120 | $ hg push -r 3 ../c |
|
121 | 121 | pushing to ../c |
|
122 | 122 | searching for changes |
|
123 | 123 | abort: push creates new remote head a5dda829a167! |
|
124 | 124 | (did you forget to merge? use push -f to force) |
|
125 | 125 | [255] |
|
126 | 126 | |
|
127 | 127 | $ hg push -v -r 3 -r 4 ../c |
|
128 | 128 | pushing to ../c |
|
129 | 129 | searching for changes |
|
130 | 130 | all remote heads known locally |
|
131 | 131 | new remote heads on branch 'default' |
|
132 | 132 | new remote head a5dda829a167 |
|
133 | 133 | new remote head ee8fbc7a0295 |
|
134 | 134 | abort: push creates new remote head a5dda829a167! |
|
135 | 135 | (did you forget to merge? use push -f to force) |
|
136 | 136 | [255] |
|
137 | 137 | |
|
138 | 138 | $ hg push -v -f -r 3 -r 4 ../c |
|
139 | 139 | pushing to ../c |
|
140 | 140 | searching for changes |
|
141 | 141 | all remote heads known locally |
|
142 | 142 | 2 changesets found |
|
143 | 143 | adding changesets |
|
144 | 144 | adding manifests |
|
145 | 145 | adding file changes |
|
146 | 146 | added 2 changesets with 2 changes to 1 files (+2 heads) |
|
147 | 147 | |
|
148 | 148 | $ hg push -r 5 ../c |
|
149 | 149 | pushing to ../c |
|
150 | 150 | searching for changes |
|
151 | 151 | adding changesets |
|
152 | 152 | adding manifests |
|
153 | 153 | adding file changes |
|
154 | 154 | added 1 changesets with 1 changes to 1 files (-1 heads) |
|
155 | 155 | |
|
156 | 156 | $ hg in ../c |
|
157 | 157 | comparing with ../c |
|
158 | 158 | searching for changes |
|
159 | 159 | no changes found |
|
160 | 160 | [1] |
|
161 | 161 | |
|
162 | 162 | |
|
163 | 163 | Issue450: push -r warns about remote head creation even if no heads |
|
164 | 164 | will be created |
|
165 | 165 | |
|
166 | 166 | $ hg init ../e |
|
167 | 167 | $ hg push -r 0 ../e |
|
168 | 168 | pushing to ../e |
|
169 | 169 | searching for changes |
|
170 | 170 | adding changesets |
|
171 | 171 | adding manifests |
|
172 | 172 | adding file changes |
|
173 | 173 | added 1 changesets with 1 changes to 1 files |
|
174 | 174 | |
|
175 | 175 | $ hg push -r 1 ../e |
|
176 | 176 | pushing to ../e |
|
177 | 177 | searching for changes |
|
178 | 178 | adding changesets |
|
179 | 179 | adding manifests |
|
180 | 180 | adding file changes |
|
181 | 181 | added 1 changesets with 1 changes to 1 files |
|
182 | 182 | |
|
183 | 183 | $ cd .. |
|
184 | 184 | |
|
185 | 185 | |
|
186 | 186 | Issue736: named branches are not considered for detection of |
|
187 | 187 | unmerged heads in "hg push" |
|
188 | 188 | |
|
189 | 189 | $ hg init f |
|
190 | 190 | $ cd f |
|
191 | 191 | $ hg -q branch a |
|
192 | 192 | $ echo 0 > foo |
|
193 | 193 | $ hg -q ci -Am 0 |
|
194 | 194 | $ echo 1 > foo |
|
195 | 195 | $ hg -q ci -m 1 |
|
196 | 196 | $ hg -q up 0 |
|
197 | 197 | $ echo 2 > foo |
|
198 | 198 | $ hg -q ci -m 2 |
|
199 | 199 | $ hg -q up 0 |
|
200 | 200 | $ hg -q branch b |
|
201 | 201 | $ echo 3 > foo |
|
202 | 202 | $ hg -q ci -m 3 |
|
203 | 203 | $ cd .. |
|
204 | 204 | |
|
205 | 205 | $ hg -q clone f g |
|
206 | 206 | $ cd g |
|
207 | 207 | |
|
208 | 208 | Push on existing branch and new branch: |
|
209 | 209 | |
|
210 | 210 | $ hg -q up 1 |
|
211 | 211 | $ echo 4 > foo |
|
212 | 212 | $ hg -q ci -m 4 |
|
213 | 213 | $ hg -q up 0 |
|
214 | 214 | $ echo 5 > foo |
|
215 | 215 | $ hg -q branch c |
|
216 | 216 | $ hg -q ci -m 5 |
|
217 | 217 | |
|
218 | 218 | $ hg push ../f |
|
219 | 219 | pushing to ../f |
|
220 | 220 | searching for changes |
|
221 | 221 | abort: push creates new remote branches: c! |
|
222 | 222 | (use 'hg push --new-branch' to create new remote branches) |
|
223 | 223 | [255] |
|
224 | 224 | |
|
225 | 225 | $ hg push -r 4 -r 5 ../f |
|
226 | 226 | pushing to ../f |
|
227 | 227 | searching for changes |
|
228 | 228 | abort: push creates new remote branches: c! |
|
229 | 229 | (use 'hg push --new-branch' to create new remote branches) |
|
230 | 230 | [255] |
|
231 | 231 | |
|
232 | 232 | |
|
233 | 233 | Multiple new branches: |
|
234 | 234 | |
|
235 | 235 | $ hg -q branch d |
|
236 | 236 | $ echo 6 > foo |
|
237 | 237 | $ hg -q ci -m 6 |
|
238 | 238 | |
|
239 | 239 | $ hg push ../f |
|
240 | 240 | pushing to ../f |
|
241 | 241 | searching for changes |
|
242 | 242 | abort: push creates new remote branches: c, d! |
|
243 | 243 | (use 'hg push --new-branch' to create new remote branches) |
|
244 | 244 | [255] |
|
245 | 245 | |
|
246 | 246 | $ hg push -r 4 -r 6 ../f |
|
247 | 247 | pushing to ../f |
|
248 | 248 | searching for changes |
|
249 | 249 | abort: push creates new remote branches: c, d! |
|
250 | 250 | (use 'hg push --new-branch' to create new remote branches) |
|
251 | 251 | [255] |
|
252 | 252 | |
|
253 | 253 | $ cd ../g |
|
254 | 254 | |
|
255 | 255 | |
|
256 | 256 | Fail on multiple head push: |
|
257 | 257 | |
|
258 | 258 | $ hg -q up 1 |
|
259 | 259 | $ echo 7 > foo |
|
260 | 260 | $ hg -q ci -m 7 |
|
261 | 261 | |
|
262 | 262 | $ hg push -r 4 -r 7 ../f |
|
263 | 263 | pushing to ../f |
|
264 | 264 | searching for changes |
|
265 | 265 | abort: push creates new remote head 0b715ef6ff8f on branch 'a'! |
|
266 | 266 | (did you forget to merge? use push -f to force) |
|
267 | 267 | [255] |
|
268 | 268 | |
|
269 | 269 | Push replacement head on existing branches: |
|
270 | 270 | |
|
271 | 271 | $ hg -q up 3 |
|
272 | 272 | $ echo 8 > foo |
|
273 | 273 | $ hg -q ci -m 8 |
|
274 | 274 | |
|
275 | 275 | $ hg push -r 7 -r 8 ../f |
|
276 | 276 | pushing to ../f |
|
277 | 277 | searching for changes |
|
278 | 278 | adding changesets |
|
279 | 279 | adding manifests |
|
280 | 280 | adding file changes |
|
281 | 281 | added 2 changesets with 2 changes to 1 files |
|
282 | 282 | |
|
283 | 283 | |
|
284 | 284 | Merge of branch a to other branch b followed by unrelated push |
|
285 | 285 | on branch a: |
|
286 | 286 | |
|
287 | 287 | $ hg -q up 7 |
|
288 | 288 | $ HGMERGE=true hg -q merge 8 |
|
289 | 289 | $ hg -q ci -m 9 |
|
290 | 290 | $ hg -q up 8 |
|
291 | 291 | $ echo 10 > foo |
|
292 | 292 | $ hg -q ci -m 10 |
|
293 | 293 | |
|
294 | 294 | $ hg push -r 9 ../f |
|
295 | 295 | pushing to ../f |
|
296 | 296 | searching for changes |
|
297 | 297 | adding changesets |
|
298 | 298 | adding manifests |
|
299 | 299 | adding file changes |
|
300 | 300 | added 1 changesets with 1 changes to 1 files (-1 heads) |
|
301 | 301 | |
|
302 | 302 | $ hg push -r 10 ../f |
|
303 | 303 | pushing to ../f |
|
304 | 304 | searching for changes |
|
305 | 305 | adding changesets |
|
306 | 306 | adding manifests |
|
307 | 307 | adding file changes |
|
308 | 308 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
309 | 309 | |
|
310 | 310 | |
|
311 | 311 | Cheating the counting algorithm: |
|
312 | 312 | |
|
313 | 313 | $ hg -q up 9 |
|
314 | 314 | $ HGMERGE=true hg -q merge 2 |
|
315 | 315 | $ hg -q ci -m 11 |
|
316 | 316 | $ hg -q up 1 |
|
317 | 317 | $ echo 12 > foo |
|
318 | 318 | $ hg -q ci -m 12 |
|
319 | 319 | |
|
320 | 320 | $ hg push -r 11 -r 12 ../f |
|
321 | 321 | pushing to ../f |
|
322 | 322 | searching for changes |
|
323 | 323 | adding changesets |
|
324 | 324 | adding manifests |
|
325 | 325 | adding file changes |
|
326 | 326 | added 2 changesets with 2 changes to 1 files |
|
327 | 327 | |
|
328 | 328 | |
|
329 | 329 | Failed push of new named branch: |
|
330 | 330 | |
|
331 | 331 | $ echo 12 > foo |
|
332 | 332 | $ hg -q ci -m 12a |
|
333 | 333 | [1] |
|
334 | 334 | $ hg -q up 11 |
|
335 | 335 | $ echo 13 > foo |
|
336 | 336 | $ hg -q branch e |
|
337 | 337 | $ hg -q ci -m 13d |
|
338 | 338 | |
|
339 | 339 | $ hg push -r 12 -r 13 ../f |
|
340 | 340 | pushing to ../f |
|
341 | 341 | searching for changes |
|
342 | 342 | abort: push creates new remote branches: e! |
|
343 | 343 | (use 'hg push --new-branch' to create new remote branches) |
|
344 | 344 | [255] |
|
345 | 345 | |
|
346 | 346 | |
|
347 | 347 | Using --new-branch to push new named branch: |
|
348 | 348 | |
|
349 | 349 | $ hg push --new-branch -r 12 -r 13 ../f |
|
350 | 350 | pushing to ../f |
|
351 | 351 | searching for changes |
|
352 | 352 | adding changesets |
|
353 | 353 | adding manifests |
|
354 | 354 | adding file changes |
|
355 | 355 | added 1 changesets with 1 changes to 1 files |
|
356 | 356 | |
|
357 | 357 | |
|
358 | 358 | Checking prepush logic does not allow silently pushing |
|
359 | 359 | multiple new heads: |
|
360 | 360 | |
|
361 | 361 | $ cd .. |
|
362 | 362 | $ hg init h |
|
363 | 363 | $ echo init > h/init |
|
364 | 364 | $ hg -R h ci -Am init |
|
365 | 365 | adding init |
|
366 | 366 | $ echo a > h/a |
|
367 | 367 | $ hg -R h ci -Am a |
|
368 | 368 | adding a |
|
369 | 369 | $ hg clone h i |
|
370 | 370 | updating to branch default |
|
371 | 371 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
372 | 372 | $ hg -R h up 0 |
|
373 | 373 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
374 | 374 | $ echo b > h/b |
|
375 | 375 | $ hg -R h ci -Am b |
|
376 | 376 | adding b |
|
377 | 377 | created new head |
|
378 | 378 | $ hg -R i up 0 |
|
379 | 379 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
380 | 380 | $ echo c > i/c |
|
381 | 381 | $ hg -R i ci -Am c |
|
382 | 382 | adding c |
|
383 | 383 | created new head |
|
384 | 384 | |
|
385 | 385 | $ hg -R i push h |
|
386 | 386 | pushing to h |
|
387 | 387 | searching for changes |
|
388 | 388 | abort: push creates new remote head 97bd0c84d346! |
|
389 | 389 | (you should pull and merge or use push -f to force) |
|
390 | 390 | [255] |
|
391 | 391 | |
|
392 | 392 | |
|
393 | 393 | Check prepush logic with merged branches: |
|
394 | 394 | |
|
395 | 395 | $ hg init j |
|
396 | 396 | $ hg -R j branch a |
|
397 | 397 | marked working directory as branch a |
|
398 | 398 | $ echo init > j/foo |
|
399 | 399 | $ hg -R j ci -Am init |
|
400 | 400 | adding foo |
|
401 | 401 | $ hg clone j k |
|
402 | 402 | updating to branch a |
|
403 | 403 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
404 | 404 | $ echo a1 > j/foo |
|
405 | 405 | $ hg -R j ci -m a1 |
|
406 | 406 | $ hg -R k branch b |
|
407 | 407 | marked working directory as branch b |
|
408 | 408 | $ echo b > k/foo |
|
409 | 409 | $ hg -R k ci -m b |
|
410 | 410 | $ hg -R k up 0 |
|
411 | 411 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
412 | 412 | |
|
413 | 413 | $ hg -R k merge b |
|
414 | 414 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
415 | 415 | (branch merge, don't forget to commit) |
|
416 | 416 | |
|
417 | 417 | $ hg -R k ci -m merge |
|
418 | 418 | |
|
419 | 419 | $ hg -R k push -r a j |
|
420 | 420 | pushing to j |
|
421 | 421 | searching for changes |
|
422 | 422 | abort: push creates new remote branches: b! |
|
423 | 423 | (use 'hg push --new-branch' to create new remote branches) |
|
424 | 424 | [255] |
|
425 | 425 | |
|
426 | 426 | |
|
427 | 427 | Prepush -r should not allow you to sneak in new heads: |
|
428 | 428 | |
|
429 | 429 | $ hg init l |
|
430 | 430 | $ cd l |
|
431 | 431 | $ echo a >> foo |
|
432 | 432 | $ hg -q add foo |
|
433 | 433 | $ hg -q branch a |
|
434 | 434 | $ hg -q ci -ma |
|
435 | 435 | $ hg -q up null |
|
436 | 436 | $ echo a >> foo |
|
437 | 437 | $ hg -q add foo |
|
438 | 438 | $ hg -q branch b |
|
439 | 439 | $ hg -q ci -mb |
|
440 | 440 | $ cd .. |
|
441 | 441 | $ hg -q clone l m -u a |
|
442 | 442 | $ cd m |
|
443 | 443 | $ hg -q merge b |
|
444 | 444 | $ hg -q ci -mmb |
|
445 | 445 | $ hg -q up 0 |
|
446 | 446 | $ echo a >> foo |
|
447 | 447 | $ hg -q ci -ma2 |
|
448 | 448 | $ hg -q up 2 |
|
449 | 449 | $ echo a >> foo |
|
450 | 450 | $ hg -q branch -f b |
|
451 | 451 | $ hg -q ci -mb2 |
|
452 | 452 | $ hg -q merge 3 |
|
453 | 453 | $ hg -q ci -mma |
|
454 | 454 | |
|
455 | 455 | $ hg push ../l -b b |
|
456 | 456 | pushing to ../l |
|
457 | 457 | searching for changes |
|
458 | 458 | abort: push creates new remote head e7e31d71180f on branch 'a'! |
|
459 | 459 | (did you forget to merge? use push -f to force) |
|
460 | 460 | [255] |
|
461 | 461 | |
|
462 | 462 | $ cd .. |
|
463 | 463 | |
|
464 | 464 | |
|
465 | 465 | Check prepush with new branch head on former topo non-head: |
|
466 | 466 | |
|
467 | 467 | $ hg init n |
|
468 | 468 | $ cd n |
|
469 | 469 | $ hg branch A |
|
470 | 470 | marked working directory as branch A |
|
471 | 471 | $ echo a >a |
|
472 | 472 | $ hg ci -Ama |
|
473 | 473 | adding a |
|
474 | 474 | $ hg branch B |
|
475 | 475 | marked working directory as branch B |
|
476 | 476 | $ echo b >b |
|
477 | 477 | $ hg ci -Amb |
|
478 | 478 | adding b |
|
479 | 479 | |
|
480 | 480 | b is now branch head of B, and a topological head |
|
481 | 481 | a is now branch head of A, but not a topological head |
|
482 | 482 | |
|
483 | 483 | $ hg clone . inner |
|
484 | 484 | updating to branch B |
|
485 | 485 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
486 | 486 | $ cd inner |
|
487 | 487 | $ hg up B |
|
488 | 488 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
489 | 489 | $ echo b1 >b1 |
|
490 | 490 | $ hg ci -Amb1 |
|
491 | 491 | adding b1 |
|
492 | 492 | |
|
493 | 493 | in the clone b1 is now the head of B |
|
494 | 494 | |
|
495 | 495 | $ cd .. |
|
496 | 496 | $ hg up 0 |
|
497 | 497 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
498 | 498 | $ echo a2 >a2 |
|
499 | 499 | $ hg ci -Ama2 |
|
500 | 500 | adding a2 |
|
501 | 501 | |
|
502 | 502 | a2 is now the new branch head of A, and a new topological head |
|
503 | 503 | it replaces a former inner branch head, so it should at most warn about |
|
504 | 504 | A, not B |
|
505 | 505 | |
|
506 | 506 | glog of local: |
|
507 | 507 | |
|
508 | 508 | $ hg glog --template "{rev}: {branches} {desc}\n" |
|
509 | 509 | @ 2: A a2 |
|
510 | 510 | | |
|
511 | 511 | | o 1: B b |
|
512 | 512 | |/ |
|
513 | 513 | o 0: A a |
|
514 | 514 | |
|
515 | 515 | glog of remote: |
|
516 | 516 | |
|
517 | 517 | $ hg glog -R inner --template "{rev}: {branches} {desc}\n" |
|
518 | 518 | @ 2: B b1 |
|
519 | 519 | | |
|
520 | 520 | o 1: B b |
|
521 | 521 | | |
|
522 | 522 | o 0: A a |
|
523 | 523 | |
|
524 | 524 | outgoing: |
|
525 | 525 | |
|
526 | 526 | $ hg out inner --template "{rev}: {branches} {desc}\n" |
|
527 | 527 | comparing with inner |
|
528 | 528 | searching for changes |
|
529 | 529 | 2: A a2 |
|
530 | 530 | |
|
531 | 531 | $ hg push inner |
|
532 | 532 | pushing to inner |
|
533 | 533 | searching for changes |
|
534 | 534 | adding changesets |
|
535 | 535 | adding manifests |
|
536 | 536 | adding file changes |
|
537 | 537 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
538 | 538 | |
|
539 | 539 | $ cd .. |
|
540 | 540 | |
|
541 | 541 | |
|
542 | 542 | Check prepush with new branch head on former topo head: |
|
543 | 543 | |
|
544 | 544 | $ hg init o |
|
545 | 545 | $ cd o |
|
546 | 546 | $ hg branch A |
|
547 | 547 | marked working directory as branch A |
|
548 | 548 | $ echo a >a |
|
549 | 549 | $ hg ci -Ama |
|
550 | 550 | adding a |
|
551 | 551 | $ hg branch B |
|
552 | 552 | marked working directory as branch B |
|
553 | 553 | $ echo b >b |
|
554 | 554 | $ hg ci -Amb |
|
555 | 555 | adding b |
|
556 | 556 | |
|
557 | 557 | b is now branch head of B, and a topological head |
|
558 | 558 | |
|
559 | 559 | $ hg up 0 |
|
560 | 560 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
561 | 561 | $ echo a1 >a1 |
|
562 | 562 | $ hg ci -Ama1 |
|
563 | 563 | adding a1 |
|
564 | 564 | |
|
565 | 565 | a1 is now branch head of A, and a topological head |
|
566 | 566 | |
|
567 | 567 | $ hg clone . inner |
|
568 | 568 | updating to branch A |
|
569 | 569 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
570 | 570 | $ cd inner |
|
571 | 571 | $ hg up B |
|
572 | 572 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
573 | 573 | $ echo b1 >b1 |
|
574 | 574 | $ hg ci -Amb1 |
|
575 | 575 | adding b1 |
|
576 | 576 | |
|
577 | 577 | in the clone b1 is now the head of B |
|
578 | 578 | |
|
579 | 579 | $ cd .. |
|
580 | 580 | $ echo a2 >a2 |
|
581 | 581 | $ hg ci -Ama2 |
|
582 | 582 | adding a2 |
|
583 | 583 | |
|
584 | 584 | a2 is now the new branch head of A, and a topological head |
|
585 | 585 | it replaces a former topological and branch head, so this should not warn |
|
586 | 586 | |
|
587 | 587 | glog of local: |
|
588 | 588 | |
|
589 | 589 | $ hg glog --template "{rev}: {branches} {desc}\n" |
|
590 | 590 | @ 3: A a2 |
|
591 | 591 | | |
|
592 | 592 | o 2: A a1 |
|
593 | 593 | | |
|
594 | 594 | | o 1: B b |
|
595 | 595 | |/ |
|
596 | 596 | o 0: A a |
|
597 | 597 | |
|
598 | 598 | glog of remote: |
|
599 | 599 | |
|
600 | 600 | $ hg glog -R inner --template "{rev}: {branches} {desc}\n" |
|
601 | 601 | @ 3: B b1 |
|
602 | 602 | | |
|
603 | 603 | | o 2: A a1 |
|
604 | 604 | | | |
|
605 | 605 | o | 1: B b |
|
606 | 606 | |/ |
|
607 | 607 | o 0: A a |
|
608 | 608 | |
|
609 | 609 | outgoing: |
|
610 | 610 | |
|
611 | 611 | $ hg out inner --template "{rev}: {branches} {desc}\n" |
|
612 | 612 | comparing with inner |
|
613 | 613 | searching for changes |
|
614 | 614 | 3: A a2 |
|
615 | 615 | |
|
616 | 616 | $ hg push inner |
|
617 | 617 | pushing to inner |
|
618 | 618 | searching for changes |
|
619 | 619 | adding changesets |
|
620 | 620 | adding manifests |
|
621 | 621 | adding file changes |
|
622 | 622 | added 1 changesets with 1 changes to 1 files |
|
623 | 623 | |
|
624 | 624 | $ cd .. |
|
625 | 625 | |
|
626 | 626 | |
|
627 | 627 | Check prepush with new branch head and new child of former branch head |
|
628 | 628 | but child is on different branch: |
|
629 | 629 | |
|
630 | 630 | $ hg init p |
|
631 | 631 | $ cd p |
|
632 | 632 | $ hg branch A |
|
633 | 633 | marked working directory as branch A |
|
634 | 634 | $ echo a0 >a |
|
635 | 635 | $ hg ci -Ama0 |
|
636 | 636 | adding a |
|
637 | 637 | $ echo a1 >a |
|
638 | 638 | $ hg ci -ma1 |
|
639 | 639 | $ hg up null |
|
640 | 640 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
641 | 641 | $ hg branch B |
|
642 | 642 | marked working directory as branch B |
|
643 | 643 | $ echo b0 >b |
|
644 | 644 | $ hg ci -Amb0 |
|
645 | 645 | adding b |
|
646 | 646 | $ echo b1 >b |
|
647 | 647 | $ hg ci -mb1 |
|
648 | 648 | |
|
649 | 649 | $ hg clone . inner |
|
650 | 650 | updating to branch B |
|
651 | 651 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
652 | 652 | |
|
653 | 653 | $ hg up A |
|
654 | 654 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
655 | 655 | $ hg branch -f B |
|
656 | 656 | marked working directory as branch B |
|
657 | 657 | $ echo a3 >a |
|
658 | 658 | $ hg ci -ma3 |
|
659 | 659 | created new head |
|
660 | 660 | $ hg up 3 |
|
661 | 661 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
662 | 662 | $ hg branch -f A |
|
663 | 663 | marked working directory as branch A |
|
664 | 664 | $ echo b3 >b |
|
665 | 665 | $ hg ci -mb3 |
|
666 | 666 | created new head |
|
667 | 667 | |
|
668 | 668 | glog of local: |
|
669 | 669 | |
|
670 | 670 | $ hg glog --template "{rev}: {branches} {desc}\n" |
|
671 | 671 | @ 5: A b3 |
|
672 | 672 | | |
|
673 | 673 | | o 4: B a3 |
|
674 | 674 | | | |
|
675 | 675 | o | 3: B b1 |
|
676 | 676 | | | |
|
677 | 677 | o | 2: B b0 |
|
678 | 678 | / |
|
679 | 679 | o 1: A a1 |
|
680 | 680 | | |
|
681 | 681 | o 0: A a0 |
|
682 | 682 | |
|
683 | 683 | glog of remote: |
|
684 | 684 | |
|
685 | 685 | $ hg glog -R inner --template "{rev}: {branches} {desc}\n" |
|
686 | 686 | @ 3: B b1 |
|
687 | 687 | | |
|
688 | 688 | o 2: B b0 |
|
689 | 689 | |
|
690 | 690 | o 1: A a1 |
|
691 | 691 | | |
|
692 | 692 | o 0: A a0 |
|
693 | 693 | |
|
694 | 694 | outgoing: |
|
695 | 695 | |
|
696 | 696 | $ hg out inner --template "{rev}: {branches} {desc}\n" |
|
697 | 697 | comparing with inner |
|
698 | 698 | searching for changes |
|
699 | 699 | 4: B a3 |
|
700 | 700 | 5: A b3 |
|
701 | 701 | |
|
702 | 702 | $ hg push inner |
|
703 | 703 | pushing to inner |
|
704 | 704 | searching for changes |
|
705 | 705 | abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'! |
|
706 | 706 | (did you forget to merge? use push -f to force) |
|
707 | 707 | [255] |
|
708 | 708 | |
|
709 | 709 | $ hg push inner -r4 -r5 |
|
710 | 710 | pushing to inner |
|
711 | 711 | searching for changes |
|
712 | 712 | abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'! |
|
713 | 713 | (did you forget to merge? use push -f to force) |
|
714 | 714 | [255] |
|
715 | 715 | |
|
716 | 716 | $ hg in inner |
|
717 | 717 | comparing with inner |
|
718 | 718 | searching for changes |
|
719 | 719 | no changes found |
|
720 | 720 | [1] |
@@ -1,47 +1,47 b'' | |||
|
1 | 1 | |
|
2 | 2 | $ cat <<EOF >> $HGRCPATH |
|
3 | 3 | > [extensions] |
|
4 | 4 | > schemes= |
|
5 | 5 | > |
|
6 | 6 | > [schemes] |
|
7 | 7 | > l = http://localhost:$HGPORT/ |
|
8 | 8 | > parts = http://{1}:$HGPORT/ |
|
9 | 9 | > z = file:\$PWD/ |
|
10 | 10 | > EOF |
|
11 | 11 | $ hg init test |
|
12 | 12 | $ cd test |
|
13 | 13 | $ echo a > a |
|
14 | 14 | $ hg ci -Am initial |
|
15 | 15 | adding a |
|
16 | 16 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
17 | 17 | $ cat hg.pid >> $DAEMON_PIDS |
|
18 | 18 | $ hg incoming l:// |
|
19 | 19 | comparing with l:// |
|
20 | 20 | searching for changes |
|
21 | 21 | no changes found |
|
22 | 22 | [1] |
|
23 | 23 | |
|
24 | 24 | check that {1} syntax works |
|
25 | 25 | |
|
26 | 26 | $ hg incoming --debug parts://localhost |
|
27 | 27 | using http://localhost:$HGPORT/ |
|
28 | 28 | sending capabilities command |
|
29 | 29 | comparing with parts://localhost/ |
|
30 | 30 | query 1; heads |
|
31 |
sending |
|
|
31 | sending batch command | |
|
32 | 32 | searching for changes |
|
33 | 33 | all remote heads known locally |
|
34 | 34 | no changes found |
|
35 | 35 | [1] |
|
36 | 36 | |
|
37 | 37 | check that paths are expanded |
|
38 | 38 | |
|
39 | 39 | $ PWD=`pwd` hg incoming z:// |
|
40 | 40 | comparing with z:// |
|
41 | 41 | searching for changes |
|
42 | 42 | no changes found |
|
43 | 43 | [1] |
|
44 | 44 | |
|
45 | 45 | errors |
|
46 | 46 | |
|
47 | 47 | $ cat errors.log |
@@ -1,271 +1,268 b'' | |||
|
1 | 1 | |
|
2 | 2 | Function to test discovery between two repos in both directions, using both the local shortcut |
|
3 | 3 | (which is currently not activated by default) and the full remotable protocol: |
|
4 | 4 | |
|
5 | 5 | $ testdesc() { # revs_a, revs_b, dagdesc |
|
6 | 6 | > if [ -e foo ]; then rm -rf foo; fi |
|
7 | 7 | > hg init foo |
|
8 | 8 | > cd foo |
|
9 | 9 | > hg debugbuilddag "$3" |
|
10 | 10 | > hg clone . a $1 --quiet |
|
11 | 11 | > hg clone . b $2 --quiet |
|
12 | 12 | > echo |
|
13 | 13 | > echo "% -- a -> b tree" |
|
14 | 14 | > hg -R a debugdiscovery b --verbose --old |
|
15 | 15 | > echo |
|
16 | 16 | > echo "% -- a -> b set" |
|
17 | 17 | > hg -R a debugdiscovery b --verbose --debug |
|
18 | 18 | > echo |
|
19 | 19 | > echo "% -- b -> a tree" |
|
20 | 20 | > hg -R b debugdiscovery a --verbose --old |
|
21 | 21 | > echo |
|
22 | 22 | > echo "% -- b -> a set" |
|
23 | 23 | > hg -R b debugdiscovery a --verbose --debug |
|
24 | 24 | > cd .. |
|
25 | 25 | > } |
|
26 | 26 | |
|
27 | 27 | |
|
28 | 28 | Small superset: |
|
29 | 29 | |
|
30 | 30 | $ testdesc '-ra1 -ra2' '-rb1 -rb2 -rb3' ' |
|
31 | 31 | > +2:f +1:a1:b1 |
|
32 | 32 | > <f +4 :a2 |
|
33 | 33 | > +5 :b2 |
|
34 | 34 | > <f +3 :b3' |
|
35 | 35 | |
|
36 | 36 | % -- a -> b tree |
|
37 | 37 | comparing with b |
|
38 | 38 | searching for changes |
|
39 | 39 | unpruned common: b5714e113bc0 66f7d451a68b 01241442b3c2 |
|
40 | 40 | common heads: b5714e113bc0 01241442b3c2 |
|
41 | 41 | local is subset |
|
42 | 42 | |
|
43 | 43 | % -- a -> b set |
|
44 | 44 | comparing with b |
|
45 | 45 | query 1; heads |
|
46 | 46 | searching for changes |
|
47 | taking initial sample | |
|
48 | searching: 2 queries | |
|
49 | query 2; still undecided: 4, sample size is: 4 | |
|
50 | 2 total queries | |
|
47 | all local heads known remotely | |
|
51 | 48 | common heads: b5714e113bc0 01241442b3c2 |
|
52 | 49 | local is subset |
|
53 | 50 | |
|
54 | 51 | % -- b -> a tree |
|
55 | 52 | comparing with a |
|
56 | 53 | searching for changes |
|
57 | 54 | unpruned common: b5714e113bc0 01241442b3c2 |
|
58 | 55 | common heads: b5714e113bc0 01241442b3c2 |
|
59 | 56 | remote is subset |
|
60 | 57 | |
|
61 | 58 | % -- b -> a set |
|
62 | 59 | comparing with a |
|
63 | 60 | query 1; heads |
|
64 | 61 | searching for changes |
|
65 | 62 | all remote heads known locally |
|
66 | 63 | common heads: b5714e113bc0 01241442b3c2 |
|
67 | 64 | remote is subset |
|
68 | 65 | |
|
69 | 66 | |
|
70 | 67 | Many new: |
|
71 | 68 | |
|
72 | 69 | $ testdesc '-ra1 -ra2' '-rb' ' |
|
73 | 70 | > +2:f +3:a1 +3:b |
|
74 | 71 | > <f +30 :a2' |
|
75 | 72 | |
|
76 | 73 | % -- a -> b tree |
|
77 | 74 | comparing with b |
|
78 | 75 | searching for changes |
|
79 | 76 | unpruned common: bebd167eb94d |
|
80 | 77 | common heads: bebd167eb94d |
|
81 | 78 | |
|
82 | 79 | % -- a -> b set |
|
83 | 80 | comparing with b |
|
84 | 81 | query 1; heads |
|
85 | 82 | searching for changes |
|
86 |
taking |
|
|
83 | taking initial sample | |
|
87 | 84 | searching: 2 queries |
|
88 |
query 2; still undecided: |
|
|
85 | query 2; still undecided: 29, sample size is: 29 | |
|
89 | 86 | 2 total queries |
|
90 | 87 | common heads: bebd167eb94d |
|
91 | 88 | |
|
92 | 89 | % -- b -> a tree |
|
93 | 90 | comparing with a |
|
94 | 91 | searching for changes |
|
95 | 92 | unpruned common: bebd167eb94d 66f7d451a68b |
|
96 | 93 | common heads: bebd167eb94d |
|
97 | 94 | |
|
98 | 95 | % -- b -> a set |
|
99 | 96 | comparing with a |
|
100 | 97 | query 1; heads |
|
101 | 98 | searching for changes |
|
102 | 99 | taking initial sample |
|
103 | 100 | searching: 2 queries |
|
104 |
query 2; |
|
|
101 | query 2; still undecided: 2, sample size is: 2 | |
|
105 | 102 | 2 total queries |
|
106 | 103 | common heads: bebd167eb94d |
|
107 | 104 | |
|
108 | 105 | |
|
109 | 106 | Both sides many new with stub: |
|
110 | 107 | |
|
111 | 108 | $ testdesc '-ra1 -ra2' '-rb' ' |
|
112 | 109 | > +2:f +2:a1 +30 :b |
|
113 | 110 | > <f +30 :a2' |
|
114 | 111 | |
|
115 | 112 | % -- a -> b tree |
|
116 | 113 | comparing with b |
|
117 | 114 | searching for changes |
|
118 | 115 | unpruned common: 2dc09a01254d |
|
119 | 116 | common heads: 2dc09a01254d |
|
120 | 117 | |
|
121 | 118 | % -- a -> b set |
|
122 | 119 | comparing with b |
|
123 | 120 | query 1; heads |
|
124 | 121 | searching for changes |
|
125 |
taking |
|
|
122 | taking initial sample | |
|
126 | 123 | searching: 2 queries |
|
127 |
query 2; still undecided: |
|
|
124 | query 2; still undecided: 29, sample size is: 29 | |
|
128 | 125 | 2 total queries |
|
129 | 126 | common heads: 2dc09a01254d |
|
130 | 127 | |
|
131 | 128 | % -- b -> a tree |
|
132 | 129 | comparing with a |
|
133 | 130 | searching for changes |
|
134 | 131 | unpruned common: 66f7d451a68b 2dc09a01254d |
|
135 | 132 | common heads: 2dc09a01254d |
|
136 | 133 | |
|
137 | 134 | % -- b -> a set |
|
138 | 135 | comparing with a |
|
139 | 136 | query 1; heads |
|
140 | 137 | searching for changes |
|
141 | 138 | taking initial sample |
|
142 | 139 | searching: 2 queries |
|
143 |
query 2; |
|
|
140 | query 2; still undecided: 29, sample size is: 29 | |
|
144 | 141 | 2 total queries |
|
145 | 142 | common heads: 2dc09a01254d |
|
146 | 143 | |
|
147 | 144 | |
|
148 | 145 | Both many new: |
|
149 | 146 | |
|
150 | 147 | $ testdesc '-ra' '-rb' ' |
|
151 | 148 | > +2:f +30 :b |
|
152 | 149 | > <f +30 :a' |
|
153 | 150 | |
|
154 | 151 | % -- a -> b tree |
|
155 | 152 | comparing with b |
|
156 | 153 | searching for changes |
|
157 | 154 | unpruned common: 66f7d451a68b |
|
158 | 155 | common heads: 66f7d451a68b |
|
159 | 156 | |
|
160 | 157 | % -- a -> b set |
|
161 | 158 | comparing with b |
|
162 | 159 | query 1; heads |
|
163 | 160 | searching for changes |
|
164 | 161 | taking quick initial sample |
|
165 | 162 | searching: 2 queries |
|
166 |
query 2; still undecided: 3 |
|
|
163 | query 2; still undecided: 31, sample size is: 31 | |
|
167 | 164 | 2 total queries |
|
168 | 165 | common heads: 66f7d451a68b |
|
169 | 166 | |
|
170 | 167 | % -- b -> a tree |
|
171 | 168 | comparing with a |
|
172 | 169 | searching for changes |
|
173 | 170 | unpruned common: 66f7d451a68b |
|
174 | 171 | common heads: 66f7d451a68b |
|
175 | 172 | |
|
176 | 173 | % -- b -> a set |
|
177 | 174 | comparing with a |
|
178 | 175 | query 1; heads |
|
179 | 176 | searching for changes |
|
180 | 177 | taking quick initial sample |
|
181 | 178 | searching: 2 queries |
|
182 |
query 2; still undecided: 3 |
|
|
179 | query 2; still undecided: 31, sample size is: 31 | |
|
183 | 180 | 2 total queries |
|
184 | 181 | common heads: 66f7d451a68b |
|
185 | 182 | |
|
186 | 183 | |
|
187 | 184 | Both many new skewed: |
|
188 | 185 | |
|
189 | 186 | $ testdesc '-ra' '-rb' ' |
|
190 | 187 | > +2:f +30 :b |
|
191 | 188 | > <f +50 :a' |
|
192 | 189 | |
|
193 | 190 | % -- a -> b tree |
|
194 | 191 | comparing with b |
|
195 | 192 | searching for changes |
|
196 | 193 | unpruned common: 66f7d451a68b |
|
197 | 194 | common heads: 66f7d451a68b |
|
198 | 195 | |
|
199 | 196 | % -- a -> b set |
|
200 | 197 | comparing with b |
|
201 | 198 | query 1; heads |
|
202 | 199 | searching for changes |
|
203 | 200 | taking quick initial sample |
|
204 | 201 | searching: 2 queries |
|
205 |
query 2; still undecided: 5 |
|
|
202 | query 2; still undecided: 51, sample size is: 51 | |
|
206 | 203 | 2 total queries |
|
207 | 204 | common heads: 66f7d451a68b |
|
208 | 205 | |
|
209 | 206 | % -- b -> a tree |
|
210 | 207 | comparing with a |
|
211 | 208 | searching for changes |
|
212 | 209 | unpruned common: 66f7d451a68b |
|
213 | 210 | common heads: 66f7d451a68b |
|
214 | 211 | |
|
215 | 212 | % -- b -> a set |
|
216 | 213 | comparing with a |
|
217 | 214 | query 1; heads |
|
218 | 215 | searching for changes |
|
219 | 216 | taking quick initial sample |
|
220 | 217 | searching: 2 queries |
|
221 |
query 2; still undecided: 3 |
|
|
218 | query 2; still undecided: 31, sample size is: 31 | |
|
222 | 219 | 2 total queries |
|
223 | 220 | common heads: 66f7d451a68b |
|
224 | 221 | |
|
225 | 222 | |
|
226 | 223 | Both many new on top of long history: |
|
227 | 224 | |
|
228 | 225 | $ testdesc '-ra' '-rb' ' |
|
229 | 226 | > +1000:f +30 :b |
|
230 | 227 | > <f +50 :a' |
|
231 | 228 | |
|
232 | 229 | % -- a -> b tree |
|
233 | 230 | comparing with b |
|
234 | 231 | searching for changes |
|
235 | 232 | unpruned common: 7ead0cba2838 |
|
236 | 233 | common heads: 7ead0cba2838 |
|
237 | 234 | |
|
238 | 235 | % -- a -> b set |
|
239 | 236 | comparing with b |
|
240 | 237 | query 1; heads |
|
241 | 238 | searching for changes |
|
242 | 239 | taking quick initial sample |
|
243 | 240 | searching: 2 queries |
|
244 |
query 2; still undecided: 10 |
|
|
241 | query 2; still undecided: 1049, sample size is: 11 | |
|
245 | 242 | sampling from both directions |
|
246 | 243 | searching: 3 queries |
|
247 | 244 | query 3; still undecided: 31, sample size is: 31 |
|
248 | 245 | 3 total queries |
|
249 | 246 | common heads: 7ead0cba2838 |
|
250 | 247 | |
|
251 | 248 | % -- b -> a tree |
|
252 | 249 | comparing with a |
|
253 | 250 | searching for changes |
|
254 | 251 | unpruned common: 7ead0cba2838 |
|
255 | 252 | common heads: 7ead0cba2838 |
|
256 | 253 | |
|
257 | 254 | % -- b -> a set |
|
258 | 255 | comparing with a |
|
259 | 256 | query 1; heads |
|
260 | 257 | searching for changes |
|
261 | 258 | taking quick initial sample |
|
262 | 259 | searching: 2 queries |
|
263 |
query 2; still undecided: 10 |
|
|
260 | query 2; still undecided: 1029, sample size is: 11 | |
|
264 | 261 | sampling from both directions |
|
265 | 262 | searching: 3 queries |
|
266 | 263 | query 3; still undecided: 16, sample size is: 16 |
|
267 | 264 | 3 total queries |
|
268 | 265 | common heads: 7ead0cba2838 |
|
269 | 266 | |
|
270 | 267 | |
|
271 | 268 |
General Comments 0
You need to be logged in to leave comments.
Login now