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