##// END OF EJS Templates
prepush: show details about new remote heads with --verbose...
Adrian Buehlmann -
r14526:4276e320 default
parent child Browse files
Show More
@@ -1,191 +1,191 b''
1 # discovery.py - protocol changeset discovery functions
1 # discovery.py - protocol changeset discovery functions
2 #
2 #
3 # Copyright 2010 Matt Mackall <mpm@selenic.com>
3 # Copyright 2010 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from node import nullid, short
8 from node import nullid, short
9 from i18n import _
9 from i18n import _
10 import util, setdiscovery, treediscovery
10 import util, setdiscovery, treediscovery
11
11
12 def findcommonincoming(repo, remote, heads=None, force=False):
12 def findcommonincoming(repo, remote, heads=None, force=False):
13 """Return a tuple (common, anyincoming, heads) used to identify the common
13 """Return a tuple (common, anyincoming, heads) used to identify the common
14 subset of nodes between repo and remote.
14 subset of nodes between repo and remote.
15
15
16 "common" is a list of (at least) the heads of the common subset.
16 "common" is a list of (at least) the heads of the common subset.
17 "anyincoming" is testable as a boolean indicating if any nodes are missing
17 "anyincoming" is testable as a boolean indicating if any nodes are missing
18 locally. If remote does not support getbundle, this actually is a list of
18 locally. If remote does not support getbundle, this actually is a list of
19 roots of the nodes that would be incoming, to be supplied to
19 roots of the nodes that would be incoming, to be supplied to
20 changegroupsubset. No code except for pull should be relying on this fact
20 changegroupsubset. No code except for pull should be relying on this fact
21 any longer.
21 any longer.
22 "heads" is either the supplied heads, or else the remote's heads.
22 "heads" is either the supplied heads, or else the remote's heads.
23
23
24 If you pass heads and they are all known locally, the reponse lists justs
24 If you pass heads and they are all known locally, the reponse lists justs
25 these heads in "common" and in "heads".
25 these heads in "common" and in "heads".
26
26
27 Please use findcommonoutgoing to compute the set of outgoing nodes to give
27 Please use findcommonoutgoing to compute the set of outgoing nodes to give
28 extensions a good hook into outgoing.
28 extensions a good hook into outgoing.
29 """
29 """
30
30
31 if not remote.capable('getbundle'):
31 if not remote.capable('getbundle'):
32 return treediscovery.findcommonincoming(repo, remote, heads, force)
32 return treediscovery.findcommonincoming(repo, remote, heads, force)
33
33
34 if heads:
34 if heads:
35 allknown = True
35 allknown = True
36 nm = repo.changelog.nodemap
36 nm = repo.changelog.nodemap
37 for h in heads:
37 for h in heads:
38 if nm.get(h) is None:
38 if nm.get(h) is None:
39 allknown = False
39 allknown = False
40 break
40 break
41 if allknown:
41 if allknown:
42 return (heads, False, heads)
42 return (heads, False, heads)
43
43
44 res = setdiscovery.findcommonheads(repo.ui, repo, remote,
44 res = setdiscovery.findcommonheads(repo.ui, repo, remote,
45 abortwhenunrelated=not force)
45 abortwhenunrelated=not force)
46 common, anyinc, srvheads = res
46 common, anyinc, srvheads = res
47 return (list(common), anyinc, heads or list(srvheads))
47 return (list(common), anyinc, heads or list(srvheads))
48
48
49 def findcommonoutgoing(repo, other, onlyheads=None, force=False, commoninc=None):
49 def findcommonoutgoing(repo, other, onlyheads=None, force=False, commoninc=None):
50 '''Return a tuple (common, anyoutgoing, heads) used to identify the set
50 '''Return a tuple (common, anyoutgoing, heads) used to identify the set
51 of nodes present in repo but not in other.
51 of nodes present in repo but not in other.
52
52
53 If onlyheads is given, only nodes ancestral to nodes in onlyheads (inclusive)
53 If onlyheads is given, only nodes ancestral to nodes in onlyheads (inclusive)
54 are included. If you already know the local repo's heads, passing them in
54 are included. If you already know the local repo's heads, passing them in
55 onlyheads is faster than letting them be recomputed here.
55 onlyheads is faster than letting them be recomputed here.
56
56
57 If commoninc is given, it must the the result of a prior call to
57 If commoninc is given, it must the the result of a prior call to
58 findcommonincoming(repo, other, force) to avoid recomputing it here.
58 findcommonincoming(repo, other, force) to avoid recomputing it here.
59
59
60 The returned tuple is meant to be passed to changelog.findmissing.'''
60 The returned tuple is meant to be passed to changelog.findmissing.'''
61 common, _any, _hds = commoninc or findcommonincoming(repo, other, force=force)
61 common, _any, _hds = commoninc or findcommonincoming(repo, other, force=force)
62 return (common, onlyheads or repo.heads())
62 return (common, onlyheads or repo.heads())
63
63
64 def prepush(repo, remote, force, revs, newbranch):
64 def prepush(repo, remote, force, revs, newbranch):
65 '''Analyze the local and remote repositories and determine which
65 '''Analyze the local and remote repositories and determine which
66 changesets need to be pushed to the remote. Return value depends
66 changesets need to be pushed to the remote. Return value depends
67 on circumstances:
67 on circumstances:
68
68
69 If we are not going to push anything, return a tuple (None,
69 If we are not going to push anything, return a tuple (None,
70 outgoing) where outgoing is 0 if there are no outgoing
70 outgoing) where outgoing is 0 if there are no outgoing
71 changesets and 1 if there are, but we refuse to push them
71 changesets and 1 if there are, but we refuse to push them
72 (e.g. would create new remote heads).
72 (e.g. would create new remote heads).
73
73
74 Otherwise, return a tuple (changegroup, remoteheads), where
74 Otherwise, return a tuple (changegroup, remoteheads), where
75 changegroup is a readable file-like object whose read() returns
75 changegroup is a readable file-like object whose read() returns
76 successive changegroup chunks ready to be sent over the wire and
76 successive changegroup chunks ready to be sent over the wire and
77 remoteheads is the list of remote heads.'''
77 remoteheads is the list of remote heads.'''
78 commoninc = findcommonincoming(repo, remote, force=force)
78 commoninc = findcommonincoming(repo, remote, force=force)
79 common, revs = findcommonoutgoing(repo, remote, onlyheads=revs,
79 common, revs = findcommonoutgoing(repo, remote, onlyheads=revs,
80 commoninc=commoninc, force=force)
80 commoninc=commoninc, force=force)
81 _common, inc, remoteheads = commoninc
81 _common, inc, remoteheads = commoninc
82
82
83 cl = repo.changelog
83 cl = repo.changelog
84 outg = cl.findmissing(common, revs)
84 outg = cl.findmissing(common, revs)
85
85
86 if not outg:
86 if not outg:
87 repo.ui.status(_("no changes found\n"))
87 repo.ui.status(_("no changes found\n"))
88 return None, 1
88 return None, 1
89
89
90 if not force and remoteheads != [nullid]:
90 if not force and remoteheads != [nullid]:
91 if remote.capable('branchmap'):
91 if remote.capable('branchmap'):
92 # Check for each named branch if we're creating new remote heads.
92 # Check for each named branch if we're creating new remote heads.
93 # To be a remote head after push, node must be either:
93 # To be a remote head after push, node must be either:
94 # - unknown locally
94 # - unknown locally
95 # - a local outgoing head descended from update
95 # - a local outgoing head descended from update
96 # - a remote head that's known locally and not
96 # - a remote head that's known locally and not
97 # ancestral to an outgoing head
97 # ancestral to an outgoing head
98
98
99 # 1. Create set of branches involved in the push.
99 # 1. Create set of branches involved in the push.
100 branches = set(repo[n].branch() for n in outg)
100 branches = set(repo[n].branch() for n in outg)
101
101
102 # 2. Check for new branches on the remote.
102 # 2. Check for new branches on the remote.
103 remotemap = remote.branchmap()
103 remotemap = remote.branchmap()
104 newbranches = branches - set(remotemap)
104 newbranches = branches - set(remotemap)
105 if newbranches and not newbranch: # new branch requires --new-branch
105 if newbranches and not newbranch: # new branch requires --new-branch
106 branchnames = ', '.join(sorted(newbranches))
106 branchnames = ', '.join(sorted(newbranches))
107 raise util.Abort(_("push creates new remote branches: %s!")
107 raise util.Abort(_("push creates new remote branches: %s!")
108 % branchnames,
108 % branchnames,
109 hint=_("use 'hg push --new-branch' to create"
109 hint=_("use 'hg push --new-branch' to create"
110 " new remote branches"))
110 " new remote branches"))
111 branches.difference_update(newbranches)
111 branches.difference_update(newbranches)
112
112
113 # 3. Construct the initial oldmap and newmap dicts.
113 # 3. Construct the initial oldmap and newmap dicts.
114 # They contain information about the remote heads before and
114 # They contain information about the remote heads before and
115 # after the push, respectively.
115 # after the push, respectively.
116 # Heads not found locally are not included in either dict,
116 # Heads not found locally are not included in either dict,
117 # since they won't be affected by the push.
117 # since they won't be affected by the push.
118 # unsynced contains all branches with incoming changesets.
118 # unsynced contains all branches with incoming changesets.
119 oldmap = {}
119 oldmap = {}
120 newmap = {}
120 newmap = {}
121 unsynced = set()
121 unsynced = set()
122 for branch in branches:
122 for branch in branches:
123 remotebrheads = remotemap[branch]
123 remotebrheads = remotemap[branch]
124 prunedbrheads = [h for h in remotebrheads if h in cl.nodemap]
124 prunedbrheads = [h for h in remotebrheads if h in cl.nodemap]
125 oldmap[branch] = prunedbrheads
125 oldmap[branch] = prunedbrheads
126 newmap[branch] = list(prunedbrheads)
126 newmap[branch] = list(prunedbrheads)
127 if len(remotebrheads) > len(prunedbrheads):
127 if len(remotebrheads) > len(prunedbrheads):
128 unsynced.add(branch)
128 unsynced.add(branch)
129
129
130 # 4. Update newmap with outgoing changes.
130 # 4. Update newmap with outgoing changes.
131 # This will possibly add new heads and remove existing ones.
131 # This will possibly add new heads and remove existing ones.
132 ctxgen = (repo[n] for n in outg)
132 ctxgen = (repo[n] for n in outg)
133 repo._updatebranchcache(newmap, ctxgen)
133 repo._updatebranchcache(newmap, ctxgen)
134
134
135 else:
135 else:
136 # 1-4b. old servers: Check for new topological heads.
136 # 1-4b. old servers: Check for new topological heads.
137 # Construct {old,new}map with branch = None (topological branch).
137 # Construct {old,new}map with branch = None (topological branch).
138 # (code based on _updatebranchcache)
138 # (code based on _updatebranchcache)
139 oldheads = set(h for h in remoteheads if h in cl.nodemap)
139 oldheads = set(h for h in remoteheads if h in cl.nodemap)
140 newheads = oldheads.union(outg)
140 newheads = oldheads.union(outg)
141 if len(newheads) > 1:
141 if len(newheads) > 1:
142 for latest in reversed(outg):
142 for latest in reversed(outg):
143 if latest not in newheads:
143 if latest not in newheads:
144 continue
144 continue
145 minhrev = min(cl.rev(h) for h in newheads)
145 minhrev = min(cl.rev(h) for h in newheads)
146 reachable = cl.reachable(latest, cl.node(minhrev))
146 reachable = cl.reachable(latest, cl.node(minhrev))
147 reachable.remove(latest)
147 reachable.remove(latest)
148 newheads.difference_update(reachable)
148 newheads.difference_update(reachable)
149 branches = set([None])
149 branches = set([None])
150 newmap = {None: newheads}
150 newmap = {None: newheads}
151 oldmap = {None: oldheads}
151 oldmap = {None: oldheads}
152 unsynced = inc and branches or set()
152 unsynced = inc and branches or set()
153
153
154 # 5. Check for new heads.
154 # 5. Check for new heads.
155 # If there are more heads after the push than before, a suitable
155 # If there are more heads after the push than before, a suitable
156 # error message, depending on unsynced status, is displayed.
156 # error message, depending on unsynced status, is displayed.
157 error = None
157 error = None
158 for branch in branches:
158 for branch in branches:
159 newhs = set(newmap[branch])
159 newhs = set(newmap[branch])
160 oldhs = set(oldmap[branch])
160 oldhs = set(oldmap[branch])
161 if len(newhs) > len(oldhs):
161 if len(newhs) > len(oldhs):
162 dhs = list(newhs - oldhs)
162 dhs = list(newhs - oldhs)
163 if error is None:
163 if error is None:
164 if branch != 'default':
164 if branch != 'default':
165 error = _("push creates new remote head %s "
165 error = _("push creates new remote head %s "
166 "on branch '%s'!") % (short(dhs[0]), branch)
166 "on branch '%s'!") % (short(dhs[0]), branch)
167 else:
167 else:
168 error = _("push creates new remote head %s!"
168 error = _("push creates new remote head %s!"
169 ) % short(dhs[0])
169 ) % short(dhs[0])
170 if branch in unsynced:
170 if branch in unsynced:
171 hint = _("you should pull and merge or "
171 hint = _("you should pull and merge or "
172 "use push -f to force")
172 "use push -f to force")
173 else:
173 else:
174 hint = _("did you forget to merge? "
174 hint = _("did you forget to merge? "
175 "use push -f to force")
175 "use push -f to force")
176 repo.ui.debug("new remote heads on branch '%s'\n" % branch)
176 repo.ui.note("new remote heads on branch '%s'\n" % branch)
177 for h in dhs:
177 for h in dhs:
178 repo.ui.debug("new remote head %s\n" % short(h))
178 repo.ui.note("new remote head %s\n" % short(h))
179 if error:
179 if error:
180 raise util.Abort(error, hint=hint)
180 raise util.Abort(error, hint=hint)
181
181
182 # 6. Check for unsynced changes on involved branches.
182 # 6. Check for unsynced changes on involved branches.
183 if unsynced:
183 if unsynced:
184 repo.ui.warn(_("note: unsynced remote changes!\n"))
184 repo.ui.warn(_("note: unsynced remote changes!\n"))
185
185
186 if revs is None:
186 if revs is None:
187 # use the fast path, no race possible on push
187 # use the fast path, no race possible on push
188 cg = repo._changegroup(outg, 'push')
188 cg = repo._changegroup(outg, 'push')
189 else:
189 else:
190 cg = repo.getbundle('push', heads=revs, common=common)
190 cg = repo.getbundle('push', heads=revs, common=common)
191 return cg, remoteheads
191 return cg, remoteheads
@@ -1,714 +1,720 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: 2, sample size is: 2
38 query 2; still undecided: 2, sample size is: 2
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 -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'
132 new remote head a5dda829a167
133 new remote head ee8fbc7a0295
130 abort: push creates new remote head a5dda829a167!
134 abort: push creates new remote head a5dda829a167!
131 (did you forget to merge? use push -f to force)
135 (did you forget to merge? use push -f to force)
132 [255]
136 [255]
133
137
134 $ hg push -f -r 3 -r 4 ../c
138 $ hg push -v -f -r 3 -r 4 ../c
135 pushing to ../c
139 pushing to ../c
136 searching for changes
140 searching for changes
141 all remote heads known locally
142 2 changesets found
137 adding changesets
143 adding changesets
138 adding manifests
144 adding manifests
139 adding file changes
145 adding file changes
140 added 2 changesets with 2 changes to 1 files (+2 heads)
146 added 2 changesets with 2 changes to 1 files (+2 heads)
141
147
142 $ hg push -r 5 ../c
148 $ hg push -r 5 ../c
143 pushing to ../c
149 pushing to ../c
144 searching for changes
150 searching for changes
145 adding changesets
151 adding changesets
146 adding manifests
152 adding manifests
147 adding file changes
153 adding file changes
148 added 1 changesets with 1 changes to 1 files (-1 heads)
154 added 1 changesets with 1 changes to 1 files (-1 heads)
149
155
150 $ hg in ../c
156 $ hg in ../c
151 comparing with ../c
157 comparing with ../c
152 searching for changes
158 searching for changes
153 no changes found
159 no changes found
154 [1]
160 [1]
155
161
156
162
157 Issue450: push -r warns about remote head creation even if no heads
163 Issue450: push -r warns about remote head creation even if no heads
158 will be created
164 will be created
159
165
160 $ hg init ../e
166 $ hg init ../e
161 $ hg push -r 0 ../e
167 $ hg push -r 0 ../e
162 pushing to ../e
168 pushing to ../e
163 searching for changes
169 searching for changes
164 adding changesets
170 adding changesets
165 adding manifests
171 adding manifests
166 adding file changes
172 adding file changes
167 added 1 changesets with 1 changes to 1 files
173 added 1 changesets with 1 changes to 1 files
168
174
169 $ hg push -r 1 ../e
175 $ hg push -r 1 ../e
170 pushing to ../e
176 pushing to ../e
171 searching for changes
177 searching for changes
172 adding changesets
178 adding changesets
173 adding manifests
179 adding manifests
174 adding file changes
180 adding file changes
175 added 1 changesets with 1 changes to 1 files
181 added 1 changesets with 1 changes to 1 files
176
182
177 $ cd ..
183 $ cd ..
178
184
179
185
180 Issue736: named branches are not considered for detection of
186 Issue736: named branches are not considered for detection of
181 unmerged heads in "hg push"
187 unmerged heads in "hg push"
182
188
183 $ hg init f
189 $ hg init f
184 $ cd f
190 $ cd f
185 $ hg -q branch a
191 $ hg -q branch a
186 $ echo 0 > foo
192 $ echo 0 > foo
187 $ hg -q ci -Am 0
193 $ hg -q ci -Am 0
188 $ echo 1 > foo
194 $ echo 1 > foo
189 $ hg -q ci -m 1
195 $ hg -q ci -m 1
190 $ hg -q up 0
196 $ hg -q up 0
191 $ echo 2 > foo
197 $ echo 2 > foo
192 $ hg -q ci -m 2
198 $ hg -q ci -m 2
193 $ hg -q up 0
199 $ hg -q up 0
194 $ hg -q branch b
200 $ hg -q branch b
195 $ echo 3 > foo
201 $ echo 3 > foo
196 $ hg -q ci -m 3
202 $ hg -q ci -m 3
197 $ cd ..
203 $ cd ..
198
204
199 $ hg -q clone f g
205 $ hg -q clone f g
200 $ cd g
206 $ cd g
201
207
202 Push on existing branch and new branch:
208 Push on existing branch and new branch:
203
209
204 $ hg -q up 1
210 $ hg -q up 1
205 $ echo 4 > foo
211 $ echo 4 > foo
206 $ hg -q ci -m 4
212 $ hg -q ci -m 4
207 $ hg -q up 0
213 $ hg -q up 0
208 $ echo 5 > foo
214 $ echo 5 > foo
209 $ hg -q branch c
215 $ hg -q branch c
210 $ hg -q ci -m 5
216 $ hg -q ci -m 5
211
217
212 $ hg push ../f
218 $ hg push ../f
213 pushing to ../f
219 pushing to ../f
214 searching for changes
220 searching for changes
215 abort: push creates new remote branches: c!
221 abort: push creates new remote branches: c!
216 (use 'hg push --new-branch' to create new remote branches)
222 (use 'hg push --new-branch' to create new remote branches)
217 [255]
223 [255]
218
224
219 $ hg push -r 4 -r 5 ../f
225 $ hg push -r 4 -r 5 ../f
220 pushing to ../f
226 pushing to ../f
221 searching for changes
227 searching for changes
222 abort: push creates new remote branches: c!
228 abort: push creates new remote branches: c!
223 (use 'hg push --new-branch' to create new remote branches)
229 (use 'hg push --new-branch' to create new remote branches)
224 [255]
230 [255]
225
231
226
232
227 Multiple new branches:
233 Multiple new branches:
228
234
229 $ hg -q branch d
235 $ hg -q branch d
230 $ echo 6 > foo
236 $ echo 6 > foo
231 $ hg -q ci -m 6
237 $ hg -q ci -m 6
232
238
233 $ hg push ../f
239 $ hg push ../f
234 pushing to ../f
240 pushing to ../f
235 searching for changes
241 searching for changes
236 abort: push creates new remote branches: c, d!
242 abort: push creates new remote branches: c, d!
237 (use 'hg push --new-branch' to create new remote branches)
243 (use 'hg push --new-branch' to create new remote branches)
238 [255]
244 [255]
239
245
240 $ hg push -r 4 -r 6 ../f
246 $ hg push -r 4 -r 6 ../f
241 pushing to ../f
247 pushing to ../f
242 searching for changes
248 searching for changes
243 abort: push creates new remote branches: c, d!
249 abort: push creates new remote branches: c, d!
244 (use 'hg push --new-branch' to create new remote branches)
250 (use 'hg push --new-branch' to create new remote branches)
245 [255]
251 [255]
246
252
247 $ cd ../g
253 $ cd ../g
248
254
249
255
250 Fail on multiple head push:
256 Fail on multiple head push:
251
257
252 $ hg -q up 1
258 $ hg -q up 1
253 $ echo 7 > foo
259 $ echo 7 > foo
254 $ hg -q ci -m 7
260 $ hg -q ci -m 7
255
261
256 $ hg push -r 4 -r 7 ../f
262 $ hg push -r 4 -r 7 ../f
257 pushing to ../f
263 pushing to ../f
258 searching for changes
264 searching for changes
259 abort: push creates new remote head 0b715ef6ff8f on branch 'a'!
265 abort: push creates new remote head 0b715ef6ff8f on branch 'a'!
260 (did you forget to merge? use push -f to force)
266 (did you forget to merge? use push -f to force)
261 [255]
267 [255]
262
268
263 Push replacement head on existing branches:
269 Push replacement head on existing branches:
264
270
265 $ hg -q up 3
271 $ hg -q up 3
266 $ echo 8 > foo
272 $ echo 8 > foo
267 $ hg -q ci -m 8
273 $ hg -q ci -m 8
268
274
269 $ hg push -r 7 -r 8 ../f
275 $ hg push -r 7 -r 8 ../f
270 pushing to ../f
276 pushing to ../f
271 searching for changes
277 searching for changes
272 adding changesets
278 adding changesets
273 adding manifests
279 adding manifests
274 adding file changes
280 adding file changes
275 added 2 changesets with 2 changes to 1 files
281 added 2 changesets with 2 changes to 1 files
276
282
277
283
278 Merge of branch a to other branch b followed by unrelated push
284 Merge of branch a to other branch b followed by unrelated push
279 on branch a:
285 on branch a:
280
286
281 $ hg -q up 7
287 $ hg -q up 7
282 $ HGMERGE=true hg -q merge 8
288 $ HGMERGE=true hg -q merge 8
283 $ hg -q ci -m 9
289 $ hg -q ci -m 9
284 $ hg -q up 8
290 $ hg -q up 8
285 $ echo 10 > foo
291 $ echo 10 > foo
286 $ hg -q ci -m 10
292 $ hg -q ci -m 10
287
293
288 $ hg push -r 9 ../f
294 $ hg push -r 9 ../f
289 pushing to ../f
295 pushing to ../f
290 searching for changes
296 searching for changes
291 adding changesets
297 adding changesets
292 adding manifests
298 adding manifests
293 adding file changes
299 adding file changes
294 added 1 changesets with 1 changes to 1 files (-1 heads)
300 added 1 changesets with 1 changes to 1 files (-1 heads)
295
301
296 $ hg push -r 10 ../f
302 $ hg push -r 10 ../f
297 pushing to ../f
303 pushing to ../f
298 searching for changes
304 searching for changes
299 adding changesets
305 adding changesets
300 adding manifests
306 adding manifests
301 adding file changes
307 adding file changes
302 added 1 changesets with 1 changes to 1 files (+1 heads)
308 added 1 changesets with 1 changes to 1 files (+1 heads)
303
309
304
310
305 Cheating the counting algorithm:
311 Cheating the counting algorithm:
306
312
307 $ hg -q up 9
313 $ hg -q up 9
308 $ HGMERGE=true hg -q merge 2
314 $ HGMERGE=true hg -q merge 2
309 $ hg -q ci -m 11
315 $ hg -q ci -m 11
310 $ hg -q up 1
316 $ hg -q up 1
311 $ echo 12 > foo
317 $ echo 12 > foo
312 $ hg -q ci -m 12
318 $ hg -q ci -m 12
313
319
314 $ hg push -r 11 -r 12 ../f
320 $ hg push -r 11 -r 12 ../f
315 pushing to ../f
321 pushing to ../f
316 searching for changes
322 searching for changes
317 adding changesets
323 adding changesets
318 adding manifests
324 adding manifests
319 adding file changes
325 adding file changes
320 added 2 changesets with 2 changes to 1 files
326 added 2 changesets with 2 changes to 1 files
321
327
322
328
323 Failed push of new named branch:
329 Failed push of new named branch:
324
330
325 $ echo 12 > foo
331 $ echo 12 > foo
326 $ hg -q ci -m 12a
332 $ hg -q ci -m 12a
327 [1]
333 [1]
328 $ hg -q up 11
334 $ hg -q up 11
329 $ echo 13 > foo
335 $ echo 13 > foo
330 $ hg -q branch e
336 $ hg -q branch e
331 $ hg -q ci -m 13d
337 $ hg -q ci -m 13d
332
338
333 $ hg push -r 12 -r 13 ../f
339 $ hg push -r 12 -r 13 ../f
334 pushing to ../f
340 pushing to ../f
335 searching for changes
341 searching for changes
336 abort: push creates new remote branches: e!
342 abort: push creates new remote branches: e!
337 (use 'hg push --new-branch' to create new remote branches)
343 (use 'hg push --new-branch' to create new remote branches)
338 [255]
344 [255]
339
345
340
346
341 Using --new-branch to push new named branch:
347 Using --new-branch to push new named branch:
342
348
343 $ hg push --new-branch -r 12 -r 13 ../f
349 $ hg push --new-branch -r 12 -r 13 ../f
344 pushing to ../f
350 pushing to ../f
345 searching for changes
351 searching for changes
346 adding changesets
352 adding changesets
347 adding manifests
353 adding manifests
348 adding file changes
354 adding file changes
349 added 1 changesets with 1 changes to 1 files
355 added 1 changesets with 1 changes to 1 files
350
356
351
357
352 Checking prepush logic does not allow silently pushing
358 Checking prepush logic does not allow silently pushing
353 multiple new heads:
359 multiple new heads:
354
360
355 $ cd ..
361 $ cd ..
356 $ hg init h
362 $ hg init h
357 $ echo init > h/init
363 $ echo init > h/init
358 $ hg -R h ci -Am init
364 $ hg -R h ci -Am init
359 adding init
365 adding init
360 $ echo a > h/a
366 $ echo a > h/a
361 $ hg -R h ci -Am a
367 $ hg -R h ci -Am a
362 adding a
368 adding a
363 $ hg clone h i
369 $ hg clone h i
364 updating to branch default
370 updating to branch default
365 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
371 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
366 $ hg -R h up 0
372 $ hg -R h up 0
367 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
373 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
368 $ echo b > h/b
374 $ echo b > h/b
369 $ hg -R h ci -Am b
375 $ hg -R h ci -Am b
370 adding b
376 adding b
371 created new head
377 created new head
372 $ hg -R i up 0
378 $ hg -R i up 0
373 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
379 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
374 $ echo c > i/c
380 $ echo c > i/c
375 $ hg -R i ci -Am c
381 $ hg -R i ci -Am c
376 adding c
382 adding c
377 created new head
383 created new head
378
384
379 $ hg -R i push h
385 $ hg -R i push h
380 pushing to h
386 pushing to h
381 searching for changes
387 searching for changes
382 abort: push creates new remote head 97bd0c84d346!
388 abort: push creates new remote head 97bd0c84d346!
383 (you should pull and merge or use push -f to force)
389 (you should pull and merge or use push -f to force)
384 [255]
390 [255]
385
391
386
392
387 Check prepush logic with merged branches:
393 Check prepush logic with merged branches:
388
394
389 $ hg init j
395 $ hg init j
390 $ hg -R j branch a
396 $ hg -R j branch a
391 marked working directory as branch a
397 marked working directory as branch a
392 $ echo init > j/foo
398 $ echo init > j/foo
393 $ hg -R j ci -Am init
399 $ hg -R j ci -Am init
394 adding foo
400 adding foo
395 $ hg clone j k
401 $ hg clone j k
396 updating to branch a
402 updating to branch a
397 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
403 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
398 $ echo a1 > j/foo
404 $ echo a1 > j/foo
399 $ hg -R j ci -m a1
405 $ hg -R j ci -m a1
400 $ hg -R k branch b
406 $ hg -R k branch b
401 marked working directory as branch b
407 marked working directory as branch b
402 $ echo b > k/foo
408 $ echo b > k/foo
403 $ hg -R k ci -m b
409 $ hg -R k ci -m b
404 $ hg -R k up 0
410 $ hg -R k up 0
405 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
406
412
407 $ hg -R k merge b
413 $ hg -R k merge b
408 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
409 (branch merge, don't forget to commit)
415 (branch merge, don't forget to commit)
410
416
411 $ hg -R k ci -m merge
417 $ hg -R k ci -m merge
412
418
413 $ hg -R k push -r a j
419 $ hg -R k push -r a j
414 pushing to j
420 pushing to j
415 searching for changes
421 searching for changes
416 abort: push creates new remote branches: b!
422 abort: push creates new remote branches: b!
417 (use 'hg push --new-branch' to create new remote branches)
423 (use 'hg push --new-branch' to create new remote branches)
418 [255]
424 [255]
419
425
420
426
421 Prepush -r should not allow you to sneak in new heads:
427 Prepush -r should not allow you to sneak in new heads:
422
428
423 $ hg init l
429 $ hg init l
424 $ cd l
430 $ cd l
425 $ echo a >> foo
431 $ echo a >> foo
426 $ hg -q add foo
432 $ hg -q add foo
427 $ hg -q branch a
433 $ hg -q branch a
428 $ hg -q ci -ma
434 $ hg -q ci -ma
429 $ hg -q up null
435 $ hg -q up null
430 $ echo a >> foo
436 $ echo a >> foo
431 $ hg -q add foo
437 $ hg -q add foo
432 $ hg -q branch b
438 $ hg -q branch b
433 $ hg -q ci -mb
439 $ hg -q ci -mb
434 $ cd ..
440 $ cd ..
435 $ hg -q clone l m -u a
441 $ hg -q clone l m -u a
436 $ cd m
442 $ cd m
437 $ hg -q merge b
443 $ hg -q merge b
438 $ hg -q ci -mmb
444 $ hg -q ci -mmb
439 $ hg -q up 0
445 $ hg -q up 0
440 $ echo a >> foo
446 $ echo a >> foo
441 $ hg -q ci -ma2
447 $ hg -q ci -ma2
442 $ hg -q up 2
448 $ hg -q up 2
443 $ echo a >> foo
449 $ echo a >> foo
444 $ hg -q branch -f b
450 $ hg -q branch -f b
445 $ hg -q ci -mb2
451 $ hg -q ci -mb2
446 $ hg -q merge 3
452 $ hg -q merge 3
447 $ hg -q ci -mma
453 $ hg -q ci -mma
448
454
449 $ hg push ../l -b b
455 $ hg push ../l -b b
450 pushing to ../l
456 pushing to ../l
451 searching for changes
457 searching for changes
452 abort: push creates new remote head e7e31d71180f on branch 'a'!
458 abort: push creates new remote head e7e31d71180f on branch 'a'!
453 (did you forget to merge? use push -f to force)
459 (did you forget to merge? use push -f to force)
454 [255]
460 [255]
455
461
456 $ cd ..
462 $ cd ..
457
463
458
464
459 Check prepush with new branch head on former topo non-head:
465 Check prepush with new branch head on former topo non-head:
460
466
461 $ hg init n
467 $ hg init n
462 $ cd n
468 $ cd n
463 $ hg branch A
469 $ hg branch A
464 marked working directory as branch A
470 marked working directory as branch A
465 $ echo a >a
471 $ echo a >a
466 $ hg ci -Ama
472 $ hg ci -Ama
467 adding a
473 adding a
468 $ hg branch B
474 $ hg branch B
469 marked working directory as branch B
475 marked working directory as branch B
470 $ echo b >b
476 $ echo b >b
471 $ hg ci -Amb
477 $ hg ci -Amb
472 adding b
478 adding b
473
479
474 b is now branch head of B, and a topological head
480 b is now branch head of B, and a topological head
475 a is now branch head of A, but not a topological head
481 a is now branch head of A, but not a topological head
476
482
477 $ hg clone . inner
483 $ hg clone . inner
478 updating to branch B
484 updating to branch B
479 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
485 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
480 $ cd inner
486 $ cd inner
481 $ hg up B
487 $ hg up B
482 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
483 $ echo b1 >b1
489 $ echo b1 >b1
484 $ hg ci -Amb1
490 $ hg ci -Amb1
485 adding b1
491 adding b1
486
492
487 in the clone b1 is now the head of B
493 in the clone b1 is now the head of B
488
494
489 $ cd ..
495 $ cd ..
490 $ hg up 0
496 $ hg up 0
491 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
497 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
492 $ echo a2 >a2
498 $ echo a2 >a2
493 $ hg ci -Ama2
499 $ hg ci -Ama2
494 adding a2
500 adding a2
495
501
496 a2 is now the new branch head of A, and a new topological head
502 a2 is now the new branch head of A, and a new topological head
497 it replaces a former inner branch head, so it should at most warn about
503 it replaces a former inner branch head, so it should at most warn about
498 A, not B
504 A, not B
499
505
500 glog of local:
506 glog of local:
501
507
502 $ hg glog --template "{rev}: {branches} {desc}\n"
508 $ hg glog --template "{rev}: {branches} {desc}\n"
503 @ 2: A a2
509 @ 2: A a2
504 |
510 |
505 | o 1: B b
511 | o 1: B b
506 |/
512 |/
507 o 0: A a
513 o 0: A a
508
514
509 glog of remote:
515 glog of remote:
510
516
511 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
517 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
512 @ 2: B b1
518 @ 2: B b1
513 |
519 |
514 o 1: B b
520 o 1: B b
515 |
521 |
516 o 0: A a
522 o 0: A a
517
523
518 outgoing:
524 outgoing:
519
525
520 $ hg out inner --template "{rev}: {branches} {desc}\n"
526 $ hg out inner --template "{rev}: {branches} {desc}\n"
521 comparing with inner
527 comparing with inner
522 searching for changes
528 searching for changes
523 2: A a2
529 2: A a2
524
530
525 $ hg push inner
531 $ hg push inner
526 pushing to inner
532 pushing to inner
527 searching for changes
533 searching for changes
528 adding changesets
534 adding changesets
529 adding manifests
535 adding manifests
530 adding file changes
536 adding file changes
531 added 1 changesets with 1 changes to 1 files (+1 heads)
537 added 1 changesets with 1 changes to 1 files (+1 heads)
532
538
533 $ cd ..
539 $ cd ..
534
540
535
541
536 Check prepush with new branch head on former topo head:
542 Check prepush with new branch head on former topo head:
537
543
538 $ hg init o
544 $ hg init o
539 $ cd o
545 $ cd o
540 $ hg branch A
546 $ hg branch A
541 marked working directory as branch A
547 marked working directory as branch A
542 $ echo a >a
548 $ echo a >a
543 $ hg ci -Ama
549 $ hg ci -Ama
544 adding a
550 adding a
545 $ hg branch B
551 $ hg branch B
546 marked working directory as branch B
552 marked working directory as branch B
547 $ echo b >b
553 $ echo b >b
548 $ hg ci -Amb
554 $ hg ci -Amb
549 adding b
555 adding b
550
556
551 b is now branch head of B, and a topological head
557 b is now branch head of B, and a topological head
552
558
553 $ hg up 0
559 $ hg up 0
554 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
560 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
555 $ echo a1 >a1
561 $ echo a1 >a1
556 $ hg ci -Ama1
562 $ hg ci -Ama1
557 adding a1
563 adding a1
558
564
559 a1 is now branch head of A, and a topological head
565 a1 is now branch head of A, and a topological head
560
566
561 $ hg clone . inner
567 $ hg clone . inner
562 updating to branch A
568 updating to branch A
563 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
569 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
564 $ cd inner
570 $ cd inner
565 $ hg up B
571 $ hg up B
566 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
572 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
567 $ echo b1 >b1
573 $ echo b1 >b1
568 $ hg ci -Amb1
574 $ hg ci -Amb1
569 adding b1
575 adding b1
570
576
571 in the clone b1 is now the head of B
577 in the clone b1 is now the head of B
572
578
573 $ cd ..
579 $ cd ..
574 $ echo a2 >a2
580 $ echo a2 >a2
575 $ hg ci -Ama2
581 $ hg ci -Ama2
576 adding a2
582 adding a2
577
583
578 a2 is now the new branch head of A, and a topological head
584 a2 is now the new branch head of A, and a topological head
579 it replaces a former topological and branch head, so this should not warn
585 it replaces a former topological and branch head, so this should not warn
580
586
581 glog of local:
587 glog of local:
582
588
583 $ hg glog --template "{rev}: {branches} {desc}\n"
589 $ hg glog --template "{rev}: {branches} {desc}\n"
584 @ 3: A a2
590 @ 3: A a2
585 |
591 |
586 o 2: A a1
592 o 2: A a1
587 |
593 |
588 | o 1: B b
594 | o 1: B b
589 |/
595 |/
590 o 0: A a
596 o 0: A a
591
597
592 glog of remote:
598 glog of remote:
593
599
594 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
600 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
595 @ 3: B b1
601 @ 3: B b1
596 |
602 |
597 | o 2: A a1
603 | o 2: A a1
598 | |
604 | |
599 o | 1: B b
605 o | 1: B b
600 |/
606 |/
601 o 0: A a
607 o 0: A a
602
608
603 outgoing:
609 outgoing:
604
610
605 $ hg out inner --template "{rev}: {branches} {desc}\n"
611 $ hg out inner --template "{rev}: {branches} {desc}\n"
606 comparing with inner
612 comparing with inner
607 searching for changes
613 searching for changes
608 3: A a2
614 3: A a2
609
615
610 $ hg push inner
616 $ hg push inner
611 pushing to inner
617 pushing to inner
612 searching for changes
618 searching for changes
613 adding changesets
619 adding changesets
614 adding manifests
620 adding manifests
615 adding file changes
621 adding file changes
616 added 1 changesets with 1 changes to 1 files
622 added 1 changesets with 1 changes to 1 files
617
623
618 $ cd ..
624 $ cd ..
619
625
620
626
621 Check prepush with new branch head and new child of former branch head
627 Check prepush with new branch head and new child of former branch head
622 but child is on different branch:
628 but child is on different branch:
623
629
624 $ hg init p
630 $ hg init p
625 $ cd p
631 $ cd p
626 $ hg branch A
632 $ hg branch A
627 marked working directory as branch A
633 marked working directory as branch A
628 $ echo a0 >a
634 $ echo a0 >a
629 $ hg ci -Ama0
635 $ hg ci -Ama0
630 adding a
636 adding a
631 $ echo a1 >a
637 $ echo a1 >a
632 $ hg ci -ma1
638 $ hg ci -ma1
633 $ hg up null
639 $ hg up null
634 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
640 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
635 $ hg branch B
641 $ hg branch B
636 marked working directory as branch B
642 marked working directory as branch B
637 $ echo b0 >b
643 $ echo b0 >b
638 $ hg ci -Amb0
644 $ hg ci -Amb0
639 adding b
645 adding b
640 $ echo b1 >b
646 $ echo b1 >b
641 $ hg ci -mb1
647 $ hg ci -mb1
642
648
643 $ hg clone . inner
649 $ hg clone . inner
644 updating to branch B
650 updating to branch B
645 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
651 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
646
652
647 $ hg up A
653 $ hg up A
648 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
654 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
649 $ hg branch -f B
655 $ hg branch -f B
650 marked working directory as branch B
656 marked working directory as branch B
651 $ echo a3 >a
657 $ echo a3 >a
652 $ hg ci -ma3
658 $ hg ci -ma3
653 created new head
659 created new head
654 $ hg up 3
660 $ hg up 3
655 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
661 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
656 $ hg branch -f A
662 $ hg branch -f A
657 marked working directory as branch A
663 marked working directory as branch A
658 $ echo b3 >b
664 $ echo b3 >b
659 $ hg ci -mb3
665 $ hg ci -mb3
660 created new head
666 created new head
661
667
662 glog of local:
668 glog of local:
663
669
664 $ hg glog --template "{rev}: {branches} {desc}\n"
670 $ hg glog --template "{rev}: {branches} {desc}\n"
665 @ 5: A b3
671 @ 5: A b3
666 |
672 |
667 | o 4: B a3
673 | o 4: B a3
668 | |
674 | |
669 o | 3: B b1
675 o | 3: B b1
670 | |
676 | |
671 o | 2: B b0
677 o | 2: B b0
672 /
678 /
673 o 1: A a1
679 o 1: A a1
674 |
680 |
675 o 0: A a0
681 o 0: A a0
676
682
677 glog of remote:
683 glog of remote:
678
684
679 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
685 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
680 @ 3: B b1
686 @ 3: B b1
681 |
687 |
682 o 2: B b0
688 o 2: B b0
683
689
684 o 1: A a1
690 o 1: A a1
685 |
691 |
686 o 0: A a0
692 o 0: A a0
687
693
688 outgoing:
694 outgoing:
689
695
690 $ hg out inner --template "{rev}: {branches} {desc}\n"
696 $ hg out inner --template "{rev}: {branches} {desc}\n"
691 comparing with inner
697 comparing with inner
692 searching for changes
698 searching for changes
693 4: B a3
699 4: B a3
694 5: A b3
700 5: A b3
695
701
696 $ hg push inner
702 $ hg push inner
697 pushing to inner
703 pushing to inner
698 searching for changes
704 searching for changes
699 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'!
705 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'!
700 (did you forget to merge? use push -f to force)
706 (did you forget to merge? use push -f to force)
701 [255]
707 [255]
702
708
703 $ hg push inner -r4 -r5
709 $ hg push inner -r4 -r5
704 pushing to inner
710 pushing to inner
705 searching for changes
711 searching for changes
706 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'!
712 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'!
707 (did you forget to merge? use push -f to force)
713 (did you forget to merge? use push -f to force)
708 [255]
714 [255]
709
715
710 $ hg in inner
716 $ hg in inner
711 comparing with inner
717 comparing with inner
712 searching for changes
718 searching for changes
713 no changes found
719 no changes found
714 [1]
720 [1]
General Comments 0
You need to be logged in to leave comments. Login now