##// END OF EJS Templates
push: hide description about "-f" in the hint to prevent from using it easily...
FUJIWARA Katsunori -
r19934:bfc6ed89 default
parent child Browse files
Show More
@@ -1,347 +1,349
1 1 # discovery.py - protocol changeset discovery functions
2 2 #
3 3 # Copyright 2010 Matt Mackall <mpm@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 from node import nullid, short
9 9 from i18n import _
10 10 import util, setdiscovery, treediscovery, phases, obsolete, bookmarks
11 11 import branchmap
12 12
13 13 def findcommonincoming(repo, remote, heads=None, force=False):
14 14 """Return a tuple (common, anyincoming, heads) used to identify the common
15 15 subset of nodes between repo and remote.
16 16
17 17 "common" is a list of (at least) the heads of the common subset.
18 18 "anyincoming" is testable as a boolean indicating if any nodes are missing
19 19 locally. If remote does not support getbundle, this actually is a list of
20 20 roots of the nodes that would be incoming, to be supplied to
21 21 changegroupsubset. No code except for pull should be relying on this fact
22 22 any longer.
23 23 "heads" is either the supplied heads, or else the remote's heads.
24 24
25 25 If you pass heads and they are all known locally, the response lists just
26 26 these heads in "common" and in "heads".
27 27
28 28 Please use findcommonoutgoing to compute the set of outgoing nodes to give
29 29 extensions a good hook into outgoing.
30 30 """
31 31
32 32 if not remote.capable('getbundle'):
33 33 return treediscovery.findcommonincoming(repo, remote, heads, force)
34 34
35 35 if heads:
36 36 allknown = True
37 37 nm = repo.changelog.nodemap
38 38 for h in heads:
39 39 if nm.get(h) is None:
40 40 allknown = False
41 41 break
42 42 if allknown:
43 43 return (heads, False, heads)
44 44
45 45 res = setdiscovery.findcommonheads(repo.ui, repo, remote,
46 46 abortwhenunrelated=not force)
47 47 common, anyinc, srvheads = res
48 48 return (list(common), anyinc, heads or list(srvheads))
49 49
50 50 class outgoing(object):
51 51 '''Represents the set of nodes present in a local repo but not in a
52 52 (possibly) remote one.
53 53
54 54 Members:
55 55
56 56 missing is a list of all nodes present in local but not in remote.
57 57 common is a list of all nodes shared between the two repos.
58 58 excluded is the list of missing changeset that shouldn't be sent remotely.
59 59 missingheads is the list of heads of missing.
60 60 commonheads is the list of heads of common.
61 61
62 62 The sets are computed on demand from the heads, unless provided upfront
63 63 by discovery.'''
64 64
65 65 def __init__(self, revlog, commonheads, missingheads):
66 66 self.commonheads = commonheads
67 67 self.missingheads = missingheads
68 68 self._revlog = revlog
69 69 self._common = None
70 70 self._missing = None
71 71 self.excluded = []
72 72
73 73 def _computecommonmissing(self):
74 74 sets = self._revlog.findcommonmissing(self.commonheads,
75 75 self.missingheads)
76 76 self._common, self._missing = sets
77 77
78 78 @util.propertycache
79 79 def common(self):
80 80 if self._common is None:
81 81 self._computecommonmissing()
82 82 return self._common
83 83
84 84 @util.propertycache
85 85 def missing(self):
86 86 if self._missing is None:
87 87 self._computecommonmissing()
88 88 return self._missing
89 89
90 90 def findcommonoutgoing(repo, other, onlyheads=None, force=False,
91 91 commoninc=None, portable=False):
92 92 '''Return an outgoing instance to identify the nodes present in repo but
93 93 not in other.
94 94
95 95 If onlyheads is given, only nodes ancestral to nodes in onlyheads
96 96 (inclusive) are included. If you already know the local repo's heads,
97 97 passing them in onlyheads is faster than letting them be recomputed here.
98 98
99 99 If commoninc is given, it must be the result of a prior call to
100 100 findcommonincoming(repo, other, force) to avoid recomputing it here.
101 101
102 102 If portable is given, compute more conservative common and missingheads,
103 103 to make bundles created from the instance more portable.'''
104 104 # declare an empty outgoing object to be filled later
105 105 og = outgoing(repo.changelog, None, None)
106 106
107 107 # get common set if not provided
108 108 if commoninc is None:
109 109 commoninc = findcommonincoming(repo, other, force=force)
110 110 og.commonheads, _any, _hds = commoninc
111 111
112 112 # compute outgoing
113 113 mayexclude = (repo._phasecache.phaseroots[phases.secret] or repo.obsstore)
114 114 if not mayexclude:
115 115 og.missingheads = onlyheads or repo.heads()
116 116 elif onlyheads is None:
117 117 # use visible heads as it should be cached
118 118 og.missingheads = repo.filtered("served").heads()
119 119 og.excluded = [ctx.node() for ctx in repo.set('secret() or extinct()')]
120 120 else:
121 121 # compute common, missing and exclude secret stuff
122 122 sets = repo.changelog.findcommonmissing(og.commonheads, onlyheads)
123 123 og._common, allmissing = sets
124 124 og._missing = missing = []
125 125 og.excluded = excluded = []
126 126 for node in allmissing:
127 127 ctx = repo[node]
128 128 if ctx.phase() >= phases.secret or ctx.extinct():
129 129 excluded.append(node)
130 130 else:
131 131 missing.append(node)
132 132 if len(missing) == len(allmissing):
133 133 missingheads = onlyheads
134 134 else: # update missing heads
135 135 missingheads = phases.newheads(repo, onlyheads, excluded)
136 136 og.missingheads = missingheads
137 137 if portable:
138 138 # recompute common and missingheads as if -r<rev> had been given for
139 139 # each head of missing, and --base <rev> for each head of the proper
140 140 # ancestors of missing
141 141 og._computecommonmissing()
142 142 cl = repo.changelog
143 143 missingrevs = set(cl.rev(n) for n in og._missing)
144 144 og._common = set(cl.ancestors(missingrevs)) - missingrevs
145 145 commonheads = set(og.commonheads)
146 146 og.missingheads = [h for h in og.missingheads if h not in commonheads]
147 147
148 148 return og
149 149
150 150 def _headssummary(repo, remote, outgoing):
151 151 """compute a summary of branch and heads status before and after push
152 152
153 153 return {'branch': ([remoteheads], [newheads], [unsyncedheads])} mapping
154 154
155 155 - branch: the branch name
156 156 - remoteheads: the list of remote heads known locally
157 157 None is the branch is new
158 158 - newheads: the new remote heads (known locally) with outgoing pushed
159 159 - unsyncedheads: the list of remote heads unknown locally.
160 160 """
161 161 cl = repo.changelog
162 162 headssum = {}
163 163 # A. Create set of branches involved in the push.
164 164 branches = set(repo[n].branch() for n in outgoing.missing)
165 165 remotemap = remote.branchmap()
166 166 newbranches = branches - set(remotemap)
167 167 branches.difference_update(newbranches)
168 168
169 169 # A. register remote heads
170 170 remotebranches = set()
171 171 for branch, heads in remote.branchmap().iteritems():
172 172 remotebranches.add(branch)
173 173 known = []
174 174 unsynced = []
175 175 for h in heads:
176 176 if h in cl.nodemap:
177 177 known.append(h)
178 178 else:
179 179 unsynced.append(h)
180 180 headssum[branch] = (known, list(known), unsynced)
181 181 # B. add new branch data
182 182 missingctx = list(repo[n] for n in outgoing.missing)
183 183 touchedbranches = set()
184 184 for ctx in missingctx:
185 185 branch = ctx.branch()
186 186 touchedbranches.add(branch)
187 187 if branch not in headssum:
188 188 headssum[branch] = (None, [], [])
189 189
190 190 # C drop data about untouched branches:
191 191 for branch in remotebranches - touchedbranches:
192 192 del headssum[branch]
193 193
194 194 # D. Update newmap with outgoing changes.
195 195 # This will possibly add new heads and remove existing ones.
196 196 newmap = branchmap.branchcache((branch, heads[1])
197 197 for branch, heads in headssum.iteritems()
198 198 if heads[0] is not None)
199 199 newmap.update(repo, (ctx.rev() for ctx in missingctx))
200 200 for branch, newheads in newmap.iteritems():
201 201 headssum[branch][1][:] = newheads
202 202 return headssum
203 203
204 204 def _oldheadssummary(repo, remoteheads, outgoing, inc=False):
205 205 """Compute branchmapsummary for repo without branchmap support"""
206 206
207 207 cl = repo.changelog
208 208 # 1-4b. old servers: Check for new topological heads.
209 209 # Construct {old,new}map with branch = None (topological branch).
210 210 # (code based on update)
211 211 oldheads = set(h for h in remoteheads if h in cl.nodemap)
212 212 # all nodes in outgoing.missing are children of either:
213 213 # - an element of oldheads
214 214 # - another element of outgoing.missing
215 215 # - nullrev
216 216 # This explains why the new head are very simple to compute.
217 217 r = repo.set('heads(%ln + %ln)', oldheads, outgoing.missing)
218 218 newheads = list(c.node() for c in r)
219 219 unsynced = inc and set([None]) or set()
220 220 return {None: (oldheads, newheads, unsynced)}
221 221
222 222 def checkheads(repo, remote, outgoing, remoteheads, newbranch=False, inc=False):
223 223 """Check that a push won't add any outgoing head
224 224
225 225 raise Abort error and display ui message as needed.
226 226 """
227 227 # Check for each named branch if we're creating new remote heads.
228 228 # To be a remote head after push, node must be either:
229 229 # - unknown locally
230 230 # - a local outgoing head descended from update
231 231 # - a remote head that's known locally and not
232 232 # ancestral to an outgoing head
233 233 if remoteheads == [nullid]:
234 234 # remote is empty, nothing to check.
235 235 return
236 236
237 237 if remote.capable('branchmap'):
238 238 headssum = _headssummary(repo, remote, outgoing)
239 239 else:
240 240 headssum = _oldheadssummary(repo, remoteheads, outgoing, inc)
241 241 newbranches = [branch for branch, heads in headssum.iteritems()
242 242 if heads[0] is None]
243 243 # 1. Check for new branches on the remote.
244 244 if newbranches and not newbranch: # new branch requires --new-branch
245 245 branchnames = ', '.join(sorted(newbranches))
246 246 raise util.Abort(_("push creates new remote branches: %s!")
247 247 % branchnames,
248 248 hint=_("use 'hg push --new-branch' to create"
249 249 " new remote branches"))
250 250
251 251 # 2 compute newly pushed bookmarks. We
252 252 # we don't warned about bookmarked heads.
253 253 localbookmarks = repo._bookmarks
254 254 remotebookmarks = remote.listkeys('bookmarks')
255 255 bookmarkedheads = set()
256 256 for bm in localbookmarks:
257 257 rnode = remotebookmarks.get(bm)
258 258 if rnode and rnode in repo:
259 259 lctx, rctx = repo[bm], repo[rnode]
260 260 if bookmarks.validdest(repo, rctx, lctx):
261 261 bookmarkedheads.add(lctx.node())
262 262
263 263 # 3. Check for new heads.
264 264 # If there are more heads after the push than before, a suitable
265 265 # error message, depending on unsynced status, is displayed.
266 266 error = None
267 267 unsynced = False
268 268 allmissing = set(outgoing.missing)
269 269 allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common))
270 270 allfuturecommon.update(allmissing)
271 271 for branch, heads in sorted(headssum.iteritems()):
272 272 candidate_newhs = set(heads[1])
273 273 # add unsynced data
274 274 if heads[0] is None:
275 275 oldhs = set()
276 276 else:
277 277 oldhs = set(heads[0])
278 278 oldhs.update(heads[2])
279 279 candidate_newhs.update(heads[2])
280 280 dhs = None
281 281 discardedheads = set()
282 282 if repo.obsstore:
283 283 # remove future heads which are actually obsolete by another
284 284 # pushed element:
285 285 #
286 286 # XXX as above, There are several cases this case does not handle
287 287 # XXX properly
288 288 #
289 289 # (1) if <nh> is public, it won't be affected by obsolete marker
290 290 # and a new is created
291 291 #
292 292 # (2) if the new heads have ancestors which are not obsolete and
293 293 # not ancestors of any other heads we will have a new head too.
294 294 #
295 295 # This two case will be easy to handle for know changeset but much
296 296 # more tricky for unsynced changes.
297 297 newhs = set()
298 298 for nh in candidate_newhs:
299 299 if nh in repo and repo[nh].phase() <= phases.public:
300 300 newhs.add(nh)
301 301 else:
302 302 for suc in obsolete.allsuccessors(repo.obsstore, [nh]):
303 303 if suc != nh and suc in allfuturecommon:
304 304 discardedheads.add(nh)
305 305 break
306 306 else:
307 307 newhs.add(nh)
308 308 else:
309 309 newhs = candidate_newhs
310 310 if [h for h in heads[2] if h not in discardedheads]:
311 311 unsynced = True
312 312 if heads[0] is None:
313 313 if 1 < len(newhs):
314 314 dhs = list(newhs)
315 315 if error is None:
316 316 error = (_("push creates multiple headed new branch '%s'")
317 317 % (branch))
318 318 hint = _("merge or"
319 319 " see \"hg help push\" for detail about"
320 320 " pushing new heads")
321 321 elif len(newhs) > len(oldhs):
322 322 # strip updates to existing remote heads from the new heads list
323 323 dhs = sorted(newhs - bookmarkedheads - oldhs)
324 324 if dhs:
325 325 if error is None:
326 326 if branch not in ('default', None):
327 327 error = _("push creates new remote head %s "
328 328 "on branch '%s'!") % (short(dhs[0]), branch)
329 329 else:
330 330 error = _("push creates new remote head %s!"
331 331 ) % short(dhs[0])
332 332 if heads[2]: # unsynced
333 hint = _("you should pull and merge or "
334 "use push -f to force")
333 hint = _("pull and merge or"
334 " see \"hg help push\" for details about"
335 " pushing new heads")
335 336 else:
336 hint = _("did you forget to merge? "
337 "use push -f to force")
337 hint = _("merge or"
338 " see \"hg help push\" for details about"
339 " pushing new heads")
338 340 if branch is not None:
339 341 repo.ui.note(_("new remote heads on branch '%s'\n") % branch)
340 342 for h in dhs:
341 343 repo.ui.note(_("new remote head %s\n") % short(h))
342 344 if error:
343 345 raise util.Abort(error, hint=hint)
344 346
345 347 # 6. Check for unsynced changes on involved branches.
346 348 if unsynced:
347 349 repo.ui.warn(_("note: unsynced remote changes!\n"))
@@ -1,427 +1,427
1 1 $ "$TESTDIR/hghave" serve || exit 80
2 2
3 3 $ cat << EOF >> $HGRCPATH
4 4 > [ui]
5 5 > logtemplate={rev}:{node|short} {desc|firstline}
6 6 > [phases]
7 7 > publish=False
8 8 > [extensions]
9 9 > EOF
10 10 $ cat > obs.py << EOF
11 11 > import mercurial.obsolete
12 12 > mercurial.obsolete._enabled = True
13 13 > EOF
14 14 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
15 15
16 16 initialize
17 17
18 18 $ hg init a
19 19 $ cd a
20 20 $ echo 'test' > test
21 21 $ hg commit -Am'test'
22 22 adding test
23 23
24 24 set bookmarks
25 25
26 26 $ hg bookmark X
27 27 $ hg bookmark Y
28 28 $ hg bookmark Z
29 29
30 30 import bookmark by name
31 31
32 32 $ hg init ../b
33 33 $ cd ../b
34 34 $ hg book Y
35 35 $ hg book
36 36 * Y -1:000000000000
37 37 $ hg pull ../a
38 38 pulling from ../a
39 39 requesting all changes
40 40 adding changesets
41 41 adding manifests
42 42 adding file changes
43 43 added 1 changesets with 1 changes to 1 files
44 44 adding remote bookmark X
45 45 updating bookmark Y
46 46 adding remote bookmark Z
47 47 (run 'hg update' to get a working copy)
48 48 $ hg bookmarks
49 49 X 0:4e3505fd9583
50 50 * Y 0:4e3505fd9583
51 51 Z 0:4e3505fd9583
52 52 $ hg debugpushkey ../a namespaces
53 53 bookmarks
54 54 namespaces
55 55 obsolete
56 56 phases
57 57 $ hg debugpushkey ../a bookmarks
58 58 X 4e3505fd95835d721066b76e75dbb8cc554d7f77
59 59 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
60 60 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77
61 61 $ hg pull -B X ../a
62 62 pulling from ../a
63 63 no changes found
64 64 importing bookmark X
65 65 $ hg bookmark
66 66 X 0:4e3505fd9583
67 67 * Y 0:4e3505fd9583
68 68 Z 0:4e3505fd9583
69 69
70 70 export bookmark by name
71 71
72 72 $ hg bookmark W
73 73 $ hg bookmark foo
74 74 $ hg bookmark foobar
75 75 $ hg push -B W ../a
76 76 pushing to ../a
77 77 searching for changes
78 78 no changes found
79 79 exporting bookmark W
80 80 [1]
81 81 $ hg -R ../a bookmarks
82 82 W -1:000000000000
83 83 X 0:4e3505fd9583
84 84 Y 0:4e3505fd9583
85 85 * Z 0:4e3505fd9583
86 86
87 87 delete a remote bookmark
88 88
89 89 $ hg book -d W
90 90 $ hg push -B W ../a
91 91 pushing to ../a
92 92 searching for changes
93 93 no changes found
94 94 deleting remote bookmark W
95 95 [1]
96 96
97 97 push/pull name that doesn't exist
98 98
99 99 $ hg push -B badname ../a
100 100 pushing to ../a
101 101 searching for changes
102 102 no changes found
103 103 bookmark badname does not exist on the local or remote repository!
104 104 [2]
105 105 $ hg pull -B anotherbadname ../a
106 106 pulling from ../a
107 107 abort: remote bookmark anotherbadname not found!
108 108 [255]
109 109
110 110 divergent bookmarks
111 111
112 112 $ cd ../a
113 113 $ echo c1 > f1
114 114 $ hg ci -Am1
115 115 adding f1
116 116 $ hg book -f @
117 117 $ hg book -f X
118 118 $ hg book
119 119 @ 1:0d2164f0ce0d
120 120 * X 1:0d2164f0ce0d
121 121 Y 0:4e3505fd9583
122 122 Z 1:0d2164f0ce0d
123 123
124 124 $ cd ../b
125 125 $ hg up
126 126 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
127 127 updating bookmark foobar
128 128 $ echo c2 > f2
129 129 $ hg ci -Am2
130 130 adding f2
131 131 $ hg book -if @
132 132 $ hg book -if X
133 133 $ hg book
134 134 @ 1:9b140be10808
135 135 X 1:9b140be10808
136 136 Y 0:4e3505fd9583
137 137 Z 0:4e3505fd9583
138 138 foo -1:000000000000
139 139 * foobar 1:9b140be10808
140 140
141 141 $ hg pull --config paths.foo=../a foo
142 142 pulling from $TESTTMP/a (glob)
143 143 searching for changes
144 144 adding changesets
145 145 adding manifests
146 146 adding file changes
147 147 added 1 changesets with 1 changes to 1 files (+1 heads)
148 148 divergent bookmark @ stored as @foo
149 149 divergent bookmark X stored as X@foo
150 150 updating bookmark Z
151 151 (run 'hg heads' to see heads, 'hg merge' to merge)
152 152 $ hg book
153 153 @ 1:9b140be10808
154 154 @foo 2:0d2164f0ce0d
155 155 X 1:9b140be10808
156 156 X@foo 2:0d2164f0ce0d
157 157 Y 0:4e3505fd9583
158 158 Z 2:0d2164f0ce0d
159 159 foo -1:000000000000
160 160 * foobar 1:9b140be10808
161 161 $ hg push -f ../a
162 162 pushing to ../a
163 163 searching for changes
164 164 adding changesets
165 165 adding manifests
166 166 adding file changes
167 167 added 1 changesets with 1 changes to 1 files (+1 heads)
168 168 $ hg -R ../a book
169 169 @ 1:0d2164f0ce0d
170 170 * X 1:0d2164f0ce0d
171 171 Y 0:4e3505fd9583
172 172 Z 1:0d2164f0ce0d
173 173
174 174 revsets should not ignore divergent bookmarks
175 175
176 176 $ hg bookmark -fr 1 Z
177 177 $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n'
178 178 0:4e3505fd9583 Y
179 179 1:9b140be10808 @ X Z foobar
180 180 2:0d2164f0ce0d @foo X@foo
181 181 $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
182 182 2:0d2164f0ce0d @foo X@foo
183 183 $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
184 184 2:0d2164f0ce0d @foo X@foo
185 185
186 186 update a remote bookmark from a non-head to a head
187 187
188 188 $ hg up -q Y
189 189 $ echo c3 > f2
190 190 $ hg ci -Am3
191 191 adding f2
192 192 created new head
193 193 $ hg push ../a
194 194 pushing to ../a
195 195 searching for changes
196 196 adding changesets
197 197 adding manifests
198 198 adding file changes
199 199 added 1 changesets with 1 changes to 1 files (+1 heads)
200 200 updating bookmark Y
201 201 $ hg -R ../a book
202 202 @ 1:0d2164f0ce0d
203 203 * X 1:0d2164f0ce0d
204 204 Y 3:f6fc62dde3c0
205 205 Z 1:0d2164f0ce0d
206 206
207 207 update a bookmark in the middle of a client pulling changes
208 208
209 209 $ cd ..
210 210 $ hg clone -q a pull-race
211 211 $ hg clone -q pull-race pull-race2
212 212 $ cd pull-race
213 213 $ hg up -q Y
214 214 $ echo c4 > f2
215 215 $ hg ci -Am4
216 216 $ echo c5 > f3
217 217 $ cat <<EOF > .hg/hgrc
218 218 > [hooks]
219 219 > outgoing.makecommit = hg ci -Am5; echo committed in pull-race
220 220 > EOF
221 221 $ cd ../pull-race2
222 222 $ hg pull
223 223 pulling from $TESTTMP/pull-race (glob)
224 224 searching for changes
225 225 adding changesets
226 226 adding f3
227 227 committed in pull-race
228 228 adding manifests
229 229 adding file changes
230 230 added 1 changesets with 1 changes to 1 files
231 231 updating bookmark Y
232 232 (run 'hg update' to get a working copy)
233 233 $ hg book
234 234 * @ 1:0d2164f0ce0d
235 235 X 1:0d2164f0ce0d
236 236 Y 4:b0a5eff05604
237 237 Z 1:0d2164f0ce0d
238 238 $ cd ../b
239 239
240 240 diverging a remote bookmark fails
241 241
242 242 $ hg up -q 4e3505fd9583
243 243 $ echo c4 > f2
244 244 $ hg ci -Am4
245 245 adding f2
246 246 created new head
247 247 $ echo c5 > f2
248 248 $ hg ci -Am5
249 249 $ hg log -G
250 250 @ 5:c922c0139ca0 5
251 251 |
252 252 o 4:4efff6d98829 4
253 253 |
254 254 | o 3:f6fc62dde3c0 3
255 255 |/
256 256 | o 2:0d2164f0ce0d 1
257 257 |/
258 258 | o 1:9b140be10808 2
259 259 |/
260 260 o 0:4e3505fd9583 test
261 261
262 262
263 263 $ hg book -f Y
264 264
265 265 $ cat <<EOF > ../a/.hg/hgrc
266 266 > [web]
267 267 > push_ssl = false
268 268 > allow_push = *
269 269 > EOF
270 270
271 271 $ hg -R ../a serve -p $HGPORT2 -d --pid-file=../hg2.pid
272 272 $ cat ../hg2.pid >> $DAEMON_PIDS
273 273
274 274 $ hg push http://localhost:$HGPORT2/
275 275 pushing to http://localhost:$HGPORT2/
276 276 searching for changes
277 277 abort: push creates new remote head c922c0139ca0!
278 (did you forget to merge? use push -f to force)
278 (merge or see "hg help push" for details about pushing new heads)
279 279 [255]
280 280 $ hg -R ../a book
281 281 @ 1:0d2164f0ce0d
282 282 * X 1:0d2164f0ce0d
283 283 Y 3:f6fc62dde3c0
284 284 Z 1:0d2164f0ce0d
285 285
286 286
287 287 Unrelated marker does not alter the decision
288 288
289 289 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
290 290 $ hg push http://localhost:$HGPORT2/
291 291 pushing to http://localhost:$HGPORT2/
292 292 searching for changes
293 293 abort: push creates new remote head c922c0139ca0!
294 (did you forget to merge? use push -f to force)
294 (merge or see "hg help push" for details about pushing new heads)
295 295 [255]
296 296 $ hg -R ../a book
297 297 @ 1:0d2164f0ce0d
298 298 * X 1:0d2164f0ce0d
299 299 Y 3:f6fc62dde3c0
300 300 Z 1:0d2164f0ce0d
301 301
302 302 Update to a successor works
303 303
304 304 $ hg id --debug -r 3
305 305 f6fc62dde3c0771e29704af56ba4d8af77abcc2f
306 306 $ hg id --debug -r 4
307 307 4efff6d98829d9c824c621afd6e3f01865f5439f
308 308 $ hg id --debug -r 5
309 309 c922c0139ca03858f655e4a2af4dd02796a63969 tip Y
310 310 $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f cccccccccccccccccccccccccccccccccccccccc
311 311 $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc 4efff6d98829d9c824c621afd6e3f01865f5439f
312 312 $ hg push http://localhost:$HGPORT2/
313 313 pushing to http://localhost:$HGPORT2/
314 314 searching for changes
315 315 remote: adding changesets
316 316 remote: adding manifests
317 317 remote: adding file changes
318 318 remote: added 2 changesets with 2 changes to 1 files (+1 heads)
319 319 updating bookmark Y
320 320 $ hg -R ../a book
321 321 @ 1:0d2164f0ce0d
322 322 * X 1:0d2164f0ce0d
323 323 Y 5:c922c0139ca0
324 324 Z 1:0d2164f0ce0d
325 325
326 326 hgweb
327 327
328 328 $ cat <<EOF > .hg/hgrc
329 329 > [web]
330 330 > push_ssl = false
331 331 > allow_push = *
332 332 > EOF
333 333
334 334 $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
335 335 $ cat ../hg.pid >> $DAEMON_PIDS
336 336 $ cd ../a
337 337
338 338 $ hg debugpushkey http://localhost:$HGPORT/ namespaces
339 339 bookmarks
340 340 namespaces
341 341 obsolete
342 342 phases
343 343 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
344 344 @ 9b140be1080824d768c5a4691a564088eede71f9
345 345 X 9b140be1080824d768c5a4691a564088eede71f9
346 346 Y c922c0139ca03858f655e4a2af4dd02796a63969
347 347 Z 9b140be1080824d768c5a4691a564088eede71f9
348 348 foo 0000000000000000000000000000000000000000
349 349 foobar 9b140be1080824d768c5a4691a564088eede71f9
350 350 $ hg out -B http://localhost:$HGPORT/
351 351 comparing with http://localhost:$HGPORT/
352 352 searching for changed bookmarks
353 353 no changed bookmarks found
354 354 [1]
355 355 $ hg push -B Z http://localhost:$HGPORT/
356 356 pushing to http://localhost:$HGPORT/
357 357 searching for changes
358 358 no changes found
359 359 exporting bookmark Z
360 360 [1]
361 361 $ hg book -d Z
362 362 $ hg in -B http://localhost:$HGPORT/
363 363 comparing with http://localhost:$HGPORT/
364 364 searching for changed bookmarks
365 365 Z 0d2164f0ce0d
366 366 foo 000000000000
367 367 foobar 9b140be10808
368 368 $ hg pull -B Z http://localhost:$HGPORT/
369 369 pulling from http://localhost:$HGPORT/
370 370 no changes found
371 371 divergent bookmark @ stored as @1
372 372 divergent bookmark X stored as X@1
373 373 adding remote bookmark Z
374 374 adding remote bookmark foo
375 375 adding remote bookmark foobar
376 376 importing bookmark Z
377 377 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
378 378 requesting all changes
379 379 adding changesets
380 380 adding manifests
381 381 adding file changes
382 382 added 5 changesets with 5 changes to 3 files (+2 heads)
383 383 updating to bookmark @
384 384 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
385 385 $ hg -R cloned-bookmarks bookmarks
386 386 * @ 1:9b140be10808
387 387 X 1:9b140be10808
388 388 Y 4:c922c0139ca0
389 389 Z 2:0d2164f0ce0d
390 390 foo -1:000000000000
391 391 foobar 1:9b140be10808
392 392
393 393 $ cd ..
394 394
395 395 Pushing a bookmark should only push the changes required by that
396 396 bookmark, not all outgoing changes:
397 397 $ hg clone http://localhost:$HGPORT/ addmarks
398 398 requesting all changes
399 399 adding changesets
400 400 adding manifests
401 401 adding file changes
402 402 added 5 changesets with 5 changes to 3 files (+2 heads)
403 403 updating to bookmark @
404 404 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
405 405 $ cd addmarks
406 406 $ echo foo > foo
407 407 $ hg add foo
408 408 $ hg commit -m 'add foo'
409 409 $ echo bar > bar
410 410 $ hg add bar
411 411 $ hg commit -m 'add bar'
412 412 $ hg co "tip^"
413 413 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
414 414 $ hg book add-foo
415 415 $ hg book -r tip add-bar
416 416 Note: this push *must* push only a single changeset, as that's the point
417 417 of this test.
418 418 $ hg push -B add-foo --traceback
419 419 pushing to http://localhost:$HGPORT/
420 420 searching for changes
421 421 remote: adding changesets
422 422 remote: adding manifests
423 423 remote: adding file changes
424 424 remote: added 1 changesets with 1 changes to 1 files
425 425 exporting bookmark add-foo
426 426
427 427 $ cd ..
@@ -1,273 +1,273
1 1 Check that obsolete properly strip heads
2 2 $ cat > obs.py << EOF
3 3 > import mercurial.obsolete
4 4 > mercurial.obsolete._enabled = True
5 5 > EOF
6 6 $ cat >> $HGRCPATH << EOF
7 7 > [phases]
8 8 > # public changeset are not obsolete
9 9 > publish=false
10 10 > [ui]
11 11 > logtemplate='{node|short} ({phase}) {desc|firstline}\n'
12 12 > [extensions]
13 13 > graphlog=
14 14 > EOF
15 15 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
16 16 $ mkcommit() {
17 17 > echo "$1" > "$1"
18 18 > hg add "$1"
19 19 > hg ci -m "add $1"
20 20 > }
21 21 $ getid() {
22 22 > hg id --debug -ir "desc('$1')"
23 23 > }
24 24
25 25
26 26 $ hg init remote
27 27 $ cd remote
28 28 $ mkcommit base
29 29 $ hg phase --public .
30 30 $ cd ..
31 31 $ cp -r remote base
32 32 $ hg clone remote local
33 33 updating to branch default
34 34 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
35 35 $ cd local
36 36
37 37 New head replaces old head
38 38 ==========================
39 39
40 40 setup
41 41 (we add the 1 flags to prevent bumped error during the test)
42 42
43 43 $ mkcommit old
44 44 $ hg push
45 45 pushing to $TESTTMP/remote (glob)
46 46 searching for changes
47 47 adding changesets
48 48 adding manifests
49 49 adding file changes
50 50 added 1 changesets with 1 changes to 1 files
51 51 $ hg up -q '.^'
52 52 $ mkcommit new
53 53 created new head
54 54 $ hg debugobsolete --flags 1 `getid old` `getid new`
55 55 $ hg glog --hidden
56 56 @ 71e3228bffe1 (draft) add new
57 57 |
58 58 | x c70b08862e08 (draft) add old
59 59 |/
60 60 o b4952fcf48cf (public) add base
61 61
62 62 $ cp -r ../remote ../backup1
63 63
64 64 old exists remotely as draft. It is obsoleted by new that we now push.
65 65 Push should not warn about creating new head
66 66
67 67 $ hg push
68 68 pushing to $TESTTMP/remote (glob)
69 69 searching for changes
70 70 adding changesets
71 71 adding manifests
72 72 adding file changes
73 73 added 1 changesets with 1 changes to 1 files (+1 heads)
74 74
75 75 old head is now public (public local version)
76 76 =============================================
77 77
78 78 setup
79 79
80 80 $ rm -fr ../remote
81 81 $ cp -r ../backup1 ../remote
82 82 $ hg -R ../remote phase --public c70b08862e08
83 83 $ hg pull -v
84 84 pulling from $TESTTMP/remote (glob)
85 85 searching for changes
86 86 no changes found
87 87 $ hg glog --hidden
88 88 @ 71e3228bffe1 (draft) add new
89 89 |
90 90 | o c70b08862e08 (public) add old
91 91 |/
92 92 o b4952fcf48cf (public) add base
93 93
94 94
95 95 Abort: old will still be an head because it's public.
96 96
97 97 $ hg push
98 98 pushing to $TESTTMP/remote (glob)
99 99 searching for changes
100 100 abort: push creates new remote head 71e3228bffe1!
101 (did you forget to merge? use push -f to force)
101 (merge or see "hg help push" for details about pushing new heads)
102 102 [255]
103 103
104 104 old head is now public (public remote version)
105 105 ==============================================
106 106
107 107 TODO: Not implemented yet.
108 108
109 109 # setup
110 110 #
111 111 # $ rm -fr ../remote
112 112 # $ cp -r ../backup1 ../remote
113 113 # $ hg -R ../remote phase --public c70b08862e08
114 114 # $ hg phase --draft --force c70b08862e08
115 115 # $ hg glog --hidden
116 116 # @ 71e3228bffe1 (draft) add new
117 117 # |
118 118 # | x c70b08862e08 (draft) add old
119 119 # |/
120 120 # o b4952fcf48cf (public) add base
121 121 #
122 122 #
123 123 #
124 124 # Abort: old will still be an head because it's public.
125 125 #
126 126 # $ hg push
127 127 # pushing to $TESTTMP/remote
128 128 # searching for changes
129 129 # abort: push creates new remote head 71e3228bffe1!
130 # (did you forget to merge? use push -f to force)
130 # (merge or see "hg help push" for details about pushing new heads)
131 131 # [255]
132 132
133 133 old head is obsolete but replacement is not pushed
134 134 ==================================================
135 135
136 136 setup
137 137
138 138 $ rm -fr ../remote
139 139 $ cp -r ../backup1 ../remote
140 140 $ hg phase --draft --force '(0::) - 0'
141 141 $ hg up -q '.^'
142 142 $ mkcommit other
143 143 created new head
144 144 $ hg glog --hidden
145 145 @ d7d41ccbd4de (draft) add other
146 146 |
147 147 | o 71e3228bffe1 (draft) add new
148 148 |/
149 149 | x c70b08862e08 (draft) add old
150 150 |/
151 151 o b4952fcf48cf (public) add base
152 152
153 153
154 154 old exists remotely as draft. It is obsoleted by new but we don't push new.
155 155 Push should abort on new head
156 156
157 157 $ hg push -r 'desc("other")'
158 158 pushing to $TESTTMP/remote (glob)
159 159 searching for changes
160 160 abort: push creates new remote head d7d41ccbd4de!
161 (did you forget to merge? use push -f to force)
161 (merge or see "hg help push" for details about pushing new heads)
162 162 [255]
163 163
164 164
165 165
166 166 Both precursors and successors are already know remotely. Descendant adds heads
167 167 ===============================================================================
168 168
169 169 setup. (The obsolete marker is known locally only
170 170
171 171 $ cd ..
172 172 $ rm -rf local
173 173 $ hg clone remote local
174 174 updating to branch default
175 175 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 176 $ cd local
177 177 $ mkcommit old
178 178 old already tracked!
179 179 nothing changed
180 180 [1]
181 181 $ hg up -q '.^'
182 182 $ mkcommit new
183 183 created new head
184 184 $ hg push -f
185 185 pushing to $TESTTMP/remote (glob)
186 186 searching for changes
187 187 adding changesets
188 188 adding manifests
189 189 adding file changes
190 190 added 1 changesets with 1 changes to 1 files (+1 heads)
191 191 $ mkcommit desc1
192 192 $ hg up -q '.^'
193 193 $ mkcommit desc2
194 194 created new head
195 195 $ hg debugobsolete `getid old` `getid new`
196 196 $ hg glog --hidden
197 197 @ 5fe37041cc2b (draft) add desc2
198 198 |
199 199 | o a3ef1d111c5f (draft) add desc1
200 200 |/
201 201 o 71e3228bffe1 (draft) add new
202 202 |
203 203 | x c70b08862e08 (draft) add old
204 204 |/
205 205 o b4952fcf48cf (public) add base
206 206
207 207 $ hg glog --hidden -R ../remote
208 208 o 71e3228bffe1 (draft) add new
209 209 |
210 210 | o c70b08862e08 (draft) add old
211 211 |/
212 212 @ b4952fcf48cf (public) add base
213 213
214 214 $ cp -r ../remote ../backup2
215 215
216 216 Push should not warn about adding new heads. We create one, but we'll delete
217 217 one anyway.
218 218
219 219 $ hg push
220 220 pushing to $TESTTMP/remote (glob)
221 221 searching for changes
222 222 adding changesets
223 223 adding manifests
224 224 adding file changes
225 225 added 2 changesets with 2 changes to 2 files (+1 heads)
226 226
227 227
228 228 Remote head is unknown but obsoleted by a local changeset
229 229 =========================================================
230 230
231 231 setup
232 232
233 233 $ rm -fr ../remote
234 234 $ cp -r ../backup1 ../remote
235 235 $ cd ..
236 236 $ rm -rf local
237 237 $ hg clone remote local -r 0
238 238 adding changesets
239 239 adding manifests
240 240 adding file changes
241 241 added 1 changesets with 1 changes to 1 files
242 242 updating to branch default
243 243 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 244 $ cd local
245 245 $ mkcommit new
246 246 $ hg -R ../remote id --debug -r tip
247 247 c70b08862e0838ea6d7c59c85da2f1ed6c8d67da tip
248 248 $ hg id --debug -r tip
249 249 71e3228bffe1886550777233d6c97bb5a6b2a650 tip
250 250 $ hg debugobsolete c70b08862e0838ea6d7c59c85da2f1ed6c8d67da 71e3228bffe1886550777233d6c97bb5a6b2a650
251 251 $ hg glog --hidden
252 252 @ 71e3228bffe1 (draft) add new
253 253 |
254 254 o b4952fcf48cf (public) add base
255 255
256 256 $ hg glog --hidden -R ../remote
257 257 o c70b08862e08 (draft) add old
258 258 |
259 259 @ b4952fcf48cf (public) add base
260 260
261 261
262 262 Push should not complain about new heads.
263 263
264 264 It should not complain about "unsynced remote changes!" either but that's not
265 265 handled yet.
266 266
267 267 $ hg push --traceback
268 268 pushing to $TESTTMP/remote (glob)
269 269 searching for changes
270 270 adding changesets
271 271 adding manifests
272 272 adding file changes
273 273 added 1 changesets with 1 changes to 1 files (+1 heads)
@@ -1,1106 +1,1106
1 1 $ "$TESTDIR/hghave" killdaemons || exit 80
2 2
3 3 $ cat >> $HGRCPATH <<EOF
4 4 > [extensions]
5 5 > graphlog=
6 6 > EOF
7 7 $ hgph() { hg log -G --template "{rev} {phase} {desc} - {node|short}\n" $*; }
8 8
9 9 $ mkcommit() {
10 10 > echo "$1" > "$1"
11 11 > hg add "$1"
12 12 > message="$1"
13 13 > shift
14 14 > hg ci -m "$message" $*
15 15 > }
16 16
17 17 $ hg init alpha
18 18 $ cd alpha
19 19 $ mkcommit a-A
20 20 $ mkcommit a-B
21 21 $ mkcommit a-C
22 22 $ mkcommit a-D
23 23 $ hgph
24 24 @ 3 draft a-D - b555f63b6063
25 25 |
26 26 o 2 draft a-C - 54acac6f23ab
27 27 |
28 28 o 1 draft a-B - 548a3d25dbf0
29 29 |
30 30 o 0 draft a-A - 054250a37db4
31 31
32 32
33 33 $ hg init ../beta
34 34 $ hg push -r 1 ../beta
35 35 pushing to ../beta
36 36 searching for changes
37 37 adding changesets
38 38 adding manifests
39 39 adding file changes
40 40 added 2 changesets with 2 changes to 2 files
41 41 $ hgph
42 42 @ 3 draft a-D - b555f63b6063
43 43 |
44 44 o 2 draft a-C - 54acac6f23ab
45 45 |
46 46 o 1 public a-B - 548a3d25dbf0
47 47 |
48 48 o 0 public a-A - 054250a37db4
49 49
50 50
51 51 $ cd ../beta
52 52 $ hgph
53 53 o 1 public a-B - 548a3d25dbf0
54 54 |
55 55 o 0 public a-A - 054250a37db4
56 56
57 57 $ hg up -q
58 58 $ mkcommit b-A
59 59 $ hgph
60 60 @ 2 draft b-A - f54f1bb90ff3
61 61 |
62 62 o 1 public a-B - 548a3d25dbf0
63 63 |
64 64 o 0 public a-A - 054250a37db4
65 65
66 66 $ hg pull ../alpha
67 67 pulling from ../alpha
68 68 searching for changes
69 69 adding changesets
70 70 adding manifests
71 71 adding file changes
72 72 added 2 changesets with 2 changes to 2 files (+1 heads)
73 73 (run 'hg heads' to see heads, 'hg merge' to merge)
74 74 $ hgph
75 75 o 4 public a-D - b555f63b6063
76 76 |
77 77 o 3 public a-C - 54acac6f23ab
78 78 |
79 79 | @ 2 draft b-A - f54f1bb90ff3
80 80 |/
81 81 o 1 public a-B - 548a3d25dbf0
82 82 |
83 83 o 0 public a-A - 054250a37db4
84 84
85 85
86 86 pull did not updated ../alpha state.
87 87 push from alpha to beta should update phase even if nothing is transferred
88 88
89 89 $ cd ../alpha
90 90 $ hgph # not updated by remote pull
91 91 @ 3 draft a-D - b555f63b6063
92 92 |
93 93 o 2 draft a-C - 54acac6f23ab
94 94 |
95 95 o 1 public a-B - 548a3d25dbf0
96 96 |
97 97 o 0 public a-A - 054250a37db4
98 98
99 99 $ hg push ../beta
100 100 pushing to ../beta
101 101 searching for changes
102 102 no changes found
103 103 [1]
104 104 $ hgph
105 105 @ 3 public a-D - b555f63b6063
106 106 |
107 107 o 2 public a-C - 54acac6f23ab
108 108 |
109 109 o 1 public a-B - 548a3d25dbf0
110 110 |
111 111 o 0 public a-A - 054250a37db4
112 112
113 113
114 114 update must update phase of common changeset too
115 115
116 116 $ hg pull ../beta # getting b-A
117 117 pulling from ../beta
118 118 searching for changes
119 119 adding changesets
120 120 adding manifests
121 121 adding file changes
122 122 added 1 changesets with 1 changes to 1 files (+1 heads)
123 123 (run 'hg heads' to see heads, 'hg merge' to merge)
124 124
125 125 $ cd ../beta
126 126 $ hgph # not updated by remote pull
127 127 o 4 public a-D - b555f63b6063
128 128 |
129 129 o 3 public a-C - 54acac6f23ab
130 130 |
131 131 | @ 2 draft b-A - f54f1bb90ff3
132 132 |/
133 133 o 1 public a-B - 548a3d25dbf0
134 134 |
135 135 o 0 public a-A - 054250a37db4
136 136
137 137 $ hg pull ../alpha
138 138 pulling from ../alpha
139 139 searching for changes
140 140 no changes found
141 141 $ hgph
142 142 o 4 public a-D - b555f63b6063
143 143 |
144 144 o 3 public a-C - 54acac6f23ab
145 145 |
146 146 | @ 2 public b-A - f54f1bb90ff3
147 147 |/
148 148 o 1 public a-B - 548a3d25dbf0
149 149 |
150 150 o 0 public a-A - 054250a37db4
151 151
152 152
153 153 Publish configuration option
154 154 ----------------------------
155 155
156 156 Pull
157 157 ````
158 158
159 159 changegroup are added without phase movement
160 160
161 161 $ hg bundle -a ../base.bundle
162 162 5 changesets found
163 163 $ cd ..
164 164 $ hg init mu
165 165 $ cd mu
166 166 $ cat > .hg/hgrc << EOF
167 167 > [phases]
168 168 > publish=0
169 169 > EOF
170 170 $ hg unbundle ../base.bundle
171 171 adding changesets
172 172 adding manifests
173 173 adding file changes
174 174 added 5 changesets with 5 changes to 5 files (+1 heads)
175 175 (run 'hg heads' to see heads, 'hg merge' to merge)
176 176 $ hgph
177 177 o 4 draft a-D - b555f63b6063
178 178 |
179 179 o 3 draft a-C - 54acac6f23ab
180 180 |
181 181 | o 2 draft b-A - f54f1bb90ff3
182 182 |/
183 183 o 1 draft a-B - 548a3d25dbf0
184 184 |
185 185 o 0 draft a-A - 054250a37db4
186 186
187 187 $ cd ..
188 188
189 189 Pulling from publish=False to publish=False does not move boundary.
190 190
191 191 $ hg init nu
192 192 $ cd nu
193 193 $ cat > .hg/hgrc << EOF
194 194 > [phases]
195 195 > publish=0
196 196 > EOF
197 197 $ hg pull ../mu -r 54acac6f23ab
198 198 pulling from ../mu
199 199 adding changesets
200 200 adding manifests
201 201 adding file changes
202 202 added 3 changesets with 3 changes to 3 files
203 203 (run 'hg update' to get a working copy)
204 204 $ hgph
205 205 o 2 draft a-C - 54acac6f23ab
206 206 |
207 207 o 1 draft a-B - 548a3d25dbf0
208 208 |
209 209 o 0 draft a-A - 054250a37db4
210 210
211 211
212 212 Even for common
213 213
214 214 $ hg pull ../mu -r f54f1bb90ff3
215 215 pulling from ../mu
216 216 searching for changes
217 217 adding changesets
218 218 adding manifests
219 219 adding file changes
220 220 added 1 changesets with 1 changes to 1 files (+1 heads)
221 221 (run 'hg heads' to see heads, 'hg merge' to merge)
222 222 $ hgph
223 223 o 3 draft b-A - f54f1bb90ff3
224 224 |
225 225 | o 2 draft a-C - 54acac6f23ab
226 226 |/
227 227 o 1 draft a-B - 548a3d25dbf0
228 228 |
229 229 o 0 draft a-A - 054250a37db4
230 230
231 231
232 232
233 233 Pulling from Publish=True to Publish=False move boundary in common set.
234 234 we are in nu
235 235
236 236 $ hg pull ../alpha -r b555f63b6063
237 237 pulling from ../alpha
238 238 searching for changes
239 239 adding changesets
240 240 adding manifests
241 241 adding file changes
242 242 added 1 changesets with 1 changes to 1 files
243 243 (run 'hg update' to get a working copy)
244 244 $ hgph # f54f1bb90ff3 stay draft, not ancestor of -r
245 245 o 4 public a-D - b555f63b6063
246 246 |
247 247 | o 3 draft b-A - f54f1bb90ff3
248 248 | |
249 249 o | 2 public a-C - 54acac6f23ab
250 250 |/
251 251 o 1 public a-B - 548a3d25dbf0
252 252 |
253 253 o 0 public a-A - 054250a37db4
254 254
255 255
256 256 pulling from Publish=False to publish=False with some public
257 257
258 258 $ hg up -q f54f1bb90ff3
259 259 $ mkcommit n-A
260 260 $ mkcommit n-B
261 261 $ hgph
262 262 @ 6 draft n-B - 145e75495359
263 263 |
264 264 o 5 draft n-A - d6bcb4f74035
265 265 |
266 266 | o 4 public a-D - b555f63b6063
267 267 | |
268 268 o | 3 draft b-A - f54f1bb90ff3
269 269 | |
270 270 | o 2 public a-C - 54acac6f23ab
271 271 |/
272 272 o 1 public a-B - 548a3d25dbf0
273 273 |
274 274 o 0 public a-A - 054250a37db4
275 275
276 276 $ cd ../mu
277 277 $ hg pull ../nu
278 278 pulling from ../nu
279 279 searching for changes
280 280 adding changesets
281 281 adding manifests
282 282 adding file changes
283 283 added 2 changesets with 2 changes to 2 files
284 284 (run 'hg update' to get a working copy)
285 285 $ hgph
286 286 o 6 draft n-B - 145e75495359
287 287 |
288 288 o 5 draft n-A - d6bcb4f74035
289 289 |
290 290 | o 4 public a-D - b555f63b6063
291 291 | |
292 292 | o 3 public a-C - 54acac6f23ab
293 293 | |
294 294 o | 2 draft b-A - f54f1bb90ff3
295 295 |/
296 296 o 1 public a-B - 548a3d25dbf0
297 297 |
298 298 o 0 public a-A - 054250a37db4
299 299
300 300 $ cd ..
301 301
302 302 pulling into publish=True
303 303
304 304 $ cd alpha
305 305 $ hgph
306 306 o 4 public b-A - f54f1bb90ff3
307 307 |
308 308 | @ 3 public a-D - b555f63b6063
309 309 | |
310 310 | o 2 public a-C - 54acac6f23ab
311 311 |/
312 312 o 1 public a-B - 548a3d25dbf0
313 313 |
314 314 o 0 public a-A - 054250a37db4
315 315
316 316 $ hg pull ../mu
317 317 pulling from ../mu
318 318 searching for changes
319 319 adding changesets
320 320 adding manifests
321 321 adding file changes
322 322 added 2 changesets with 2 changes to 2 files
323 323 (run 'hg update' to get a working copy)
324 324 $ hgph
325 325 o 6 draft n-B - 145e75495359
326 326 |
327 327 o 5 draft n-A - d6bcb4f74035
328 328 |
329 329 o 4 public b-A - f54f1bb90ff3
330 330 |
331 331 | @ 3 public a-D - b555f63b6063
332 332 | |
333 333 | o 2 public a-C - 54acac6f23ab
334 334 |/
335 335 o 1 public a-B - 548a3d25dbf0
336 336 |
337 337 o 0 public a-A - 054250a37db4
338 338
339 339 $ cd ..
340 340
341 341 pulling back into original repo
342 342
343 343 $ cd nu
344 344 $ hg pull ../alpha
345 345 pulling from ../alpha
346 346 searching for changes
347 347 no changes found
348 348 $ hgph
349 349 @ 6 public n-B - 145e75495359
350 350 |
351 351 o 5 public n-A - d6bcb4f74035
352 352 |
353 353 | o 4 public a-D - b555f63b6063
354 354 | |
355 355 o | 3 public b-A - f54f1bb90ff3
356 356 | |
357 357 | o 2 public a-C - 54acac6f23ab
358 358 |/
359 359 o 1 public a-B - 548a3d25dbf0
360 360 |
361 361 o 0 public a-A - 054250a37db4
362 362
363 363
364 364 Push
365 365 ````
366 366
367 367 (inserted)
368 368
369 369 Test that phase are pushed even when they are nothing to pus
370 370 (this might be tested later bu are very convenient to not alter too much test)
371 371
372 372 Push back to alpha
373 373
374 374 $ hg push ../alpha # from nu
375 375 pushing to ../alpha
376 376 searching for changes
377 377 no changes found
378 378 [1]
379 379 $ cd ..
380 380 $ cd alpha
381 381 $ hgph
382 382 o 6 public n-B - 145e75495359
383 383 |
384 384 o 5 public n-A - d6bcb4f74035
385 385 |
386 386 o 4 public b-A - f54f1bb90ff3
387 387 |
388 388 | @ 3 public a-D - b555f63b6063
389 389 | |
390 390 | o 2 public a-C - 54acac6f23ab
391 391 |/
392 392 o 1 public a-B - 548a3d25dbf0
393 393 |
394 394 o 0 public a-A - 054250a37db4
395 395
396 396
397 397 (end insertion)
398 398
399 399
400 400 initial setup
401 401
402 402 $ hg glog # of alpha
403 403 o changeset: 6:145e75495359
404 404 | tag: tip
405 405 | user: test
406 406 | date: Thu Jan 01 00:00:00 1970 +0000
407 407 | summary: n-B
408 408 |
409 409 o changeset: 5:d6bcb4f74035
410 410 | user: test
411 411 | date: Thu Jan 01 00:00:00 1970 +0000
412 412 | summary: n-A
413 413 |
414 414 o changeset: 4:f54f1bb90ff3
415 415 | parent: 1:548a3d25dbf0
416 416 | user: test
417 417 | date: Thu Jan 01 00:00:00 1970 +0000
418 418 | summary: b-A
419 419 |
420 420 | @ changeset: 3:b555f63b6063
421 421 | | user: test
422 422 | | date: Thu Jan 01 00:00:00 1970 +0000
423 423 | | summary: a-D
424 424 | |
425 425 | o changeset: 2:54acac6f23ab
426 426 |/ user: test
427 427 | date: Thu Jan 01 00:00:00 1970 +0000
428 428 | summary: a-C
429 429 |
430 430 o changeset: 1:548a3d25dbf0
431 431 | user: test
432 432 | date: Thu Jan 01 00:00:00 1970 +0000
433 433 | summary: a-B
434 434 |
435 435 o changeset: 0:054250a37db4
436 436 user: test
437 437 date: Thu Jan 01 00:00:00 1970 +0000
438 438 summary: a-A
439 439
440 440 $ mkcommit a-E
441 441 $ mkcommit a-F
442 442 $ mkcommit a-G
443 443 $ hg up d6bcb4f74035 -q
444 444 $ mkcommit a-H
445 445 created new head
446 446 $ hgph
447 447 @ 10 draft a-H - 967b449fbc94
448 448 |
449 449 | o 9 draft a-G - 3e27b6f1eee1
450 450 | |
451 451 | o 8 draft a-F - b740e3e5c05d
452 452 | |
453 453 | o 7 draft a-E - e9f537e46dea
454 454 | |
455 455 +---o 6 public n-B - 145e75495359
456 456 | |
457 457 o | 5 public n-A - d6bcb4f74035
458 458 | |
459 459 o | 4 public b-A - f54f1bb90ff3
460 460 | |
461 461 | o 3 public a-D - b555f63b6063
462 462 | |
463 463 | o 2 public a-C - 54acac6f23ab
464 464 |/
465 465 o 1 public a-B - 548a3d25dbf0
466 466 |
467 467 o 0 public a-A - 054250a37db4
468 468
469 469
470 470 Pulling from bundle does not alter phases of changeset not present in the bundle
471 471
472 472 $ hg bundle --base 1 -r 6 -r 3 ../partial-bundle.hg
473 473 5 changesets found
474 474 $ hg pull ../partial-bundle.hg
475 475 pulling from ../partial-bundle.hg
476 476 searching for changes
477 477 no changes found
478 478 $ hgph
479 479 @ 10 draft a-H - 967b449fbc94
480 480 |
481 481 | o 9 draft a-G - 3e27b6f1eee1
482 482 | |
483 483 | o 8 draft a-F - b740e3e5c05d
484 484 | |
485 485 | o 7 draft a-E - e9f537e46dea
486 486 | |
487 487 +---o 6 public n-B - 145e75495359
488 488 | |
489 489 o | 5 public n-A - d6bcb4f74035
490 490 | |
491 491 o | 4 public b-A - f54f1bb90ff3
492 492 | |
493 493 | o 3 public a-D - b555f63b6063
494 494 | |
495 495 | o 2 public a-C - 54acac6f23ab
496 496 |/
497 497 o 1 public a-B - 548a3d25dbf0
498 498 |
499 499 o 0 public a-A - 054250a37db4
500 500
501 501
502 502 Pushing to Publish=False (unknown changeset)
503 503
504 504 $ hg push ../mu -r b740e3e5c05d # a-F
505 505 pushing to ../mu
506 506 searching for changes
507 507 adding changesets
508 508 adding manifests
509 509 adding file changes
510 510 added 2 changesets with 2 changes to 2 files
511 511 $ hgph
512 512 @ 10 draft a-H - 967b449fbc94
513 513 |
514 514 | o 9 draft a-G - 3e27b6f1eee1
515 515 | |
516 516 | o 8 draft a-F - b740e3e5c05d
517 517 | |
518 518 | o 7 draft a-E - e9f537e46dea
519 519 | |
520 520 +---o 6 public n-B - 145e75495359
521 521 | |
522 522 o | 5 public n-A - d6bcb4f74035
523 523 | |
524 524 o | 4 public b-A - f54f1bb90ff3
525 525 | |
526 526 | o 3 public a-D - b555f63b6063
527 527 | |
528 528 | o 2 public a-C - 54acac6f23ab
529 529 |/
530 530 o 1 public a-B - 548a3d25dbf0
531 531 |
532 532 o 0 public a-A - 054250a37db4
533 533
534 534
535 535 $ cd ../mu
536 536 $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft,
537 537 > # not ancestor of -r
538 538 o 8 draft a-F - b740e3e5c05d
539 539 |
540 540 o 7 draft a-E - e9f537e46dea
541 541 |
542 542 | o 6 draft n-B - 145e75495359
543 543 | |
544 544 | o 5 draft n-A - d6bcb4f74035
545 545 | |
546 546 o | 4 public a-D - b555f63b6063
547 547 | |
548 548 o | 3 public a-C - 54acac6f23ab
549 549 | |
550 550 | o 2 draft b-A - f54f1bb90ff3
551 551 |/
552 552 o 1 public a-B - 548a3d25dbf0
553 553 |
554 554 o 0 public a-A - 054250a37db4
555 555
556 556
557 557 Pushing to Publish=True (unknown changeset)
558 558
559 559 $ hg push ../beta -r b740e3e5c05d
560 560 pushing to ../beta
561 561 searching for changes
562 562 adding changesets
563 563 adding manifests
564 564 adding file changes
565 565 added 2 changesets with 2 changes to 2 files
566 566 $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft,
567 567 > # not ancestor of -r
568 568 o 8 public a-F - b740e3e5c05d
569 569 |
570 570 o 7 public a-E - e9f537e46dea
571 571 |
572 572 | o 6 draft n-B - 145e75495359
573 573 | |
574 574 | o 5 draft n-A - d6bcb4f74035
575 575 | |
576 576 o | 4 public a-D - b555f63b6063
577 577 | |
578 578 o | 3 public a-C - 54acac6f23ab
579 579 | |
580 580 | o 2 draft b-A - f54f1bb90ff3
581 581 |/
582 582 o 1 public a-B - 548a3d25dbf0
583 583 |
584 584 o 0 public a-A - 054250a37db4
585 585
586 586
587 587 Pushing to Publish=True (common changeset)
588 588
589 589 $ cd ../beta
590 590 $ hg push ../alpha
591 591 pushing to ../alpha
592 592 searching for changes
593 593 no changes found
594 594 [1]
595 595 $ hgph
596 596 o 6 public a-F - b740e3e5c05d
597 597 |
598 598 o 5 public a-E - e9f537e46dea
599 599 |
600 600 o 4 public a-D - b555f63b6063
601 601 |
602 602 o 3 public a-C - 54acac6f23ab
603 603 |
604 604 | @ 2 public b-A - f54f1bb90ff3
605 605 |/
606 606 o 1 public a-B - 548a3d25dbf0
607 607 |
608 608 o 0 public a-A - 054250a37db4
609 609
610 610 $ cd ../alpha
611 611 $ hgph
612 612 @ 10 draft a-H - 967b449fbc94
613 613 |
614 614 | o 9 draft a-G - 3e27b6f1eee1
615 615 | |
616 616 | o 8 public a-F - b740e3e5c05d
617 617 | |
618 618 | o 7 public a-E - e9f537e46dea
619 619 | |
620 620 +---o 6 public n-B - 145e75495359
621 621 | |
622 622 o | 5 public n-A - d6bcb4f74035
623 623 | |
624 624 o | 4 public b-A - f54f1bb90ff3
625 625 | |
626 626 | o 3 public a-D - b555f63b6063
627 627 | |
628 628 | o 2 public a-C - 54acac6f23ab
629 629 |/
630 630 o 1 public a-B - 548a3d25dbf0
631 631 |
632 632 o 0 public a-A - 054250a37db4
633 633
634 634
635 635 Pushing to Publish=False (common changeset that change phase + unknown one)
636 636
637 637 $ hg push ../mu -r 967b449fbc94 -f
638 638 pushing to ../mu
639 639 searching for changes
640 640 adding changesets
641 641 adding manifests
642 642 adding file changes
643 643 added 1 changesets with 1 changes to 1 files (+1 heads)
644 644 $ hgph
645 645 @ 10 draft a-H - 967b449fbc94
646 646 |
647 647 | o 9 draft a-G - 3e27b6f1eee1
648 648 | |
649 649 | o 8 public a-F - b740e3e5c05d
650 650 | |
651 651 | o 7 public a-E - e9f537e46dea
652 652 | |
653 653 +---o 6 public n-B - 145e75495359
654 654 | |
655 655 o | 5 public n-A - d6bcb4f74035
656 656 | |
657 657 o | 4 public b-A - f54f1bb90ff3
658 658 | |
659 659 | o 3 public a-D - b555f63b6063
660 660 | |
661 661 | o 2 public a-C - 54acac6f23ab
662 662 |/
663 663 o 1 public a-B - 548a3d25dbf0
664 664 |
665 665 o 0 public a-A - 054250a37db4
666 666
667 667 $ cd ../mu
668 668 $ hgph # d6bcb4f74035 should have changed phase
669 669 > # 145e75495359 is still draft. not ancestor of -r
670 670 o 9 draft a-H - 967b449fbc94
671 671 |
672 672 | o 8 public a-F - b740e3e5c05d
673 673 | |
674 674 | o 7 public a-E - e9f537e46dea
675 675 | |
676 676 +---o 6 draft n-B - 145e75495359
677 677 | |
678 678 o | 5 public n-A - d6bcb4f74035
679 679 | |
680 680 | o 4 public a-D - b555f63b6063
681 681 | |
682 682 | o 3 public a-C - 54acac6f23ab
683 683 | |
684 684 o | 2 public b-A - f54f1bb90ff3
685 685 |/
686 686 o 1 public a-B - 548a3d25dbf0
687 687 |
688 688 o 0 public a-A - 054250a37db4
689 689
690 690
691 691
692 692 Pushing to Publish=True (common changeset from publish=False)
693 693
694 694 (in mu)
695 695 $ hg push ../alpha
696 696 pushing to ../alpha
697 697 searching for changes
698 698 no changes found
699 699 [1]
700 700 $ hgph
701 701 o 9 public a-H - 967b449fbc94
702 702 |
703 703 | o 8 public a-F - b740e3e5c05d
704 704 | |
705 705 | o 7 public a-E - e9f537e46dea
706 706 | |
707 707 +---o 6 public n-B - 145e75495359
708 708 | |
709 709 o | 5 public n-A - d6bcb4f74035
710 710 | |
711 711 | o 4 public a-D - b555f63b6063
712 712 | |
713 713 | o 3 public a-C - 54acac6f23ab
714 714 | |
715 715 o | 2 public b-A - f54f1bb90ff3
716 716 |/
717 717 o 1 public a-B - 548a3d25dbf0
718 718 |
719 719 o 0 public a-A - 054250a37db4
720 720
721 721 $ hgph -R ../alpha # a-H should have been synced to 0
722 722 @ 10 public a-H - 967b449fbc94
723 723 |
724 724 | o 9 draft a-G - 3e27b6f1eee1
725 725 | |
726 726 | o 8 public a-F - b740e3e5c05d
727 727 | |
728 728 | o 7 public a-E - e9f537e46dea
729 729 | |
730 730 +---o 6 public n-B - 145e75495359
731 731 | |
732 732 o | 5 public n-A - d6bcb4f74035
733 733 | |
734 734 o | 4 public b-A - f54f1bb90ff3
735 735 | |
736 736 | o 3 public a-D - b555f63b6063
737 737 | |
738 738 | o 2 public a-C - 54acac6f23ab
739 739 |/
740 740 o 1 public a-B - 548a3d25dbf0
741 741 |
742 742 o 0 public a-A - 054250a37db4
743 743
744 744
745 745
746 746 Discovery locally secret changeset on a remote repository:
747 747
748 748 - should make it non-secret
749 749
750 750 $ cd ../alpha
751 751 $ mkcommit A-secret --config phases.new-commit=2
752 752 $ hgph
753 753 @ 11 secret A-secret - 435b5d83910c
754 754 |
755 755 o 10 public a-H - 967b449fbc94
756 756 |
757 757 | o 9 draft a-G - 3e27b6f1eee1
758 758 | |
759 759 | o 8 public a-F - b740e3e5c05d
760 760 | |
761 761 | o 7 public a-E - e9f537e46dea
762 762 | |
763 763 +---o 6 public n-B - 145e75495359
764 764 | |
765 765 o | 5 public n-A - d6bcb4f74035
766 766 | |
767 767 o | 4 public b-A - f54f1bb90ff3
768 768 | |
769 769 | o 3 public a-D - b555f63b6063
770 770 | |
771 771 | o 2 public a-C - 54acac6f23ab
772 772 |/
773 773 o 1 public a-B - 548a3d25dbf0
774 774 |
775 775 o 0 public a-A - 054250a37db4
776 776
777 777 $ hg bundle --base 'parents(.)' -r . ../secret-bundle.hg
778 778 1 changesets found
779 779 $ hg -R ../mu unbundle ../secret-bundle.hg
780 780 adding changesets
781 781 adding manifests
782 782 adding file changes
783 783 added 1 changesets with 1 changes to 1 files
784 784 (run 'hg update' to get a working copy)
785 785 $ hgph -R ../mu
786 786 o 10 draft A-secret - 435b5d83910c
787 787 |
788 788 o 9 public a-H - 967b449fbc94
789 789 |
790 790 | o 8 public a-F - b740e3e5c05d
791 791 | |
792 792 | o 7 public a-E - e9f537e46dea
793 793 | |
794 794 +---o 6 public n-B - 145e75495359
795 795 | |
796 796 o | 5 public n-A - d6bcb4f74035
797 797 | |
798 798 | o 4 public a-D - b555f63b6063
799 799 | |
800 800 | o 3 public a-C - 54acac6f23ab
801 801 | |
802 802 o | 2 public b-A - f54f1bb90ff3
803 803 |/
804 804 o 1 public a-B - 548a3d25dbf0
805 805 |
806 806 o 0 public a-A - 054250a37db4
807 807
808 808 $ hg pull ../mu
809 809 pulling from ../mu
810 810 searching for changes
811 811 no changes found
812 812 $ hgph
813 813 @ 11 draft A-secret - 435b5d83910c
814 814 |
815 815 o 10 public a-H - 967b449fbc94
816 816 |
817 817 | o 9 draft a-G - 3e27b6f1eee1
818 818 | |
819 819 | o 8 public a-F - b740e3e5c05d
820 820 | |
821 821 | o 7 public a-E - e9f537e46dea
822 822 | |
823 823 +---o 6 public n-B - 145e75495359
824 824 | |
825 825 o | 5 public n-A - d6bcb4f74035
826 826 | |
827 827 o | 4 public b-A - f54f1bb90ff3
828 828 | |
829 829 | o 3 public a-D - b555f63b6063
830 830 | |
831 831 | o 2 public a-C - 54acac6f23ab
832 832 |/
833 833 o 1 public a-B - 548a3d25dbf0
834 834 |
835 835 o 0 public a-A - 054250a37db4
836 836
837 837
838 838 pushing a locally public and draft changesets remotly secret should make them
839 839 appear on the remote side.
840 840
841 841
842 842 $ hg -R ../mu phase --secret --force 967b449fbc94
843 843 $ hg push -r 435b5d83910c ../mu
844 844 pushing to ../mu
845 845 searching for changes
846 846 abort: push creates new remote head 435b5d83910c!
847 (did you forget to merge? use push -f to force)
847 (merge or see "hg help push" for details about pushing new heads)
848 848 [255]
849 849 $ hg push -fr 435b5d83910c ../mu # because the push will create new visible head
850 850 pushing to ../mu
851 851 searching for changes
852 852 adding changesets
853 853 adding manifests
854 854 adding file changes
855 855 added 0 changesets with 0 changes to 2 files
856 856 $ hgph -R ../mu
857 857 o 10 draft A-secret - 435b5d83910c
858 858 |
859 859 o 9 public a-H - 967b449fbc94
860 860 |
861 861 | o 8 public a-F - b740e3e5c05d
862 862 | |
863 863 | o 7 public a-E - e9f537e46dea
864 864 | |
865 865 +---o 6 public n-B - 145e75495359
866 866 | |
867 867 o | 5 public n-A - d6bcb4f74035
868 868 | |
869 869 | o 4 public a-D - b555f63b6063
870 870 | |
871 871 | o 3 public a-C - 54acac6f23ab
872 872 | |
873 873 o | 2 public b-A - f54f1bb90ff3
874 874 |/
875 875 o 1 public a-B - 548a3d25dbf0
876 876 |
877 877 o 0 public a-A - 054250a37db4
878 878
879 879
880 880 pull new changeset with common draft locally
881 881
882 882 $ hg up -q 967b449fbc94 # create a new root for draft
883 883 $ mkcommit 'alpha-more'
884 884 created new head
885 885 $ hg push -fr . ../mu
886 886 pushing to ../mu
887 887 searching for changes
888 888 adding changesets
889 889 adding manifests
890 890 adding file changes
891 891 added 1 changesets with 1 changes to 1 files (+1 heads)
892 892 $ cd ../mu
893 893 $ hg phase --secret --force 1c5cfd894796
894 894 $ hg up -q 435b5d83910c
895 895 $ mkcommit 'mu-more'
896 896 $ cd ../alpha
897 897 $ hg pull ../mu
898 898 pulling from ../mu
899 899 searching for changes
900 900 adding changesets
901 901 adding manifests
902 902 adding file changes
903 903 added 1 changesets with 1 changes to 1 files
904 904 (run 'hg update' to get a working copy)
905 905 $ hgph
906 906 o 13 draft mu-more - 5237fb433fc8
907 907 |
908 908 | @ 12 draft alpha-more - 1c5cfd894796
909 909 | |
910 910 o | 11 draft A-secret - 435b5d83910c
911 911 |/
912 912 o 10 public a-H - 967b449fbc94
913 913 |
914 914 | o 9 draft a-G - 3e27b6f1eee1
915 915 | |
916 916 | o 8 public a-F - b740e3e5c05d
917 917 | |
918 918 | o 7 public a-E - e9f537e46dea
919 919 | |
920 920 +---o 6 public n-B - 145e75495359
921 921 | |
922 922 o | 5 public n-A - d6bcb4f74035
923 923 | |
924 924 o | 4 public b-A - f54f1bb90ff3
925 925 | |
926 926 | o 3 public a-D - b555f63b6063
927 927 | |
928 928 | o 2 public a-C - 54acac6f23ab
929 929 |/
930 930 o 1 public a-B - 548a3d25dbf0
931 931 |
932 932 o 0 public a-A - 054250a37db4
933 933
934 934
935 935 Test that test are properly ignored on remote event when existing locally
936 936
937 937 $ cd ..
938 938 $ hg clone -qU -r b555f63b6063 -r f54f1bb90ff3 beta gamma
939 939
940 940 # pathological case are
941 941 #
942 942 # * secret remotely
943 943 # * known locally
944 944 # * repo have uncommon changeset
945 945
946 946 $ hg -R beta phase --secret --force f54f1bb90ff3
947 947 $ hg -R gamma phase --draft --force f54f1bb90ff3
948 948
949 949 $ cd gamma
950 950 $ hg pull ../beta
951 951 pulling from ../beta
952 952 searching for changes
953 953 adding changesets
954 954 adding manifests
955 955 adding file changes
956 956 added 2 changesets with 2 changes to 2 files
957 957 (run 'hg update' to get a working copy)
958 958 $ hg phase f54f1bb90ff3
959 959 2: draft
960 960
961 961 same over the wire
962 962
963 963 $ cd ../beta
964 964 $ hg serve -p $HGPORT -d --pid-file=../beta.pid -E ../beta-error.log
965 965 $ cat ../beta.pid >> $DAEMON_PIDS
966 966 $ cd ../gamma
967 967
968 968 $ hg pull http://localhost:$HGPORT/
969 969 pulling from http://localhost:$HGPORT/
970 970 searching for changes
971 971 no changes found
972 972 $ hg phase f54f1bb90ff3
973 973 2: draft
974 974
975 975 check that secret local on both side are not synced to public
976 976
977 977 $ hg push -r b555f63b6063 http://localhost:$HGPORT/
978 978 pushing to http://localhost:$HGPORT/
979 979 searching for changes
980 980 no changes found
981 981 [1]
982 982 $ hg phase f54f1bb90ff3
983 983 2: draft
984 984
985 985 put the changeset in the draft state again
986 986 (first test after this one expect to be able to copy)
987 987
988 988 $ cd ..
989 989
990 990
991 991 Test Clone behavior
992 992
993 993 A. Clone without secret changeset
994 994
995 995 1. cloning non-publishing repository
996 996 (Phase should be preserved)
997 997
998 998 # make sure there is no secret so we can use a copy clone
999 999
1000 1000 $ hg -R mu phase --draft 'secret()'
1001 1001
1002 1002 $ hg clone -U mu Tau
1003 1003 $ hgph -R Tau
1004 1004 o 12 draft mu-more - 5237fb433fc8
1005 1005 |
1006 1006 | o 11 draft alpha-more - 1c5cfd894796
1007 1007 | |
1008 1008 o | 10 draft A-secret - 435b5d83910c
1009 1009 |/
1010 1010 o 9 public a-H - 967b449fbc94
1011 1011 |
1012 1012 | o 8 public a-F - b740e3e5c05d
1013 1013 | |
1014 1014 | o 7 public a-E - e9f537e46dea
1015 1015 | |
1016 1016 +---o 6 public n-B - 145e75495359
1017 1017 | |
1018 1018 o | 5 public n-A - d6bcb4f74035
1019 1019 | |
1020 1020 | o 4 public a-D - b555f63b6063
1021 1021 | |
1022 1022 | o 3 public a-C - 54acac6f23ab
1023 1023 | |
1024 1024 o | 2 public b-A - f54f1bb90ff3
1025 1025 |/
1026 1026 o 1 public a-B - 548a3d25dbf0
1027 1027 |
1028 1028 o 0 public a-A - 054250a37db4
1029 1029
1030 1030
1031 1031 2. cloning publishing repository
1032 1032
1033 1033 (everything should be public)
1034 1034
1035 1035 $ hg clone -U alpha Upsilon
1036 1036 $ hgph -R Upsilon
1037 1037 o 13 public mu-more - 5237fb433fc8
1038 1038 |
1039 1039 | o 12 public alpha-more - 1c5cfd894796
1040 1040 | |
1041 1041 o | 11 public A-secret - 435b5d83910c
1042 1042 |/
1043 1043 o 10 public a-H - 967b449fbc94
1044 1044 |
1045 1045 | o 9 public a-G - 3e27b6f1eee1
1046 1046 | |
1047 1047 | o 8 public a-F - b740e3e5c05d
1048 1048 | |
1049 1049 | o 7 public a-E - e9f537e46dea
1050 1050 | |
1051 1051 +---o 6 public n-B - 145e75495359
1052 1052 | |
1053 1053 o | 5 public n-A - d6bcb4f74035
1054 1054 | |
1055 1055 o | 4 public b-A - f54f1bb90ff3
1056 1056 | |
1057 1057 | o 3 public a-D - b555f63b6063
1058 1058 | |
1059 1059 | o 2 public a-C - 54acac6f23ab
1060 1060 |/
1061 1061 o 1 public a-B - 548a3d25dbf0
1062 1062 |
1063 1063 o 0 public a-A - 054250a37db4
1064 1064
1065 1065 #if unix-permissions
1066 1066
1067 1067 Pushing From an unlockable repo
1068 1068 --------------------------------
1069 1069 (issue3684)
1070 1070
1071 1071 Unability to lock the source repo should not prevent the push. It will prevent
1072 1072 the retrieval of remote phase during push. For example, pushing to a publishing
1073 1073 server won't turn changeset public.
1074 1074
1075 1075 1. Test that push is not prevented
1076 1076
1077 1077 $ hg init Phi
1078 1078 $ cd Upsilon
1079 1079 $ chmod -R -w .hg
1080 1080 $ hg push ../Phi
1081 1081 pushing to ../Phi
1082 1082 searching for changes
1083 1083 adding changesets
1084 1084 adding manifests
1085 1085 adding file changes
1086 1086 added 14 changesets with 14 changes to 14 files (+3 heads)
1087 1087 $ chmod -R +w .hg
1088 1088
1089 1089 2. Test that failed phases movement are reported
1090 1090
1091 1091 $ hg phase --force --draft 3
1092 1092 $ chmod -R -w .hg
1093 1093 $ hg push ../Phi
1094 1094 pushing to ../Phi
1095 1095 searching for changes
1096 1096 no changes found
1097 1097 cannot lock source repo, skipping local public phase update
1098 1098 [1]
1099 1099 $ chmod -R +w .hg
1100 1100 $ hgph Upsilon
1101 1101
1102 1102 $ cd ..
1103 1103
1104 1104 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1105 1105
1106 1106 #endif
@@ -1,755 +1,755
1 1 $ echo "[extensions]" >> $HGRCPATH
2 2 $ echo "graphlog=" >> $HGRCPATH
3 3
4 4 $ hg init a
5 5 $ cd a
6 6 $ echo foo > t1
7 7 $ hg add t1
8 8 $ hg commit -m "1"
9 9
10 10 $ cd ..
11 11 $ hg clone a b
12 12 updating to branch default
13 13 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
14 14
15 15 $ cd a
16 16 $ echo foo > t2
17 17 $ hg add t2
18 18 $ hg commit -m "2"
19 19
20 20 $ cd ../b
21 21 $ echo foo > t3
22 22 $ hg add t3
23 23 $ hg commit -m "3"
24 24
25 25 $ hg push ../a
26 26 pushing to ../a
27 27 searching for changes
28 28 abort: push creates new remote head 1e108cc5548c!
29 (you should pull and merge or use push -f to force)
29 (pull and merge or see "hg help push" for details about pushing new heads)
30 30 [255]
31 31
32 32 $ hg push --debug ../a
33 33 pushing to ../a
34 34 query 1; heads
35 35 searching for changes
36 36 taking quick initial sample
37 37 searching: 2 queries
38 38 query 2; still undecided: 1, sample size is: 1
39 39 2 total queries
40 40 listing keys for "bookmarks"
41 41 new remote heads on branch 'default'
42 42 new remote head 1e108cc5548c
43 43 abort: push creates new remote head 1e108cc5548c!
44 (you should pull and merge or use push -f to force)
44 (pull and merge or see "hg help push" for details about pushing new heads)
45 45 [255]
46 46
47 47 $ hg pull ../a
48 48 pulling from ../a
49 49 searching for changes
50 50 adding changesets
51 51 adding manifests
52 52 adding file changes
53 53 added 1 changesets with 1 changes to 1 files (+1 heads)
54 54 (run 'hg heads' to see heads, 'hg merge' to merge)
55 55
56 56 $ hg push ../a
57 57 pushing to ../a
58 58 searching for changes
59 59 abort: push creates new remote head 1e108cc5548c!
60 (did you forget to merge? use push -f to force)
60 (merge or see "hg help push" for details about pushing new heads)
61 61 [255]
62 62
63 63 $ hg merge
64 64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 65 (branch merge, don't forget to commit)
66 66
67 67 $ hg commit -m "4"
68 68 $ hg push ../a
69 69 pushing to ../a
70 70 searching for changes
71 71 adding changesets
72 72 adding manifests
73 73 adding file changes
74 74 added 2 changesets with 1 changes to 1 files
75 75
76 76 $ cd ..
77 77
78 78 $ hg init c
79 79 $ cd c
80 80 $ for i in 0 1 2; do
81 81 > echo $i >> foo
82 82 > hg ci -Am $i
83 83 > done
84 84 adding foo
85 85 $ cd ..
86 86
87 87 $ hg clone c d
88 88 updating to branch default
89 89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 90
91 91 $ cd d
92 92 $ for i in 0 1; do
93 93 > hg co -C $i
94 94 > echo d-$i >> foo
95 95 > hg ci -m d-$i
96 96 > done
97 97 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 98 created new head
99 99 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 100 created new head
101 101
102 102 $ HGMERGE=true hg merge 3
103 103 merging foo
104 104 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
105 105 (branch merge, don't forget to commit)
106 106
107 107 $ hg ci -m c-d
108 108
109 109 $ hg push ../c
110 110 pushing to ../c
111 111 searching for changes
112 112 abort: push creates new remote head 6346d66eb9f5!
113 (did you forget to merge? use push -f to force)
113 (merge or see "hg help push" for details about pushing new heads)
114 114 [255]
115 115
116 116 $ hg push -r 2 ../c
117 117 pushing to ../c
118 118 searching for changes
119 119 no changes found
120 120 [1]
121 121
122 122 $ hg push -r 3 ../c
123 123 pushing to ../c
124 124 searching for changes
125 125 abort: push creates new remote head a5dda829a167!
126 (did you forget to merge? use push -f to force)
126 (merge or see "hg help push" for details about pushing new heads)
127 127 [255]
128 128
129 129 $ hg push -v -r 3 -r 4 ../c
130 130 pushing to ../c
131 131 searching for changes
132 132 new remote heads on branch 'default'
133 133 new remote head a5dda829a167
134 134 new remote head ee8fbc7a0295
135 135 abort: push creates new remote head a5dda829a167!
136 (did you forget to merge? use push -f to force)
136 (merge or see "hg help push" for details about pushing new heads)
137 137 [255]
138 138
139 139 $ hg push -v -f -r 3 -r 4 ../c
140 140 pushing to ../c
141 141 searching for changes
142 142 2 changesets found
143 143 adding changesets
144 144 adding manifests
145 145 adding file changes
146 146 added 2 changesets with 2 changes to 1 files (+2 heads)
147 147
148 148 $ hg push -r 5 ../c
149 149 pushing to ../c
150 150 searching for changes
151 151 adding changesets
152 152 adding manifests
153 153 adding file changes
154 154 added 1 changesets with 1 changes to 1 files (-1 heads)
155 155
156 156 $ hg in ../c
157 157 comparing with ../c
158 158 searching for changes
159 159 no changes found
160 160 [1]
161 161
162 162
163 163 Issue450: push -r warns about remote head creation even if no heads
164 164 will be created
165 165
166 166 $ hg init ../e
167 167 $ hg push -r 0 ../e
168 168 pushing to ../e
169 169 searching for changes
170 170 adding changesets
171 171 adding manifests
172 172 adding file changes
173 173 added 1 changesets with 1 changes to 1 files
174 174
175 175 $ hg push -r 1 ../e
176 176 pushing to ../e
177 177 searching for changes
178 178 adding changesets
179 179 adding manifests
180 180 adding file changes
181 181 added 1 changesets with 1 changes to 1 files
182 182
183 183 $ cd ..
184 184
185 185
186 186 Issue736: named branches are not considered for detection of
187 187 unmerged heads in "hg push"
188 188
189 189 $ hg init f
190 190 $ cd f
191 191 $ hg -q branch a
192 192 $ echo 0 > foo
193 193 $ hg -q ci -Am 0
194 194 $ echo 1 > foo
195 195 $ hg -q ci -m 1
196 196 $ hg -q up 0
197 197 $ echo 2 > foo
198 198 $ hg -q ci -m 2
199 199 $ hg -q up 0
200 200 $ hg -q branch b
201 201 $ echo 3 > foo
202 202 $ hg -q ci -m 3
203 203 $ cd ..
204 204
205 205 $ hg -q clone f g
206 206 $ cd g
207 207
208 208 Push on existing branch and new branch:
209 209
210 210 $ hg -q up 1
211 211 $ echo 4 > foo
212 212 $ hg -q ci -m 4
213 213 $ hg -q up 0
214 214 $ echo 5 > foo
215 215 $ hg -q branch c
216 216 $ hg -q ci -m 5
217 217
218 218 $ hg push ../f
219 219 pushing to ../f
220 220 searching for changes
221 221 abort: push creates new remote branches: c!
222 222 (use 'hg push --new-branch' to create new remote branches)
223 223 [255]
224 224
225 225 $ hg push -r 4 -r 5 ../f
226 226 pushing to ../f
227 227 searching for changes
228 228 abort: push creates new remote branches: c!
229 229 (use 'hg push --new-branch' to create new remote branches)
230 230 [255]
231 231
232 232
233 233 Multiple new branches:
234 234
235 235 $ hg -q branch d
236 236 $ echo 6 > foo
237 237 $ hg -q ci -m 6
238 238
239 239 $ hg push ../f
240 240 pushing to ../f
241 241 searching for changes
242 242 abort: push creates new remote branches: c, d!
243 243 (use 'hg push --new-branch' to create new remote branches)
244 244 [255]
245 245
246 246 $ hg push -r 4 -r 6 ../f
247 247 pushing to ../f
248 248 searching for changes
249 249 abort: push creates new remote branches: c, d!
250 250 (use 'hg push --new-branch' to create new remote branches)
251 251 [255]
252 252
253 253 $ cd ../g
254 254
255 255
256 256 Fail on multiple head push:
257 257
258 258 $ hg -q up 1
259 259 $ echo 7 > foo
260 260 $ hg -q ci -m 7
261 261
262 262 $ hg push -r 4 -r 7 ../f
263 263 pushing to ../f
264 264 searching for changes
265 265 abort: push creates new remote head 0b715ef6ff8f on branch 'a'!
266 (did you forget to merge? use push -f to force)
266 (merge or see "hg help push" for details about pushing new heads)
267 267 [255]
268 268
269 269 Push replacement head on existing branches:
270 270
271 271 $ hg -q up 3
272 272 $ echo 8 > foo
273 273 $ hg -q ci -m 8
274 274
275 275 $ hg push -r 7 -r 8 ../f
276 276 pushing to ../f
277 277 searching for changes
278 278 adding changesets
279 279 adding manifests
280 280 adding file changes
281 281 added 2 changesets with 2 changes to 1 files
282 282
283 283
284 284 Merge of branch a to other branch b followed by unrelated push
285 285 on branch a:
286 286
287 287 $ hg -q up 7
288 288 $ HGMERGE=true hg -q merge 8
289 289 $ hg -q ci -m 9
290 290 $ hg -q up 8
291 291 $ echo 10 > foo
292 292 $ hg -q ci -m 10
293 293
294 294 $ hg push -r 9 ../f
295 295 pushing to ../f
296 296 searching for changes
297 297 adding changesets
298 298 adding manifests
299 299 adding file changes
300 300 added 1 changesets with 1 changes to 1 files (-1 heads)
301 301
302 302 $ hg push -r 10 ../f
303 303 pushing to ../f
304 304 searching for changes
305 305 adding changesets
306 306 adding manifests
307 307 adding file changes
308 308 added 1 changesets with 1 changes to 1 files (+1 heads)
309 309
310 310
311 311 Cheating the counting algorithm:
312 312
313 313 $ hg -q up 9
314 314 $ HGMERGE=true hg -q merge 2
315 315 $ hg -q ci -m 11
316 316 $ hg -q up 1
317 317 $ echo 12 > foo
318 318 $ hg -q ci -m 12
319 319
320 320 $ hg push -r 11 -r 12 ../f
321 321 pushing to ../f
322 322 searching for changes
323 323 adding changesets
324 324 adding manifests
325 325 adding file changes
326 326 added 2 changesets with 2 changes to 1 files
327 327
328 328
329 329 Failed push of new named branch:
330 330
331 331 $ echo 12 > foo
332 332 $ hg -q ci -m 12a
333 333 [1]
334 334 $ hg -q up 11
335 335 $ echo 13 > foo
336 336 $ hg -q branch e
337 337 $ hg -q ci -m 13d
338 338
339 339 $ hg push -r 12 -r 13 ../f
340 340 pushing to ../f
341 341 searching for changes
342 342 abort: push creates new remote branches: e!
343 343 (use 'hg push --new-branch' to create new remote branches)
344 344 [255]
345 345
346 346
347 347 Using --new-branch to push new named branch:
348 348
349 349 $ hg push --new-branch -r 12 -r 13 ../f
350 350 pushing to ../f
351 351 searching for changes
352 352 adding changesets
353 353 adding manifests
354 354 adding file changes
355 355 added 1 changesets with 1 changes to 1 files
356 356
357 357 Pushing muliple headed new branch:
358 358
359 359 $ echo 14 > foo
360 360 $ hg -q branch f
361 361 $ hg -q ci -m 14
362 362 $ echo 15 > foo
363 363 $ hg -q ci -m 15
364 364 $ hg -q up 14
365 365 $ echo 16 > foo
366 366 $ hg -q ci -m 16
367 367 $ hg push --branch f --new-branch ../f
368 368 pushing to ../f
369 369 searching for changes
370 370 abort: push creates multiple headed new branch 'f'
371 371 (merge or see "hg help push" for detail about pushing new heads)
372 372 [255]
373 373 $ hg push --branch f --new-branch --force ../f
374 374 pushing to ../f
375 375 searching for changes
376 376 adding changesets
377 377 adding manifests
378 378 adding file changes
379 379 added 3 changesets with 3 changes to 1 files (+1 heads)
380 380
381 381 Checking prepush logic does not allow silently pushing
382 382 multiple new heads:
383 383
384 384 $ cd ..
385 385 $ hg init h
386 386 $ echo init > h/init
387 387 $ hg -R h ci -Am init
388 388 adding init
389 389 $ echo a > h/a
390 390 $ hg -R h ci -Am a
391 391 adding a
392 392 $ hg clone h i
393 393 updating to branch default
394 394 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
395 395 $ hg -R h up 0
396 396 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
397 397 $ echo b > h/b
398 398 $ hg -R h ci -Am b
399 399 adding b
400 400 created new head
401 401 $ hg -R i up 0
402 402 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
403 403 $ echo c > i/c
404 404 $ hg -R i ci -Am c
405 405 adding c
406 406 created new head
407 407
408 408 $ hg -R i push h
409 409 pushing to h
410 410 searching for changes
411 411 abort: push creates new remote head 97bd0c84d346!
412 (you should pull and merge or use push -f to force)
412 (pull and merge or see "hg help push" for details about pushing new heads)
413 413 [255]
414 414
415 415
416 416 Check prepush logic with merged branches:
417 417
418 418 $ hg init j
419 419 $ hg -R j branch a
420 420 marked working directory as branch a
421 421 (branches are permanent and global, did you want a bookmark?)
422 422 $ echo init > j/foo
423 423 $ hg -R j ci -Am init
424 424 adding foo
425 425 $ hg clone j k
426 426 updating to branch a
427 427 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
428 428 $ echo a1 > j/foo
429 429 $ hg -R j ci -m a1
430 430 $ hg -R k branch b
431 431 marked working directory as branch b
432 432 (branches are permanent and global, did you want a bookmark?)
433 433 $ echo b > k/foo
434 434 $ hg -R k ci -m b
435 435 $ hg -R k up 0
436 436 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
437 437
438 438 $ hg -R k merge b
439 439 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
440 440 (branch merge, don't forget to commit)
441 441
442 442 $ hg -R k ci -m merge
443 443
444 444 $ hg -R k push -r a j
445 445 pushing to j
446 446 searching for changes
447 447 abort: push creates new remote branches: b!
448 448 (use 'hg push --new-branch' to create new remote branches)
449 449 [255]
450 450
451 451
452 452 Prepush -r should not allow you to sneak in new heads:
453 453
454 454 $ hg init l
455 455 $ cd l
456 456 $ echo a >> foo
457 457 $ hg -q add foo
458 458 $ hg -q branch a
459 459 $ hg -q ci -ma
460 460 $ hg -q up null
461 461 $ echo a >> foo
462 462 $ hg -q add foo
463 463 $ hg -q branch b
464 464 $ hg -q ci -mb
465 465 $ cd ..
466 466 $ hg -q clone l m -u a
467 467 $ cd m
468 468 $ hg -q merge b
469 469 $ hg -q ci -mmb
470 470 $ hg -q up 0
471 471 $ echo a >> foo
472 472 $ hg -q ci -ma2
473 473 $ hg -q up 2
474 474 $ echo a >> foo
475 475 $ hg -q branch -f b
476 476 $ hg -q ci -mb2
477 477 $ hg -q merge 3
478 478 $ hg -q ci -mma
479 479
480 480 $ hg push ../l -b b
481 481 pushing to ../l
482 482 searching for changes
483 483 abort: push creates new remote head 451211cc22b0 on branch 'a'!
484 (did you forget to merge? use push -f to force)
484 (merge or see "hg help push" for details about pushing new heads)
485 485 [255]
486 486
487 487 $ cd ..
488 488
489 489
490 490 Check prepush with new branch head on former topo non-head:
491 491
492 492 $ hg init n
493 493 $ cd n
494 494 $ hg branch A
495 495 marked working directory as branch A
496 496 (branches are permanent and global, did you want a bookmark?)
497 497 $ echo a >a
498 498 $ hg ci -Ama
499 499 adding a
500 500 $ hg branch B
501 501 marked working directory as branch B
502 502 (branches are permanent and global, did you want a bookmark?)
503 503 $ echo b >b
504 504 $ hg ci -Amb
505 505 adding b
506 506
507 507 b is now branch head of B, and a topological head
508 508 a is now branch head of A, but not a topological head
509 509
510 510 $ hg clone . inner
511 511 updating to branch B
512 512 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
513 513 $ cd inner
514 514 $ hg up B
515 515 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
516 516 $ echo b1 >b1
517 517 $ hg ci -Amb1
518 518 adding b1
519 519
520 520 in the clone b1 is now the head of B
521 521
522 522 $ cd ..
523 523 $ hg up 0
524 524 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
525 525 $ echo a2 >a2
526 526 $ hg ci -Ama2
527 527 adding a2
528 528
529 529 a2 is now the new branch head of A, and a new topological head
530 530 it replaces a former inner branch head, so it should at most warn about
531 531 A, not B
532 532
533 533 glog of local:
534 534
535 535 $ hg glog --template "{rev}: {branches} {desc}\n"
536 536 @ 2: A a2
537 537 |
538 538 | o 1: B b
539 539 |/
540 540 o 0: A a
541 541
542 542 glog of remote:
543 543
544 544 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
545 545 @ 2: B b1
546 546 |
547 547 o 1: B b
548 548 |
549 549 o 0: A a
550 550
551 551 outgoing:
552 552
553 553 $ hg out inner --template "{rev}: {branches} {desc}\n"
554 554 comparing with inner
555 555 searching for changes
556 556 2: A a2
557 557
558 558 $ hg push inner
559 559 pushing to inner
560 560 searching for changes
561 561 adding changesets
562 562 adding manifests
563 563 adding file changes
564 564 added 1 changesets with 1 changes to 1 files (+1 heads)
565 565
566 566 $ cd ..
567 567
568 568
569 569 Check prepush with new branch head on former topo head:
570 570
571 571 $ hg init o
572 572 $ cd o
573 573 $ hg branch A
574 574 marked working directory as branch A
575 575 (branches are permanent and global, did you want a bookmark?)
576 576 $ echo a >a
577 577 $ hg ci -Ama
578 578 adding a
579 579 $ hg branch B
580 580 marked working directory as branch B
581 581 (branches are permanent and global, did you want a bookmark?)
582 582 $ echo b >b
583 583 $ hg ci -Amb
584 584 adding b
585 585
586 586 b is now branch head of B, and a topological head
587 587
588 588 $ hg up 0
589 589 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
590 590 $ echo a1 >a1
591 591 $ hg ci -Ama1
592 592 adding a1
593 593
594 594 a1 is now branch head of A, and a topological head
595 595
596 596 $ hg clone . inner
597 597 updating to branch A
598 598 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
599 599 $ cd inner
600 600 $ hg up B
601 601 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
602 602 $ echo b1 >b1
603 603 $ hg ci -Amb1
604 604 adding b1
605 605
606 606 in the clone b1 is now the head of B
607 607
608 608 $ cd ..
609 609 $ echo a2 >a2
610 610 $ hg ci -Ama2
611 611 adding a2
612 612
613 613 a2 is now the new branch head of A, and a topological head
614 614 it replaces a former topological and branch head, so this should not warn
615 615
616 616 glog of local:
617 617
618 618 $ hg glog --template "{rev}: {branches} {desc}\n"
619 619 @ 3: A a2
620 620 |
621 621 o 2: A a1
622 622 |
623 623 | o 1: B b
624 624 |/
625 625 o 0: A a
626 626
627 627 glog of remote:
628 628
629 629 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
630 630 @ 3: B b1
631 631 |
632 632 | o 2: A a1
633 633 | |
634 634 o | 1: B b
635 635 |/
636 636 o 0: A a
637 637
638 638 outgoing:
639 639
640 640 $ hg out inner --template "{rev}: {branches} {desc}\n"
641 641 comparing with inner
642 642 searching for changes
643 643 3: A a2
644 644
645 645 $ hg push inner
646 646 pushing to inner
647 647 searching for changes
648 648 adding changesets
649 649 adding manifests
650 650 adding file changes
651 651 added 1 changesets with 1 changes to 1 files
652 652
653 653 $ cd ..
654 654
655 655
656 656 Check prepush with new branch head and new child of former branch head
657 657 but child is on different branch:
658 658
659 659 $ hg init p
660 660 $ cd p
661 661 $ hg branch A
662 662 marked working directory as branch A
663 663 (branches are permanent and global, did you want a bookmark?)
664 664 $ echo a0 >a
665 665 $ hg ci -Ama0
666 666 adding a
667 667 $ echo a1 >a
668 668 $ hg ci -ma1
669 669 $ hg up null
670 670 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
671 671 $ hg branch B
672 672 marked working directory as branch B
673 673 (branches are permanent and global, did you want a bookmark?)
674 674 $ echo b0 >b
675 675 $ hg ci -Amb0
676 676 adding b
677 677 $ echo b1 >b
678 678 $ hg ci -mb1
679 679
680 680 $ hg clone . inner
681 681 updating to branch B
682 682 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
683 683
684 684 $ hg up A
685 685 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
686 686 $ hg branch -f B
687 687 marked working directory as branch B
688 688 (branches are permanent and global, did you want a bookmark?)
689 689 $ echo a3 >a
690 690 $ hg ci -ma3
691 691 created new head
692 692 $ hg up 3
693 693 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
694 694 $ hg branch -f A
695 695 marked working directory as branch A
696 696 (branches are permanent and global, did you want a bookmark?)
697 697 $ echo b3 >b
698 698 $ hg ci -mb3
699 699 created new head
700 700
701 701 glog of local:
702 702
703 703 $ hg glog --template "{rev}: {branches} {desc}\n"
704 704 @ 5: A b3
705 705 |
706 706 | o 4: B a3
707 707 | |
708 708 o | 3: B b1
709 709 | |
710 710 o | 2: B b0
711 711 /
712 712 o 1: A a1
713 713 |
714 714 o 0: A a0
715 715
716 716 glog of remote:
717 717
718 718 $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
719 719 @ 3: B b1
720 720 |
721 721 o 2: B b0
722 722
723 723 o 1: A a1
724 724 |
725 725 o 0: A a0
726 726
727 727 outgoing:
728 728
729 729 $ hg out inner --template "{rev}: {branches} {desc}\n"
730 730 comparing with inner
731 731 searching for changes
732 732 4: B a3
733 733 5: A b3
734 734
735 735 $ hg push inner
736 736 pushing to inner
737 737 searching for changes
738 738 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'!
739 (did you forget to merge? use push -f to force)
739 (merge or see "hg help push" for details about pushing new heads)
740 740 [255]
741 741
742 742 $ hg push inner -r4 -r5
743 743 pushing to inner
744 744 searching for changes
745 745 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'!
746 (did you forget to merge? use push -f to force)
746 (merge or see "hg help push" for details about pushing new heads)
747 747 [255]
748 748
749 749 $ hg in inner
750 750 comparing with inner
751 751 searching for changes
752 752 no changes found
753 753 [1]
754 754
755 755 $ cd ..
@@ -1,1235 +1,1235
1 1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2 2
3 3 $ echo "[ui]" >> $HGRCPATH
4 4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5 5
6 6 $ hg init t
7 7 $ cd t
8 8
9 9 first revision, no sub
10 10
11 11 $ echo a > a
12 12 $ hg ci -Am0
13 13 adding a
14 14
15 15 add first sub
16 16
17 17 $ echo s = s > .hgsub
18 18 $ hg add .hgsub
19 19 $ hg init s
20 20 $ echo a > s/a
21 21
22 22 Issue2232: committing a subrepo without .hgsub
23 23
24 24 $ hg ci -mbad s
25 25 abort: can't commit subrepos without .hgsub
26 26 [255]
27 27
28 28 $ hg -R s ci -Ams0
29 29 adding a
30 30 $ hg sum
31 31 parent: 0:f7b1eb17ad24 tip
32 32 0
33 33 branch: default
34 34 commit: 1 added, 1 subrepos
35 35 update: (current)
36 36 $ hg ci -m1
37 37
38 38 Revert subrepo and test subrepo fileset keyword:
39 39
40 40 $ echo b > s/a
41 41 $ hg revert "set:subrepo('glob:s*')"
42 42 reverting subrepo s
43 43 reverting s/a (glob)
44 44 $ rm s/a.orig
45 45
46 46 Revert subrepo with no backup. The "reverting s/a" line is gone since
47 47 we're really running 'hg update' in the subrepo:
48 48
49 49 $ echo b > s/a
50 50 $ hg revert --no-backup s
51 51 reverting subrepo s
52 52
53 53 Issue2022: update -C
54 54
55 55 $ echo b > s/a
56 56 $ hg sum
57 57 parent: 1:7cf8cfea66e4 tip
58 58 1
59 59 branch: default
60 60 commit: 1 subrepos
61 61 update: (current)
62 62 $ hg co -C 1
63 63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 64 $ hg sum
65 65 parent: 1:7cf8cfea66e4 tip
66 66 1
67 67 branch: default
68 68 commit: (clean)
69 69 update: (current)
70 70
71 71 commands that require a clean repo should respect subrepos
72 72
73 73 $ echo b >> s/a
74 74 $ hg backout tip
75 75 abort: uncommitted changes in subrepo s
76 76 [255]
77 77 $ hg revert -C -R s s/a
78 78
79 79 add sub sub
80 80
81 81 $ echo ss = ss > s/.hgsub
82 82 $ hg init s/ss
83 83 $ echo a > s/ss/a
84 84 $ hg -R s add s/.hgsub
85 85 $ hg -R s/ss add s/ss/a
86 86 $ hg sum
87 87 parent: 1:7cf8cfea66e4 tip
88 88 1
89 89 branch: default
90 90 commit: 1 subrepos
91 91 update: (current)
92 92 $ hg ci -m2
93 93 committing subrepository s
94 94 committing subrepository s/ss (glob)
95 95 $ hg sum
96 96 parent: 2:df30734270ae tip
97 97 2
98 98 branch: default
99 99 commit: (clean)
100 100 update: (current)
101 101
102 102 bump sub rev (and check it is ignored by ui.commitsubrepos)
103 103
104 104 $ echo b > s/a
105 105 $ hg -R s ci -ms1
106 106 $ hg --config ui.commitsubrepos=no ci -m3
107 107
108 108 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
109 109
110 110 $ echo c > s/a
111 111 $ hg --config ui.commitsubrepos=no ci -m4
112 112 abort: uncommitted changes in subrepo s
113 113 (use --subrepos for recursive commit)
114 114 [255]
115 115 $ hg id
116 116 f6affe3fbfaa+ tip
117 117 $ hg -R s ci -mc
118 118 $ hg id
119 119 f6affe3fbfaa+ tip
120 120 $ echo d > s/a
121 121 $ hg ci -m4
122 122 committing subrepository s
123 123 $ hg tip -R s
124 124 changeset: 4:02dcf1d70411
125 125 tag: tip
126 126 user: test
127 127 date: Thu Jan 01 00:00:00 1970 +0000
128 128 summary: 4
129 129
130 130
131 131 check caching
132 132
133 133 $ hg co 0
134 134 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
135 135 $ hg debugsub
136 136
137 137 restore
138 138
139 139 $ hg co
140 140 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 141 $ hg debugsub
142 142 path s
143 143 source s
144 144 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
145 145
146 146 new branch for merge tests
147 147
148 148 $ hg co 1
149 149 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 150 $ echo t = t >> .hgsub
151 151 $ hg init t
152 152 $ echo t > t/t
153 153 $ hg -R t add t
154 154 adding t/t (glob)
155 155
156 156 5
157 157
158 158 $ hg ci -m5 # add sub
159 159 committing subrepository t
160 160 created new head
161 161 $ echo t2 > t/t
162 162
163 163 6
164 164
165 165 $ hg st -R s
166 166 $ hg ci -m6 # change sub
167 167 committing subrepository t
168 168 $ hg debugsub
169 169 path s
170 170 source s
171 171 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
172 172 path t
173 173 source t
174 174 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
175 175 $ echo t3 > t/t
176 176
177 177 7
178 178
179 179 $ hg ci -m7 # change sub again for conflict test
180 180 committing subrepository t
181 181 $ hg rm .hgsub
182 182
183 183 8
184 184
185 185 $ hg ci -m8 # remove sub
186 186
187 187 merge tests
188 188
189 189 $ hg co -C 3
190 190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 191 $ hg merge 5 # test adding
192 192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 193 (branch merge, don't forget to commit)
194 194 $ hg debugsub
195 195 path s
196 196 source s
197 197 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
198 198 path t
199 199 source t
200 200 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
201 201 $ hg ci -m9
202 202 created new head
203 203 $ hg merge 6 --debug # test change
204 204 searching for copies back to rev 2
205 205 resolving manifests
206 206 branchmerge: True, force: False, partial: False
207 207 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
208 208 .hgsubstate: versions differ -> m
209 209 updating: .hgsubstate 1/1 files (100.00%)
210 210 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
211 211 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
212 212 getting subrepo t
213 213 resolving manifests
214 214 branchmerge: False, force: False, partial: False
215 215 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
216 216 t: remote is newer -> g
217 217 getting t
218 218 updating: t 1/1 files (100.00%)
219 219 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
220 220 (branch merge, don't forget to commit)
221 221 $ hg debugsub
222 222 path s
223 223 source s
224 224 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
225 225 path t
226 226 source t
227 227 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
228 228 $ echo conflict > t/t
229 229 $ hg ci -m10
230 230 committing subrepository t
231 231 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
232 232 searching for copies back to rev 2
233 233 resolving manifests
234 234 branchmerge: True, force: False, partial: False
235 235 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
236 236 .hgsubstate: versions differ -> m
237 237 updating: .hgsubstate 1/1 files (100.00%)
238 238 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
239 239 subrepo t: both sides changed
240 240 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
241 241 (M)erge, keep (l)ocal or keep (r)emote? m
242 242 merging subrepo t
243 243 searching for copies back to rev 2
244 244 resolving manifests
245 245 branchmerge: True, force: False, partial: False
246 246 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
247 247 t: versions differ -> m
248 248 preserving t for resolve of t
249 249 updating: t 1/1 files (100.00%)
250 250 picked tool 'internal:merge' for t (binary False symlink False)
251 251 merging t
252 252 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
253 253 warning: conflicts during merge.
254 254 merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
255 255 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
256 256 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
257 257 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
258 258 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 259 (branch merge, don't forget to commit)
260 260
261 261 should conflict
262 262
263 263 $ cat t/t
264 264 <<<<<<< local
265 265 conflict
266 266 =======
267 267 t3
268 268 >>>>>>> other
269 269
270 270 clone
271 271
272 272 $ cd ..
273 273 $ hg clone t tc
274 274 updating to branch default
275 275 cloning subrepo s from $TESTTMP/t/s
276 276 cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
277 277 cloning subrepo t from $TESTTMP/t/t
278 278 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 279 $ cd tc
280 280 $ hg debugsub
281 281 path s
282 282 source s
283 283 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
284 284 path t
285 285 source t
286 286 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
287 287
288 288 push
289 289
290 290 $ echo bah > t/t
291 291 $ hg ci -m11
292 292 committing subrepository t
293 293 $ hg push
294 294 pushing to $TESTTMP/t (glob)
295 295 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
296 296 no changes made to subrepo s since last push to $TESTTMP/t/s
297 297 pushing subrepo t to $TESTTMP/t/t
298 298 searching for changes
299 299 adding changesets
300 300 adding manifests
301 301 adding file changes
302 302 added 1 changesets with 1 changes to 1 files
303 303 searching for changes
304 304 adding changesets
305 305 adding manifests
306 306 adding file changes
307 307 added 1 changesets with 1 changes to 1 files
308 308
309 309 push -f
310 310
311 311 $ echo bah > s/a
312 312 $ hg ci -m12
313 313 committing subrepository s
314 314 $ hg push
315 315 pushing to $TESTTMP/t (glob)
316 316 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
317 317 pushing subrepo s to $TESTTMP/t/s
318 318 searching for changes
319 319 abort: push creates new remote head 12a213df6fa9! (in subrepo s)
320 (did you forget to merge? use push -f to force)
320 (merge or see "hg help push" for details about pushing new heads)
321 321 [255]
322 322 $ hg push -f
323 323 pushing to $TESTTMP/t (glob)
324 324 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
325 325 searching for changes
326 326 no changes found
327 327 pushing subrepo s to $TESTTMP/t/s
328 328 searching for changes
329 329 adding changesets
330 330 adding manifests
331 331 adding file changes
332 332 added 1 changesets with 1 changes to 1 files (+1 heads)
333 333 pushing subrepo t to $TESTTMP/t/t
334 334 searching for changes
335 335 no changes found
336 336 searching for changes
337 337 adding changesets
338 338 adding manifests
339 339 adding file changes
340 340 added 1 changesets with 1 changes to 1 files
341 341
342 342 check that unmodified subrepos are not pushed
343 343
344 344 $ hg clone . ../tcc
345 345 updating to branch default
346 346 cloning subrepo s from $TESTTMP/tc/s
347 347 cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob)
348 348 cloning subrepo t from $TESTTMP/tc/t
349 349 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
350 350
351 351 the subrepos on the new clone have nothing to push to its source
352 352
353 353 $ hg push -R ../tcc .
354 354 pushing to .
355 355 no changes made to subrepo s/ss since last push to s/ss (glob)
356 356 no changes made to subrepo s since last push to s
357 357 no changes made to subrepo t since last push to t
358 358 searching for changes
359 359 no changes found
360 360 [1]
361 361
362 362 the subrepos on the source do not have a clean store versus the clone target
363 363 because they were never explicitly pushed to the source
364 364
365 365 $ hg push ../tcc
366 366 pushing to ../tcc
367 367 pushing subrepo s/ss to ../tcc/s/ss (glob)
368 368 searching for changes
369 369 no changes found
370 370 pushing subrepo s to ../tcc/s
371 371 searching for changes
372 372 no changes found
373 373 pushing subrepo t to ../tcc/t
374 374 searching for changes
375 375 no changes found
376 376 searching for changes
377 377 no changes found
378 378 [1]
379 379
380 380 after push their stores become clean
381 381
382 382 $ hg push ../tcc
383 383 pushing to ../tcc
384 384 no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob)
385 385 no changes made to subrepo s since last push to ../tcc/s
386 386 no changes made to subrepo t since last push to ../tcc/t
387 387 searching for changes
388 388 no changes found
389 389 [1]
390 390
391 391 updating a subrepo to a different revision or changing
392 392 its working directory does not make its store dirty
393 393
394 394 $ hg -R s update '.^'
395 395 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
396 396 $ hg push
397 397 pushing to $TESTTMP/t (glob)
398 398 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
399 399 no changes made to subrepo s since last push to $TESTTMP/t/s
400 400 no changes made to subrepo t since last push to $TESTTMP/t/t
401 401 searching for changes
402 402 no changes found
403 403 [1]
404 404 $ echo foo >> s/a
405 405 $ hg push
406 406 pushing to $TESTTMP/t (glob)
407 407 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
408 408 no changes made to subrepo s since last push to $TESTTMP/t/s
409 409 no changes made to subrepo t since last push to $TESTTMP/t/t
410 410 searching for changes
411 411 no changes found
412 412 [1]
413 413 $ hg -R s update -C tip
414 414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 415
416 416 committing into a subrepo makes its store (but not its parent's store) dirty
417 417
418 418 $ echo foo >> s/ss/a
419 419 $ hg -R s/ss commit -m 'test dirty store detection'
420 420 $ hg push
421 421 pushing to $TESTTMP/t (glob)
422 422 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
423 423 searching for changes
424 424 adding changesets
425 425 adding manifests
426 426 adding file changes
427 427 added 1 changesets with 1 changes to 1 files
428 428 no changes made to subrepo s since last push to $TESTTMP/t/s
429 429 no changes made to subrepo t since last push to $TESTTMP/t/t
430 430 searching for changes
431 431 no changes found
432 432 [1]
433 433
434 434 a subrepo store may be clean versus one repo but not versus another
435 435
436 436 $ hg push
437 437 pushing to $TESTTMP/t (glob)
438 438 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
439 439 no changes made to subrepo s since last push to $TESTTMP/t/s
440 440 no changes made to subrepo t since last push to $TESTTMP/t/t
441 441 searching for changes
442 442 no changes found
443 443 [1]
444 444 $ hg push ../tcc
445 445 pushing to ../tcc
446 446 pushing subrepo s/ss to ../tcc/s/ss (glob)
447 447 searching for changes
448 448 adding changesets
449 449 adding manifests
450 450 adding file changes
451 451 added 1 changesets with 1 changes to 1 files
452 452 no changes made to subrepo s since last push to ../tcc/s
453 453 no changes made to subrepo t since last push to ../tcc/t
454 454 searching for changes
455 455 no changes found
456 456 [1]
457 457
458 458 update
459 459
460 460 $ cd ../t
461 461 $ hg up -C # discard our earlier merge
462 462 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 463 $ echo blah > t/t
464 464 $ hg ci -m13
465 465 committing subrepository t
466 466
467 467 backout calls revert internally with minimal opts, which should not raise
468 468 KeyError
469 469
470 470 $ hg backout ".^"
471 471 reverting .hgsubstate
472 472 reverting subrepo s
473 473 reverting s/a (glob)
474 474 reverting subrepo ss
475 475 reverting subrepo t
476 476 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
477 477
478 478 $ hg up -C # discard changes
479 479 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
480 480
481 481 pull
482 482
483 483 $ cd ../tc
484 484 $ hg pull
485 485 pulling from $TESTTMP/t (glob)
486 486 searching for changes
487 487 adding changesets
488 488 adding manifests
489 489 adding file changes
490 490 added 1 changesets with 1 changes to 1 files
491 491 (run 'hg update' to get a working copy)
492 492
493 493 should pull t
494 494
495 495 $ hg up
496 496 pulling subrepo t from $TESTTMP/t/t
497 497 searching for changes
498 498 adding changesets
499 499 adding manifests
500 500 adding file changes
501 501 added 1 changesets with 1 changes to 1 files
502 502 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
503 503 $ cat t/t
504 504 blah
505 505
506 506 bogus subrepo path aborts
507 507
508 508 $ echo 'bogus=[boguspath' >> .hgsub
509 509 $ hg ci -m 'bogus subrepo path'
510 510 abort: missing ] in subrepo source
511 511 [255]
512 512
513 513 Issue1986: merge aborts when trying to merge a subrepo that
514 514 shouldn't need merging
515 515
516 516 # subrepo layout
517 517 #
518 518 # o 5 br
519 519 # /|
520 520 # o | 4 default
521 521 # | |
522 522 # | o 3 br
523 523 # |/|
524 524 # o | 2 default
525 525 # | |
526 526 # | o 1 br
527 527 # |/
528 528 # o 0 default
529 529
530 530 $ cd ..
531 531 $ rm -rf sub
532 532 $ hg init main
533 533 $ cd main
534 534 $ hg init s
535 535 $ cd s
536 536 $ echo a > a
537 537 $ hg ci -Am1
538 538 adding a
539 539 $ hg branch br
540 540 marked working directory as branch br
541 541 (branches are permanent and global, did you want a bookmark?)
542 542 $ echo a >> a
543 543 $ hg ci -m1
544 544 $ hg up default
545 545 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
546 546 $ echo b > b
547 547 $ hg ci -Am1
548 548 adding b
549 549 $ hg up br
550 550 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
551 551 $ hg merge tip
552 552 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
553 553 (branch merge, don't forget to commit)
554 554 $ hg ci -m1
555 555 $ hg up 2
556 556 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
557 557 $ echo c > c
558 558 $ hg ci -Am1
559 559 adding c
560 560 $ hg up 3
561 561 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
562 562 $ hg merge 4
563 563 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
564 564 (branch merge, don't forget to commit)
565 565 $ hg ci -m1
566 566
567 567 # main repo layout:
568 568 #
569 569 # * <-- try to merge default into br again
570 570 # .`|
571 571 # . o 5 br --> substate = 5
572 572 # . |
573 573 # o | 4 default --> substate = 4
574 574 # | |
575 575 # | o 3 br --> substate = 2
576 576 # |/|
577 577 # o | 2 default --> substate = 2
578 578 # | |
579 579 # | o 1 br --> substate = 3
580 580 # |/
581 581 # o 0 default --> substate = 2
582 582
583 583 $ cd ..
584 584 $ echo 's = s' > .hgsub
585 585 $ hg -R s up 2
586 586 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
587 587 $ hg ci -Am1
588 588 adding .hgsub
589 589 $ hg branch br
590 590 marked working directory as branch br
591 591 (branches are permanent and global, did you want a bookmark?)
592 592 $ echo b > b
593 593 $ hg -R s up 3
594 594 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
595 595 $ hg ci -Am1
596 596 adding b
597 597 $ hg up default
598 598 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
599 599 $ echo c > c
600 600 $ hg ci -Am1
601 601 adding c
602 602 $ hg up 1
603 603 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
604 604 $ hg merge 2
605 605 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
606 606 (branch merge, don't forget to commit)
607 607 $ hg ci -m1
608 608 $ hg up 2
609 609 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
610 610 $ hg -R s up 4
611 611 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
612 612 $ echo d > d
613 613 $ hg ci -Am1
614 614 adding d
615 615 $ hg up 3
616 616 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
617 617 $ hg -R s up 5
618 618 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
619 619 $ echo e > e
620 620 $ hg ci -Am1
621 621 adding e
622 622
623 623 $ hg up 5
624 624 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
625 625 $ hg merge 4 # try to merge default into br again
626 626 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
627 627 (M)erge, keep (l)ocal or keep (r)emote? m
628 628 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
629 629 (branch merge, don't forget to commit)
630 630 $ cd ..
631 631
632 632 test subrepo delete from .hgsubstate
633 633
634 634 $ hg init testdelete
635 635 $ mkdir testdelete/nested testdelete/nested2
636 636 $ hg init testdelete/nested
637 637 $ hg init testdelete/nested2
638 638 $ echo test > testdelete/nested/foo
639 639 $ echo test > testdelete/nested2/foo
640 640 $ hg -R testdelete/nested add
641 641 adding testdelete/nested/foo (glob)
642 642 $ hg -R testdelete/nested2 add
643 643 adding testdelete/nested2/foo (glob)
644 644 $ hg -R testdelete/nested ci -m test
645 645 $ hg -R testdelete/nested2 ci -m test
646 646 $ echo nested = nested > testdelete/.hgsub
647 647 $ echo nested2 = nested2 >> testdelete/.hgsub
648 648 $ hg -R testdelete add
649 649 adding testdelete/.hgsub (glob)
650 650 $ hg -R testdelete ci -m "nested 1 & 2 added"
651 651 $ echo nested = nested > testdelete/.hgsub
652 652 $ hg -R testdelete ci -m "nested 2 deleted"
653 653 $ cat testdelete/.hgsubstate
654 654 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
655 655 $ hg -R testdelete remove testdelete/.hgsub
656 656 $ hg -R testdelete ci -m ".hgsub deleted"
657 657 $ cat testdelete/.hgsubstate
658 658 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
659 659
660 660 test repository cloning
661 661
662 662 $ mkdir mercurial mercurial2
663 663 $ hg init nested_absolute
664 664 $ echo test > nested_absolute/foo
665 665 $ hg -R nested_absolute add
666 666 adding nested_absolute/foo (glob)
667 667 $ hg -R nested_absolute ci -mtest
668 668 $ cd mercurial
669 669 $ hg init nested_relative
670 670 $ echo test2 > nested_relative/foo2
671 671 $ hg -R nested_relative add
672 672 adding nested_relative/foo2 (glob)
673 673 $ hg -R nested_relative ci -mtest2
674 674 $ hg init main
675 675 $ echo "nested_relative = ../nested_relative" > main/.hgsub
676 676 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
677 677 $ hg -R main add
678 678 adding main/.hgsub (glob)
679 679 $ hg -R main ci -m "add subrepos"
680 680 $ cd ..
681 681 $ hg clone mercurial/main mercurial2/main
682 682 updating to branch default
683 683 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
684 684 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
685 685 > mercurial2/main/nested_relative/.hg/hgrc
686 686 [paths]
687 687 default = $TESTTMP/mercurial/nested_absolute
688 688 [paths]
689 689 default = $TESTTMP/mercurial/nested_relative
690 690 $ rm -rf mercurial mercurial2
691 691
692 692 Issue1977: multirepo push should fail if subrepo push fails
693 693
694 694 $ hg init repo
695 695 $ hg init repo/s
696 696 $ echo a > repo/s/a
697 697 $ hg -R repo/s ci -Am0
698 698 adding a
699 699 $ echo s = s > repo/.hgsub
700 700 $ hg -R repo ci -Am1
701 701 adding .hgsub
702 702 $ hg clone repo repo2
703 703 updating to branch default
704 704 cloning subrepo s from $TESTTMP/repo/s
705 705 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
706 706 $ hg -q -R repo2 pull -u
707 707 $ echo 1 > repo2/s/a
708 708 $ hg -R repo2/s ci -m2
709 709 $ hg -q -R repo2/s push
710 710 $ hg -R repo2/s up -C 0
711 711 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
712 712 $ echo 2 > repo2/s/b
713 713 $ hg -R repo2/s ci -m3 -A
714 714 adding b
715 715 created new head
716 716 $ hg -R repo2 ci -m3
717 717 $ hg -q -R repo2 push
718 718 abort: push creates new remote head cc505f09a8b2! (in subrepo s)
719 (did you forget to merge? use push -f to force)
719 (merge or see "hg help push" for details about pushing new heads)
720 720 [255]
721 721 $ hg -R repo update
722 722 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
723 723
724 724 test if untracked file is not overwritten
725 725
726 726 $ echo issue3276_ok > repo/s/b
727 727 $ hg -R repo2 push -f -q
728 728 $ hg -R repo update
729 729 b: untracked file differs
730 730 abort: untracked files in working directory differ from files in requested revision (in subrepo s)
731 731 [255]
732 732
733 733 $ cat repo/s/b
734 734 issue3276_ok
735 735 $ rm repo/s/b
736 736 $ hg -R repo revert --all
737 737 reverting repo/.hgsubstate (glob)
738 738 reverting subrepo s
739 739 $ hg -R repo update
740 740 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
741 741 $ cat repo/s/b
742 742 2
743 743 $ rm -rf repo2 repo
744 744
745 745
746 746 Issue1852 subrepos with relative paths always push/pull relative to default
747 747
748 748 Prepare a repo with subrepo
749 749
750 750 $ hg init issue1852a
751 751 $ cd issue1852a
752 752 $ hg init sub/repo
753 753 $ echo test > sub/repo/foo
754 754 $ hg -R sub/repo add sub/repo/foo
755 755 $ echo sub/repo = sub/repo > .hgsub
756 756 $ hg add .hgsub
757 757 $ hg ci -mtest
758 758 committing subrepository sub/repo (glob)
759 759 $ echo test >> sub/repo/foo
760 760 $ hg ci -mtest
761 761 committing subrepository sub/repo (glob)
762 762 $ cd ..
763 763
764 764 Create repo without default path, pull top repo, and see what happens on update
765 765
766 766 $ hg init issue1852b
767 767 $ hg -R issue1852b pull issue1852a
768 768 pulling from issue1852a
769 769 requesting all changes
770 770 adding changesets
771 771 adding manifests
772 772 adding file changes
773 773 added 2 changesets with 3 changes to 2 files
774 774 (run 'hg update' to get a working copy)
775 775 $ hg -R issue1852b update
776 776 abort: default path for subrepository not found (in subrepo sub/repo) (glob)
777 777 [255]
778 778
779 779 Ensure a full traceback, not just the SubrepoAbort part
780 780
781 781 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise util\.Abort'
782 782 raise util.Abort(_("default path for subrepository not found"))
783 783
784 784 Pull -u now doesn't help
785 785
786 786 $ hg -R issue1852b pull -u issue1852a
787 787 pulling from issue1852a
788 788 searching for changes
789 789 no changes found
790 790
791 791 Try the same, but with pull -u
792 792
793 793 $ hg init issue1852c
794 794 $ hg -R issue1852c pull -r0 -u issue1852a
795 795 pulling from issue1852a
796 796 adding changesets
797 797 adding manifests
798 798 adding file changes
799 799 added 1 changesets with 2 changes to 2 files
800 800 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
801 801 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
802 802
803 803 Try to push from the other side
804 804
805 805 $ hg -R issue1852a push `pwd`/issue1852c
806 806 pushing to $TESTTMP/issue1852c (glob)
807 807 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
808 808 searching for changes
809 809 no changes found
810 810 searching for changes
811 811 adding changesets
812 812 adding manifests
813 813 adding file changes
814 814 added 1 changesets with 1 changes to 1 files
815 815
816 816 Incoming and outgoing should not use the default path:
817 817
818 818 $ hg clone -q issue1852a issue1852d
819 819 $ hg -R issue1852d outgoing --subrepos issue1852c
820 820 comparing with issue1852c
821 821 searching for changes
822 822 no changes found
823 823 comparing with issue1852c/sub/repo
824 824 searching for changes
825 825 no changes found
826 826 [1]
827 827 $ hg -R issue1852d incoming --subrepos issue1852c
828 828 comparing with issue1852c
829 829 searching for changes
830 830 no changes found
831 831 comparing with issue1852c/sub/repo
832 832 searching for changes
833 833 no changes found
834 834 [1]
835 835
836 836 Check status of files when none of them belong to the first
837 837 subrepository:
838 838
839 839 $ hg init subrepo-status
840 840 $ cd subrepo-status
841 841 $ hg init subrepo-1
842 842 $ hg init subrepo-2
843 843 $ cd subrepo-2
844 844 $ touch file
845 845 $ hg add file
846 846 $ cd ..
847 847 $ echo subrepo-1 = subrepo-1 > .hgsub
848 848 $ echo subrepo-2 = subrepo-2 >> .hgsub
849 849 $ hg add .hgsub
850 850 $ hg ci -m 'Added subrepos'
851 851 committing subrepository subrepo-2
852 852 $ hg st subrepo-2/file
853 853
854 854 Check that share works with subrepo
855 855 $ hg --config extensions.share= share . ../shared
856 856 updating working directory
857 857 cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
858 858 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
859 859 $ test -f ../shared/subrepo-1/.hg/sharedpath
860 860 [1]
861 861 $ hg -R ../shared in
862 862 abort: repository default not found!
863 863 [255]
864 864 $ hg -R ../shared/subrepo-2 showconfig paths
865 865 paths.default=$TESTTMP/subrepo-status/subrepo-2
866 866 $ hg -R ../shared/subrepo-1 sum --remote
867 867 parent: -1:000000000000 tip (empty repository)
868 868 branch: default
869 869 commit: (clean)
870 870 update: (current)
871 871 remote: (synced)
872 872
873 873 Check hg update --clean
874 874 $ cd $TESTTMP/t
875 875 $ rm -r t/t.orig
876 876 $ hg status -S --all
877 877 C .hgsub
878 878 C .hgsubstate
879 879 C a
880 880 C s/.hgsub
881 881 C s/.hgsubstate
882 882 C s/a
883 883 C s/ss/a
884 884 C t/t
885 885 $ echo c1 > s/a
886 886 $ cd s
887 887 $ echo c1 > b
888 888 $ echo c1 > c
889 889 $ hg add b
890 890 $ cd ..
891 891 $ hg status -S
892 892 M s/a
893 893 A s/b
894 894 ? s/c
895 895 $ hg update -C
896 896 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
897 897 $ hg status -S
898 898 ? s/b
899 899 ? s/c
900 900
901 901 Sticky subrepositories, no changes
902 902 $ cd $TESTTMP/t
903 903 $ hg id
904 904 925c17564ef8 tip
905 905 $ hg -R s id
906 906 12a213df6fa9 tip
907 907 $ hg -R t id
908 908 52c0adc0515a tip
909 909 $ hg update 11
910 910 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
911 911 $ hg id
912 912 365661e5936a
913 913 $ hg -R s id
914 914 fc627a69481f
915 915 $ hg -R t id
916 916 e95bcfa18a35
917 917
918 918 Sticky subrepositorys, file changes
919 919 $ touch s/f1
920 920 $ touch t/f1
921 921 $ hg add -S s/f1
922 922 $ hg add -S t/f1
923 923 $ hg id
924 924 365661e5936a+
925 925 $ hg -R s id
926 926 fc627a69481f+
927 927 $ hg -R t id
928 928 e95bcfa18a35+
929 929 $ hg update tip
930 930 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
931 931 (M)erge, keep (l)ocal or keep (r)emote? m
932 932 subrepository sources for s differ
933 933 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
934 934 l
935 935 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
936 936 (M)erge, keep (l)ocal or keep (r)emote? m
937 937 subrepository sources for t differ
938 938 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)?
939 939 l
940 940 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
941 941 $ hg id
942 942 925c17564ef8+ tip
943 943 $ hg -R s id
944 944 fc627a69481f+
945 945 $ hg -R t id
946 946 e95bcfa18a35+
947 947 $ hg update --clean tip
948 948 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
949 949
950 950 Sticky subrepository, revision updates
951 951 $ hg id
952 952 925c17564ef8 tip
953 953 $ hg -R s id
954 954 12a213df6fa9 tip
955 955 $ hg -R t id
956 956 52c0adc0515a tip
957 957 $ cd s
958 958 $ hg update -r -2
959 959 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
960 960 $ cd ../t
961 961 $ hg update -r 2
962 962 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
963 963 $ cd ..
964 964 $ hg update 10
965 965 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
966 966 (M)erge, keep (l)ocal or keep (r)emote? m
967 967 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
968 968 (M)erge, keep (l)ocal or keep (r)emote? m
969 969 subrepository sources for t differ (in checked out version)
970 970 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)?
971 971 l
972 972 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
973 973 $ hg id
974 974 e45c8b14af55+
975 975 $ hg -R s id
976 976 02dcf1d70411
977 977 $ hg -R t id
978 978 7af322bc1198
979 979
980 980 Sticky subrepository, file changes and revision updates
981 981 $ touch s/f1
982 982 $ touch t/f1
983 983 $ hg add -S s/f1
984 984 $ hg add -S t/f1
985 985 $ hg id
986 986 e45c8b14af55+
987 987 $ hg -R s id
988 988 02dcf1d70411+
989 989 $ hg -R t id
990 990 7af322bc1198+
991 991 $ hg update tip
992 992 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
993 993 (M)erge, keep (l)ocal or keep (r)emote? m
994 994 subrepository sources for s differ
995 995 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)?
996 996 l
997 997 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
998 998 (M)erge, keep (l)ocal or keep (r)emote? m
999 999 subrepository sources for t differ
1000 1000 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)?
1001 1001 l
1002 1002 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1003 1003 $ hg id
1004 1004 925c17564ef8+ tip
1005 1005 $ hg -R s id
1006 1006 02dcf1d70411+
1007 1007 $ hg -R t id
1008 1008 7af322bc1198+
1009 1009
1010 1010 Sticky repository, update --clean
1011 1011 $ hg update --clean tip
1012 1012 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1013 1013 $ hg id
1014 1014 925c17564ef8 tip
1015 1015 $ hg -R s id
1016 1016 12a213df6fa9 tip
1017 1017 $ hg -R t id
1018 1018 52c0adc0515a tip
1019 1019
1020 1020 Test subrepo already at intended revision:
1021 1021 $ cd s
1022 1022 $ hg update fc627a69481f
1023 1023 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1024 1024 $ cd ..
1025 1025 $ hg update 11
1026 1026 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1027 1027 (M)erge, keep (l)ocal or keep (r)emote? m
1028 1028 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1029 1029 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1030 1030 $ hg id -n
1031 1031 11+
1032 1032 $ hg -R s id
1033 1033 fc627a69481f
1034 1034 $ hg -R t id
1035 1035 e95bcfa18a35
1036 1036
1037 1037 Test that removing .hgsubstate doesn't break anything:
1038 1038
1039 1039 $ hg rm -f .hgsubstate
1040 1040 $ hg ci -mrm
1041 1041 nothing changed
1042 1042 [1]
1043 1043 $ hg log -vr tip
1044 1044 changeset: 13:925c17564ef8
1045 1045 tag: tip
1046 1046 user: test
1047 1047 date: Thu Jan 01 00:00:00 1970 +0000
1048 1048 files: .hgsubstate
1049 1049 description:
1050 1050 13
1051 1051
1052 1052
1053 1053
1054 1054 Test that removing .hgsub removes .hgsubstate:
1055 1055
1056 1056 $ hg rm .hgsub
1057 1057 $ hg ci -mrm2
1058 1058 created new head
1059 1059 $ hg log -vr tip
1060 1060 changeset: 14:2400bccd50af
1061 1061 tag: tip
1062 1062 parent: 11:365661e5936a
1063 1063 user: test
1064 1064 date: Thu Jan 01 00:00:00 1970 +0000
1065 1065 files: .hgsub .hgsubstate
1066 1066 description:
1067 1067 rm2
1068 1068
1069 1069
1070 1070 Test issue3153: diff -S with deleted subrepos
1071 1071
1072 1072 $ hg diff --nodates -S -c .
1073 1073 diff -r 365661e5936a -r 2400bccd50af .hgsub
1074 1074 --- a/.hgsub
1075 1075 +++ /dev/null
1076 1076 @@ -1,2 +0,0 @@
1077 1077 -s = s
1078 1078 -t = t
1079 1079 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1080 1080 --- a/.hgsubstate
1081 1081 +++ /dev/null
1082 1082 @@ -1,2 +0,0 @@
1083 1083 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1084 1084 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1085 1085
1086 1086 Test behavior of add for explicit path in subrepo:
1087 1087 $ cd ..
1088 1088 $ hg init explicit
1089 1089 $ cd explicit
1090 1090 $ echo s = s > .hgsub
1091 1091 $ hg add .hgsub
1092 1092 $ hg init s
1093 1093 $ hg ci -m0
1094 1094 Adding with an explicit path in a subrepo adds the file
1095 1095 $ echo c1 > f1
1096 1096 $ echo c2 > s/f2
1097 1097 $ hg st -S
1098 1098 ? f1
1099 1099 ? s/f2
1100 1100 $ hg add s/f2
1101 1101 $ hg st -S
1102 1102 A s/f2
1103 1103 ? f1
1104 1104 $ hg ci -R s -m0
1105 1105 $ hg ci -Am1
1106 1106 adding f1
1107 1107 Adding with an explicit path in a subrepo with -S has the same behavior
1108 1108 $ echo c3 > f3
1109 1109 $ echo c4 > s/f4
1110 1110 $ hg st -S
1111 1111 ? f3
1112 1112 ? s/f4
1113 1113 $ hg add -S s/f4
1114 1114 $ hg st -S
1115 1115 A s/f4
1116 1116 ? f3
1117 1117 $ hg ci -R s -m1
1118 1118 $ hg ci -Ama2
1119 1119 adding f3
1120 1120 Adding without a path or pattern silently ignores subrepos
1121 1121 $ echo c5 > f5
1122 1122 $ echo c6 > s/f6
1123 1123 $ echo c7 > s/f7
1124 1124 $ hg st -S
1125 1125 ? f5
1126 1126 ? s/f6
1127 1127 ? s/f7
1128 1128 $ hg add
1129 1129 adding f5
1130 1130 $ hg st -S
1131 1131 A f5
1132 1132 ? s/f6
1133 1133 ? s/f7
1134 1134 $ hg ci -R s -Am2
1135 1135 adding f6
1136 1136 adding f7
1137 1137 $ hg ci -m3
1138 1138 Adding without a path or pattern with -S also adds files in subrepos
1139 1139 $ echo c8 > f8
1140 1140 $ echo c9 > s/f9
1141 1141 $ echo c10 > s/f10
1142 1142 $ hg st -S
1143 1143 ? f8
1144 1144 ? s/f10
1145 1145 ? s/f9
1146 1146 $ hg add -S
1147 1147 adding f8
1148 1148 adding s/f10 (glob)
1149 1149 adding s/f9 (glob)
1150 1150 $ hg st -S
1151 1151 A f8
1152 1152 A s/f10
1153 1153 A s/f9
1154 1154 $ hg ci -R s -m3
1155 1155 $ hg ci -m4
1156 1156 Adding with a pattern silently ignores subrepos
1157 1157 $ echo c11 > fm11
1158 1158 $ echo c12 > fn12
1159 1159 $ echo c13 > s/fm13
1160 1160 $ echo c14 > s/fn14
1161 1161 $ hg st -S
1162 1162 ? fm11
1163 1163 ? fn12
1164 1164 ? s/fm13
1165 1165 ? s/fn14
1166 1166 $ hg add 'glob:**fm*'
1167 1167 adding fm11
1168 1168 $ hg st -S
1169 1169 A fm11
1170 1170 ? fn12
1171 1171 ? s/fm13
1172 1172 ? s/fn14
1173 1173 $ hg ci -R s -Am4
1174 1174 adding fm13
1175 1175 adding fn14
1176 1176 $ hg ci -Am5
1177 1177 adding fn12
1178 1178 Adding with a pattern with -S also adds matches in subrepos
1179 1179 $ echo c15 > fm15
1180 1180 $ echo c16 > fn16
1181 1181 $ echo c17 > s/fm17
1182 1182 $ echo c18 > s/fn18
1183 1183 $ hg st -S
1184 1184 ? fm15
1185 1185 ? fn16
1186 1186 ? s/fm17
1187 1187 ? s/fn18
1188 1188 $ hg add -S 'glob:**fm*'
1189 1189 adding fm15
1190 1190 adding s/fm17 (glob)
1191 1191 $ hg st -S
1192 1192 A fm15
1193 1193 A s/fm17
1194 1194 ? fn16
1195 1195 ? s/fn18
1196 1196 $ hg ci -R s -Am5
1197 1197 adding fn18
1198 1198 $ hg ci -Am6
1199 1199 adding fn16
1200 1200
1201 1201 Test behavior of forget for explicit path in subrepo:
1202 1202 Forgetting an explicit path in a subrepo untracks the file
1203 1203 $ echo c19 > s/f19
1204 1204 $ hg add s/f19
1205 1205 $ hg st -S
1206 1206 A s/f19
1207 1207 $ hg forget s/f19
1208 1208 $ hg st -S
1209 1209 ? s/f19
1210 1210 $ rm s/f19
1211 1211 $ cd ..
1212 1212
1213 1213 Courtesy phases synchronisation to publishing server does not block the push
1214 1214 (issue3781)
1215 1215
1216 1216 $ cp -r main issue3781
1217 1217 $ cp -r main issue3781-dest
1218 1218 $ cd issue3781-dest/s
1219 1219 $ hg phase tip # show we have draft changeset
1220 1220 5: draft
1221 1221 $ chmod a-w .hg/store/phaseroots # prevent phase push
1222 1222 $ cd ../../issue3781
1223 1223 $ cat >> .hg/hgrc << EOF
1224 1224 > [paths]
1225 1225 > default=../issue3781-dest/
1226 1226 > EOF
1227 1227 $ hg push
1228 1228 pushing to $TESTTMP/issue3781-dest (glob)
1229 1229 pushing subrepo s to $TESTTMP/issue3781-dest/s
1230 1230 searching for changes
1231 1231 no changes found
1232 1232 searching for changes
1233 1233 no changes found
1234 1234 [1]
1235 1235
General Comments 0
You need to be logged in to leave comments. Login now