##// END OF EJS Templates
copies: delete debug message about search limit...
Martin von Zweigbergk -
r42343:380f59da default draft
parent child Browse files
Show More
@@ -1,1027 +1,1026 b''
1 # copies.py - copy detection for Mercurial
1 # copies.py - copy detection for Mercurial
2 #
2 #
3 # Copyright 2008 Matt Mackall <mpm@selenic.com>
3 # Copyright 2008 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import collections
10 import collections
11 import heapq
11 import heapq
12 import os
12 import os
13
13
14 from .i18n import _
14 from .i18n import _
15
15
16 from . import (
16 from . import (
17 match as matchmod,
17 match as matchmod,
18 node,
18 node,
19 pathutil,
19 pathutil,
20 util,
20 util,
21 )
21 )
22 from .utils import (
22 from .utils import (
23 stringutil,
23 stringutil,
24 )
24 )
25
25
26 def _findlimit(repo, ctxa, ctxb):
26 def _findlimit(repo, ctxa, ctxb):
27 """
27 """
28 Find the last revision that needs to be checked to ensure that a full
28 Find the last revision that needs to be checked to ensure that a full
29 transitive closure for file copies can be properly calculated.
29 transitive closure for file copies can be properly calculated.
30 Generally, this means finding the earliest revision number that's an
30 Generally, this means finding the earliest revision number that's an
31 ancestor of a or b but not both, except when a or b is a direct descendent
31 ancestor of a or b but not both, except when a or b is a direct descendent
32 of the other, in which case we can return the minimum revnum of a and b.
32 of the other, in which case we can return the minimum revnum of a and b.
33 """
33 """
34
34
35 # basic idea:
35 # basic idea:
36 # - mark a and b with different sides
36 # - mark a and b with different sides
37 # - if a parent's children are all on the same side, the parent is
37 # - if a parent's children are all on the same side, the parent is
38 # on that side, otherwise it is on no side
38 # on that side, otherwise it is on no side
39 # - walk the graph in topological order with the help of a heap;
39 # - walk the graph in topological order with the help of a heap;
40 # - add unseen parents to side map
40 # - add unseen parents to side map
41 # - clear side of any parent that has children on different sides
41 # - clear side of any parent that has children on different sides
42 # - track number of interesting revs that might still be on a side
42 # - track number of interesting revs that might still be on a side
43 # - track the lowest interesting rev seen
43 # - track the lowest interesting rev seen
44 # - quit when interesting revs is zero
44 # - quit when interesting revs is zero
45
45
46 cl = repo.changelog
46 cl = repo.changelog
47 wdirparents = None
47 wdirparents = None
48 a = ctxa.rev()
48 a = ctxa.rev()
49 b = ctxb.rev()
49 b = ctxb.rev()
50 if a is None:
50 if a is None:
51 wdirparents = (ctxa.p1(), ctxa.p2())
51 wdirparents = (ctxa.p1(), ctxa.p2())
52 a = node.wdirrev
52 a = node.wdirrev
53 if b is None:
53 if b is None:
54 assert not wdirparents
54 assert not wdirparents
55 wdirparents = (ctxb.p1(), ctxb.p2())
55 wdirparents = (ctxb.p1(), ctxb.p2())
56 b = node.wdirrev
56 b = node.wdirrev
57
57
58 side = {a: -1, b: 1}
58 side = {a: -1, b: 1}
59 visit = [-a, -b]
59 visit = [-a, -b]
60 heapq.heapify(visit)
60 heapq.heapify(visit)
61 interesting = len(visit)
61 interesting = len(visit)
62 limit = node.wdirrev
62 limit = node.wdirrev
63
63
64 while interesting:
64 while interesting:
65 r = -heapq.heappop(visit)
65 r = -heapq.heappop(visit)
66 if r == node.wdirrev:
66 if r == node.wdirrev:
67 parents = [pctx.rev() for pctx in wdirparents]
67 parents = [pctx.rev() for pctx in wdirparents]
68 else:
68 else:
69 parents = cl.parentrevs(r)
69 parents = cl.parentrevs(r)
70 if parents[1] == node.nullrev:
70 if parents[1] == node.nullrev:
71 parents = parents[:1]
71 parents = parents[:1]
72 for p in parents:
72 for p in parents:
73 if p not in side:
73 if p not in side:
74 # first time we see p; add it to visit
74 # first time we see p; add it to visit
75 side[p] = side[r]
75 side[p] = side[r]
76 if side[p]:
76 if side[p]:
77 interesting += 1
77 interesting += 1
78 heapq.heappush(visit, -p)
78 heapq.heappush(visit, -p)
79 elif side[p] and side[p] != side[r]:
79 elif side[p] and side[p] != side[r]:
80 # p was interesting but now we know better
80 # p was interesting but now we know better
81 side[p] = 0
81 side[p] = 0
82 interesting -= 1
82 interesting -= 1
83 if side[r]:
83 if side[r]:
84 limit = r # lowest rev visited
84 limit = r # lowest rev visited
85 interesting -= 1
85 interesting -= 1
86
86
87 # Consider the following flow (see test-commit-amend.t under issue4405):
87 # Consider the following flow (see test-commit-amend.t under issue4405):
88 # 1/ File 'a0' committed
88 # 1/ File 'a0' committed
89 # 2/ File renamed from 'a0' to 'a1' in a new commit (call it 'a1')
89 # 2/ File renamed from 'a0' to 'a1' in a new commit (call it 'a1')
90 # 3/ Move back to first commit
90 # 3/ Move back to first commit
91 # 4/ Create a new commit via revert to contents of 'a1' (call it 'a1-amend')
91 # 4/ Create a new commit via revert to contents of 'a1' (call it 'a1-amend')
92 # 5/ Rename file from 'a1' to 'a2' and commit --amend 'a1-msg'
92 # 5/ Rename file from 'a1' to 'a2' and commit --amend 'a1-msg'
93 #
93 #
94 # During the amend in step five, we will be in this state:
94 # During the amend in step five, we will be in this state:
95 #
95 #
96 # @ 3 temporary amend commit for a1-amend
96 # @ 3 temporary amend commit for a1-amend
97 # |
97 # |
98 # o 2 a1-amend
98 # o 2 a1-amend
99 # |
99 # |
100 # | o 1 a1
100 # | o 1 a1
101 # |/
101 # |/
102 # o 0 a0
102 # o 0 a0
103 #
103 #
104 # When _findlimit is called, a and b are revs 3 and 0, so limit will be 2,
104 # When _findlimit is called, a and b are revs 3 and 0, so limit will be 2,
105 # yet the filelog has the copy information in rev 1 and we will not look
105 # yet the filelog has the copy information in rev 1 and we will not look
106 # back far enough unless we also look at the a and b as candidates.
106 # back far enough unless we also look at the a and b as candidates.
107 # This only occurs when a is a descendent of b or visa-versa.
107 # This only occurs when a is a descendent of b or visa-versa.
108 return min(limit, a, b)
108 return min(limit, a, b)
109
109
110 def _chain(src, dst, a, b):
110 def _chain(src, dst, a, b):
111 """chain two sets of copies a->b"""
111 """chain two sets of copies a->b"""
112 t = a.copy()
112 t = a.copy()
113 for k, v in b.iteritems():
113 for k, v in b.iteritems():
114 if v in t:
114 if v in t:
115 # found a chain
115 # found a chain
116 if t[v] != k:
116 if t[v] != k:
117 # file wasn't renamed back to itself
117 # file wasn't renamed back to itself
118 t[k] = t[v]
118 t[k] = t[v]
119 if v not in dst:
119 if v not in dst:
120 # chain was a rename, not a copy
120 # chain was a rename, not a copy
121 del t[v]
121 del t[v]
122 if v in src:
122 if v in src:
123 # file is a copy of an existing file
123 # file is a copy of an existing file
124 t[k] = v
124 t[k] = v
125
125
126 for k, v in list(t.items()):
126 for k, v in list(t.items()):
127 # remove criss-crossed copies
127 # remove criss-crossed copies
128 if k in src and v in dst:
128 if k in src and v in dst:
129 del t[k]
129 del t[k]
130 # remove copies to files that were then removed
130 # remove copies to files that were then removed
131 elif k not in dst:
131 elif k not in dst:
132 del t[k]
132 del t[k]
133
133
134 return t
134 return t
135
135
136 def _tracefile(fctx, am, limit=node.nullrev):
136 def _tracefile(fctx, am, limit=node.nullrev):
137 """return file context that is the ancestor of fctx present in ancestor
137 """return file context that is the ancestor of fctx present in ancestor
138 manifest am, stopping after the first ancestor lower than limit"""
138 manifest am, stopping after the first ancestor lower than limit"""
139
139
140 for f in fctx.ancestors():
140 for f in fctx.ancestors():
141 if am.get(f.path(), None) == f.filenode():
141 if am.get(f.path(), None) == f.filenode():
142 return f
142 return f
143 if limit >= 0 and not f.isintroducedafter(limit):
143 if limit >= 0 and not f.isintroducedafter(limit):
144 return None
144 return None
145
145
146 def _dirstatecopies(repo, match=None):
146 def _dirstatecopies(repo, match=None):
147 ds = repo.dirstate
147 ds = repo.dirstate
148 c = ds.copies().copy()
148 c = ds.copies().copy()
149 for k in list(c):
149 for k in list(c):
150 if ds[k] not in 'anm' or (match and not match(k)):
150 if ds[k] not in 'anm' or (match and not match(k)):
151 del c[k]
151 del c[k]
152 return c
152 return c
153
153
154 def _computeforwardmissing(a, b, match=None):
154 def _computeforwardmissing(a, b, match=None):
155 """Computes which files are in b but not a.
155 """Computes which files are in b but not a.
156 This is its own function so extensions can easily wrap this call to see what
156 This is its own function so extensions can easily wrap this call to see what
157 files _forwardcopies is about to process.
157 files _forwardcopies is about to process.
158 """
158 """
159 ma = a.manifest()
159 ma = a.manifest()
160 mb = b.manifest()
160 mb = b.manifest()
161 return mb.filesnotin(ma, match=match)
161 return mb.filesnotin(ma, match=match)
162
162
163 def usechangesetcentricalgo(repo):
163 def usechangesetcentricalgo(repo):
164 """Checks if we should use changeset-centric copy algorithms"""
164 """Checks if we should use changeset-centric copy algorithms"""
165 return (repo.ui.config('experimental', 'copies.read-from') in
165 return (repo.ui.config('experimental', 'copies.read-from') in
166 ('changeset-only', 'compatibility'))
166 ('changeset-only', 'compatibility'))
167
167
168 def _committedforwardcopies(a, b, match):
168 def _committedforwardcopies(a, b, match):
169 """Like _forwardcopies(), but b.rev() cannot be None (working copy)"""
169 """Like _forwardcopies(), but b.rev() cannot be None (working copy)"""
170 # files might have to be traced back to the fctx parent of the last
170 # files might have to be traced back to the fctx parent of the last
171 # one-side-only changeset, but not further back than that
171 # one-side-only changeset, but not further back than that
172 repo = a._repo
172 repo = a._repo
173
173
174 if usechangesetcentricalgo(repo):
174 if usechangesetcentricalgo(repo):
175 return _changesetforwardcopies(a, b, match)
175 return _changesetforwardcopies(a, b, match)
176
176
177 debug = repo.ui.debugflag and repo.ui.configbool('devel', 'debug.copies')
177 debug = repo.ui.debugflag and repo.ui.configbool('devel', 'debug.copies')
178 dbg = repo.ui.debug
178 dbg = repo.ui.debug
179 if debug:
179 if debug:
180 dbg('debug.copies: looking into rename from %s to %s\n'
180 dbg('debug.copies: looking into rename from %s to %s\n'
181 % (a, b))
181 % (a, b))
182 limit = _findlimit(repo, a, b)
182 limit = _findlimit(repo, a, b)
183 if debug:
183 if debug:
184 dbg('debug.copies: search limit: %d\n' % limit)
184 dbg('debug.copies: search limit: %d\n' % limit)
185 am = a.manifest()
185 am = a.manifest()
186
186
187 # find where new files came from
187 # find where new files came from
188 # we currently don't try to find where old files went, too expensive
188 # we currently don't try to find where old files went, too expensive
189 # this means we can miss a case like 'hg rm b; hg cp a b'
189 # this means we can miss a case like 'hg rm b; hg cp a b'
190 cm = {}
190 cm = {}
191
191
192 # Computing the forward missing is quite expensive on large manifests, since
192 # Computing the forward missing is quite expensive on large manifests, since
193 # it compares the entire manifests. We can optimize it in the common use
193 # it compares the entire manifests. We can optimize it in the common use
194 # case of computing what copies are in a commit versus its parent (like
194 # case of computing what copies are in a commit versus its parent (like
195 # during a rebase or histedit). Note, we exclude merge commits from this
195 # during a rebase or histedit). Note, we exclude merge commits from this
196 # optimization, since the ctx.files() for a merge commit is not correct for
196 # optimization, since the ctx.files() for a merge commit is not correct for
197 # this comparison.
197 # this comparison.
198 forwardmissingmatch = match
198 forwardmissingmatch = match
199 if b.p1() == a and b.p2().node() == node.nullid:
199 if b.p1() == a and b.p2().node() == node.nullid:
200 filesmatcher = matchmod.exact(b.files())
200 filesmatcher = matchmod.exact(b.files())
201 forwardmissingmatch = matchmod.intersectmatchers(match, filesmatcher)
201 forwardmissingmatch = matchmod.intersectmatchers(match, filesmatcher)
202 missing = _computeforwardmissing(a, b, match=forwardmissingmatch)
202 missing = _computeforwardmissing(a, b, match=forwardmissingmatch)
203
203
204 ancestrycontext = a._repo.changelog.ancestors([b.rev()], inclusive=True)
204 ancestrycontext = a._repo.changelog.ancestors([b.rev()], inclusive=True)
205
205
206 if debug:
206 if debug:
207 dbg('debug.copies: missing file to search: %d\n' % len(missing))
207 dbg('debug.copies: missing file to search: %d\n' % len(missing))
208
208
209 for f in missing:
209 for f in missing:
210 if debug:
210 if debug:
211 dbg('debug.copies: tracing file: %s\n' % f)
211 dbg('debug.copies: tracing file: %s\n' % f)
212 fctx = b[f]
212 fctx = b[f]
213 fctx._ancestrycontext = ancestrycontext
213 fctx._ancestrycontext = ancestrycontext
214
214
215 if debug:
215 if debug:
216 start = util.timer()
216 start = util.timer()
217 ofctx = _tracefile(fctx, am, limit)
217 ofctx = _tracefile(fctx, am, limit)
218 if ofctx:
218 if ofctx:
219 if debug:
219 if debug:
220 dbg('debug.copies: rename of: %s\n' % ofctx._path)
220 dbg('debug.copies: rename of: %s\n' % ofctx._path)
221 cm[f] = ofctx.path()
221 cm[f] = ofctx.path()
222 if debug:
222 if debug:
223 dbg('debug.copies: time: %f seconds\n'
223 dbg('debug.copies: time: %f seconds\n'
224 % (util.timer() - start))
224 % (util.timer() - start))
225 return cm
225 return cm
226
226
227 def _changesetforwardcopies(a, b, match):
227 def _changesetforwardcopies(a, b, match):
228 if a.rev() == node.nullrev:
228 if a.rev() == node.nullrev:
229 return {}
229 return {}
230
230
231 repo = a.repo()
231 repo = a.repo()
232 children = {}
232 children = {}
233 cl = repo.changelog
233 cl = repo.changelog
234 missingrevs = cl.findmissingrevs(common=[a.rev()], heads=[b.rev()])
234 missingrevs = cl.findmissingrevs(common=[a.rev()], heads=[b.rev()])
235 for r in missingrevs:
235 for r in missingrevs:
236 for p in cl.parentrevs(r):
236 for p in cl.parentrevs(r):
237 if p == node.nullrev:
237 if p == node.nullrev:
238 continue
238 continue
239 if p not in children:
239 if p not in children:
240 children[p] = [r]
240 children[p] = [r]
241 else:
241 else:
242 children[p].append(r)
242 children[p].append(r)
243
243
244 roots = set(children) - set(missingrevs)
244 roots = set(children) - set(missingrevs)
245 # 'work' contains 3-tuples of a (revision number, parent number, copies).
245 # 'work' contains 3-tuples of a (revision number, parent number, copies).
246 # The parent number is only used for knowing which parent the copies dict
246 # The parent number is only used for knowing which parent the copies dict
247 # came from.
247 # came from.
248 work = [(r, 1, {}) for r in roots]
248 work = [(r, 1, {}) for r in roots]
249 heapq.heapify(work)
249 heapq.heapify(work)
250 while work:
250 while work:
251 r, i1, copies1 = heapq.heappop(work)
251 r, i1, copies1 = heapq.heappop(work)
252 if work and work[0][0] == r:
252 if work and work[0][0] == r:
253 # We are tracing copies from both parents
253 # We are tracing copies from both parents
254 r, i2, copies2 = heapq.heappop(work)
254 r, i2, copies2 = heapq.heappop(work)
255 copies = {}
255 copies = {}
256 ctx = repo[r]
256 ctx = repo[r]
257 p1man, p2man = ctx.p1().manifest(), ctx.p2().manifest()
257 p1man, p2man = ctx.p1().manifest(), ctx.p2().manifest()
258 allcopies = set(copies1) | set(copies2)
258 allcopies = set(copies1) | set(copies2)
259 # TODO: perhaps this filtering should be done as long as ctx
259 # TODO: perhaps this filtering should be done as long as ctx
260 # is merge, whether or not we're tracing from both parent.
260 # is merge, whether or not we're tracing from both parent.
261 for dst in allcopies:
261 for dst in allcopies:
262 if not match(dst):
262 if not match(dst):
263 continue
263 continue
264 if dst not in copies2:
264 if dst not in copies2:
265 # Copied on p1 side: mark as copy from p1 side if it didn't
265 # Copied on p1 side: mark as copy from p1 side if it didn't
266 # already exist on p2 side
266 # already exist on p2 side
267 if dst not in p2man:
267 if dst not in p2man:
268 copies[dst] = copies1[dst]
268 copies[dst] = copies1[dst]
269 elif dst not in copies1:
269 elif dst not in copies1:
270 # Copied on p2 side: mark as copy from p2 side if it didn't
270 # Copied on p2 side: mark as copy from p2 side if it didn't
271 # already exist on p1 side
271 # already exist on p1 side
272 if dst not in p1man:
272 if dst not in p1man:
273 copies[dst] = copies2[dst]
273 copies[dst] = copies2[dst]
274 else:
274 else:
275 # Copied on both sides: mark as copy from p1 side
275 # Copied on both sides: mark as copy from p1 side
276 copies[dst] = copies1[dst]
276 copies[dst] = copies1[dst]
277 else:
277 else:
278 copies = copies1
278 copies = copies1
279 if r == b.rev():
279 if r == b.rev():
280 return copies
280 return copies
281 for c in children[r]:
281 for c in children[r]:
282 childctx = repo[c]
282 childctx = repo[c]
283 if r == childctx.p1().rev():
283 if r == childctx.p1().rev():
284 parent = 1
284 parent = 1
285 childcopies = childctx.p1copies()
285 childcopies = childctx.p1copies()
286 else:
286 else:
287 assert r == childctx.p2().rev()
287 assert r == childctx.p2().rev()
288 parent = 2
288 parent = 2
289 childcopies = childctx.p2copies()
289 childcopies = childctx.p2copies()
290 if not match.always():
290 if not match.always():
291 childcopies = {dst: src for dst, src in childcopies.items()
291 childcopies = {dst: src for dst, src in childcopies.items()
292 if match(dst)}
292 if match(dst)}
293 childcopies = _chain(a, childctx, copies, childcopies)
293 childcopies = _chain(a, childctx, copies, childcopies)
294 heapq.heappush(work, (c, parent, childcopies))
294 heapq.heappush(work, (c, parent, childcopies))
295 assert False
295 assert False
296
296
297 def _forwardcopies(a, b, match=None):
297 def _forwardcopies(a, b, match=None):
298 """find {dst@b: src@a} copy mapping where a is an ancestor of b"""
298 """find {dst@b: src@a} copy mapping where a is an ancestor of b"""
299
299
300 match = a.repo().narrowmatch(match)
300 match = a.repo().narrowmatch(match)
301 # check for working copy
301 # check for working copy
302 if b.rev() is None:
302 if b.rev() is None:
303 if a == b.p1():
303 if a == b.p1():
304 # short-circuit to avoid issues with merge states
304 # short-circuit to avoid issues with merge states
305 return _dirstatecopies(b._repo, match)
305 return _dirstatecopies(b._repo, match)
306
306
307 cm = _committedforwardcopies(a, b.p1(), match)
307 cm = _committedforwardcopies(a, b.p1(), match)
308 # combine copies from dirstate if necessary
308 # combine copies from dirstate if necessary
309 return _chain(a, b, cm, _dirstatecopies(b._repo, match))
309 return _chain(a, b, cm, _dirstatecopies(b._repo, match))
310 return _committedforwardcopies(a, b, match)
310 return _committedforwardcopies(a, b, match)
311
311
312 def _backwardrenames(a, b, match):
312 def _backwardrenames(a, b, match):
313 if a._repo.ui.config('experimental', 'copytrace') == 'off':
313 if a._repo.ui.config('experimental', 'copytrace') == 'off':
314 return {}
314 return {}
315
315
316 # Even though we're not taking copies into account, 1:n rename situations
316 # Even though we're not taking copies into account, 1:n rename situations
317 # can still exist (e.g. hg cp a b; hg mv a c). In those cases we
317 # can still exist (e.g. hg cp a b; hg mv a c). In those cases we
318 # arbitrarily pick one of the renames.
318 # arbitrarily pick one of the renames.
319 # We don't want to pass in "match" here, since that would filter
319 # We don't want to pass in "match" here, since that would filter
320 # the destination by it. Since we're reversing the copies, we want
320 # the destination by it. Since we're reversing the copies, we want
321 # to filter the source instead.
321 # to filter the source instead.
322 f = _forwardcopies(b, a)
322 f = _forwardcopies(b, a)
323 r = {}
323 r = {}
324 for k, v in sorted(f.iteritems()):
324 for k, v in sorted(f.iteritems()):
325 if match and not match(v):
325 if match and not match(v):
326 continue
326 continue
327 # remove copies
327 # remove copies
328 if v in a:
328 if v in a:
329 continue
329 continue
330 r[v] = k
330 r[v] = k
331 return r
331 return r
332
332
333 def pathcopies(x, y, match=None):
333 def pathcopies(x, y, match=None):
334 """find {dst@y: src@x} copy mapping for directed compare"""
334 """find {dst@y: src@x} copy mapping for directed compare"""
335 repo = x._repo
335 repo = x._repo
336 debug = repo.ui.debugflag and repo.ui.configbool('devel', 'debug.copies')
336 debug = repo.ui.debugflag and repo.ui.configbool('devel', 'debug.copies')
337 if debug:
337 if debug:
338 repo.ui.debug('debug.copies: searching copies from %s to %s\n'
338 repo.ui.debug('debug.copies: searching copies from %s to %s\n'
339 % (x, y))
339 % (x, y))
340 if x == y or not x or not y:
340 if x == y or not x or not y:
341 return {}
341 return {}
342 a = y.ancestor(x)
342 a = y.ancestor(x)
343 if a == x:
343 if a == x:
344 if debug:
344 if debug:
345 repo.ui.debug('debug.copies: search mode: forward\n')
345 repo.ui.debug('debug.copies: search mode: forward\n')
346 return _forwardcopies(x, y, match=match)
346 return _forwardcopies(x, y, match=match)
347 if a == y:
347 if a == y:
348 if debug:
348 if debug:
349 repo.ui.debug('debug.copies: search mode: backward\n')
349 repo.ui.debug('debug.copies: search mode: backward\n')
350 return _backwardrenames(x, y, match=match)
350 return _backwardrenames(x, y, match=match)
351 if debug:
351 if debug:
352 repo.ui.debug('debug.copies: search mode: combined\n')
352 repo.ui.debug('debug.copies: search mode: combined\n')
353 return _chain(x, y, _backwardrenames(x, a, match=match),
353 return _chain(x, y, _backwardrenames(x, a, match=match),
354 _forwardcopies(a, y, match=match))
354 _forwardcopies(a, y, match=match))
355
355
356 def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, baselabel=''):
356 def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, baselabel=''):
357 """Computes, based on addedinm1 and addedinm2, the files exclusive to c1
357 """Computes, based on addedinm1 and addedinm2, the files exclusive to c1
358 and c2. This is its own function so extensions can easily wrap this call
358 and c2. This is its own function so extensions can easily wrap this call
359 to see what files mergecopies is about to process.
359 to see what files mergecopies is about to process.
360
360
361 Even though c1 and c2 are not used in this function, they are useful in
361 Even though c1 and c2 are not used in this function, they are useful in
362 other extensions for being able to read the file nodes of the changed files.
362 other extensions for being able to read the file nodes of the changed files.
363
363
364 "baselabel" can be passed to help distinguish the multiple computations
364 "baselabel" can be passed to help distinguish the multiple computations
365 done in the graft case.
365 done in the graft case.
366 """
366 """
367 u1 = sorted(addedinm1 - addedinm2)
367 u1 = sorted(addedinm1 - addedinm2)
368 u2 = sorted(addedinm2 - addedinm1)
368 u2 = sorted(addedinm2 - addedinm1)
369
369
370 header = " unmatched files in %s"
370 header = " unmatched files in %s"
371 if baselabel:
371 if baselabel:
372 header += ' (from %s)' % baselabel
372 header += ' (from %s)' % baselabel
373 if u1:
373 if u1:
374 repo.ui.debug("%s:\n %s\n" % (header % 'local', "\n ".join(u1)))
374 repo.ui.debug("%s:\n %s\n" % (header % 'local', "\n ".join(u1)))
375 if u2:
375 if u2:
376 repo.ui.debug("%s:\n %s\n" % (header % 'other', "\n ".join(u2)))
376 repo.ui.debug("%s:\n %s\n" % (header % 'other', "\n ".join(u2)))
377
377
378 return u1, u2
378 return u1, u2
379
379
380 def _makegetfctx(ctx):
380 def _makegetfctx(ctx):
381 """return a 'getfctx' function suitable for _checkcopies usage
381 """return a 'getfctx' function suitable for _checkcopies usage
382
382
383 We have to re-setup the function building 'filectx' for each
383 We have to re-setup the function building 'filectx' for each
384 '_checkcopies' to ensure the linkrev adjustment is properly setup for
384 '_checkcopies' to ensure the linkrev adjustment is properly setup for
385 each. Linkrev adjustment is important to avoid bug in rename
385 each. Linkrev adjustment is important to avoid bug in rename
386 detection. Moreover, having a proper '_ancestrycontext' setup ensures
386 detection. Moreover, having a proper '_ancestrycontext' setup ensures
387 the performance impact of this adjustment is kept limited. Without it,
387 the performance impact of this adjustment is kept limited. Without it,
388 each file could do a full dag traversal making the time complexity of
388 each file could do a full dag traversal making the time complexity of
389 the operation explode (see issue4537).
389 the operation explode (see issue4537).
390
390
391 This function exists here mostly to limit the impact on stable. Feel
391 This function exists here mostly to limit the impact on stable. Feel
392 free to refactor on default.
392 free to refactor on default.
393 """
393 """
394 rev = ctx.rev()
394 rev = ctx.rev()
395 repo = ctx._repo
395 repo = ctx._repo
396 ac = getattr(ctx, '_ancestrycontext', None)
396 ac = getattr(ctx, '_ancestrycontext', None)
397 if ac is None:
397 if ac is None:
398 revs = [rev]
398 revs = [rev]
399 if rev is None:
399 if rev is None:
400 revs = [p.rev() for p in ctx.parents()]
400 revs = [p.rev() for p in ctx.parents()]
401 ac = repo.changelog.ancestors(revs, inclusive=True)
401 ac = repo.changelog.ancestors(revs, inclusive=True)
402 ctx._ancestrycontext = ac
402 ctx._ancestrycontext = ac
403 def makectx(f, n):
403 def makectx(f, n):
404 if n in node.wdirfilenodeids: # in a working context?
404 if n in node.wdirfilenodeids: # in a working context?
405 if ctx.rev() is None:
405 if ctx.rev() is None:
406 return ctx.filectx(f)
406 return ctx.filectx(f)
407 return repo[None][f]
407 return repo[None][f]
408 fctx = repo.filectx(f, fileid=n)
408 fctx = repo.filectx(f, fileid=n)
409 # setup only needed for filectx not create from a changectx
409 # setup only needed for filectx not create from a changectx
410 fctx._ancestrycontext = ac
410 fctx._ancestrycontext = ac
411 fctx._descendantrev = rev
411 fctx._descendantrev = rev
412 return fctx
412 return fctx
413 return util.lrucachefunc(makectx)
413 return util.lrucachefunc(makectx)
414
414
415 def _combinecopies(copyfrom, copyto, finalcopy, diverge, incompletediverge):
415 def _combinecopies(copyfrom, copyto, finalcopy, diverge, incompletediverge):
416 """combine partial copy paths"""
416 """combine partial copy paths"""
417 remainder = {}
417 remainder = {}
418 for f in copyfrom:
418 for f in copyfrom:
419 if f in copyto:
419 if f in copyto:
420 finalcopy[copyto[f]] = copyfrom[f]
420 finalcopy[copyto[f]] = copyfrom[f]
421 del copyto[f]
421 del copyto[f]
422 for f in incompletediverge:
422 for f in incompletediverge:
423 assert f not in diverge
423 assert f not in diverge
424 ic = incompletediverge[f]
424 ic = incompletediverge[f]
425 if ic[0] in copyto:
425 if ic[0] in copyto:
426 diverge[f] = [copyto[ic[0]], ic[1]]
426 diverge[f] = [copyto[ic[0]], ic[1]]
427 else:
427 else:
428 remainder[f] = ic
428 remainder[f] = ic
429 return remainder
429 return remainder
430
430
431 def mergecopies(repo, c1, c2, base):
431 def mergecopies(repo, c1, c2, base):
432 """
432 """
433 Finds moves and copies between context c1 and c2 that are relevant for
433 Finds moves and copies between context c1 and c2 that are relevant for
434 merging. 'base' will be used as the merge base.
434 merging. 'base' will be used as the merge base.
435
435
436 Copytracing is used in commands like rebase, merge, unshelve, etc to merge
436 Copytracing is used in commands like rebase, merge, unshelve, etc to merge
437 files that were moved/ copied in one merge parent and modified in another.
437 files that were moved/ copied in one merge parent and modified in another.
438 For example:
438 For example:
439
439
440 o ---> 4 another commit
440 o ---> 4 another commit
441 |
441 |
442 | o ---> 3 commit that modifies a.txt
442 | o ---> 3 commit that modifies a.txt
443 | /
443 | /
444 o / ---> 2 commit that moves a.txt to b.txt
444 o / ---> 2 commit that moves a.txt to b.txt
445 |/
445 |/
446 o ---> 1 merge base
446 o ---> 1 merge base
447
447
448 If we try to rebase revision 3 on revision 4, since there is no a.txt in
448 If we try to rebase revision 3 on revision 4, since there is no a.txt in
449 revision 4, and if user have copytrace disabled, we prints the following
449 revision 4, and if user have copytrace disabled, we prints the following
450 message:
450 message:
451
451
452 ```other changed <file> which local deleted```
452 ```other changed <file> which local deleted```
453
453
454 Returns five dicts: "copy", "movewithdir", "diverge", "renamedelete" and
454 Returns five dicts: "copy", "movewithdir", "diverge", "renamedelete" and
455 "dirmove".
455 "dirmove".
456
456
457 "copy" is a mapping from destination name -> source name,
457 "copy" is a mapping from destination name -> source name,
458 where source is in c1 and destination is in c2 or vice-versa.
458 where source is in c1 and destination is in c2 or vice-versa.
459
459
460 "movewithdir" is a mapping from source name -> destination name,
460 "movewithdir" is a mapping from source name -> destination name,
461 where the file at source present in one context but not the other
461 where the file at source present in one context but not the other
462 needs to be moved to destination by the merge process, because the
462 needs to be moved to destination by the merge process, because the
463 other context moved the directory it is in.
463 other context moved the directory it is in.
464
464
465 "diverge" is a mapping of source name -> list of destination names
465 "diverge" is a mapping of source name -> list of destination names
466 for divergent renames.
466 for divergent renames.
467
467
468 "renamedelete" is a mapping of source name -> list of destination
468 "renamedelete" is a mapping of source name -> list of destination
469 names for files deleted in c1 that were renamed in c2 or vice-versa.
469 names for files deleted in c1 that were renamed in c2 or vice-versa.
470
470
471 "dirmove" is a mapping of detected source dir -> destination dir renames.
471 "dirmove" is a mapping of detected source dir -> destination dir renames.
472 This is needed for handling changes to new files previously grafted into
472 This is needed for handling changes to new files previously grafted into
473 renamed directories.
473 renamed directories.
474
474
475 This function calls different copytracing algorithms based on config.
475 This function calls different copytracing algorithms based on config.
476 """
476 """
477 # avoid silly behavior for update from empty dir
477 # avoid silly behavior for update from empty dir
478 if not c1 or not c2 or c1 == c2:
478 if not c1 or not c2 or c1 == c2:
479 return {}, {}, {}, {}, {}
479 return {}, {}, {}, {}, {}
480
480
481 narrowmatch = c1.repo().narrowmatch()
481 narrowmatch = c1.repo().narrowmatch()
482
482
483 # avoid silly behavior for parent -> working dir
483 # avoid silly behavior for parent -> working dir
484 if c2.node() is None and c1.node() == repo.dirstate.p1():
484 if c2.node() is None and c1.node() == repo.dirstate.p1():
485 return _dirstatecopies(repo, narrowmatch), {}, {}, {}, {}
485 return _dirstatecopies(repo, narrowmatch), {}, {}, {}, {}
486
486
487 copytracing = repo.ui.config('experimental', 'copytrace')
487 copytracing = repo.ui.config('experimental', 'copytrace')
488 boolctrace = stringutil.parsebool(copytracing)
488 boolctrace = stringutil.parsebool(copytracing)
489
489
490 # Copy trace disabling is explicitly below the node == p1 logic above
490 # Copy trace disabling is explicitly below the node == p1 logic above
491 # because the logic above is required for a simple copy to be kept across a
491 # because the logic above is required for a simple copy to be kept across a
492 # rebase.
492 # rebase.
493 if copytracing == 'heuristics':
493 if copytracing == 'heuristics':
494 # Do full copytracing if only non-public revisions are involved as
494 # Do full copytracing if only non-public revisions are involved as
495 # that will be fast enough and will also cover the copies which could
495 # that will be fast enough and will also cover the copies which could
496 # be missed by heuristics
496 # be missed by heuristics
497 if _isfullcopytraceable(repo, c1, base):
497 if _isfullcopytraceable(repo, c1, base):
498 return _fullcopytracing(repo, c1, c2, base)
498 return _fullcopytracing(repo, c1, c2, base)
499 return _heuristicscopytracing(repo, c1, c2, base)
499 return _heuristicscopytracing(repo, c1, c2, base)
500 elif boolctrace is False:
500 elif boolctrace is False:
501 # stringutil.parsebool() returns None when it is unable to parse the
501 # stringutil.parsebool() returns None when it is unable to parse the
502 # value, so we should rely on making sure copytracing is on such cases
502 # value, so we should rely on making sure copytracing is on such cases
503 return {}, {}, {}, {}, {}
503 return {}, {}, {}, {}, {}
504 else:
504 else:
505 return _fullcopytracing(repo, c1, c2, base)
505 return _fullcopytracing(repo, c1, c2, base)
506
506
507 def _isfullcopytraceable(repo, c1, base):
507 def _isfullcopytraceable(repo, c1, base):
508 """ Checks that if base, source and destination are all no-public branches,
508 """ Checks that if base, source and destination are all no-public branches,
509 if yes let's use the full copytrace algorithm for increased capabilities
509 if yes let's use the full copytrace algorithm for increased capabilities
510 since it will be fast enough.
510 since it will be fast enough.
511
511
512 `experimental.copytrace.sourcecommitlimit` can be used to set a limit for
512 `experimental.copytrace.sourcecommitlimit` can be used to set a limit for
513 number of changesets from c1 to base such that if number of changesets are
513 number of changesets from c1 to base such that if number of changesets are
514 more than the limit, full copytracing algorithm won't be used.
514 more than the limit, full copytracing algorithm won't be used.
515 """
515 """
516 if c1.rev() is None:
516 if c1.rev() is None:
517 c1 = c1.p1()
517 c1 = c1.p1()
518 if c1.mutable() and base.mutable():
518 if c1.mutable() and base.mutable():
519 sourcecommitlimit = repo.ui.configint('experimental',
519 sourcecommitlimit = repo.ui.configint('experimental',
520 'copytrace.sourcecommitlimit')
520 'copytrace.sourcecommitlimit')
521 commits = len(repo.revs('%d::%d', base.rev(), c1.rev()))
521 commits = len(repo.revs('%d::%d', base.rev(), c1.rev()))
522 return commits < sourcecommitlimit
522 return commits < sourcecommitlimit
523 return False
523 return False
524
524
525 def _fullcopytracing(repo, c1, c2, base):
525 def _fullcopytracing(repo, c1, c2, base):
526 """ The full copytracing algorithm which finds all the new files that were
526 """ The full copytracing algorithm which finds all the new files that were
527 added from merge base up to the top commit and for each file it checks if
527 added from merge base up to the top commit and for each file it checks if
528 this file was copied from another file.
528 this file was copied from another file.
529
529
530 This is pretty slow when a lot of changesets are involved but will track all
530 This is pretty slow when a lot of changesets are involved but will track all
531 the copies.
531 the copies.
532 """
532 """
533 # In certain scenarios (e.g. graft, update or rebase), base can be
533 # In certain scenarios (e.g. graft, update or rebase), base can be
534 # overridden We still need to know a real common ancestor in this case We
534 # overridden We still need to know a real common ancestor in this case We
535 # can't just compute _c1.ancestor(_c2) and compare it to ca, because there
535 # can't just compute _c1.ancestor(_c2) and compare it to ca, because there
536 # can be multiple common ancestors, e.g. in case of bidmerge. Because our
536 # can be multiple common ancestors, e.g. in case of bidmerge. Because our
537 # caller may not know if the revision passed in lieu of the CA is a genuine
537 # caller may not know if the revision passed in lieu of the CA is a genuine
538 # common ancestor or not without explicitly checking it, it's better to
538 # common ancestor or not without explicitly checking it, it's better to
539 # determine that here.
539 # determine that here.
540 #
540 #
541 # base.isancestorof(wc) is False, work around that
541 # base.isancestorof(wc) is False, work around that
542 _c1 = c1.p1() if c1.rev() is None else c1
542 _c1 = c1.p1() if c1.rev() is None else c1
543 _c2 = c2.p1() if c2.rev() is None else c2
543 _c2 = c2.p1() if c2.rev() is None else c2
544 # an endpoint is "dirty" if it isn't a descendant of the merge base
544 # an endpoint is "dirty" if it isn't a descendant of the merge base
545 # if we have a dirty endpoint, we need to trigger graft logic, and also
545 # if we have a dirty endpoint, we need to trigger graft logic, and also
546 # keep track of which endpoint is dirty
546 # keep track of which endpoint is dirty
547 dirtyc1 = not base.isancestorof(_c1)
547 dirtyc1 = not base.isancestorof(_c1)
548 dirtyc2 = not base.isancestorof(_c2)
548 dirtyc2 = not base.isancestorof(_c2)
549 graft = dirtyc1 or dirtyc2
549 graft = dirtyc1 or dirtyc2
550 tca = base
550 tca = base
551 if graft:
551 if graft:
552 tca = _c1.ancestor(_c2)
552 tca = _c1.ancestor(_c2)
553
553
554 limit = _findlimit(repo, c1, c2)
554 limit = _findlimit(repo, c1, c2)
555 repo.ui.debug(" searching for copies back to rev %d\n" % limit)
556
555
557 m1 = c1.manifest()
556 m1 = c1.manifest()
558 m2 = c2.manifest()
557 m2 = c2.manifest()
559 mb = base.manifest()
558 mb = base.manifest()
560
559
561 # gather data from _checkcopies:
560 # gather data from _checkcopies:
562 # - diverge = record all diverges in this dict
561 # - diverge = record all diverges in this dict
563 # - copy = record all non-divergent copies in this dict
562 # - copy = record all non-divergent copies in this dict
564 # - fullcopy = record all copies in this dict
563 # - fullcopy = record all copies in this dict
565 # - incomplete = record non-divergent partial copies here
564 # - incomplete = record non-divergent partial copies here
566 # - incompletediverge = record divergent partial copies here
565 # - incompletediverge = record divergent partial copies here
567 diverge = {} # divergence data is shared
566 diverge = {} # divergence data is shared
568 incompletediverge = {}
567 incompletediverge = {}
569 data1 = {'copy': {},
568 data1 = {'copy': {},
570 'fullcopy': {},
569 'fullcopy': {},
571 'incomplete': {},
570 'incomplete': {},
572 'diverge': diverge,
571 'diverge': diverge,
573 'incompletediverge': incompletediverge,
572 'incompletediverge': incompletediverge,
574 }
573 }
575 data2 = {'copy': {},
574 data2 = {'copy': {},
576 'fullcopy': {},
575 'fullcopy': {},
577 'incomplete': {},
576 'incomplete': {},
578 'diverge': diverge,
577 'diverge': diverge,
579 'incompletediverge': incompletediverge,
578 'incompletediverge': incompletediverge,
580 }
579 }
581
580
582 # find interesting file sets from manifests
581 # find interesting file sets from manifests
583 addedinm1 = m1.filesnotin(mb, repo.narrowmatch())
582 addedinm1 = m1.filesnotin(mb, repo.narrowmatch())
584 addedinm2 = m2.filesnotin(mb, repo.narrowmatch())
583 addedinm2 = m2.filesnotin(mb, repo.narrowmatch())
585 bothnew = sorted(addedinm1 & addedinm2)
584 bothnew = sorted(addedinm1 & addedinm2)
586 if tca == base:
585 if tca == base:
587 # unmatched file from base
586 # unmatched file from base
588 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
587 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
589 u1u, u2u = u1r, u2r
588 u1u, u2u = u1r, u2r
590 else:
589 else:
591 # unmatched file from base (DAG rotation in the graft case)
590 # unmatched file from base (DAG rotation in the graft case)
592 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2,
591 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2,
593 baselabel='base')
592 baselabel='base')
594 # unmatched file from topological common ancestors (no DAG rotation)
593 # unmatched file from topological common ancestors (no DAG rotation)
595 # need to recompute this for directory move handling when grafting
594 # need to recompute this for directory move handling when grafting
596 mta = tca.manifest()
595 mta = tca.manifest()
597 u1u, u2u = _computenonoverlap(repo, c1, c2,
596 u1u, u2u = _computenonoverlap(repo, c1, c2,
598 m1.filesnotin(mta, repo.narrowmatch()),
597 m1.filesnotin(mta, repo.narrowmatch()),
599 m2.filesnotin(mta, repo.narrowmatch()),
598 m2.filesnotin(mta, repo.narrowmatch()),
600 baselabel='topological common ancestor')
599 baselabel='topological common ancestor')
601
600
602 for f in u1u:
601 for f in u1u:
603 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, data1)
602 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, data1)
604
603
605 for f in u2u:
604 for f in u2u:
606 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, data2)
605 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, data2)
607
606
608 copy = dict(data1['copy'])
607 copy = dict(data1['copy'])
609 copy.update(data2['copy'])
608 copy.update(data2['copy'])
610 fullcopy = dict(data1['fullcopy'])
609 fullcopy = dict(data1['fullcopy'])
611 fullcopy.update(data2['fullcopy'])
610 fullcopy.update(data2['fullcopy'])
612
611
613 if dirtyc1:
612 if dirtyc1:
614 _combinecopies(data2['incomplete'], data1['incomplete'], copy, diverge,
613 _combinecopies(data2['incomplete'], data1['incomplete'], copy, diverge,
615 incompletediverge)
614 incompletediverge)
616 if dirtyc2:
615 if dirtyc2:
617 _combinecopies(data1['incomplete'], data2['incomplete'], copy, diverge,
616 _combinecopies(data1['incomplete'], data2['incomplete'], copy, diverge,
618 incompletediverge)
617 incompletediverge)
619
618
620 renamedelete = {}
619 renamedelete = {}
621 renamedeleteset = set()
620 renamedeleteset = set()
622 divergeset = set()
621 divergeset = set()
623 for of, fl in list(diverge.items()):
622 for of, fl in list(diverge.items()):
624 if len(fl) == 1 or of in c1 or of in c2:
623 if len(fl) == 1 or of in c1 or of in c2:
625 del diverge[of] # not actually divergent, or not a rename
624 del diverge[of] # not actually divergent, or not a rename
626 if of not in c1 and of not in c2:
625 if of not in c1 and of not in c2:
627 # renamed on one side, deleted on the other side, but filter
626 # renamed on one side, deleted on the other side, but filter
628 # out files that have been renamed and then deleted
627 # out files that have been renamed and then deleted
629 renamedelete[of] = [f for f in fl if f in c1 or f in c2]
628 renamedelete[of] = [f for f in fl if f in c1 or f in c2]
630 renamedeleteset.update(fl) # reverse map for below
629 renamedeleteset.update(fl) # reverse map for below
631 else:
630 else:
632 divergeset.update(fl) # reverse map for below
631 divergeset.update(fl) # reverse map for below
633
632
634 if bothnew:
633 if bothnew:
635 repo.ui.debug(" unmatched files new in both:\n %s\n"
634 repo.ui.debug(" unmatched files new in both:\n %s\n"
636 % "\n ".join(bothnew))
635 % "\n ".join(bothnew))
637 bothdiverge = {}
636 bothdiverge = {}
638 bothincompletediverge = {}
637 bothincompletediverge = {}
639 remainder = {}
638 remainder = {}
640 both1 = {'copy': {},
639 both1 = {'copy': {},
641 'fullcopy': {},
640 'fullcopy': {},
642 'incomplete': {},
641 'incomplete': {},
643 'diverge': bothdiverge,
642 'diverge': bothdiverge,
644 'incompletediverge': bothincompletediverge
643 'incompletediverge': bothincompletediverge
645 }
644 }
646 both2 = {'copy': {},
645 both2 = {'copy': {},
647 'fullcopy': {},
646 'fullcopy': {},
648 'incomplete': {},
647 'incomplete': {},
649 'diverge': bothdiverge,
648 'diverge': bothdiverge,
650 'incompletediverge': bothincompletediverge
649 'incompletediverge': bothincompletediverge
651 }
650 }
652 for f in bothnew:
651 for f in bothnew:
653 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, both1)
652 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, both1)
654 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, both2)
653 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, both2)
655 if dirtyc1 and dirtyc2:
654 if dirtyc1 and dirtyc2:
656 remainder = _combinecopies(both2['incomplete'], both1['incomplete'],
655 remainder = _combinecopies(both2['incomplete'], both1['incomplete'],
657 copy, bothdiverge, bothincompletediverge)
656 copy, bothdiverge, bothincompletediverge)
658 remainder1 = _combinecopies(both1['incomplete'], both2['incomplete'],
657 remainder1 = _combinecopies(both1['incomplete'], both2['incomplete'],
659 copy, bothdiverge, bothincompletediverge)
658 copy, bothdiverge, bothincompletediverge)
660 remainder.update(remainder1)
659 remainder.update(remainder1)
661 elif dirtyc1:
660 elif dirtyc1:
662 # incomplete copies may only be found on the "dirty" side for bothnew
661 # incomplete copies may only be found on the "dirty" side for bothnew
663 assert not both2['incomplete']
662 assert not both2['incomplete']
664 remainder = _combinecopies({}, both1['incomplete'], copy, bothdiverge,
663 remainder = _combinecopies({}, both1['incomplete'], copy, bothdiverge,
665 bothincompletediverge)
664 bothincompletediverge)
666 elif dirtyc2:
665 elif dirtyc2:
667 assert not both1['incomplete']
666 assert not both1['incomplete']
668 remainder = _combinecopies({}, both2['incomplete'], copy, bothdiverge,
667 remainder = _combinecopies({}, both2['incomplete'], copy, bothdiverge,
669 bothincompletediverge)
668 bothincompletediverge)
670 else:
669 else:
671 # incomplete copies and divergences can't happen outside grafts
670 # incomplete copies and divergences can't happen outside grafts
672 assert not both1['incomplete']
671 assert not both1['incomplete']
673 assert not both2['incomplete']
672 assert not both2['incomplete']
674 assert not bothincompletediverge
673 assert not bothincompletediverge
675 for f in remainder:
674 for f in remainder:
676 assert f not in bothdiverge
675 assert f not in bothdiverge
677 ic = remainder[f]
676 ic = remainder[f]
678 if ic[0] in (m1 if dirtyc1 else m2):
677 if ic[0] in (m1 if dirtyc1 else m2):
679 # backed-out rename on one side, but watch out for deleted files
678 # backed-out rename on one side, but watch out for deleted files
680 bothdiverge[f] = ic
679 bothdiverge[f] = ic
681 for of, fl in bothdiverge.items():
680 for of, fl in bothdiverge.items():
682 if len(fl) == 2 and fl[0] == fl[1]:
681 if len(fl) == 2 and fl[0] == fl[1]:
683 copy[fl[0]] = of # not actually divergent, just matching renames
682 copy[fl[0]] = of # not actually divergent, just matching renames
684
683
685 # Sometimes we get invalid copies here (the "and not remotebase" in
684 # Sometimes we get invalid copies here (the "and not remotebase" in
686 # _checkcopies() seems suspicious). Filter them out.
685 # _checkcopies() seems suspicious). Filter them out.
687 for dst, src in fullcopy.copy().items():
686 for dst, src in fullcopy.copy().items():
688 if src not in mb:
687 if src not in mb:
689 del fullcopy[dst]
688 del fullcopy[dst]
690 # Sometimes we forget to add entries from "copy" to "fullcopy", so fix
689 # Sometimes we forget to add entries from "copy" to "fullcopy", so fix
691 # that up here
690 # that up here
692 for dst, src in copy.items():
691 for dst, src in copy.items():
693 fullcopy[dst] = src
692 fullcopy[dst] = src
694 # Sometimes we forget to add entries from "diverge" to "fullcopy", so fix
693 # Sometimes we forget to add entries from "diverge" to "fullcopy", so fix
695 # that up here
694 # that up here
696 for src, dsts in diverge.items():
695 for src, dsts in diverge.items():
697 for dst in dsts:
696 for dst in dsts:
698 fullcopy[dst] = src
697 fullcopy[dst] = src
699
698
700 if not fullcopy:
699 if not fullcopy:
701 return copy, {}, diverge, renamedelete, {}
700 return copy, {}, diverge, renamedelete, {}
702
701
703 if repo.ui.debugflag:
702 if repo.ui.debugflag:
704 repo.ui.debug(" all copies found (* = to merge, ! = divergent, "
703 repo.ui.debug(" all copies found (* = to merge, ! = divergent, "
705 "% = renamed and deleted):\n")
704 "% = renamed and deleted):\n")
706 for f in sorted(fullcopy):
705 for f in sorted(fullcopy):
707 note = ""
706 note = ""
708 if f in copy:
707 if f in copy:
709 note += "*"
708 note += "*"
710 if f in divergeset:
709 if f in divergeset:
711 note += "!"
710 note += "!"
712 if f in renamedeleteset:
711 if f in renamedeleteset:
713 note += "%"
712 note += "%"
714 repo.ui.debug(" src: '%s' -> dst: '%s' %s\n" % (fullcopy[f], f,
713 repo.ui.debug(" src: '%s' -> dst: '%s' %s\n" % (fullcopy[f], f,
715 note))
714 note))
716 del divergeset
715 del divergeset
717
716
718 repo.ui.debug(" checking for directory renames\n")
717 repo.ui.debug(" checking for directory renames\n")
719
718
720 # generate a directory move map
719 # generate a directory move map
721 d1, d2 = c1.dirs(), c2.dirs()
720 d1, d2 = c1.dirs(), c2.dirs()
722 # Hack for adding '', which is not otherwise added, to d1 and d2
721 # Hack for adding '', which is not otherwise added, to d1 and d2
723 d1.addpath('/')
722 d1.addpath('/')
724 d2.addpath('/')
723 d2.addpath('/')
725 invalid = set()
724 invalid = set()
726 dirmove = {}
725 dirmove = {}
727
726
728 # examine each file copy for a potential directory move, which is
727 # examine each file copy for a potential directory move, which is
729 # when all the files in a directory are moved to a new directory
728 # when all the files in a directory are moved to a new directory
730 for dst, src in fullcopy.iteritems():
729 for dst, src in fullcopy.iteritems():
731 dsrc, ddst = pathutil.dirname(src), pathutil.dirname(dst)
730 dsrc, ddst = pathutil.dirname(src), pathutil.dirname(dst)
732 if dsrc in invalid:
731 if dsrc in invalid:
733 # already seen to be uninteresting
732 # already seen to be uninteresting
734 continue
733 continue
735 elif dsrc in d1 and ddst in d1:
734 elif dsrc in d1 and ddst in d1:
736 # directory wasn't entirely moved locally
735 # directory wasn't entirely moved locally
737 invalid.add(dsrc)
736 invalid.add(dsrc)
738 elif dsrc in d2 and ddst in d2:
737 elif dsrc in d2 and ddst in d2:
739 # directory wasn't entirely moved remotely
738 # directory wasn't entirely moved remotely
740 invalid.add(dsrc)
739 invalid.add(dsrc)
741 elif dsrc in dirmove and dirmove[dsrc] != ddst:
740 elif dsrc in dirmove and dirmove[dsrc] != ddst:
742 # files from the same directory moved to two different places
741 # files from the same directory moved to two different places
743 invalid.add(dsrc)
742 invalid.add(dsrc)
744 else:
743 else:
745 # looks good so far
744 # looks good so far
746 dirmove[dsrc] = ddst
745 dirmove[dsrc] = ddst
747
746
748 for i in invalid:
747 for i in invalid:
749 if i in dirmove:
748 if i in dirmove:
750 del dirmove[i]
749 del dirmove[i]
751 del d1, d2, invalid
750 del d1, d2, invalid
752
751
753 if not dirmove:
752 if not dirmove:
754 return copy, {}, diverge, renamedelete, {}
753 return copy, {}, diverge, renamedelete, {}
755
754
756 dirmove = {k + "/": v + "/" for k, v in dirmove.iteritems()}
755 dirmove = {k + "/": v + "/" for k, v in dirmove.iteritems()}
757
756
758 for d in dirmove:
757 for d in dirmove:
759 repo.ui.debug(" discovered dir src: '%s' -> dst: '%s'\n" %
758 repo.ui.debug(" discovered dir src: '%s' -> dst: '%s'\n" %
760 (d, dirmove[d]))
759 (d, dirmove[d]))
761
760
762 movewithdir = {}
761 movewithdir = {}
763 # check unaccounted nonoverlapping files against directory moves
762 # check unaccounted nonoverlapping files against directory moves
764 for f in u1r + u2r:
763 for f in u1r + u2r:
765 if f not in fullcopy:
764 if f not in fullcopy:
766 for d in dirmove:
765 for d in dirmove:
767 if f.startswith(d):
766 if f.startswith(d):
768 # new file added in a directory that was moved, move it
767 # new file added in a directory that was moved, move it
769 df = dirmove[d] + f[len(d):]
768 df = dirmove[d] + f[len(d):]
770 if df not in copy:
769 if df not in copy:
771 movewithdir[f] = df
770 movewithdir[f] = df
772 repo.ui.debug((" pending file src: '%s' -> "
771 repo.ui.debug((" pending file src: '%s' -> "
773 "dst: '%s'\n") % (f, df))
772 "dst: '%s'\n") % (f, df))
774 break
773 break
775
774
776 return copy, movewithdir, diverge, renamedelete, dirmove
775 return copy, movewithdir, diverge, renamedelete, dirmove
777
776
778 def _heuristicscopytracing(repo, c1, c2, base):
777 def _heuristicscopytracing(repo, c1, c2, base):
779 """ Fast copytracing using filename heuristics
778 """ Fast copytracing using filename heuristics
780
779
781 Assumes that moves or renames are of following two types:
780 Assumes that moves or renames are of following two types:
782
781
783 1) Inside a directory only (same directory name but different filenames)
782 1) Inside a directory only (same directory name but different filenames)
784 2) Move from one directory to another
783 2) Move from one directory to another
785 (same filenames but different directory names)
784 (same filenames but different directory names)
786
785
787 Works only when there are no merge commits in the "source branch".
786 Works only when there are no merge commits in the "source branch".
788 Source branch is commits from base up to c2 not including base.
787 Source branch is commits from base up to c2 not including base.
789
788
790 If merge is involved it fallbacks to _fullcopytracing().
789 If merge is involved it fallbacks to _fullcopytracing().
791
790
792 Can be used by setting the following config:
791 Can be used by setting the following config:
793
792
794 [experimental]
793 [experimental]
795 copytrace = heuristics
794 copytrace = heuristics
796
795
797 In some cases the copy/move candidates found by heuristics can be very large
796 In some cases the copy/move candidates found by heuristics can be very large
798 in number and that will make the algorithm slow. The number of possible
797 in number and that will make the algorithm slow. The number of possible
799 candidates to check can be limited by using the config
798 candidates to check can be limited by using the config
800 `experimental.copytrace.movecandidateslimit` which defaults to 100.
799 `experimental.copytrace.movecandidateslimit` which defaults to 100.
801 """
800 """
802
801
803 if c1.rev() is None:
802 if c1.rev() is None:
804 c1 = c1.p1()
803 c1 = c1.p1()
805 if c2.rev() is None:
804 if c2.rev() is None:
806 c2 = c2.p1()
805 c2 = c2.p1()
807
806
808 copies = {}
807 copies = {}
809
808
810 changedfiles = set()
809 changedfiles = set()
811 m1 = c1.manifest()
810 m1 = c1.manifest()
812 if not repo.revs('%d::%d', base.rev(), c2.rev()):
811 if not repo.revs('%d::%d', base.rev(), c2.rev()):
813 # If base is not in c2 branch, we switch to fullcopytracing
812 # If base is not in c2 branch, we switch to fullcopytracing
814 repo.ui.debug("switching to full copytracing as base is not "
813 repo.ui.debug("switching to full copytracing as base is not "
815 "an ancestor of c2\n")
814 "an ancestor of c2\n")
816 return _fullcopytracing(repo, c1, c2, base)
815 return _fullcopytracing(repo, c1, c2, base)
817
816
818 ctx = c2
817 ctx = c2
819 while ctx != base:
818 while ctx != base:
820 if len(ctx.parents()) == 2:
819 if len(ctx.parents()) == 2:
821 # To keep things simple let's not handle merges
820 # To keep things simple let's not handle merges
822 repo.ui.debug("switching to full copytracing because of merges\n")
821 repo.ui.debug("switching to full copytracing because of merges\n")
823 return _fullcopytracing(repo, c1, c2, base)
822 return _fullcopytracing(repo, c1, c2, base)
824 changedfiles.update(ctx.files())
823 changedfiles.update(ctx.files())
825 ctx = ctx.p1()
824 ctx = ctx.p1()
826
825
827 cp = _forwardcopies(base, c2)
826 cp = _forwardcopies(base, c2)
828 for dst, src in cp.iteritems():
827 for dst, src in cp.iteritems():
829 if src in m1:
828 if src in m1:
830 copies[dst] = src
829 copies[dst] = src
831
830
832 # file is missing if it isn't present in the destination, but is present in
831 # file is missing if it isn't present in the destination, but is present in
833 # the base and present in the source.
832 # the base and present in the source.
834 # Presence in the base is important to exclude added files, presence in the
833 # Presence in the base is important to exclude added files, presence in the
835 # source is important to exclude removed files.
834 # source is important to exclude removed files.
836 filt = lambda f: f not in m1 and f in base and f in c2
835 filt = lambda f: f not in m1 and f in base and f in c2
837 missingfiles = [f for f in changedfiles if filt(f)]
836 missingfiles = [f for f in changedfiles if filt(f)]
838
837
839 if missingfiles:
838 if missingfiles:
840 basenametofilename = collections.defaultdict(list)
839 basenametofilename = collections.defaultdict(list)
841 dirnametofilename = collections.defaultdict(list)
840 dirnametofilename = collections.defaultdict(list)
842
841
843 for f in m1.filesnotin(base.manifest()):
842 for f in m1.filesnotin(base.manifest()):
844 basename = os.path.basename(f)
843 basename = os.path.basename(f)
845 dirname = os.path.dirname(f)
844 dirname = os.path.dirname(f)
846 basenametofilename[basename].append(f)
845 basenametofilename[basename].append(f)
847 dirnametofilename[dirname].append(f)
846 dirnametofilename[dirname].append(f)
848
847
849 for f in missingfiles:
848 for f in missingfiles:
850 basename = os.path.basename(f)
849 basename = os.path.basename(f)
851 dirname = os.path.dirname(f)
850 dirname = os.path.dirname(f)
852 samebasename = basenametofilename[basename]
851 samebasename = basenametofilename[basename]
853 samedirname = dirnametofilename[dirname]
852 samedirname = dirnametofilename[dirname]
854 movecandidates = samebasename + samedirname
853 movecandidates = samebasename + samedirname
855 # f is guaranteed to be present in c2, that's why
854 # f is guaranteed to be present in c2, that's why
856 # c2.filectx(f) won't fail
855 # c2.filectx(f) won't fail
857 f2 = c2.filectx(f)
856 f2 = c2.filectx(f)
858 # we can have a lot of candidates which can slow down the heuristics
857 # we can have a lot of candidates which can slow down the heuristics
859 # config value to limit the number of candidates moves to check
858 # config value to limit the number of candidates moves to check
860 maxcandidates = repo.ui.configint('experimental',
859 maxcandidates = repo.ui.configint('experimental',
861 'copytrace.movecandidateslimit')
860 'copytrace.movecandidateslimit')
862
861
863 if len(movecandidates) > maxcandidates:
862 if len(movecandidates) > maxcandidates:
864 repo.ui.status(_("skipping copytracing for '%s', more "
863 repo.ui.status(_("skipping copytracing for '%s', more "
865 "candidates than the limit: %d\n")
864 "candidates than the limit: %d\n")
866 % (f, len(movecandidates)))
865 % (f, len(movecandidates)))
867 continue
866 continue
868
867
869 for candidate in movecandidates:
868 for candidate in movecandidates:
870 f1 = c1.filectx(candidate)
869 f1 = c1.filectx(candidate)
871 if _related(f1, f2):
870 if _related(f1, f2):
872 # if there are a few related copies then we'll merge
871 # if there are a few related copies then we'll merge
873 # changes into all of them. This matches the behaviour
872 # changes into all of them. This matches the behaviour
874 # of upstream copytracing
873 # of upstream copytracing
875 copies[candidate] = f
874 copies[candidate] = f
876
875
877 return copies, {}, {}, {}, {}
876 return copies, {}, {}, {}, {}
878
877
879 def _related(f1, f2):
878 def _related(f1, f2):
880 """return True if f1 and f2 filectx have a common ancestor
879 """return True if f1 and f2 filectx have a common ancestor
881
880
882 Walk back to common ancestor to see if the two files originate
881 Walk back to common ancestor to see if the two files originate
883 from the same file. Since workingfilectx's rev() is None it messes
882 from the same file. Since workingfilectx's rev() is None it messes
884 up the integer comparison logic, hence the pre-step check for
883 up the integer comparison logic, hence the pre-step check for
885 None (f1 and f2 can only be workingfilectx's initially).
884 None (f1 and f2 can only be workingfilectx's initially).
886 """
885 """
887
886
888 if f1 == f2:
887 if f1 == f2:
889 return True # a match
888 return True # a match
890
889
891 g1, g2 = f1.ancestors(), f2.ancestors()
890 g1, g2 = f1.ancestors(), f2.ancestors()
892 try:
891 try:
893 f1r, f2r = f1.linkrev(), f2.linkrev()
892 f1r, f2r = f1.linkrev(), f2.linkrev()
894
893
895 if f1r is None:
894 if f1r is None:
896 f1 = next(g1)
895 f1 = next(g1)
897 if f2r is None:
896 if f2r is None:
898 f2 = next(g2)
897 f2 = next(g2)
899
898
900 while True:
899 while True:
901 f1r, f2r = f1.linkrev(), f2.linkrev()
900 f1r, f2r = f1.linkrev(), f2.linkrev()
902 if f1r > f2r:
901 if f1r > f2r:
903 f1 = next(g1)
902 f1 = next(g1)
904 elif f2r > f1r:
903 elif f2r > f1r:
905 f2 = next(g2)
904 f2 = next(g2)
906 else: # f1 and f2 point to files in the same linkrev
905 else: # f1 and f2 point to files in the same linkrev
907 return f1 == f2 # true if they point to the same file
906 return f1 == f2 # true if they point to the same file
908 except StopIteration:
907 except StopIteration:
909 return False
908 return False
910
909
911 def _checkcopies(srcctx, dstctx, f, base, tca, remotebase, limit, data):
910 def _checkcopies(srcctx, dstctx, f, base, tca, remotebase, limit, data):
912 """
911 """
913 check possible copies of f from msrc to mdst
912 check possible copies of f from msrc to mdst
914
913
915 srcctx = starting context for f in msrc
914 srcctx = starting context for f in msrc
916 dstctx = destination context for f in mdst
915 dstctx = destination context for f in mdst
917 f = the filename to check (as in msrc)
916 f = the filename to check (as in msrc)
918 base = the changectx used as a merge base
917 base = the changectx used as a merge base
919 tca = topological common ancestor for graft-like scenarios
918 tca = topological common ancestor for graft-like scenarios
920 remotebase = True if base is outside tca::srcctx, False otherwise
919 remotebase = True if base is outside tca::srcctx, False otherwise
921 limit = the rev number to not search beyond
920 limit = the rev number to not search beyond
922 data = dictionary of dictionary to store copy data. (see mergecopies)
921 data = dictionary of dictionary to store copy data. (see mergecopies)
923
922
924 note: limit is only an optimization, and provides no guarantee that
923 note: limit is only an optimization, and provides no guarantee that
925 irrelevant revisions will not be visited
924 irrelevant revisions will not be visited
926 there is no easy way to make this algorithm stop in a guaranteed way
925 there is no easy way to make this algorithm stop in a guaranteed way
927 once it "goes behind a certain revision".
926 once it "goes behind a certain revision".
928 """
927 """
929
928
930 msrc = srcctx.manifest()
929 msrc = srcctx.manifest()
931 mdst = dstctx.manifest()
930 mdst = dstctx.manifest()
932 mb = base.manifest()
931 mb = base.manifest()
933 mta = tca.manifest()
932 mta = tca.manifest()
934 # Might be true if this call is about finding backward renames,
933 # Might be true if this call is about finding backward renames,
935 # This happens in the case of grafts because the DAG is then rotated.
934 # This happens in the case of grafts because the DAG is then rotated.
936 # If the file exists in both the base and the source, we are not looking
935 # If the file exists in both the base and the source, we are not looking
937 # for a rename on the source side, but on the part of the DAG that is
936 # for a rename on the source side, but on the part of the DAG that is
938 # traversed backwards.
937 # traversed backwards.
939 #
938 #
940 # In the case there is both backward and forward renames (before and after
939 # In the case there is both backward and forward renames (before and after
941 # the base) this is more complicated as we must detect a divergence.
940 # the base) this is more complicated as we must detect a divergence.
942 # We use 'backwards = False' in that case.
941 # We use 'backwards = False' in that case.
943 backwards = not remotebase and base != tca and f in mb
942 backwards = not remotebase and base != tca and f in mb
944 getsrcfctx = _makegetfctx(srcctx)
943 getsrcfctx = _makegetfctx(srcctx)
945 getdstfctx = _makegetfctx(dstctx)
944 getdstfctx = _makegetfctx(dstctx)
946
945
947 if msrc[f] == mb.get(f) and not remotebase:
946 if msrc[f] == mb.get(f) and not remotebase:
948 # Nothing to merge
947 # Nothing to merge
949 return
948 return
950
949
951 of = None
950 of = None
952 seen = {f}
951 seen = {f}
953 for oc in getsrcfctx(f, msrc[f]).ancestors():
952 for oc in getsrcfctx(f, msrc[f]).ancestors():
954 of = oc.path()
953 of = oc.path()
955 if of in seen:
954 if of in seen:
956 # check limit late - grab last rename before
955 # check limit late - grab last rename before
957 if oc.linkrev() < limit:
956 if oc.linkrev() < limit:
958 break
957 break
959 continue
958 continue
960 seen.add(of)
959 seen.add(of)
961
960
962 # remember for dir rename detection
961 # remember for dir rename detection
963 if backwards:
962 if backwards:
964 data['fullcopy'][of] = f # grafting backwards through renames
963 data['fullcopy'][of] = f # grafting backwards through renames
965 else:
964 else:
966 data['fullcopy'][f] = of
965 data['fullcopy'][f] = of
967 if of not in mdst:
966 if of not in mdst:
968 continue # no match, keep looking
967 continue # no match, keep looking
969 if mdst[of] == mb.get(of):
968 if mdst[of] == mb.get(of):
970 return # no merge needed, quit early
969 return # no merge needed, quit early
971 c2 = getdstfctx(of, mdst[of])
970 c2 = getdstfctx(of, mdst[of])
972 # c2 might be a plain new file on added on destination side that is
971 # c2 might be a plain new file on added on destination side that is
973 # unrelated to the droids we are looking for.
972 # unrelated to the droids we are looking for.
974 cr = _related(oc, c2)
973 cr = _related(oc, c2)
975 if cr and (of == f or of == c2.path()): # non-divergent
974 if cr and (of == f or of == c2.path()): # non-divergent
976 if backwards:
975 if backwards:
977 data['copy'][of] = f
976 data['copy'][of] = f
978 elif of in mb:
977 elif of in mb:
979 data['copy'][f] = of
978 data['copy'][f] = of
980 elif remotebase: # special case: a <- b <- a -> b "ping-pong" rename
979 elif remotebase: # special case: a <- b <- a -> b "ping-pong" rename
981 data['copy'][of] = f
980 data['copy'][of] = f
982 del data['fullcopy'][f]
981 del data['fullcopy'][f]
983 data['fullcopy'][of] = f
982 data['fullcopy'][of] = f
984 else: # divergence w.r.t. graft CA on one side of topological CA
983 else: # divergence w.r.t. graft CA on one side of topological CA
985 for sf in seen:
984 for sf in seen:
986 if sf in mb:
985 if sf in mb:
987 assert sf not in data['diverge']
986 assert sf not in data['diverge']
988 data['diverge'][sf] = [f, of]
987 data['diverge'][sf] = [f, of]
989 break
988 break
990 return
989 return
991
990
992 if of in mta:
991 if of in mta:
993 if backwards or remotebase:
992 if backwards or remotebase:
994 data['incomplete'][of] = f
993 data['incomplete'][of] = f
995 else:
994 else:
996 for sf in seen:
995 for sf in seen:
997 if sf in mb:
996 if sf in mb:
998 if tca == base:
997 if tca == base:
999 data['diverge'].setdefault(sf, []).append(f)
998 data['diverge'].setdefault(sf, []).append(f)
1000 else:
999 else:
1001 data['incompletediverge'][sf] = [of, f]
1000 data['incompletediverge'][sf] = [of, f]
1002 return
1001 return
1003
1002
1004 def duplicatecopies(repo, wctx, rev, fromrev, skiprev=None):
1003 def duplicatecopies(repo, wctx, rev, fromrev, skiprev=None):
1005 """reproduce copies from fromrev to rev in the dirstate
1004 """reproduce copies from fromrev to rev in the dirstate
1006
1005
1007 If skiprev is specified, it's a revision that should be used to
1006 If skiprev is specified, it's a revision that should be used to
1008 filter copy records. Any copies that occur between fromrev and
1007 filter copy records. Any copies that occur between fromrev and
1009 skiprev will not be duplicated, even if they appear in the set of
1008 skiprev will not be duplicated, even if they appear in the set of
1010 copies between fromrev and rev.
1009 copies between fromrev and rev.
1011 """
1010 """
1012 exclude = {}
1011 exclude = {}
1013 ctraceconfig = repo.ui.config('experimental', 'copytrace')
1012 ctraceconfig = repo.ui.config('experimental', 'copytrace')
1014 bctrace = stringutil.parsebool(ctraceconfig)
1013 bctrace = stringutil.parsebool(ctraceconfig)
1015 if (skiprev is not None and
1014 if (skiprev is not None and
1016 (ctraceconfig == 'heuristics' or bctrace or bctrace is None)):
1015 (ctraceconfig == 'heuristics' or bctrace or bctrace is None)):
1017 # copytrace='off' skips this line, but not the entire function because
1016 # copytrace='off' skips this line, but not the entire function because
1018 # the line below is O(size of the repo) during a rebase, while the rest
1017 # the line below is O(size of the repo) during a rebase, while the rest
1019 # of the function is much faster (and is required for carrying copy
1018 # of the function is much faster (and is required for carrying copy
1020 # metadata across the rebase anyway).
1019 # metadata across the rebase anyway).
1021 exclude = pathcopies(repo[fromrev], repo[skiprev])
1020 exclude = pathcopies(repo[fromrev], repo[skiprev])
1022 for dst, src in pathcopies(repo[fromrev], repo[rev]).iteritems():
1021 for dst, src in pathcopies(repo[fromrev], repo[rev]).iteritems():
1023 # copies.pathcopies returns backward renames, so dst might not
1022 # copies.pathcopies returns backward renames, so dst might not
1024 # actually be in the dirstate
1023 # actually be in the dirstate
1025 if dst in exclude:
1024 if dst in exclude:
1026 continue
1025 continue
1027 wctx[dst].markcopied(src)
1026 wctx[dst].markcopied(src)
@@ -1,172 +1,171 b''
1 Test for the full copytracing algorithm
1 Test for the full copytracing algorithm
2 =======================================
2 =======================================
3
3
4 $ hg init t
4 $ hg init t
5 $ cd t
5 $ cd t
6
6
7 $ echo 1 > a
7 $ echo 1 > a
8 $ hg ci -qAm "first"
8 $ hg ci -qAm "first"
9
9
10 $ hg cp a b
10 $ hg cp a b
11 $ hg mv a c
11 $ hg mv a c
12 $ echo 2 >> b
12 $ echo 2 >> b
13 $ echo 2 >> c
13 $ echo 2 >> c
14
14
15 $ hg ci -qAm "second"
15 $ hg ci -qAm "second"
16
16
17 $ hg co -C 0
17 $ hg co -C 0
18 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
18 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
19
19
20 $ echo 0 > a
20 $ echo 0 > a
21 $ echo 1 >> a
21 $ echo 1 >> a
22
22
23 $ hg ci -qAm "other"
23 $ hg ci -qAm "other"
24
24
25 $ hg merge --debug
25 $ hg merge --debug
26 searching for copies back to rev 1
27 unmatched files in other:
26 unmatched files in other:
28 b
27 b
29 c
28 c
30 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
29 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
31 src: 'a' -> dst: 'b' *
30 src: 'a' -> dst: 'b' *
32 src: 'a' -> dst: 'c' *
31 src: 'a' -> dst: 'c' *
33 checking for directory renames
32 checking for directory renames
34 resolving manifests
33 resolving manifests
35 branchmerge: True, force: False, partial: False
34 branchmerge: True, force: False, partial: False
36 ancestor: b8bf91eeebbc, local: add3f11052fa+, remote: 17c05bb7fcb6
35 ancestor: b8bf91eeebbc, local: add3f11052fa+, remote: 17c05bb7fcb6
37 preserving a for resolve of b
36 preserving a for resolve of b
38 preserving a for resolve of c
37 preserving a for resolve of c
39 removing a
38 removing a
40 starting 4 threads for background file closing (?)
39 starting 4 threads for background file closing (?)
41 b: remote moved from a -> m (premerge)
40 b: remote moved from a -> m (premerge)
42 picked tool ':merge' for b (binary False symlink False changedelete False)
41 picked tool ':merge' for b (binary False symlink False changedelete False)
43 merging a and b to b
42 merging a and b to b
44 my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc
43 my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc
45 premerge successful
44 premerge successful
46 c: remote moved from a -> m (premerge)
45 c: remote moved from a -> m (premerge)
47 picked tool ':merge' for c (binary False symlink False changedelete False)
46 picked tool ':merge' for c (binary False symlink False changedelete False)
48 merging a and c to c
47 merging a and c to c
49 my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc
48 my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc
50 premerge successful
49 premerge successful
51 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
50 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
52 (branch merge, don't forget to commit)
51 (branch merge, don't forget to commit)
53
52
54 file b
53 file b
55 $ cat b
54 $ cat b
56 0
55 0
57 1
56 1
58 2
57 2
59
58
60 file c
59 file c
61 $ cat c
60 $ cat c
62 0
61 0
63 1
62 1
64 2
63 2
65
64
66 Test disabling copy tracing
65 Test disabling copy tracing
67
66
68 - first verify copy metadata was kept
67 - first verify copy metadata was kept
69
68
70 $ hg up -qC 2
69 $ hg up -qC 2
71 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase=
70 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase=
72 rebasing 2:add3f11052fa "other" (tip)
71 rebasing 2:add3f11052fa "other" (tip)
73 merging b and a to b
72 merging b and a to b
74 merging c and a to c
73 merging c and a to c
75
74
76 $ cat b
75 $ cat b
77 0
76 0
78 1
77 1
79 2
78 2
80
79
81 - next verify copy metadata is lost when disabled
80 - next verify copy metadata is lost when disabled
82
81
83 $ hg strip -r . --config extensions.strip=
82 $ hg strip -r . --config extensions.strip=
84 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 saved backup bundle to $TESTTMP/t/.hg/strip-backup/550bd84c0cd3-fc575957-backup.hg
84 saved backup bundle to $TESTTMP/t/.hg/strip-backup/550bd84c0cd3-fc575957-backup.hg
86 $ hg up -qC 2
85 $ hg up -qC 2
87 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase= --config experimental.copytrace=off --config ui.interactive=True << EOF
86 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase= --config experimental.copytrace=off --config ui.interactive=True << EOF
88 > c
87 > c
89 > EOF
88 > EOF
90 rebasing 2:add3f11052fa "other" (tip)
89 rebasing 2:add3f11052fa "other" (tip)
91 file 'a' was deleted in local [dest] but was modified in other [source].
90 file 'a' was deleted in local [dest] but was modified in other [source].
92 What do you want to do?
91 What do you want to do?
93 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
92 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
94
93
95 $ cat b
94 $ cat b
96 1
95 1
97 2
96 2
98
97
99 $ cd ..
98 $ cd ..
100
99
101 Verify disabling copy tracing still keeps copies from rebase source
100 Verify disabling copy tracing still keeps copies from rebase source
102
101
103 $ hg init copydisable
102 $ hg init copydisable
104 $ cd copydisable
103 $ cd copydisable
105 $ touch a
104 $ touch a
106 $ hg ci -Aqm 'add a'
105 $ hg ci -Aqm 'add a'
107 $ touch b
106 $ touch b
108 $ hg ci -Aqm 'add b, c'
107 $ hg ci -Aqm 'add b, c'
109 $ hg cp b x
108 $ hg cp b x
110 $ echo x >> x
109 $ echo x >> x
111 $ hg ci -qm 'copy b->x'
110 $ hg ci -qm 'copy b->x'
112 $ hg up -q 1
111 $ hg up -q 1
113 $ touch z
112 $ touch z
114 $ hg ci -Aqm 'add z'
113 $ hg ci -Aqm 'add z'
115 $ hg log -G -T '{rev} {desc}\n'
114 $ hg log -G -T '{rev} {desc}\n'
116 @ 3 add z
115 @ 3 add z
117 |
116 |
118 | o 2 copy b->x
117 | o 2 copy b->x
119 |/
118 |/
120 o 1 add b, c
119 o 1 add b, c
121 |
120 |
122 o 0 add a
121 o 0 add a
123
122
124 $ hg rebase -d . -b 2 --config extensions.rebase= --config experimental.copytrace=off
123 $ hg rebase -d . -b 2 --config extensions.rebase= --config experimental.copytrace=off
125 rebasing 2:6adcf8c12e7d "copy b->x"
124 rebasing 2:6adcf8c12e7d "copy b->x"
126 saved backup bundle to $TESTTMP/copydisable/.hg/strip-backup/6adcf8c12e7d-ce4b3e75-rebase.hg
125 saved backup bundle to $TESTTMP/copydisable/.hg/strip-backup/6adcf8c12e7d-ce4b3e75-rebase.hg
127 $ hg up -q 3
126 $ hg up -q 3
128 $ hg log -f x -T '{rev} {desc}\n'
127 $ hg log -f x -T '{rev} {desc}\n'
129 3 copy b->x
128 3 copy b->x
130 1 add b, c
129 1 add b, c
131
130
132 $ cd ../
131 $ cd ../
133
132
134 Verify we duplicate existing copies, instead of detecting them
133 Verify we duplicate existing copies, instead of detecting them
135
134
136 $ hg init copydisable3
135 $ hg init copydisable3
137 $ cd copydisable3
136 $ cd copydisable3
138 $ touch a
137 $ touch a
139 $ hg ci -Aqm 'add a'
138 $ hg ci -Aqm 'add a'
140 $ hg cp a b
139 $ hg cp a b
141 $ hg ci -Aqm 'copy a->b'
140 $ hg ci -Aqm 'copy a->b'
142 $ hg mv b c
141 $ hg mv b c
143 $ hg ci -Aqm 'move b->c'
142 $ hg ci -Aqm 'move b->c'
144 $ hg up -q 0
143 $ hg up -q 0
145 $ hg cp a b
144 $ hg cp a b
146 $ echo b >> b
145 $ echo b >> b
147 $ hg ci -Aqm 'copy a->b (2)'
146 $ hg ci -Aqm 'copy a->b (2)'
148 $ hg log -G -T '{rev} {desc}\n'
147 $ hg log -G -T '{rev} {desc}\n'
149 @ 3 copy a->b (2)
148 @ 3 copy a->b (2)
150 |
149 |
151 | o 2 move b->c
150 | o 2 move b->c
152 | |
151 | |
153 | o 1 copy a->b
152 | o 1 copy a->b
154 |/
153 |/
155 o 0 add a
154 o 0 add a
156
155
157 $ hg rebase -d 2 -s 3 --config extensions.rebase= --config experimental.copytrace=off
156 $ hg rebase -d 2 -s 3 --config extensions.rebase= --config experimental.copytrace=off
158 rebasing 3:47e1a9e6273b "copy a->b (2)" (tip)
157 rebasing 3:47e1a9e6273b "copy a->b (2)" (tip)
159 saved backup bundle to $TESTTMP/copydisable3/.hg/strip-backup/47e1a9e6273b-2d099c59-rebase.hg
158 saved backup bundle to $TESTTMP/copydisable3/.hg/strip-backup/47e1a9e6273b-2d099c59-rebase.hg
160
159
161 $ hg log -G -f b
160 $ hg log -G -f b
162 @ changeset: 3:76024fb4b05b
161 @ changeset: 3:76024fb4b05b
163 : tag: tip
162 : tag: tip
164 : user: test
163 : user: test
165 : date: Thu Jan 01 00:00:00 1970 +0000
164 : date: Thu Jan 01 00:00:00 1970 +0000
166 : summary: copy a->b (2)
165 : summary: copy a->b (2)
167 :
166 :
168 o changeset: 0:ac82d8b1f7c4
167 o changeset: 0:ac82d8b1f7c4
169 user: test
168 user: test
170 date: Thu Jan 01 00:00:00 1970 +0000
169 date: Thu Jan 01 00:00:00 1970 +0000
171 summary: add a
170 summary: add a
172
171
@@ -1,66 +1,65 b''
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3
3
4 $ echo line 1 > foo
4 $ echo line 1 > foo
5 $ hg ci -qAm 'add foo'
5 $ hg ci -qAm 'add foo'
6
6
7 copy foo to bar and change both files
7 copy foo to bar and change both files
8 $ hg cp foo bar
8 $ hg cp foo bar
9 $ echo line 2-1 >> foo
9 $ echo line 2-1 >> foo
10 $ echo line 2-2 >> bar
10 $ echo line 2-2 >> bar
11 $ hg ci -m 'cp foo bar; change both'
11 $ hg ci -m 'cp foo bar; change both'
12
12
13 in another branch, change foo in a way that doesn't conflict with
13 in another branch, change foo in a way that doesn't conflict with
14 the other changes
14 the other changes
15 $ hg up -qC 0
15 $ hg up -qC 0
16 $ echo line 0 > foo
16 $ echo line 0 > foo
17 $ hg cat foo >> foo
17 $ hg cat foo >> foo
18 $ hg ci -m 'change foo'
18 $ hg ci -m 'change foo'
19 created new head
19 created new head
20
20
21 we get conflicts that shouldn't be there
21 we get conflicts that shouldn't be there
22 $ hg merge -P
22 $ hg merge -P
23 changeset: 1:484bf6903104
23 changeset: 1:484bf6903104
24 user: test
24 user: test
25 date: Thu Jan 01 00:00:00 1970 +0000
25 date: Thu Jan 01 00:00:00 1970 +0000
26 summary: cp foo bar; change both
26 summary: cp foo bar; change both
27
27
28 $ hg merge --debug
28 $ hg merge --debug
29 searching for copies back to rev 1
30 unmatched files in other:
29 unmatched files in other:
31 bar
30 bar
32 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
31 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
33 src: 'foo' -> dst: 'bar' *
32 src: 'foo' -> dst: 'bar' *
34 checking for directory renames
33 checking for directory renames
35 resolving manifests
34 resolving manifests
36 branchmerge: True, force: False, partial: False
35 branchmerge: True, force: False, partial: False
37 ancestor: e6dc8efe11cc, local: 6a0df1dad128+, remote: 484bf6903104
36 ancestor: e6dc8efe11cc, local: 6a0df1dad128+, remote: 484bf6903104
38 preserving foo for resolve of bar
37 preserving foo for resolve of bar
39 preserving foo for resolve of foo
38 preserving foo for resolve of foo
40 starting 4 threads for background file closing (?)
39 starting 4 threads for background file closing (?)
41 bar: remote copied from foo -> m (premerge)
40 bar: remote copied from foo -> m (premerge)
42 picked tool ':merge' for bar (binary False symlink False changedelete False)
41 picked tool ':merge' for bar (binary False symlink False changedelete False)
43 merging foo and bar to bar
42 merging foo and bar to bar
44 my bar@6a0df1dad128+ other bar@484bf6903104 ancestor foo@e6dc8efe11cc
43 my bar@6a0df1dad128+ other bar@484bf6903104 ancestor foo@e6dc8efe11cc
45 premerge successful
44 premerge successful
46 foo: versions differ -> m (premerge)
45 foo: versions differ -> m (premerge)
47 picked tool ':merge' for foo (binary False symlink False changedelete False)
46 picked tool ':merge' for foo (binary False symlink False changedelete False)
48 merging foo
47 merging foo
49 my foo@6a0df1dad128+ other foo@484bf6903104 ancestor foo@e6dc8efe11cc
48 my foo@6a0df1dad128+ other foo@484bf6903104 ancestor foo@e6dc8efe11cc
50 premerge successful
49 premerge successful
51 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
50 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
52 (branch merge, don't forget to commit)
51 (branch merge, don't forget to commit)
53
52
54 contents of foo
53 contents of foo
55 $ cat foo
54 $ cat foo
56 line 0
55 line 0
57 line 1
56 line 1
58 line 2-1
57 line 2-1
59
58
60 contents of bar
59 contents of bar
61 $ cat bar
60 $ cat bar
62 line 0
61 line 0
63 line 1
62 line 1
64 line 2-2
63 line 2-2
65
64
66 $ cd ..
65 $ cd ..
@@ -1,2415 +1,2411 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extdiff]
2 > [extdiff]
3 > # for portability:
3 > # for portability:
4 > pdiff = sh "$RUNTESTDIR/pdiff"
4 > pdiff = sh "$RUNTESTDIR/pdiff"
5 > EOF
5 > EOF
6
6
7 Create a repo with some stuff in it:
7 Create a repo with some stuff in it:
8
8
9 $ hg init a
9 $ hg init a
10 $ cd a
10 $ cd a
11 $ echo a > a
11 $ echo a > a
12 $ echo a > d
12 $ echo a > d
13 $ echo a > e
13 $ echo a > e
14 $ hg ci -qAm0
14 $ hg ci -qAm0
15 $ echo b > a
15 $ echo b > a
16 $ hg ci -m1 -u bar
16 $ hg ci -m1 -u bar
17 $ hg mv a b
17 $ hg mv a b
18 $ hg ci -m2
18 $ hg ci -m2
19 $ hg cp b c
19 $ hg cp b c
20 $ hg ci -m3 -u baz
20 $ hg ci -m3 -u baz
21 $ echo b > d
21 $ echo b > d
22 $ echo f > e
22 $ echo f > e
23 $ hg ci -m4
23 $ hg ci -m4
24 $ hg up -q 3
24 $ hg up -q 3
25 $ echo b > e
25 $ echo b > e
26 $ hg branch -q stable
26 $ hg branch -q stable
27 $ hg ci -m5
27 $ hg ci -m5
28 $ hg merge -q default --tool internal:local # for conflicts in e, choose 5 and ignore 4
28 $ hg merge -q default --tool internal:local # for conflicts in e, choose 5 and ignore 4
29 $ hg branch -q default
29 $ hg branch -q default
30 $ hg ci -m6
30 $ hg ci -m6
31 $ hg phase --public 3
31 $ hg phase --public 3
32 $ hg phase --force --secret 6
32 $ hg phase --force --secret 6
33
33
34 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
34 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
35 @ test@6.secret: 6
35 @ test@6.secret: 6
36 |\
36 |\
37 | o test@5.draft: 5
37 | o test@5.draft: 5
38 | |
38 | |
39 o | test@4.draft: 4
39 o | test@4.draft: 4
40 |/
40 |/
41 o baz@3.public: 3
41 o baz@3.public: 3
42 |
42 |
43 o test@2.public: 2
43 o test@2.public: 2
44 |
44 |
45 o bar@1.public: 1
45 o bar@1.public: 1
46 |
46 |
47 o test@0.public: 0
47 o test@0.public: 0
48
48
49 Test --base for grafting the merge of 4 from the perspective of 5, thus only getting the change to d
49 Test --base for grafting the merge of 4 from the perspective of 5, thus only getting the change to d
50
50
51 $ hg up -cqr 3
51 $ hg up -cqr 3
52 $ hg graft -r 6 --base 5
52 $ hg graft -r 6 --base 5
53 grafting 6:25a2b029d3ae "6" (tip)
53 grafting 6:25a2b029d3ae "6" (tip)
54 merging e
54 merging e
55 $ hg st --change .
55 $ hg st --change .
56 M d
56 M d
57
57
58 $ hg -q strip . --config extensions.strip=
58 $ hg -q strip . --config extensions.strip=
59
59
60 Test --base for collapsing changesets 2 and 3, thus getting both b and c
60 Test --base for collapsing changesets 2 and 3, thus getting both b and c
61
61
62 $ hg up -cqr 0
62 $ hg up -cqr 0
63 $ hg graft -r 3 --base 1
63 $ hg graft -r 3 --base 1
64 grafting 3:4c60f11aa304 "3"
64 grafting 3:4c60f11aa304 "3"
65 merging a and b to b
65 merging a and b to b
66 merging a and c to c
66 merging a and c to c
67 $ hg st --change .
67 $ hg st --change .
68 A b
68 A b
69 A c
69 A c
70 R a
70 R a
71
71
72 $ hg -q strip . --config extensions.strip=
72 $ hg -q strip . --config extensions.strip=
73
73
74 Specifying child as --base revision fails safely (perhaps slightly confusing, but consistent)
74 Specifying child as --base revision fails safely (perhaps slightly confusing, but consistent)
75
75
76 $ hg graft -r 2 --base 3
76 $ hg graft -r 2 --base 3
77 grafting 2:5c095ad7e90f "2"
77 grafting 2:5c095ad7e90f "2"
78 note: graft of 2:5c095ad7e90f created no changes to commit
78 note: graft of 2:5c095ad7e90f created no changes to commit
79
79
80 Can't continue without starting:
80 Can't continue without starting:
81
81
82 $ hg -q up -cr tip
82 $ hg -q up -cr tip
83 $ hg rm -q e
83 $ hg rm -q e
84 $ hg graft --continue
84 $ hg graft --continue
85 abort: no graft in progress
85 abort: no graft in progress
86 [255]
86 [255]
87 $ hg revert -r . -q e
87 $ hg revert -r . -q e
88
88
89 Need to specify a rev:
89 Need to specify a rev:
90
90
91 $ hg graft
91 $ hg graft
92 abort: no revisions specified
92 abort: no revisions specified
93 [255]
93 [255]
94
94
95 Can't graft ancestor:
95 Can't graft ancestor:
96
96
97 $ hg graft 1 2
97 $ hg graft 1 2
98 skipping ancestor revision 1:5d205f8b35b6
98 skipping ancestor revision 1:5d205f8b35b6
99 skipping ancestor revision 2:5c095ad7e90f
99 skipping ancestor revision 2:5c095ad7e90f
100 [255]
100 [255]
101
101
102 Specify revisions with -r:
102 Specify revisions with -r:
103
103
104 $ hg graft -r 1 -r 2
104 $ hg graft -r 1 -r 2
105 skipping ancestor revision 1:5d205f8b35b6
105 skipping ancestor revision 1:5d205f8b35b6
106 skipping ancestor revision 2:5c095ad7e90f
106 skipping ancestor revision 2:5c095ad7e90f
107 [255]
107 [255]
108
108
109 $ hg graft -r 1 2
109 $ hg graft -r 1 2
110 warning: inconsistent use of --rev might give unexpected revision ordering!
110 warning: inconsistent use of --rev might give unexpected revision ordering!
111 skipping ancestor revision 2:5c095ad7e90f
111 skipping ancestor revision 2:5c095ad7e90f
112 skipping ancestor revision 1:5d205f8b35b6
112 skipping ancestor revision 1:5d205f8b35b6
113 [255]
113 [255]
114
114
115 Conflicting date/user options:
115 Conflicting date/user options:
116
116
117 $ hg up -q 0
117 $ hg up -q 0
118 $ hg graft -U --user foo 2
118 $ hg graft -U --user foo 2
119 abort: --user and --currentuser are mutually exclusive
119 abort: --user and --currentuser are mutually exclusive
120 [255]
120 [255]
121 $ hg graft -D --date '0 0' 2
121 $ hg graft -D --date '0 0' 2
122 abort: --date and --currentdate are mutually exclusive
122 abort: --date and --currentdate are mutually exclusive
123 [255]
123 [255]
124
124
125 Can't graft with dirty wd:
125 Can't graft with dirty wd:
126
126
127 $ hg up -q 0
127 $ hg up -q 0
128 $ echo foo > a
128 $ echo foo > a
129 $ hg graft 1
129 $ hg graft 1
130 abort: uncommitted changes
130 abort: uncommitted changes
131 [255]
131 [255]
132 $ hg revert a
132 $ hg revert a
133
133
134 Graft a rename:
134 Graft a rename:
135 (this also tests that editor is invoked if '--edit' is specified)
135 (this also tests that editor is invoked if '--edit' is specified)
136
136
137 $ hg status --rev "2^1" --rev 2
137 $ hg status --rev "2^1" --rev 2
138 A b
138 A b
139 R a
139 R a
140 $ HGEDITOR=cat hg graft 2 -u foo --edit
140 $ HGEDITOR=cat hg graft 2 -u foo --edit
141 grafting 2:5c095ad7e90f "2"
141 grafting 2:5c095ad7e90f "2"
142 merging a and b to b
142 merging a and b to b
143 2
143 2
144
144
145
145
146 HG: Enter commit message. Lines beginning with 'HG:' are removed.
146 HG: Enter commit message. Lines beginning with 'HG:' are removed.
147 HG: Leave message empty to abort commit.
147 HG: Leave message empty to abort commit.
148 HG: --
148 HG: --
149 HG: user: foo
149 HG: user: foo
150 HG: branch 'default'
150 HG: branch 'default'
151 HG: added b
151 HG: added b
152 HG: removed a
152 HG: removed a
153 $ hg export tip --git
153 $ hg export tip --git
154 # HG changeset patch
154 # HG changeset patch
155 # User foo
155 # User foo
156 # Date 0 0
156 # Date 0 0
157 # Thu Jan 01 00:00:00 1970 +0000
157 # Thu Jan 01 00:00:00 1970 +0000
158 # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82
158 # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82
159 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
159 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
160 2
160 2
161
161
162 diff --git a/a b/b
162 diff --git a/a b/b
163 rename from a
163 rename from a
164 rename to b
164 rename to b
165
165
166 Look for extra:source
166 Look for extra:source
167
167
168 $ hg log --debug -r tip
168 $ hg log --debug -r tip
169 changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
169 changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
170 tag: tip
170 tag: tip
171 phase: draft
171 phase: draft
172 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
172 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
173 parent: -1:0000000000000000000000000000000000000000
173 parent: -1:0000000000000000000000000000000000000000
174 manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb
174 manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb
175 user: foo
175 user: foo
176 date: Thu Jan 01 00:00:00 1970 +0000
176 date: Thu Jan 01 00:00:00 1970 +0000
177 files+: b
177 files+: b
178 files-: a
178 files-: a
179 extra: branch=default
179 extra: branch=default
180 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
180 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
181 description:
181 description:
182 2
182 2
183
183
184
184
185
185
186 Graft out of order, skipping a merge and a duplicate
186 Graft out of order, skipping a merge and a duplicate
187 (this also tests that editor is not invoked if '--edit' is not specified)
187 (this also tests that editor is not invoked if '--edit' is not specified)
188
188
189 $ hg graft 1 5 4 3 'merge()' 2 -n
189 $ hg graft 1 5 4 3 'merge()' 2 -n
190 skipping ungraftable merge revision 6
190 skipping ungraftable merge revision 6
191 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
191 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
192 grafting 1:5d205f8b35b6 "1"
192 grafting 1:5d205f8b35b6 "1"
193 grafting 5:97f8bfe72746 "5"
193 grafting 5:97f8bfe72746 "5"
194 grafting 4:9c233e8e184d "4"
194 grafting 4:9c233e8e184d "4"
195 grafting 3:4c60f11aa304 "3"
195 grafting 3:4c60f11aa304 "3"
196
196
197 $ HGEDITOR=cat hg graft 1 5 'merge()' 2 --debug
197 $ HGEDITOR=cat hg graft 1 5 'merge()' 2 --debug
198 skipping ungraftable merge revision 6
198 skipping ungraftable merge revision 6
199 scanning for duplicate grafts
199 scanning for duplicate grafts
200 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
200 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
201 grafting 1:5d205f8b35b6 "1"
201 grafting 1:5d205f8b35b6 "1"
202 searching for copies back to rev 1
203 unmatched files in local:
202 unmatched files in local:
204 b
203 b
205 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
204 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
206 src: 'a' -> dst: 'b' *
205 src: 'a' -> dst: 'b' *
207 checking for directory renames
206 checking for directory renames
208 resolving manifests
207 resolving manifests
209 branchmerge: True, force: True, partial: False
208 branchmerge: True, force: True, partial: False
210 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
209 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
211 preserving b for resolve of b
210 preserving b for resolve of b
212 starting 4 threads for background file closing (?)
211 starting 4 threads for background file closing (?)
213 b: local copied/moved from a -> m (premerge)
212 b: local copied/moved from a -> m (premerge)
214 picked tool ':merge' for b (binary False symlink False changedelete False)
213 picked tool ':merge' for b (binary False symlink False changedelete False)
215 merging b and a to b
214 merging b and a to b
216 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
215 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
217 premerge successful
216 premerge successful
218 committing files:
217 committing files:
219 b
218 b
220 committing manifest
219 committing manifest
221 committing changelog
220 committing changelog
222 updating the branch cache
221 updating the branch cache
223 grafting 5:97f8bfe72746 "5"
222 grafting 5:97f8bfe72746 "5"
224 searching for copies back to rev 1
225 unmatched files in other (from topological common ancestor):
223 unmatched files in other (from topological common ancestor):
226 c
224 c
227 resolving manifests
225 resolving manifests
228 branchmerge: True, force: True, partial: False
226 branchmerge: True, force: True, partial: False
229 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
227 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
230 e: remote is newer -> g
228 e: remote is newer -> g
231 getting e
229 getting e
232 committing files:
230 committing files:
233 e
231 e
234 committing manifest
232 committing manifest
235 committing changelog
233 committing changelog
236 updating the branch cache
234 updating the branch cache
237 $ HGEDITOR=cat hg graft 4 3 --log --debug
235 $ HGEDITOR=cat hg graft 4 3 --log --debug
238 scanning for duplicate grafts
236 scanning for duplicate grafts
239 grafting 4:9c233e8e184d "4"
237 grafting 4:9c233e8e184d "4"
240 searching for copies back to rev 1
241 unmatched files in other (from topological common ancestor):
238 unmatched files in other (from topological common ancestor):
242 c
239 c
243 resolving manifests
240 resolving manifests
244 branchmerge: True, force: True, partial: False
241 branchmerge: True, force: True, partial: False
245 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
242 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
246 preserving e for resolve of e
243 preserving e for resolve of e
247 d: remote is newer -> g
244 d: remote is newer -> g
248 getting d
245 getting d
249 e: versions differ -> m (premerge)
246 e: versions differ -> m (premerge)
250 picked tool ':merge' for e (binary False symlink False changedelete False)
247 picked tool ':merge' for e (binary False symlink False changedelete False)
251 merging e
248 merging e
252 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
249 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
253 e: versions differ -> m (merge)
250 e: versions differ -> m (merge)
254 picked tool ':merge' for e (binary False symlink False changedelete False)
251 picked tool ':merge' for e (binary False symlink False changedelete False)
255 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
252 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
256 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
253 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
257 abort: unresolved conflicts, can't continue
254 abort: unresolved conflicts, can't continue
258 (use 'hg resolve' and 'hg graft --continue')
255 (use 'hg resolve' and 'hg graft --continue')
259 [255]
256 [255]
260
257
261 Summary should mention graft:
258 Summary should mention graft:
262
259
263 $ hg summary |grep graft
260 $ hg summary |grep graft
264 commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
261 commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
265
262
266 Using status to get more context
263 Using status to get more context
267
264
268 $ hg status --verbose
265 $ hg status --verbose
269 M d
266 M d
270 M e
267 M e
271 ? a.orig
268 ? a.orig
272 ? e.orig
269 ? e.orig
273 # The repository is in an unfinished *graft* state.
270 # The repository is in an unfinished *graft* state.
274
271
275 # Unresolved merge conflicts:
272 # Unresolved merge conflicts:
276 #
273 #
277 # e
274 # e
278 #
275 #
279 # To mark files as resolved: hg resolve --mark FILE
276 # To mark files as resolved: hg resolve --mark FILE
280
277
281 # To continue: hg graft --continue
278 # To continue: hg graft --continue
282 # To abort: hg graft --abort
279 # To abort: hg graft --abort
283
280
284
281
285 Commit while interrupted should fail:
282 Commit while interrupted should fail:
286
283
287 $ hg ci -m 'commit interrupted graft'
284 $ hg ci -m 'commit interrupted graft'
288 abort: graft in progress
285 abort: graft in progress
289 (use 'hg graft --continue' or 'hg graft --stop' to stop)
286 (use 'hg graft --continue' or 'hg graft --stop' to stop)
290 [255]
287 [255]
291
288
292 Abort the graft and try committing:
289 Abort the graft and try committing:
293
290
294 $ hg up -C .
291 $ hg up -C .
295 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
296 $ echo c >> e
293 $ echo c >> e
297 $ hg ci -mtest
294 $ hg ci -mtest
298
295
299 $ hg strip . --config extensions.strip=
296 $ hg strip . --config extensions.strip=
300 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
297 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
301 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
298 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
302
299
303 Graft again:
300 Graft again:
304
301
305 $ hg graft 1 5 4 3 'merge()' 2
302 $ hg graft 1 5 4 3 'merge()' 2
306 skipping ungraftable merge revision 6
303 skipping ungraftable merge revision 6
307 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
304 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
308 skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e)
305 skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e)
309 skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec)
306 skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec)
310 grafting 4:9c233e8e184d "4"
307 grafting 4:9c233e8e184d "4"
311 merging e
308 merging e
312 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
309 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
313 abort: unresolved conflicts, can't continue
310 abort: unresolved conflicts, can't continue
314 (use 'hg resolve' and 'hg graft --continue')
311 (use 'hg resolve' and 'hg graft --continue')
315 [255]
312 [255]
316
313
317 Continue without resolve should fail:
314 Continue without resolve should fail:
318
315
319 $ hg graft -c
316 $ hg graft -c
320 grafting 4:9c233e8e184d "4"
317 grafting 4:9c233e8e184d "4"
321 abort: unresolved merge conflicts (see 'hg help resolve')
318 abort: unresolved merge conflicts (see 'hg help resolve')
322 [255]
319 [255]
323
320
324 Fix up:
321 Fix up:
325
322
326 $ echo b > e
323 $ echo b > e
327 $ hg resolve -m e
324 $ hg resolve -m e
328 (no more unresolved files)
325 (no more unresolved files)
329 continue: hg graft --continue
326 continue: hg graft --continue
330
327
331 Continue with a revision should fail:
328 Continue with a revision should fail:
332
329
333 $ hg graft -c 6
330 $ hg graft -c 6
334 abort: can't specify --continue and revisions
331 abort: can't specify --continue and revisions
335 [255]
332 [255]
336
333
337 $ hg graft -c -r 6
334 $ hg graft -c -r 6
338 abort: can't specify --continue and revisions
335 abort: can't specify --continue and revisions
339 [255]
336 [255]
340
337
341 Continue for real, clobber usernames
338 Continue for real, clobber usernames
342
339
343 $ hg graft -c -U
340 $ hg graft -c -U
344 grafting 4:9c233e8e184d "4"
341 grafting 4:9c233e8e184d "4"
345 grafting 3:4c60f11aa304 "3"
342 grafting 3:4c60f11aa304 "3"
346
343
347 Compare with original:
344 Compare with original:
348
345
349 $ hg diff -r 6
346 $ hg diff -r 6
350 $ hg status --rev 0:. -C
347 $ hg status --rev 0:. -C
351 M d
348 M d
352 M e
349 M e
353 A b
350 A b
354 a
351 a
355 A c
352 A c
356 a
353 a
357 R a
354 R a
358
355
359 View graph:
356 View graph:
360
357
361 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
358 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
362 @ test@11.draft: 3
359 @ test@11.draft: 3
363 |
360 |
364 o test@10.draft: 4
361 o test@10.draft: 4
365 |
362 |
366 o test@9.draft: 5
363 o test@9.draft: 5
367 |
364 |
368 o bar@8.draft: 1
365 o bar@8.draft: 1
369 |
366 |
370 o foo@7.draft: 2
367 o foo@7.draft: 2
371 |
368 |
372 | o test@6.secret: 6
369 | o test@6.secret: 6
373 | |\
370 | |\
374 | | o test@5.draft: 5
371 | | o test@5.draft: 5
375 | | |
372 | | |
376 | o | test@4.draft: 4
373 | o | test@4.draft: 4
377 | |/
374 | |/
378 | o baz@3.public: 3
375 | o baz@3.public: 3
379 | |
376 | |
380 | o test@2.public: 2
377 | o test@2.public: 2
381 | |
378 | |
382 | o bar@1.public: 1
379 | o bar@1.public: 1
383 |/
380 |/
384 o test@0.public: 0
381 o test@0.public: 0
385
382
386 Graft again onto another branch should preserve the original source
383 Graft again onto another branch should preserve the original source
387 $ hg up -q 0
384 $ hg up -q 0
388 $ echo 'g'>g
385 $ echo 'g'>g
389 $ hg add g
386 $ hg add g
390 $ hg ci -m 7
387 $ hg ci -m 7
391 created new head
388 created new head
392 $ hg graft 7
389 $ hg graft 7
393 grafting 7:ef0ef43d49e7 "2"
390 grafting 7:ef0ef43d49e7 "2"
394
391
395 $ hg log -r 7 --template '{rev}:{node}\n'
392 $ hg log -r 7 --template '{rev}:{node}\n'
396 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
393 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
397 $ hg log -r 2 --template '{rev}:{node}\n'
394 $ hg log -r 2 --template '{rev}:{node}\n'
398 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
395 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
399
396
400 $ hg log --debug -r tip
397 $ hg log --debug -r tip
401 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
398 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
402 tag: tip
399 tag: tip
403 phase: draft
400 phase: draft
404 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
401 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
405 parent: -1:0000000000000000000000000000000000000000
402 parent: -1:0000000000000000000000000000000000000000
406 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
403 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
407 user: foo
404 user: foo
408 date: Thu Jan 01 00:00:00 1970 +0000
405 date: Thu Jan 01 00:00:00 1970 +0000
409 files+: b
406 files+: b
410 files-: a
407 files-: a
411 extra: branch=default
408 extra: branch=default
412 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
409 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
413 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
410 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
414 description:
411 description:
415 2
412 2
416
413
417
414
418 Disallow grafting an already grafted cset onto its original branch
415 Disallow grafting an already grafted cset onto its original branch
419 $ hg up -q 6
416 $ hg up -q 6
420 $ hg graft 7
417 $ hg graft 7
421 skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f)
418 skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f)
422 [255]
419 [255]
423
420
424 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13
421 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13
425 --- */hg-5c095ad7e90f.patch * (glob)
422 --- */hg-5c095ad7e90f.patch * (glob)
426 +++ */hg-7a4785234d87.patch * (glob)
423 +++ */hg-7a4785234d87.patch * (glob)
427 @@ -1,18 +1,18 @@
424 @@ -1,18 +1,18 @@
428 # HG changeset patch
425 # HG changeset patch
429 -# User test
426 -# User test
430 +# User foo
427 +# User foo
431 # Date 0 0
428 # Date 0 0
432 # Thu Jan 01 00:00:00 1970 +0000
429 # Thu Jan 01 00:00:00 1970 +0000
433 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
430 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
434 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
431 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
435 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
432 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
436 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
433 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
437 2
434 2
438
435
439 -diff -r 5d205f8b35b6 -r 5c095ad7e90f a
436 -diff -r 5d205f8b35b6 -r 5c095ad7e90f a
440 +diff -r b592ea63bb0c -r 7a4785234d87 a
437 +diff -r b592ea63bb0c -r 7a4785234d87 a
441 --- a/a Thu Jan 01 00:00:00 1970 +0000
438 --- a/a Thu Jan 01 00:00:00 1970 +0000
442 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
439 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
443 @@ -1,1 +0,0 @@
440 @@ -1,1 +0,0 @@
444 --b
441 --b
445 -diff -r 5d205f8b35b6 -r 5c095ad7e90f b
442 -diff -r 5d205f8b35b6 -r 5c095ad7e90f b
446 +-a
443 +-a
447 +diff -r b592ea63bb0c -r 7a4785234d87 b
444 +diff -r b592ea63bb0c -r 7a4785234d87 b
448 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
445 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
449 +++ b/b Thu Jan 01 00:00:00 1970 +0000
446 +++ b/b Thu Jan 01 00:00:00 1970 +0000
450 @@ -0,0 +1,1 @@
447 @@ -0,0 +1,1 @@
451 -+b
448 -+b
452 ++a
449 ++a
453 [1]
450 [1]
454
451
455 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X .
452 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X .
456 --- */hg-5c095ad7e90f.patch * (glob)
453 --- */hg-5c095ad7e90f.patch * (glob)
457 +++ */hg-7a4785234d87.patch * (glob)
454 +++ */hg-7a4785234d87.patch * (glob)
458 @@ -1,8 +1,8 @@
455 @@ -1,8 +1,8 @@
459 # HG changeset patch
456 # HG changeset patch
460 -# User test
457 -# User test
461 +# User foo
458 +# User foo
462 # Date 0 0
459 # Date 0 0
463 # Thu Jan 01 00:00:00 1970 +0000
460 # Thu Jan 01 00:00:00 1970 +0000
464 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
461 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
465 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
462 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
466 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
463 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
467 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
464 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
468 2
465 2
469
466
470 [1]
467 [1]
471
468
472 Disallow grafting already grafted csets with the same origin onto each other
469 Disallow grafting already grafted csets with the same origin onto each other
473 $ hg up -q 13
470 $ hg up -q 13
474 $ hg graft 2
471 $ hg graft 2
475 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
472 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
476 [255]
473 [255]
477 $ hg graft 7
474 $ hg graft 7
478 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
475 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
479 [255]
476 [255]
480
477
481 $ hg up -q 7
478 $ hg up -q 7
482 $ hg graft 2
479 $ hg graft 2
483 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
480 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
484 [255]
481 [255]
485 $ hg graft tip
482 $ hg graft tip
486 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
483 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
487 [255]
484 [255]
488
485
489 Graft with --log
486 Graft with --log
490
487
491 $ hg up -Cq 1
488 $ hg up -Cq 1
492 $ hg graft 3 --log -u foo
489 $ hg graft 3 --log -u foo
493 grafting 3:4c60f11aa304 "3"
490 grafting 3:4c60f11aa304 "3"
494 warning: can't find ancestor for 'c' copied from 'b'!
491 warning: can't find ancestor for 'c' copied from 'b'!
495 $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
492 $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
496 14:0c921c65ef1e 1:5d205f8b35b6 3
493 14:0c921c65ef1e 1:5d205f8b35b6 3
497 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
494 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
498
495
499 Resolve conflicted graft
496 Resolve conflicted graft
500 $ hg up -q 0
497 $ hg up -q 0
501 $ echo b > a
498 $ echo b > a
502 $ hg ci -m 8
499 $ hg ci -m 8
503 created new head
500 created new head
504 $ echo c > a
501 $ echo c > a
505 $ hg ci -m 9
502 $ hg ci -m 9
506 $ hg graft 1 --tool internal:fail
503 $ hg graft 1 --tool internal:fail
507 grafting 1:5d205f8b35b6 "1"
504 grafting 1:5d205f8b35b6 "1"
508 abort: unresolved conflicts, can't continue
505 abort: unresolved conflicts, can't continue
509 (use 'hg resolve' and 'hg graft --continue')
506 (use 'hg resolve' and 'hg graft --continue')
510 [255]
507 [255]
511 $ hg resolve --all
508 $ hg resolve --all
512 merging a
509 merging a
513 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
510 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
514 [1]
511 [1]
515 $ cat a
512 $ cat a
516 <<<<<<< local: aaa4406d4f0a - test: 9
513 <<<<<<< local: aaa4406d4f0a - test: 9
517 c
514 c
518 =======
515 =======
519 b
516 b
520 >>>>>>> graft: 5d205f8b35b6 - bar: 1
517 >>>>>>> graft: 5d205f8b35b6 - bar: 1
521 $ echo b > a
518 $ echo b > a
522 $ hg resolve -m a
519 $ hg resolve -m a
523 (no more unresolved files)
520 (no more unresolved files)
524 continue: hg graft --continue
521 continue: hg graft --continue
525 $ hg graft -c
522 $ hg graft -c
526 grafting 1:5d205f8b35b6 "1"
523 grafting 1:5d205f8b35b6 "1"
527 $ hg export tip --git
524 $ hg export tip --git
528 # HG changeset patch
525 # HG changeset patch
529 # User bar
526 # User bar
530 # Date 0 0
527 # Date 0 0
531 # Thu Jan 01 00:00:00 1970 +0000
528 # Thu Jan 01 00:00:00 1970 +0000
532 # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
529 # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
533 # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6
530 # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6
534 1
531 1
535
532
536 diff --git a/a b/a
533 diff --git a/a b/a
537 --- a/a
534 --- a/a
538 +++ b/a
535 +++ b/a
539 @@ -1,1 +1,1 @@
536 @@ -1,1 +1,1 @@
540 -c
537 -c
541 +b
538 +b
542
539
543 Resolve conflicted graft with rename
540 Resolve conflicted graft with rename
544 $ echo c > a
541 $ echo c > a
545 $ hg ci -m 10
542 $ hg ci -m 10
546 $ hg graft 2 --tool internal:fail
543 $ hg graft 2 --tool internal:fail
547 grafting 2:5c095ad7e90f "2"
544 grafting 2:5c095ad7e90f "2"
548 abort: unresolved conflicts, can't continue
545 abort: unresolved conflicts, can't continue
549 (use 'hg resolve' and 'hg graft --continue')
546 (use 'hg resolve' and 'hg graft --continue')
550 [255]
547 [255]
551 $ hg resolve --all
548 $ hg resolve --all
552 merging a and b to b
549 merging a and b to b
553 (no more unresolved files)
550 (no more unresolved files)
554 continue: hg graft --continue
551 continue: hg graft --continue
555 $ hg graft -c
552 $ hg graft -c
556 grafting 2:5c095ad7e90f "2"
553 grafting 2:5c095ad7e90f "2"
557 $ hg export tip --git
554 $ hg export tip --git
558 # HG changeset patch
555 # HG changeset patch
559 # User test
556 # User test
560 # Date 0 0
557 # Date 0 0
561 # Thu Jan 01 00:00:00 1970 +0000
558 # Thu Jan 01 00:00:00 1970 +0000
562 # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
559 # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
563 # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612
560 # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612
564 2
561 2
565
562
566 diff --git a/a b/b
563 diff --git a/a b/b
567 rename from a
564 rename from a
568 rename to b
565 rename to b
569
566
570 Test simple origin(), with and without args
567 Test simple origin(), with and without args
571 $ hg log -r 'origin()'
568 $ hg log -r 'origin()'
572 changeset: 1:5d205f8b35b6
569 changeset: 1:5d205f8b35b6
573 user: bar
570 user: bar
574 date: Thu Jan 01 00:00:00 1970 +0000
571 date: Thu Jan 01 00:00:00 1970 +0000
575 summary: 1
572 summary: 1
576
573
577 changeset: 2:5c095ad7e90f
574 changeset: 2:5c095ad7e90f
578 user: test
575 user: test
579 date: Thu Jan 01 00:00:00 1970 +0000
576 date: Thu Jan 01 00:00:00 1970 +0000
580 summary: 2
577 summary: 2
581
578
582 changeset: 3:4c60f11aa304
579 changeset: 3:4c60f11aa304
583 user: baz
580 user: baz
584 date: Thu Jan 01 00:00:00 1970 +0000
581 date: Thu Jan 01 00:00:00 1970 +0000
585 summary: 3
582 summary: 3
586
583
587 changeset: 4:9c233e8e184d
584 changeset: 4:9c233e8e184d
588 user: test
585 user: test
589 date: Thu Jan 01 00:00:00 1970 +0000
586 date: Thu Jan 01 00:00:00 1970 +0000
590 summary: 4
587 summary: 4
591
588
592 changeset: 5:97f8bfe72746
589 changeset: 5:97f8bfe72746
593 branch: stable
590 branch: stable
594 parent: 3:4c60f11aa304
591 parent: 3:4c60f11aa304
595 user: test
592 user: test
596 date: Thu Jan 01 00:00:00 1970 +0000
593 date: Thu Jan 01 00:00:00 1970 +0000
597 summary: 5
594 summary: 5
598
595
599 $ hg log -r 'origin(7)'
596 $ hg log -r 'origin(7)'
600 changeset: 2:5c095ad7e90f
597 changeset: 2:5c095ad7e90f
601 user: test
598 user: test
602 date: Thu Jan 01 00:00:00 1970 +0000
599 date: Thu Jan 01 00:00:00 1970 +0000
603 summary: 2
600 summary: 2
604
601
605 Now transplant a graft to test following through copies
602 Now transplant a graft to test following through copies
606 $ hg up -q 0
603 $ hg up -q 0
607 $ hg branch -q dev
604 $ hg branch -q dev
608 $ hg ci -qm "dev branch"
605 $ hg ci -qm "dev branch"
609 $ hg --config extensions.transplant= transplant -q 7
606 $ hg --config extensions.transplant= transplant -q 7
610 $ hg log -r 'origin(.)'
607 $ hg log -r 'origin(.)'
611 changeset: 2:5c095ad7e90f
608 changeset: 2:5c095ad7e90f
612 user: test
609 user: test
613 date: Thu Jan 01 00:00:00 1970 +0000
610 date: Thu Jan 01 00:00:00 1970 +0000
614 summary: 2
611 summary: 2
615
612
616 Test that the graft and transplant markers in extra are converted, allowing
613 Test that the graft and transplant markers in extra are converted, allowing
617 origin() to still work. Note that these recheck the immediately preceeding two
614 origin() to still work. Note that these recheck the immediately preceeding two
618 tests.
615 tests.
619 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
616 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
620
617
621 The graft case
618 The graft case
622 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
619 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
623 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
620 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
624 branch=default
621 branch=default
625 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
622 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
626 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
623 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
627 $ hg -R ../converted log -r 'origin(7)'
624 $ hg -R ../converted log -r 'origin(7)'
628 changeset: 2:e0213322b2c1
625 changeset: 2:e0213322b2c1
629 user: test
626 user: test
630 date: Thu Jan 01 00:00:00 1970 +0000
627 date: Thu Jan 01 00:00:00 1970 +0000
631 summary: 2
628 summary: 2
632
629
633 Test that template correctly expands more than one 'extra' (issue4362), and that
630 Test that template correctly expands more than one 'extra' (issue4362), and that
634 'intermediate-source' is converted.
631 'intermediate-source' is converted.
635 $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}"
632 $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}"
636 Extra: branch=default
633 Extra: branch=default
637 Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9
634 Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9
638 Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b
635 Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b
639 Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d
636 Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d
640
637
641 The transplant case
638 The transplant case
642 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
639 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
643 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
640 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
644 branch=dev
641 branch=dev
645 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
642 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
646 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b
643 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b
647 $ hg -R ../converted log -r 'origin(tip)'
644 $ hg -R ../converted log -r 'origin(tip)'
648 changeset: 2:e0213322b2c1
645 changeset: 2:e0213322b2c1
649 user: test
646 user: test
650 date: Thu Jan 01 00:00:00 1970 +0000
647 date: Thu Jan 01 00:00:00 1970 +0000
651 summary: 2
648 summary: 2
652
649
653
650
654 Test simple destination
651 Test simple destination
655 $ hg log -r 'destination()'
652 $ hg log -r 'destination()'
656 changeset: 7:ef0ef43d49e7
653 changeset: 7:ef0ef43d49e7
657 parent: 0:68795b066622
654 parent: 0:68795b066622
658 user: foo
655 user: foo
659 date: Thu Jan 01 00:00:00 1970 +0000
656 date: Thu Jan 01 00:00:00 1970 +0000
660 summary: 2
657 summary: 2
661
658
662 changeset: 8:6b9e5368ca4e
659 changeset: 8:6b9e5368ca4e
663 user: bar
660 user: bar
664 date: Thu Jan 01 00:00:00 1970 +0000
661 date: Thu Jan 01 00:00:00 1970 +0000
665 summary: 1
662 summary: 1
666
663
667 changeset: 9:1905859650ec
664 changeset: 9:1905859650ec
668 user: test
665 user: test
669 date: Thu Jan 01 00:00:00 1970 +0000
666 date: Thu Jan 01 00:00:00 1970 +0000
670 summary: 5
667 summary: 5
671
668
672 changeset: 10:52dc0b4c6907
669 changeset: 10:52dc0b4c6907
673 user: test
670 user: test
674 date: Thu Jan 01 00:00:00 1970 +0000
671 date: Thu Jan 01 00:00:00 1970 +0000
675 summary: 4
672 summary: 4
676
673
677 changeset: 11:882b35362a6b
674 changeset: 11:882b35362a6b
678 user: test
675 user: test
679 date: Thu Jan 01 00:00:00 1970 +0000
676 date: Thu Jan 01 00:00:00 1970 +0000
680 summary: 3
677 summary: 3
681
678
682 changeset: 13:7a4785234d87
679 changeset: 13:7a4785234d87
683 user: foo
680 user: foo
684 date: Thu Jan 01 00:00:00 1970 +0000
681 date: Thu Jan 01 00:00:00 1970 +0000
685 summary: 2
682 summary: 2
686
683
687 changeset: 14:0c921c65ef1e
684 changeset: 14:0c921c65ef1e
688 parent: 1:5d205f8b35b6
685 parent: 1:5d205f8b35b6
689 user: foo
686 user: foo
690 date: Thu Jan 01 00:00:00 1970 +0000
687 date: Thu Jan 01 00:00:00 1970 +0000
691 summary: 3
688 summary: 3
692
689
693 changeset: 17:f67661df0c48
690 changeset: 17:f67661df0c48
694 user: bar
691 user: bar
695 date: Thu Jan 01 00:00:00 1970 +0000
692 date: Thu Jan 01 00:00:00 1970 +0000
696 summary: 1
693 summary: 1
697
694
698 changeset: 19:9627f653b421
695 changeset: 19:9627f653b421
699 user: test
696 user: test
700 date: Thu Jan 01 00:00:00 1970 +0000
697 date: Thu Jan 01 00:00:00 1970 +0000
701 summary: 2
698 summary: 2
702
699
703 changeset: 21:7e61b508e709
700 changeset: 21:7e61b508e709
704 branch: dev
701 branch: dev
705 tag: tip
702 tag: tip
706 user: foo
703 user: foo
707 date: Thu Jan 01 00:00:00 1970 +0000
704 date: Thu Jan 01 00:00:00 1970 +0000
708 summary: 2
705 summary: 2
709
706
710 $ hg log -r 'destination(2)'
707 $ hg log -r 'destination(2)'
711 changeset: 7:ef0ef43d49e7
708 changeset: 7:ef0ef43d49e7
712 parent: 0:68795b066622
709 parent: 0:68795b066622
713 user: foo
710 user: foo
714 date: Thu Jan 01 00:00:00 1970 +0000
711 date: Thu Jan 01 00:00:00 1970 +0000
715 summary: 2
712 summary: 2
716
713
717 changeset: 13:7a4785234d87
714 changeset: 13:7a4785234d87
718 user: foo
715 user: foo
719 date: Thu Jan 01 00:00:00 1970 +0000
716 date: Thu Jan 01 00:00:00 1970 +0000
720 summary: 2
717 summary: 2
721
718
722 changeset: 19:9627f653b421
719 changeset: 19:9627f653b421
723 user: test
720 user: test
724 date: Thu Jan 01 00:00:00 1970 +0000
721 date: Thu Jan 01 00:00:00 1970 +0000
725 summary: 2
722 summary: 2
726
723
727 changeset: 21:7e61b508e709
724 changeset: 21:7e61b508e709
728 branch: dev
725 branch: dev
729 tag: tip
726 tag: tip
730 user: foo
727 user: foo
731 date: Thu Jan 01 00:00:00 1970 +0000
728 date: Thu Jan 01 00:00:00 1970 +0000
732 summary: 2
729 summary: 2
733
730
734 Transplants of grafts can find a destination...
731 Transplants of grafts can find a destination...
735 $ hg log -r 'destination(7)'
732 $ hg log -r 'destination(7)'
736 changeset: 21:7e61b508e709
733 changeset: 21:7e61b508e709
737 branch: dev
734 branch: dev
738 tag: tip
735 tag: tip
739 user: foo
736 user: foo
740 date: Thu Jan 01 00:00:00 1970 +0000
737 date: Thu Jan 01 00:00:00 1970 +0000
741 summary: 2
738 summary: 2
742
739
743 ... grafts of grafts unfortunately can't
740 ... grafts of grafts unfortunately can't
744 $ hg graft -q 13 --debug
741 $ hg graft -q 13 --debug
745 scanning for duplicate grafts
742 scanning for duplicate grafts
746 grafting 13:7a4785234d87 "2"
743 grafting 13:7a4785234d87 "2"
747 searching for copies back to rev 12
748 unmatched files in other (from topological common ancestor):
744 unmatched files in other (from topological common ancestor):
749 g
745 g
750 unmatched files new in both:
746 unmatched files new in both:
751 b
747 b
752 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
748 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
753 src: 'a' -> dst: 'b' *
749 src: 'a' -> dst: 'b' *
754 checking for directory renames
750 checking for directory renames
755 resolving manifests
751 resolving manifests
756 branchmerge: True, force: True, partial: False
752 branchmerge: True, force: True, partial: False
757 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
753 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
758 starting 4 threads for background file closing (?)
754 starting 4 threads for background file closing (?)
759 committing files:
755 committing files:
760 b
756 b
761 warning: can't find ancestor for 'b' copied from 'a'!
757 warning: can't find ancestor for 'b' copied from 'a'!
762 reusing manifest form p1 (listed files actually unchanged)
758 reusing manifest form p1 (listed files actually unchanged)
763 committing changelog
759 committing changelog
764 updating the branch cache
760 updating the branch cache
765 $ hg log -r 'destination(13)'
761 $ hg log -r 'destination(13)'
766 All copies of a cset
762 All copies of a cset
767 $ hg log -r 'origin(13) or destination(origin(13))'
763 $ hg log -r 'origin(13) or destination(origin(13))'
768 changeset: 2:5c095ad7e90f
764 changeset: 2:5c095ad7e90f
769 user: test
765 user: test
770 date: Thu Jan 01 00:00:00 1970 +0000
766 date: Thu Jan 01 00:00:00 1970 +0000
771 summary: 2
767 summary: 2
772
768
773 changeset: 7:ef0ef43d49e7
769 changeset: 7:ef0ef43d49e7
774 parent: 0:68795b066622
770 parent: 0:68795b066622
775 user: foo
771 user: foo
776 date: Thu Jan 01 00:00:00 1970 +0000
772 date: Thu Jan 01 00:00:00 1970 +0000
777 summary: 2
773 summary: 2
778
774
779 changeset: 13:7a4785234d87
775 changeset: 13:7a4785234d87
780 user: foo
776 user: foo
781 date: Thu Jan 01 00:00:00 1970 +0000
777 date: Thu Jan 01 00:00:00 1970 +0000
782 summary: 2
778 summary: 2
783
779
784 changeset: 19:9627f653b421
780 changeset: 19:9627f653b421
785 user: test
781 user: test
786 date: Thu Jan 01 00:00:00 1970 +0000
782 date: Thu Jan 01 00:00:00 1970 +0000
787 summary: 2
783 summary: 2
788
784
789 changeset: 21:7e61b508e709
785 changeset: 21:7e61b508e709
790 branch: dev
786 branch: dev
791 user: foo
787 user: foo
792 date: Thu Jan 01 00:00:00 1970 +0000
788 date: Thu Jan 01 00:00:00 1970 +0000
793 summary: 2
789 summary: 2
794
790
795 changeset: 22:3a4e92d81b97
791 changeset: 22:3a4e92d81b97
796 branch: dev
792 branch: dev
797 tag: tip
793 tag: tip
798 user: foo
794 user: foo
799 date: Thu Jan 01 00:00:00 1970 +0000
795 date: Thu Jan 01 00:00:00 1970 +0000
800 summary: 2
796 summary: 2
801
797
802
798
803 graft works on complex revset
799 graft works on complex revset
804
800
805 $ hg graft 'origin(13) or destination(origin(13))'
801 $ hg graft 'origin(13) or destination(origin(13))'
806 skipping ancestor revision 21:7e61b508e709
802 skipping ancestor revision 21:7e61b508e709
807 skipping ancestor revision 22:3a4e92d81b97
803 skipping ancestor revision 22:3a4e92d81b97
808 skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97)
804 skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97)
809 grafting 7:ef0ef43d49e7 "2"
805 grafting 7:ef0ef43d49e7 "2"
810 warning: can't find ancestor for 'b' copied from 'a'!
806 warning: can't find ancestor for 'b' copied from 'a'!
811 grafting 13:7a4785234d87 "2"
807 grafting 13:7a4785234d87 "2"
812 warning: can't find ancestor for 'b' copied from 'a'!
808 warning: can't find ancestor for 'b' copied from 'a'!
813 grafting 19:9627f653b421 "2"
809 grafting 19:9627f653b421 "2"
814 merging b
810 merging b
815 warning: can't find ancestor for 'b' copied from 'a'!
811 warning: can't find ancestor for 'b' copied from 'a'!
816
812
817 graft with --force (still doesn't graft merges)
813 graft with --force (still doesn't graft merges)
818
814
819 $ hg graft 19 0 6
815 $ hg graft 19 0 6
820 skipping ungraftable merge revision 6
816 skipping ungraftable merge revision 6
821 skipping ancestor revision 0:68795b066622
817 skipping ancestor revision 0:68795b066622
822 skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f)
818 skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f)
823 [255]
819 [255]
824 $ hg graft 19 0 6 --force
820 $ hg graft 19 0 6 --force
825 skipping ungraftable merge revision 6
821 skipping ungraftable merge revision 6
826 grafting 19:9627f653b421 "2"
822 grafting 19:9627f653b421 "2"
827 merging b
823 merging b
828 warning: can't find ancestor for 'b' copied from 'a'!
824 warning: can't find ancestor for 'b' copied from 'a'!
829 grafting 0:68795b066622 "0"
825 grafting 0:68795b066622 "0"
830
826
831 graft --force after backout
827 graft --force after backout
832
828
833 $ echo abc > a
829 $ echo abc > a
834 $ hg ci -m 28
830 $ hg ci -m 28
835 $ hg backout 28
831 $ hg backout 28
836 reverting a
832 reverting a
837 changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d
833 changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d
838 $ hg graft 28
834 $ hg graft 28
839 skipping ancestor revision 28:cc20d29aec8d
835 skipping ancestor revision 28:cc20d29aec8d
840 [255]
836 [255]
841 $ hg graft 28 --force
837 $ hg graft 28 --force
842 grafting 28:cc20d29aec8d "28"
838 grafting 28:cc20d29aec8d "28"
843 merging a
839 merging a
844 $ cat a
840 $ cat a
845 abc
841 abc
846
842
847 graft --continue after --force
843 graft --continue after --force
848
844
849 $ echo def > a
845 $ echo def > a
850 $ hg ci -m 31
846 $ hg ci -m 31
851 $ hg graft 28 --force --tool internal:fail
847 $ hg graft 28 --force --tool internal:fail
852 grafting 28:cc20d29aec8d "28"
848 grafting 28:cc20d29aec8d "28"
853 abort: unresolved conflicts, can't continue
849 abort: unresolved conflicts, can't continue
854 (use 'hg resolve' and 'hg graft --continue')
850 (use 'hg resolve' and 'hg graft --continue')
855 [255]
851 [255]
856 $ hg resolve --all
852 $ hg resolve --all
857 merging a
853 merging a
858 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
854 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
859 [1]
855 [1]
860 $ echo abc > a
856 $ echo abc > a
861 $ hg resolve -m a
857 $ hg resolve -m a
862 (no more unresolved files)
858 (no more unresolved files)
863 continue: hg graft --continue
859 continue: hg graft --continue
864 $ hg graft -c
860 $ hg graft -c
865 grafting 28:cc20d29aec8d "28"
861 grafting 28:cc20d29aec8d "28"
866 $ cat a
862 $ cat a
867 abc
863 abc
868
864
869 Continue testing same origin policy, using revision numbers from test above
865 Continue testing same origin policy, using revision numbers from test above
870 but do some destructive editing of the repo:
866 but do some destructive editing of the repo:
871
867
872 $ hg up -qC 7
868 $ hg up -qC 7
873 $ hg tag -l -r 13 tmp
869 $ hg tag -l -r 13 tmp
874 $ hg --config extensions.strip= strip 2
870 $ hg --config extensions.strip= strip 2
875 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg
871 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg
876 $ hg graft tmp
872 $ hg graft tmp
877 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
873 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
878 [255]
874 [255]
879
875
880 Empty graft
876 Empty graft
881
877
882 $ hg up -qr 26
878 $ hg up -qr 26
883 $ hg tag -f something
879 $ hg tag -f something
884 $ hg graft -qr 27
880 $ hg graft -qr 27
885 $ hg graft -f 27
881 $ hg graft -f 27
886 grafting 27:17d42b8f5d50 "28"
882 grafting 27:17d42b8f5d50 "28"
887 note: graft of 27:17d42b8f5d50 created no changes to commit
883 note: graft of 27:17d42b8f5d50 created no changes to commit
888
884
889 $ cd ..
885 $ cd ..
890
886
891 Graft to duplicate a commit
887 Graft to duplicate a commit
892
888
893 $ hg init graftsibling
889 $ hg init graftsibling
894 $ cd graftsibling
890 $ cd graftsibling
895 $ touch a
891 $ touch a
896 $ hg commit -qAm a
892 $ hg commit -qAm a
897 $ touch b
893 $ touch b
898 $ hg commit -qAm b
894 $ hg commit -qAm b
899 $ hg log -G -T '{rev}\n'
895 $ hg log -G -T '{rev}\n'
900 @ 1
896 @ 1
901 |
897 |
902 o 0
898 o 0
903
899
904 $ hg up -q 0
900 $ hg up -q 0
905 $ hg graft -r 1
901 $ hg graft -r 1
906 grafting 1:0e067c57feba "b" (tip)
902 grafting 1:0e067c57feba "b" (tip)
907 $ hg log -G -T '{rev}\n'
903 $ hg log -G -T '{rev}\n'
908 @ 2
904 @ 2
909 |
905 |
910 | o 1
906 | o 1
911 |/
907 |/
912 o 0
908 o 0
913
909
914 Graft to duplicate a commit twice
910 Graft to duplicate a commit twice
915
911
916 $ hg up -q 0
912 $ hg up -q 0
917 $ hg graft -r 2
913 $ hg graft -r 2
918 grafting 2:044ec77f6389 "b" (tip)
914 grafting 2:044ec77f6389 "b" (tip)
919 $ hg log -G -T '{rev}\n'
915 $ hg log -G -T '{rev}\n'
920 @ 3
916 @ 3
921 |
917 |
922 | o 2
918 | o 2
923 |/
919 |/
924 | o 1
920 | o 1
925 |/
921 |/
926 o 0
922 o 0
927
923
928 Graft from behind a move or rename
924 Graft from behind a move or rename
929 ==================================
925 ==================================
930
926
931 NOTE: This is affected by issue5343, and will need updating when it's fixed
927 NOTE: This is affected by issue5343, and will need updating when it's fixed
932
928
933 Consider this topology for a regular graft:
929 Consider this topology for a regular graft:
934
930
935 o c1
931 o c1
936 |
932 |
937 | o c2
933 | o c2
938 | |
934 | |
939 | o ca # stands for "common ancestor"
935 | o ca # stands for "common ancestor"
940 |/
936 |/
941 o cta # stands for "common topological ancestor"
937 o cta # stands for "common topological ancestor"
942
938
943 Note that in issue5343, ca==cta.
939 Note that in issue5343, ca==cta.
944
940
945 The following table shows the possible cases. Here, "x->y" and, equivalently,
941 The following table shows the possible cases. Here, "x->y" and, equivalently,
946 "y<-x", where x is an ancestor of y, means that some copy happened from x to y.
942 "y<-x", where x is an ancestor of y, means that some copy happened from x to y.
947
943
948 name | c1<-cta | cta<->ca | ca->c2
944 name | c1<-cta | cta<->ca | ca->c2
949 A.0 | | |
945 A.0 | | |
950 A.1 | X | |
946 A.1 | X | |
951 A.2 | | X |
947 A.2 | | X |
952 A.3 | | | X
948 A.3 | | | X
953 A.4 | X | X |
949 A.4 | X | X |
954 A.5 | X | | X
950 A.5 | X | | X
955 A.6 | | X | X
951 A.6 | | X | X
956 A.7 | X | X | X
952 A.7 | X | X | X
957
953
958 A.0 is trivial, and doesn't need copy tracking.
954 A.0 is trivial, and doesn't need copy tracking.
959 For A.1, a forward rename is recorded in the c1 pass, to be followed later.
955 For A.1, a forward rename is recorded in the c1 pass, to be followed later.
960 In A.2, the rename is recorded in the c2 pass and followed backwards.
956 In A.2, the rename is recorded in the c2 pass and followed backwards.
961 A.3 is recorded in the c2 pass as a forward rename to be duplicated on target.
957 A.3 is recorded in the c2 pass as a forward rename to be duplicated on target.
962 In A.4, both passes of checkcopies record incomplete renames, which are
958 In A.4, both passes of checkcopies record incomplete renames, which are
963 then joined in mergecopies to record a rename to be followed.
959 then joined in mergecopies to record a rename to be followed.
964 In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass
960 In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass
965 records an incomplete divergence. The incomplete rename is then joined to the
961 records an incomplete divergence. The incomplete rename is then joined to the
966 appropriate side of the incomplete divergence, and the result is recorded as a
962 appropriate side of the incomplete divergence, and the result is recorded as a
967 divergence. The code doesn't distinguish at all between these two cases, since
963 divergence. The code doesn't distinguish at all between these two cases, since
968 the end result of them is the same: an incomplete divergence joined with an
964 the end result of them is the same: an incomplete divergence joined with an
969 incomplete rename into a divergence.
965 incomplete rename into a divergence.
970 Finally, A.6 records a divergence entirely in the c2 pass.
966 Finally, A.6 records a divergence entirely in the c2 pass.
971
967
972 A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all.
968 A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all.
973 A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge.
969 A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge.
974 A.5 has issue5343 as a special case.
970 A.5 has issue5343 as a special case.
975 A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious
971 A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious
976 incomplete divergence, which is in fact complete. This is handled later in
972 incomplete divergence, which is in fact complete. This is handled later in
977 mergecopies.
973 mergecopies.
978 A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b,
974 A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b,
979 a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting,
975 a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting,
980 the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base
976 the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base
981 case, a<-b<-c->a is treated the same as a<-b<-b->a).
977 case, a<-b<-c->a is treated the same as a<-b<-b->a).
982
978
983 f5a therefore tests the "ping-pong" rename case, where a file is renamed to the
979 f5a therefore tests the "ping-pong" rename case, where a file is renamed to the
984 same name on both branches, then the rename is backed out on one branch, and
980 same name on both branches, then the rename is backed out on one branch, and
985 the backout is grafted to the other branch. This creates a challenging rename
981 the backout is grafted to the other branch. This creates a challenging rename
986 sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft
982 sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft
987 source, respectively. Since rename detection will run on the c1 side for such a
983 source, respectively. Since rename detection will run on the c1 side for such a
988 sequence (as for technical reasons, we split the c1 and c2 sides not at the
984 sequence (as for technical reasons, we split the c1 and c2 sides not at the
989 graft CA, but rather at the topological CA), it will pick up a false rename,
985 graft CA, but rather at the topological CA), it will pick up a false rename,
990 and cause a spurious merge conflict. This false rename is always exactly the
986 and cause a spurious merge conflict. This false rename is always exactly the
991 reverse of the true rename that would be detected on the c2 side, so we can
987 reverse of the true rename that would be detected on the c2 side, so we can
992 correct for it by detecting this condition and reversing as necessary.
988 correct for it by detecting this condition and reversing as necessary.
993
989
994 First, set up the repository with commits to be grafted
990 First, set up the repository with commits to be grafted
995
991
996 $ hg init ../graftmove
992 $ hg init ../graftmove
997 $ cd ../graftmove
993 $ cd ../graftmove
998 $ echo c1a > f1a
994 $ echo c1a > f1a
999 $ echo c2a > f2a
995 $ echo c2a > f2a
1000 $ echo c3a > f3a
996 $ echo c3a > f3a
1001 $ echo c4a > f4a
997 $ echo c4a > f4a
1002 $ echo c5a > f5a
998 $ echo c5a > f5a
1003 $ hg ci -qAm A0
999 $ hg ci -qAm A0
1004 $ hg mv f1a f1b
1000 $ hg mv f1a f1b
1005 $ hg mv f3a f3b
1001 $ hg mv f3a f3b
1006 $ hg mv f5a f5b
1002 $ hg mv f5a f5b
1007 $ hg ci -qAm B0
1003 $ hg ci -qAm B0
1008 $ echo c1c > f1b
1004 $ echo c1c > f1b
1009 $ hg mv f2a f2c
1005 $ hg mv f2a f2c
1010 $ hg mv f5b f5a
1006 $ hg mv f5b f5a
1011 $ echo c5c > f5a
1007 $ echo c5c > f5a
1012 $ hg ci -qAm C0
1008 $ hg ci -qAm C0
1013 $ hg mv f3b f3d
1009 $ hg mv f3b f3d
1014 $ echo c4d > f4a
1010 $ echo c4d > f4a
1015 $ hg ci -qAm D0
1011 $ hg ci -qAm D0
1016 $ hg log -G
1012 $ hg log -G
1017 @ changeset: 3:b69f5839d2d9
1013 @ changeset: 3:b69f5839d2d9
1018 | tag: tip
1014 | tag: tip
1019 | user: test
1015 | user: test
1020 | date: Thu Jan 01 00:00:00 1970 +0000
1016 | date: Thu Jan 01 00:00:00 1970 +0000
1021 | summary: D0
1017 | summary: D0
1022 |
1018 |
1023 o changeset: 2:f58c7e2b28fa
1019 o changeset: 2:f58c7e2b28fa
1024 | user: test
1020 | user: test
1025 | date: Thu Jan 01 00:00:00 1970 +0000
1021 | date: Thu Jan 01 00:00:00 1970 +0000
1026 | summary: C0
1022 | summary: C0
1027 |
1023 |
1028 o changeset: 1:3d7bba921b5d
1024 o changeset: 1:3d7bba921b5d
1029 | user: test
1025 | user: test
1030 | date: Thu Jan 01 00:00:00 1970 +0000
1026 | date: Thu Jan 01 00:00:00 1970 +0000
1031 | summary: B0
1027 | summary: B0
1032 |
1028 |
1033 o changeset: 0:11f7a1b56675
1029 o changeset: 0:11f7a1b56675
1034 user: test
1030 user: test
1035 date: Thu Jan 01 00:00:00 1970 +0000
1031 date: Thu Jan 01 00:00:00 1970 +0000
1036 summary: A0
1032 summary: A0
1037
1033
1038
1034
1039 Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the
1035 Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the
1040 two renames actually converge to the same name (thus no actual divergence).
1036 two renames actually converge to the same name (thus no actual divergence).
1041
1037
1042 $ hg up -q 'desc("A0")'
1038 $ hg up -q 'desc("A0")'
1043 $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit
1039 $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit
1044 grafting 2:f58c7e2b28fa "C0"
1040 grafting 2:f58c7e2b28fa "C0"
1045 merging f1a and f1b to f1a
1041 merging f1a and f1b to f1a
1046 merging f5a
1042 merging f5a
1047 warning: can't find ancestor for 'f5a' copied from 'f5b'!
1043 warning: can't find ancestor for 'f5a' copied from 'f5b'!
1048 $ hg status --change .
1044 $ hg status --change .
1049 M f1a
1045 M f1a
1050 M f5a
1046 M f5a
1051 A f2c
1047 A f2c
1052 R f2a
1048 R f2a
1053 $ hg cat f1a
1049 $ hg cat f1a
1054 c1c
1050 c1c
1055 $ hg cat f1b
1051 $ hg cat f1b
1056 f1b: no such file in rev c9763722f9bd
1052 f1b: no such file in rev c9763722f9bd
1057 [1]
1053 [1]
1058
1054
1059 Test the cases A.0 (f4x) and A.6 (f3x)
1055 Test the cases A.0 (f4x) and A.6 (f3x)
1060
1056
1061 $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit
1057 $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit
1062 grafting 3:b69f5839d2d9 "D0"
1058 grafting 3:b69f5839d2d9 "D0"
1063 note: possible conflict - f3b was renamed multiple times to:
1059 note: possible conflict - f3b was renamed multiple times to:
1064 f3a
1060 f3a
1065 f3d
1061 f3d
1066 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1062 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1067
1063
1068 Set up the repository for some further tests
1064 Set up the repository for some further tests
1069
1065
1070 $ hg up -q "min(desc("A0"))"
1066 $ hg up -q "min(desc("A0"))"
1071 $ hg mv f1a f1e
1067 $ hg mv f1a f1e
1072 $ echo c2e > f2a
1068 $ echo c2e > f2a
1073 $ hg mv f3a f3e
1069 $ hg mv f3a f3e
1074 $ hg mv f4a f4e
1070 $ hg mv f4a f4e
1075 $ hg mv f5a f5b
1071 $ hg mv f5a f5b
1076 $ hg ci -qAm "E0"
1072 $ hg ci -qAm "E0"
1077 $ hg up -q "min(desc("A0"))"
1073 $ hg up -q "min(desc("A0"))"
1078 $ hg cp f1a f1f
1074 $ hg cp f1a f1f
1079 $ hg ci -qAm "F0"
1075 $ hg ci -qAm "F0"
1080 $ hg up -q "min(desc("A0"))"
1076 $ hg up -q "min(desc("A0"))"
1081 $ hg cp f1a f1g
1077 $ hg cp f1a f1g
1082 $ echo c1g > f1g
1078 $ echo c1g > f1g
1083 $ hg ci -qAm "G0"
1079 $ hg ci -qAm "G0"
1084 $ hg log -G
1080 $ hg log -G
1085 @ changeset: 8:ba67f08fb15a
1081 @ changeset: 8:ba67f08fb15a
1086 | tag: tip
1082 | tag: tip
1087 | parent: 0:11f7a1b56675
1083 | parent: 0:11f7a1b56675
1088 | user: test
1084 | user: test
1089 | date: Thu Jan 01 00:00:00 1970 +0000
1085 | date: Thu Jan 01 00:00:00 1970 +0000
1090 | summary: G0
1086 | summary: G0
1091 |
1087 |
1092 | o changeset: 7:d376ab0d7fda
1088 | o changeset: 7:d376ab0d7fda
1093 |/ parent: 0:11f7a1b56675
1089 |/ parent: 0:11f7a1b56675
1094 | user: test
1090 | user: test
1095 | date: Thu Jan 01 00:00:00 1970 +0000
1091 | date: Thu Jan 01 00:00:00 1970 +0000
1096 | summary: F0
1092 | summary: F0
1097 |
1093 |
1098 | o changeset: 6:6bd1736cab86
1094 | o changeset: 6:6bd1736cab86
1099 |/ parent: 0:11f7a1b56675
1095 |/ parent: 0:11f7a1b56675
1100 | user: test
1096 | user: test
1101 | date: Thu Jan 01 00:00:00 1970 +0000
1097 | date: Thu Jan 01 00:00:00 1970 +0000
1102 | summary: E0
1098 | summary: E0
1103 |
1099 |
1104 | o changeset: 5:560daee679da
1100 | o changeset: 5:560daee679da
1105 | | user: test
1101 | | user: test
1106 | | date: Thu Jan 01 00:00:00 1970 +0000
1102 | | date: Thu Jan 01 00:00:00 1970 +0000
1107 | | summary: D1
1103 | | summary: D1
1108 | |
1104 | |
1109 | o changeset: 4:c9763722f9bd
1105 | o changeset: 4:c9763722f9bd
1110 |/ parent: 0:11f7a1b56675
1106 |/ parent: 0:11f7a1b56675
1111 | user: test
1107 | user: test
1112 | date: Thu Jan 01 00:00:00 1970 +0000
1108 | date: Thu Jan 01 00:00:00 1970 +0000
1113 | summary: C1
1109 | summary: C1
1114 |
1110 |
1115 | o changeset: 3:b69f5839d2d9
1111 | o changeset: 3:b69f5839d2d9
1116 | | user: test
1112 | | user: test
1117 | | date: Thu Jan 01 00:00:00 1970 +0000
1113 | | date: Thu Jan 01 00:00:00 1970 +0000
1118 | | summary: D0
1114 | | summary: D0
1119 | |
1115 | |
1120 | o changeset: 2:f58c7e2b28fa
1116 | o changeset: 2:f58c7e2b28fa
1121 | | user: test
1117 | | user: test
1122 | | date: Thu Jan 01 00:00:00 1970 +0000
1118 | | date: Thu Jan 01 00:00:00 1970 +0000
1123 | | summary: C0
1119 | | summary: C0
1124 | |
1120 | |
1125 | o changeset: 1:3d7bba921b5d
1121 | o changeset: 1:3d7bba921b5d
1126 |/ user: test
1122 |/ user: test
1127 | date: Thu Jan 01 00:00:00 1970 +0000
1123 | date: Thu Jan 01 00:00:00 1970 +0000
1128 | summary: B0
1124 | summary: B0
1129 |
1125 |
1130 o changeset: 0:11f7a1b56675
1126 o changeset: 0:11f7a1b56675
1131 user: test
1127 user: test
1132 date: Thu Jan 01 00:00:00 1970 +0000
1128 date: Thu Jan 01 00:00:00 1970 +0000
1133 summary: A0
1129 summary: A0
1134
1130
1135
1131
1136 Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x),
1132 Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x),
1137 and A.3 with a local content change to be preserved (f2x).
1133 and A.3 with a local content change to be preserved (f2x).
1138
1134
1139 $ hg up -q "desc("E0")"
1135 $ hg up -q "desc("E0")"
1140 $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
1136 $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
1141 grafting 2:f58c7e2b28fa "C0"
1137 grafting 2:f58c7e2b28fa "C0"
1142 merging f1e and f1b to f1e
1138 merging f1e and f1b to f1e
1143 merging f2a and f2c to f2c
1139 merging f2a and f2c to f2c
1144 merging f5b and f5a to f5a
1140 merging f5b and f5a to f5a
1145
1141
1146 Test the cases A.1 (f4x) and A.7 (f3x).
1142 Test the cases A.1 (f4x) and A.7 (f3x).
1147
1143
1148 $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit
1144 $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit
1149 grafting 3:b69f5839d2d9 "D0"
1145 grafting 3:b69f5839d2d9 "D0"
1150 note: possible conflict - f3b was renamed multiple times to:
1146 note: possible conflict - f3b was renamed multiple times to:
1151 f3d
1147 f3d
1152 f3e
1148 f3e
1153 merging f4e and f4a to f4e
1149 merging f4e and f4a to f4e
1154 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1150 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1155
1151
1156 $ hg cat f2c
1152 $ hg cat f2c
1157 c2e
1153 c2e
1158
1154
1159 Test the case A.5 (move case, f1x).
1155 Test the case A.5 (move case, f1x).
1160
1156
1161 $ hg up -q "desc("C0")"
1157 $ hg up -q "desc("C0")"
1162 BROKEN: Shouldn't get the warning about missing ancestor
1158 BROKEN: Shouldn't get the warning about missing ancestor
1163 $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit
1159 $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit
1164 grafting 6:6bd1736cab86 "E0"
1160 grafting 6:6bd1736cab86 "E0"
1165 note: possible conflict - f1a was renamed multiple times to:
1161 note: possible conflict - f1a was renamed multiple times to:
1166 f1b
1162 f1b
1167 f1e
1163 f1e
1168 note: possible conflict - f3a was renamed multiple times to:
1164 note: possible conflict - f3a was renamed multiple times to:
1169 f3b
1165 f3b
1170 f3e
1166 f3e
1171 merging f2c and f2a to f2c
1167 merging f2c and f2a to f2c
1172 merging f5a and f5b to f5b
1168 merging f5a and f5b to f5b
1173 warning: can't find ancestor for 'f1e' copied from 'f1a'!
1169 warning: can't find ancestor for 'f1e' copied from 'f1a'!
1174 warning: can't find ancestor for 'f3e' copied from 'f3a'!
1170 warning: can't find ancestor for 'f3e' copied from 'f3a'!
1175 $ cat f1e
1171 $ cat f1e
1176 c1a
1172 c1a
1177
1173
1178 Test the case A.5 (copy case, f1x).
1174 Test the case A.5 (copy case, f1x).
1179
1175
1180 $ hg up -q "desc("C0")"
1176 $ hg up -q "desc("C0")"
1181 BROKEN: Shouldn't get the warning about missing ancestor
1177 BROKEN: Shouldn't get the warning about missing ancestor
1182 $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit
1178 $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit
1183 grafting 7:d376ab0d7fda "F0"
1179 grafting 7:d376ab0d7fda "F0"
1184 warning: can't find ancestor for 'f1f' copied from 'f1a'!
1180 warning: can't find ancestor for 'f1f' copied from 'f1a'!
1185 BROKEN: f1f should be marked a copy from f1b
1181 BROKEN: f1f should be marked a copy from f1b
1186 $ hg st --copies --change .
1182 $ hg st --copies --change .
1187 A f1f
1183 A f1f
1188 BROKEN: f1f should have the new content from f1b (i.e. "c1c")
1184 BROKEN: f1f should have the new content from f1b (i.e. "c1c")
1189 $ cat f1f
1185 $ cat f1f
1190 c1a
1186 c1a
1191
1187
1192 Test the case A.5 (copy+modify case, f1x).
1188 Test the case A.5 (copy+modify case, f1x).
1193
1189
1194 $ hg up -q "desc("C0")"
1190 $ hg up -q "desc("C0")"
1195 BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0
1191 BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0
1196 (content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content
1192 (content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content
1197 "c1a")
1193 "c1a")
1198 $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit
1194 $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit
1199 grafting 8:ba67f08fb15a "G0"
1195 grafting 8:ba67f08fb15a "G0"
1200 warning: can't find ancestor for 'f1g' copied from 'f1a'!
1196 warning: can't find ancestor for 'f1g' copied from 'f1a'!
1201
1197
1202 Check the results of the grafts tested
1198 Check the results of the grafts tested
1203
1199
1204 $ hg log -CGv --patch --git
1200 $ hg log -CGv --patch --git
1205 @ changeset: 13:ef3adf6c20a4
1201 @ changeset: 13:ef3adf6c20a4
1206 | tag: tip
1202 | tag: tip
1207 | parent: 2:f58c7e2b28fa
1203 | parent: 2:f58c7e2b28fa
1208 | user: test
1204 | user: test
1209 | date: Thu Jan 01 00:00:00 1970 +0000
1205 | date: Thu Jan 01 00:00:00 1970 +0000
1210 | files: f1g
1206 | files: f1g
1211 | description:
1207 | description:
1212 | G1
1208 | G1
1213 |
1209 |
1214 |
1210 |
1215 | diff --git a/f1g b/f1g
1211 | diff --git a/f1g b/f1g
1216 | new file mode 100644
1212 | new file mode 100644
1217 | --- /dev/null
1213 | --- /dev/null
1218 | +++ b/f1g
1214 | +++ b/f1g
1219 | @@ -0,0 +1,1 @@
1215 | @@ -0,0 +1,1 @@
1220 | +c1g
1216 | +c1g
1221 |
1217 |
1222 | o changeset: 12:b5542d755b54
1218 | o changeset: 12:b5542d755b54
1223 |/ parent: 2:f58c7e2b28fa
1219 |/ parent: 2:f58c7e2b28fa
1224 | user: test
1220 | user: test
1225 | date: Thu Jan 01 00:00:00 1970 +0000
1221 | date: Thu Jan 01 00:00:00 1970 +0000
1226 | files: f1f
1222 | files: f1f
1227 | description:
1223 | description:
1228 | F1
1224 | F1
1229 |
1225 |
1230 |
1226 |
1231 | diff --git a/f1f b/f1f
1227 | diff --git a/f1f b/f1f
1232 | new file mode 100644
1228 | new file mode 100644
1233 | --- /dev/null
1229 | --- /dev/null
1234 | +++ b/f1f
1230 | +++ b/f1f
1235 | @@ -0,0 +1,1 @@
1231 | @@ -0,0 +1,1 @@
1236 | +c1a
1232 | +c1a
1237 |
1233 |
1238 | o changeset: 11:f8a162271246
1234 | o changeset: 11:f8a162271246
1239 |/ parent: 2:f58c7e2b28fa
1235 |/ parent: 2:f58c7e2b28fa
1240 | user: test
1236 | user: test
1241 | date: Thu Jan 01 00:00:00 1970 +0000
1237 | date: Thu Jan 01 00:00:00 1970 +0000
1242 | files: f1e f2c f3e f4a f4e f5a f5b
1238 | files: f1e f2c f3e f4a f4e f5a f5b
1243 | copies: f4e (f4a) f5b (f5a)
1239 | copies: f4e (f4a) f5b (f5a)
1244 | description:
1240 | description:
1245 | E1
1241 | E1
1246 |
1242 |
1247 |
1243 |
1248 | diff --git a/f1e b/f1e
1244 | diff --git a/f1e b/f1e
1249 | new file mode 100644
1245 | new file mode 100644
1250 | --- /dev/null
1246 | --- /dev/null
1251 | +++ b/f1e
1247 | +++ b/f1e
1252 | @@ -0,0 +1,1 @@
1248 | @@ -0,0 +1,1 @@
1253 | +c1a
1249 | +c1a
1254 | diff --git a/f2c b/f2c
1250 | diff --git a/f2c b/f2c
1255 | --- a/f2c
1251 | --- a/f2c
1256 | +++ b/f2c
1252 | +++ b/f2c
1257 | @@ -1,1 +1,1 @@
1253 | @@ -1,1 +1,1 @@
1258 | -c2a
1254 | -c2a
1259 | +c2e
1255 | +c2e
1260 | diff --git a/f3e b/f3e
1256 | diff --git a/f3e b/f3e
1261 | new file mode 100644
1257 | new file mode 100644
1262 | --- /dev/null
1258 | --- /dev/null
1263 | +++ b/f3e
1259 | +++ b/f3e
1264 | @@ -0,0 +1,1 @@
1260 | @@ -0,0 +1,1 @@
1265 | +c3a
1261 | +c3a
1266 | diff --git a/f4a b/f4e
1262 | diff --git a/f4a b/f4e
1267 | rename from f4a
1263 | rename from f4a
1268 | rename to f4e
1264 | rename to f4e
1269 | diff --git a/f5a b/f5b
1265 | diff --git a/f5a b/f5b
1270 | rename from f5a
1266 | rename from f5a
1271 | rename to f5b
1267 | rename to f5b
1272 |
1268 |
1273 | o changeset: 10:93ee502e8b0a
1269 | o changeset: 10:93ee502e8b0a
1274 | | user: test
1270 | | user: test
1275 | | date: Thu Jan 01 00:00:00 1970 +0000
1271 | | date: Thu Jan 01 00:00:00 1970 +0000
1276 | | files: f3d f4e
1272 | | files: f3d f4e
1277 | | description:
1273 | | description:
1278 | | D2
1274 | | D2
1279 | |
1275 | |
1280 | |
1276 | |
1281 | | diff --git a/f3d b/f3d
1277 | | diff --git a/f3d b/f3d
1282 | | new file mode 100644
1278 | | new file mode 100644
1283 | | --- /dev/null
1279 | | --- /dev/null
1284 | | +++ b/f3d
1280 | | +++ b/f3d
1285 | | @@ -0,0 +1,1 @@
1281 | | @@ -0,0 +1,1 @@
1286 | | +c3a
1282 | | +c3a
1287 | | diff --git a/f4e b/f4e
1283 | | diff --git a/f4e b/f4e
1288 | | --- a/f4e
1284 | | --- a/f4e
1289 | | +++ b/f4e
1285 | | +++ b/f4e
1290 | | @@ -1,1 +1,1 @@
1286 | | @@ -1,1 +1,1 @@
1291 | | -c4a
1287 | | -c4a
1292 | | +c4d
1288 | | +c4d
1293 | |
1289 | |
1294 | o changeset: 9:539cf145f496
1290 | o changeset: 9:539cf145f496
1295 | | parent: 6:6bd1736cab86
1291 | | parent: 6:6bd1736cab86
1296 | | user: test
1292 | | user: test
1297 | | date: Thu Jan 01 00:00:00 1970 +0000
1293 | | date: Thu Jan 01 00:00:00 1970 +0000
1298 | | files: f1e f2a f2c f5a f5b
1294 | | files: f1e f2a f2c f5a f5b
1299 | | copies: f2c (f2a) f5a (f5b)
1295 | | copies: f2c (f2a) f5a (f5b)
1300 | | description:
1296 | | description:
1301 | | C2
1297 | | C2
1302 | |
1298 | |
1303 | |
1299 | |
1304 | | diff --git a/f1e b/f1e
1300 | | diff --git a/f1e b/f1e
1305 | | --- a/f1e
1301 | | --- a/f1e
1306 | | +++ b/f1e
1302 | | +++ b/f1e
1307 | | @@ -1,1 +1,1 @@
1303 | | @@ -1,1 +1,1 @@
1308 | | -c1a
1304 | | -c1a
1309 | | +c1c
1305 | | +c1c
1310 | | diff --git a/f2a b/f2c
1306 | | diff --git a/f2a b/f2c
1311 | | rename from f2a
1307 | | rename from f2a
1312 | | rename to f2c
1308 | | rename to f2c
1313 | | diff --git a/f5b b/f5a
1309 | | diff --git a/f5b b/f5a
1314 | | rename from f5b
1310 | | rename from f5b
1315 | | rename to f5a
1311 | | rename to f5a
1316 | | --- a/f5b
1312 | | --- a/f5b
1317 | | +++ b/f5a
1313 | | +++ b/f5a
1318 | | @@ -1,1 +1,1 @@
1314 | | @@ -1,1 +1,1 @@
1319 | | -c5a
1315 | | -c5a
1320 | | +c5c
1316 | | +c5c
1321 | |
1317 | |
1322 | | o changeset: 8:ba67f08fb15a
1318 | | o changeset: 8:ba67f08fb15a
1323 | | | parent: 0:11f7a1b56675
1319 | | | parent: 0:11f7a1b56675
1324 | | | user: test
1320 | | | user: test
1325 | | | date: Thu Jan 01 00:00:00 1970 +0000
1321 | | | date: Thu Jan 01 00:00:00 1970 +0000
1326 | | | files: f1g
1322 | | | files: f1g
1327 | | | copies: f1g (f1a)
1323 | | | copies: f1g (f1a)
1328 | | | description:
1324 | | | description:
1329 | | | G0
1325 | | | G0
1330 | | |
1326 | | |
1331 | | |
1327 | | |
1332 | | | diff --git a/f1a b/f1g
1328 | | | diff --git a/f1a b/f1g
1333 | | | copy from f1a
1329 | | | copy from f1a
1334 | | | copy to f1g
1330 | | | copy to f1g
1335 | | | --- a/f1a
1331 | | | --- a/f1a
1336 | | | +++ b/f1g
1332 | | | +++ b/f1g
1337 | | | @@ -1,1 +1,1 @@
1333 | | | @@ -1,1 +1,1 @@
1338 | | | -c1a
1334 | | | -c1a
1339 | | | +c1g
1335 | | | +c1g
1340 | | |
1336 | | |
1341 | | | o changeset: 7:d376ab0d7fda
1337 | | | o changeset: 7:d376ab0d7fda
1342 | | |/ parent: 0:11f7a1b56675
1338 | | |/ parent: 0:11f7a1b56675
1343 | | | user: test
1339 | | | user: test
1344 | | | date: Thu Jan 01 00:00:00 1970 +0000
1340 | | | date: Thu Jan 01 00:00:00 1970 +0000
1345 | | | files: f1f
1341 | | | files: f1f
1346 | | | copies: f1f (f1a)
1342 | | | copies: f1f (f1a)
1347 | | | description:
1343 | | | description:
1348 | | | F0
1344 | | | F0
1349 | | |
1345 | | |
1350 | | |
1346 | | |
1351 | | | diff --git a/f1a b/f1f
1347 | | | diff --git a/f1a b/f1f
1352 | | | copy from f1a
1348 | | | copy from f1a
1353 | | | copy to f1f
1349 | | | copy to f1f
1354 | | |
1350 | | |
1355 | o | changeset: 6:6bd1736cab86
1351 | o | changeset: 6:6bd1736cab86
1356 | |/ parent: 0:11f7a1b56675
1352 | |/ parent: 0:11f7a1b56675
1357 | | user: test
1353 | | user: test
1358 | | date: Thu Jan 01 00:00:00 1970 +0000
1354 | | date: Thu Jan 01 00:00:00 1970 +0000
1359 | | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b
1355 | | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b
1360 | | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a)
1356 | | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a)
1361 | | description:
1357 | | description:
1362 | | E0
1358 | | E0
1363 | |
1359 | |
1364 | |
1360 | |
1365 | | diff --git a/f1a b/f1e
1361 | | diff --git a/f1a b/f1e
1366 | | rename from f1a
1362 | | rename from f1a
1367 | | rename to f1e
1363 | | rename to f1e
1368 | | diff --git a/f2a b/f2a
1364 | | diff --git a/f2a b/f2a
1369 | | --- a/f2a
1365 | | --- a/f2a
1370 | | +++ b/f2a
1366 | | +++ b/f2a
1371 | | @@ -1,1 +1,1 @@
1367 | | @@ -1,1 +1,1 @@
1372 | | -c2a
1368 | | -c2a
1373 | | +c2e
1369 | | +c2e
1374 | | diff --git a/f3a b/f3e
1370 | | diff --git a/f3a b/f3e
1375 | | rename from f3a
1371 | | rename from f3a
1376 | | rename to f3e
1372 | | rename to f3e
1377 | | diff --git a/f4a b/f4e
1373 | | diff --git a/f4a b/f4e
1378 | | rename from f4a
1374 | | rename from f4a
1379 | | rename to f4e
1375 | | rename to f4e
1380 | | diff --git a/f5a b/f5b
1376 | | diff --git a/f5a b/f5b
1381 | | rename from f5a
1377 | | rename from f5a
1382 | | rename to f5b
1378 | | rename to f5b
1383 | |
1379 | |
1384 | | o changeset: 5:560daee679da
1380 | | o changeset: 5:560daee679da
1385 | | | user: test
1381 | | | user: test
1386 | | | date: Thu Jan 01 00:00:00 1970 +0000
1382 | | | date: Thu Jan 01 00:00:00 1970 +0000
1387 | | | files: f3d f4a
1383 | | | files: f3d f4a
1388 | | | description:
1384 | | | description:
1389 | | | D1
1385 | | | D1
1390 | | |
1386 | | |
1391 | | |
1387 | | |
1392 | | | diff --git a/f3d b/f3d
1388 | | | diff --git a/f3d b/f3d
1393 | | | new file mode 100644
1389 | | | new file mode 100644
1394 | | | --- /dev/null
1390 | | | --- /dev/null
1395 | | | +++ b/f3d
1391 | | | +++ b/f3d
1396 | | | @@ -0,0 +1,1 @@
1392 | | | @@ -0,0 +1,1 @@
1397 | | | +c3a
1393 | | | +c3a
1398 | | | diff --git a/f4a b/f4a
1394 | | | diff --git a/f4a b/f4a
1399 | | | --- a/f4a
1395 | | | --- a/f4a
1400 | | | +++ b/f4a
1396 | | | +++ b/f4a
1401 | | | @@ -1,1 +1,1 @@
1397 | | | @@ -1,1 +1,1 @@
1402 | | | -c4a
1398 | | | -c4a
1403 | | | +c4d
1399 | | | +c4d
1404 | | |
1400 | | |
1405 | | o changeset: 4:c9763722f9bd
1401 | | o changeset: 4:c9763722f9bd
1406 | |/ parent: 0:11f7a1b56675
1402 | |/ parent: 0:11f7a1b56675
1407 | | user: test
1403 | | user: test
1408 | | date: Thu Jan 01 00:00:00 1970 +0000
1404 | | date: Thu Jan 01 00:00:00 1970 +0000
1409 | | files: f1a f2a f2c f5a
1405 | | files: f1a f2a f2c f5a
1410 | | copies: f2c (f2a)
1406 | | copies: f2c (f2a)
1411 | | description:
1407 | | description:
1412 | | C1
1408 | | C1
1413 | |
1409 | |
1414 | |
1410 | |
1415 | | diff --git a/f1a b/f1a
1411 | | diff --git a/f1a b/f1a
1416 | | --- a/f1a
1412 | | --- a/f1a
1417 | | +++ b/f1a
1413 | | +++ b/f1a
1418 | | @@ -1,1 +1,1 @@
1414 | | @@ -1,1 +1,1 @@
1419 | | -c1a
1415 | | -c1a
1420 | | +c1c
1416 | | +c1c
1421 | | diff --git a/f2a b/f2c
1417 | | diff --git a/f2a b/f2c
1422 | | rename from f2a
1418 | | rename from f2a
1423 | | rename to f2c
1419 | | rename to f2c
1424 | | diff --git a/f5a b/f5a
1420 | | diff --git a/f5a b/f5a
1425 | | --- a/f5a
1421 | | --- a/f5a
1426 | | +++ b/f5a
1422 | | +++ b/f5a
1427 | | @@ -1,1 +1,1 @@
1423 | | @@ -1,1 +1,1 @@
1428 | | -c5a
1424 | | -c5a
1429 | | +c5c
1425 | | +c5c
1430 | |
1426 | |
1431 +---o changeset: 3:b69f5839d2d9
1427 +---o changeset: 3:b69f5839d2d9
1432 | | user: test
1428 | | user: test
1433 | | date: Thu Jan 01 00:00:00 1970 +0000
1429 | | date: Thu Jan 01 00:00:00 1970 +0000
1434 | | files: f3b f3d f4a
1430 | | files: f3b f3d f4a
1435 | | copies: f3d (f3b)
1431 | | copies: f3d (f3b)
1436 | | description:
1432 | | description:
1437 | | D0
1433 | | D0
1438 | |
1434 | |
1439 | |
1435 | |
1440 | | diff --git a/f3b b/f3d
1436 | | diff --git a/f3b b/f3d
1441 | | rename from f3b
1437 | | rename from f3b
1442 | | rename to f3d
1438 | | rename to f3d
1443 | | diff --git a/f4a b/f4a
1439 | | diff --git a/f4a b/f4a
1444 | | --- a/f4a
1440 | | --- a/f4a
1445 | | +++ b/f4a
1441 | | +++ b/f4a
1446 | | @@ -1,1 +1,1 @@
1442 | | @@ -1,1 +1,1 @@
1447 | | -c4a
1443 | | -c4a
1448 | | +c4d
1444 | | +c4d
1449 | |
1445 | |
1450 o | changeset: 2:f58c7e2b28fa
1446 o | changeset: 2:f58c7e2b28fa
1451 | | user: test
1447 | | user: test
1452 | | date: Thu Jan 01 00:00:00 1970 +0000
1448 | | date: Thu Jan 01 00:00:00 1970 +0000
1453 | | files: f1b f2a f2c f5a f5b
1449 | | files: f1b f2a f2c f5a f5b
1454 | | copies: f2c (f2a) f5a (f5b)
1450 | | copies: f2c (f2a) f5a (f5b)
1455 | | description:
1451 | | description:
1456 | | C0
1452 | | C0
1457 | |
1453 | |
1458 | |
1454 | |
1459 | | diff --git a/f1b b/f1b
1455 | | diff --git a/f1b b/f1b
1460 | | --- a/f1b
1456 | | --- a/f1b
1461 | | +++ b/f1b
1457 | | +++ b/f1b
1462 | | @@ -1,1 +1,1 @@
1458 | | @@ -1,1 +1,1 @@
1463 | | -c1a
1459 | | -c1a
1464 | | +c1c
1460 | | +c1c
1465 | | diff --git a/f2a b/f2c
1461 | | diff --git a/f2a b/f2c
1466 | | rename from f2a
1462 | | rename from f2a
1467 | | rename to f2c
1463 | | rename to f2c
1468 | | diff --git a/f5b b/f5a
1464 | | diff --git a/f5b b/f5a
1469 | | rename from f5b
1465 | | rename from f5b
1470 | | rename to f5a
1466 | | rename to f5a
1471 | | --- a/f5b
1467 | | --- a/f5b
1472 | | +++ b/f5a
1468 | | +++ b/f5a
1473 | | @@ -1,1 +1,1 @@
1469 | | @@ -1,1 +1,1 @@
1474 | | -c5a
1470 | | -c5a
1475 | | +c5c
1471 | | +c5c
1476 | |
1472 | |
1477 o | changeset: 1:3d7bba921b5d
1473 o | changeset: 1:3d7bba921b5d
1478 |/ user: test
1474 |/ user: test
1479 | date: Thu Jan 01 00:00:00 1970 +0000
1475 | date: Thu Jan 01 00:00:00 1970 +0000
1480 | files: f1a f1b f3a f3b f5a f5b
1476 | files: f1a f1b f3a f3b f5a f5b
1481 | copies: f1b (f1a) f3b (f3a) f5b (f5a)
1477 | copies: f1b (f1a) f3b (f3a) f5b (f5a)
1482 | description:
1478 | description:
1483 | B0
1479 | B0
1484 |
1480 |
1485 |
1481 |
1486 | diff --git a/f1a b/f1b
1482 | diff --git a/f1a b/f1b
1487 | rename from f1a
1483 | rename from f1a
1488 | rename to f1b
1484 | rename to f1b
1489 | diff --git a/f3a b/f3b
1485 | diff --git a/f3a b/f3b
1490 | rename from f3a
1486 | rename from f3a
1491 | rename to f3b
1487 | rename to f3b
1492 | diff --git a/f5a b/f5b
1488 | diff --git a/f5a b/f5b
1493 | rename from f5a
1489 | rename from f5a
1494 | rename to f5b
1490 | rename to f5b
1495 |
1491 |
1496 o changeset: 0:11f7a1b56675
1492 o changeset: 0:11f7a1b56675
1497 user: test
1493 user: test
1498 date: Thu Jan 01 00:00:00 1970 +0000
1494 date: Thu Jan 01 00:00:00 1970 +0000
1499 files: f1a f2a f3a f4a f5a
1495 files: f1a f2a f3a f4a f5a
1500 description:
1496 description:
1501 A0
1497 A0
1502
1498
1503
1499
1504 diff --git a/f1a b/f1a
1500 diff --git a/f1a b/f1a
1505 new file mode 100644
1501 new file mode 100644
1506 --- /dev/null
1502 --- /dev/null
1507 +++ b/f1a
1503 +++ b/f1a
1508 @@ -0,0 +1,1 @@
1504 @@ -0,0 +1,1 @@
1509 +c1a
1505 +c1a
1510 diff --git a/f2a b/f2a
1506 diff --git a/f2a b/f2a
1511 new file mode 100644
1507 new file mode 100644
1512 --- /dev/null
1508 --- /dev/null
1513 +++ b/f2a
1509 +++ b/f2a
1514 @@ -0,0 +1,1 @@
1510 @@ -0,0 +1,1 @@
1515 +c2a
1511 +c2a
1516 diff --git a/f3a b/f3a
1512 diff --git a/f3a b/f3a
1517 new file mode 100644
1513 new file mode 100644
1518 --- /dev/null
1514 --- /dev/null
1519 +++ b/f3a
1515 +++ b/f3a
1520 @@ -0,0 +1,1 @@
1516 @@ -0,0 +1,1 @@
1521 +c3a
1517 +c3a
1522 diff --git a/f4a b/f4a
1518 diff --git a/f4a b/f4a
1523 new file mode 100644
1519 new file mode 100644
1524 --- /dev/null
1520 --- /dev/null
1525 +++ b/f4a
1521 +++ b/f4a
1526 @@ -0,0 +1,1 @@
1522 @@ -0,0 +1,1 @@
1527 +c4a
1523 +c4a
1528 diff --git a/f5a b/f5a
1524 diff --git a/f5a b/f5a
1529 new file mode 100644
1525 new file mode 100644
1530 --- /dev/null
1526 --- /dev/null
1531 +++ b/f5a
1527 +++ b/f5a
1532 @@ -0,0 +1,1 @@
1528 @@ -0,0 +1,1 @@
1533 +c5a
1529 +c5a
1534
1530
1535 Check superfluous filemerge of files renamed in the past but untouched by graft
1531 Check superfluous filemerge of files renamed in the past but untouched by graft
1536
1532
1537 $ echo a > a
1533 $ echo a > a
1538 $ hg ci -qAma
1534 $ hg ci -qAma
1539 $ hg mv a b
1535 $ hg mv a b
1540 $ echo b > b
1536 $ echo b > b
1541 $ hg ci -qAmb
1537 $ hg ci -qAmb
1542 $ echo c > c
1538 $ echo c > c
1543 $ hg ci -qAmc
1539 $ hg ci -qAmc
1544 $ hg up -q .~2
1540 $ hg up -q .~2
1545 $ hg graft tip -qt:fail
1541 $ hg graft tip -qt:fail
1546
1542
1547 $ cd ..
1543 $ cd ..
1548
1544
1549 Graft a change into a new file previously grafted into a renamed directory
1545 Graft a change into a new file previously grafted into a renamed directory
1550
1546
1551 $ hg init dirmovenewfile
1547 $ hg init dirmovenewfile
1552 $ cd dirmovenewfile
1548 $ cd dirmovenewfile
1553 $ mkdir a
1549 $ mkdir a
1554 $ echo a > a/a
1550 $ echo a > a/a
1555 $ hg ci -qAma
1551 $ hg ci -qAma
1556 $ echo x > a/x
1552 $ echo x > a/x
1557 $ hg ci -qAmx
1553 $ hg ci -qAmx
1558 $ hg up -q 0
1554 $ hg up -q 0
1559 $ hg mv -q a b
1555 $ hg mv -q a b
1560 $ hg ci -qAmb
1556 $ hg ci -qAmb
1561 $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded
1557 $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded
1562 $ hg up -q 1
1558 $ hg up -q 1
1563 $ echo y > a/x
1559 $ echo y > a/x
1564 $ hg ci -qAmy
1560 $ hg ci -qAmy
1565 $ hg up -q 3
1561 $ hg up -q 3
1566 $ hg graft -q 4
1562 $ hg graft -q 4
1567 $ hg status --change .
1563 $ hg status --change .
1568 M b/x
1564 M b/x
1569
1565
1570 Prepare for test of skipped changesets and how merges can influence it:
1566 Prepare for test of skipped changesets and how merges can influence it:
1571
1567
1572 $ hg merge -q -r 1 --tool :local
1568 $ hg merge -q -r 1 --tool :local
1573 $ hg ci -m m
1569 $ hg ci -m m
1574 $ echo xx >> b/x
1570 $ echo xx >> b/x
1575 $ hg ci -m xx
1571 $ hg ci -m xx
1576
1572
1577 $ hg log -G -T '{rev} {desc|firstline}'
1573 $ hg log -G -T '{rev} {desc|firstline}'
1578 @ 7 xx
1574 @ 7 xx
1579 |
1575 |
1580 o 6 m
1576 o 6 m
1581 |\
1577 |\
1582 | o 5 y
1578 | o 5 y
1583 | |
1579 | |
1584 +---o 4 y
1580 +---o 4 y
1585 | |
1581 | |
1586 | o 3 x
1582 | o 3 x
1587 | |
1583 | |
1588 | o 2 b
1584 | o 2 b
1589 | |
1585 | |
1590 o | 1 x
1586 o | 1 x
1591 |/
1587 |/
1592 o 0 a
1588 o 0 a
1593
1589
1594 Grafting of plain changes correctly detects that 3 and 5 should be skipped:
1590 Grafting of plain changes correctly detects that 3 and 5 should be skipped:
1595
1591
1596 $ hg up -qCr 4
1592 $ hg up -qCr 4
1597 $ hg graft --tool :local -r 2::5
1593 $ hg graft --tool :local -r 2::5
1598 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1594 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1599 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1595 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1600 grafting 2:42127f193bcd "b"
1596 grafting 2:42127f193bcd "b"
1601
1597
1602 Extending the graft range to include a (skipped) merge of 3 will not prevent us from
1598 Extending the graft range to include a (skipped) merge of 3 will not prevent us from
1603 also detecting that both 3 and 5 should be skipped:
1599 also detecting that both 3 and 5 should be skipped:
1604
1600
1605 $ hg up -qCr 4
1601 $ hg up -qCr 4
1606 $ hg graft --tool :local -r 2::7
1602 $ hg graft --tool :local -r 2::7
1607 skipping ungraftable merge revision 6
1603 skipping ungraftable merge revision 6
1608 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1604 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1609 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1605 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1610 grafting 2:42127f193bcd "b"
1606 grafting 2:42127f193bcd "b"
1611 grafting 7:d3c3f2b38ecc "xx"
1607 grafting 7:d3c3f2b38ecc "xx"
1612 note: graft of 7:d3c3f2b38ecc created no changes to commit
1608 note: graft of 7:d3c3f2b38ecc created no changes to commit
1613
1609
1614 $ cd ..
1610 $ cd ..
1615
1611
1616 Grafted revision should be warned and skipped only once. (issue6024)
1612 Grafted revision should be warned and skipped only once. (issue6024)
1617
1613
1618 $ mkdir issue6024
1614 $ mkdir issue6024
1619 $ cd issue6024
1615 $ cd issue6024
1620
1616
1621 $ hg init base
1617 $ hg init base
1622 $ cd base
1618 $ cd base
1623 $ touch x
1619 $ touch x
1624 $ hg commit -qAminit
1620 $ hg commit -qAminit
1625 $ echo a > x
1621 $ echo a > x
1626 $ hg commit -mchange
1622 $ hg commit -mchange
1627 $ hg update -q 0
1623 $ hg update -q 0
1628 $ hg graft -r 1
1624 $ hg graft -r 1
1629 grafting 1:a0b923c546aa "change" (tip)
1625 grafting 1:a0b923c546aa "change" (tip)
1630 $ cd ..
1626 $ cd ..
1631
1627
1632 $ hg clone -qr 2 base clone
1628 $ hg clone -qr 2 base clone
1633 $ cd clone
1629 $ cd clone
1634 $ hg pull -q
1630 $ hg pull -q
1635 $ hg merge -q 2
1631 $ hg merge -q 2
1636 $ hg commit -mmerge
1632 $ hg commit -mmerge
1637 $ hg update -q 0
1633 $ hg update -q 0
1638 $ hg graft -r 1
1634 $ hg graft -r 1
1639 grafting 1:04fc6d444368 "change"
1635 grafting 1:04fc6d444368 "change"
1640 $ hg update -q 3
1636 $ hg update -q 3
1641 $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n'
1637 $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n'
1642 o 4:4e16 <- a0b9
1638 o 4:4e16 <- a0b9
1643 |
1639 |
1644 | @ 3:f0ac <-
1640 | @ 3:f0ac <-
1645 | |\
1641 | |\
1646 +---o 2:a0b9 <-
1642 +---o 2:a0b9 <-
1647 | |
1643 | |
1648 | o 1:04fc <- a0b9
1644 | o 1:04fc <- a0b9
1649 |/
1645 |/
1650 o 0:7848 <-
1646 o 0:7848 <-
1651
1647
1652
1648
1653 the source of rev 4 is an ancestor of the working parent, and was also
1649 the source of rev 4 is an ancestor of the working parent, and was also
1654 grafted as rev 1. it should be stripped from the target revisions only once.
1650 grafted as rev 1. it should be stripped from the target revisions only once.
1655
1651
1656 $ hg graft -r 4
1652 $ hg graft -r 4
1657 skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa)
1653 skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa)
1658 [255]
1654 [255]
1659
1655
1660 $ cd ../..
1656 $ cd ../..
1661
1657
1662 Testing the reading of old format graftstate file with newer mercurial
1658 Testing the reading of old format graftstate file with newer mercurial
1663
1659
1664 $ hg init oldgraft
1660 $ hg init oldgraft
1665 $ cd oldgraft
1661 $ cd oldgraft
1666 $ for ch in a b c; do echo foo > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1662 $ for ch in a b c; do echo foo > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1667 $ hg log -GT "{rev}:{node|short} {desc}\n"
1663 $ hg log -GT "{rev}:{node|short} {desc}\n"
1668 @ 2:8be98ac1a569 added c
1664 @ 2:8be98ac1a569 added c
1669 |
1665 |
1670 o 1:80e6d2c47cfe added b
1666 o 1:80e6d2c47cfe added b
1671 |
1667 |
1672 o 0:f7ad41964313 added a
1668 o 0:f7ad41964313 added a
1673
1669
1674 $ hg up 0
1670 $ hg up 0
1675 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1671 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1676 $ echo bar > b
1672 $ echo bar > b
1677 $ hg add b
1673 $ hg add b
1678 $ hg ci -m "bar to b"
1674 $ hg ci -m "bar to b"
1679 created new head
1675 created new head
1680 $ hg graft -r 1 -r 2
1676 $ hg graft -r 1 -r 2
1681 grafting 1:80e6d2c47cfe "added b"
1677 grafting 1:80e6d2c47cfe "added b"
1682 merging b
1678 merging b
1683 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1679 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1684 abort: unresolved conflicts, can't continue
1680 abort: unresolved conflicts, can't continue
1685 (use 'hg resolve' and 'hg graft --continue')
1681 (use 'hg resolve' and 'hg graft --continue')
1686 [255]
1682 [255]
1687
1683
1688 Writing the nodes in old format to graftstate
1684 Writing the nodes in old format to graftstate
1689
1685
1690 $ hg log -r 1 -r 2 -T '{node}\n' > .hg/graftstate
1686 $ hg log -r 1 -r 2 -T '{node}\n' > .hg/graftstate
1691 $ echo foo > b
1687 $ echo foo > b
1692 $ hg resolve -m
1688 $ hg resolve -m
1693 (no more unresolved files)
1689 (no more unresolved files)
1694 continue: hg graft --continue
1690 continue: hg graft --continue
1695 $ hg graft --continue
1691 $ hg graft --continue
1696 grafting 1:80e6d2c47cfe "added b"
1692 grafting 1:80e6d2c47cfe "added b"
1697 grafting 2:8be98ac1a569 "added c"
1693 grafting 2:8be98ac1a569 "added c"
1698
1694
1699 Testing that --user is preserved during conflicts and value is reused while
1695 Testing that --user is preserved during conflicts and value is reused while
1700 running `hg graft --continue`
1696 running `hg graft --continue`
1701
1697
1702 $ hg log -G
1698 $ hg log -G
1703 @ changeset: 5:711e9fa999f1
1699 @ changeset: 5:711e9fa999f1
1704 | tag: tip
1700 | tag: tip
1705 | user: test
1701 | user: test
1706 | date: Thu Jan 01 00:00:00 1970 +0000
1702 | date: Thu Jan 01 00:00:00 1970 +0000
1707 | summary: added c
1703 | summary: added c
1708 |
1704 |
1709 o changeset: 4:e5ad7353b408
1705 o changeset: 4:e5ad7353b408
1710 | user: test
1706 | user: test
1711 | date: Thu Jan 01 00:00:00 1970 +0000
1707 | date: Thu Jan 01 00:00:00 1970 +0000
1712 | summary: added b
1708 | summary: added b
1713 |
1709 |
1714 o changeset: 3:9e887f7a939c
1710 o changeset: 3:9e887f7a939c
1715 | parent: 0:f7ad41964313
1711 | parent: 0:f7ad41964313
1716 | user: test
1712 | user: test
1717 | date: Thu Jan 01 00:00:00 1970 +0000
1713 | date: Thu Jan 01 00:00:00 1970 +0000
1718 | summary: bar to b
1714 | summary: bar to b
1719 |
1715 |
1720 | o changeset: 2:8be98ac1a569
1716 | o changeset: 2:8be98ac1a569
1721 | | user: test
1717 | | user: test
1722 | | date: Thu Jan 01 00:00:00 1970 +0000
1718 | | date: Thu Jan 01 00:00:00 1970 +0000
1723 | | summary: added c
1719 | | summary: added c
1724 | |
1720 | |
1725 | o changeset: 1:80e6d2c47cfe
1721 | o changeset: 1:80e6d2c47cfe
1726 |/ user: test
1722 |/ user: test
1727 | date: Thu Jan 01 00:00:00 1970 +0000
1723 | date: Thu Jan 01 00:00:00 1970 +0000
1728 | summary: added b
1724 | summary: added b
1729 |
1725 |
1730 o changeset: 0:f7ad41964313
1726 o changeset: 0:f7ad41964313
1731 user: test
1727 user: test
1732 date: Thu Jan 01 00:00:00 1970 +0000
1728 date: Thu Jan 01 00:00:00 1970 +0000
1733 summary: added a
1729 summary: added a
1734
1730
1735
1731
1736 $ hg up '.^^'
1732 $ hg up '.^^'
1737 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1733 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1738
1734
1739 $ hg graft -r 1 -r 2 --user batman
1735 $ hg graft -r 1 -r 2 --user batman
1740 grafting 1:80e6d2c47cfe "added b"
1736 grafting 1:80e6d2c47cfe "added b"
1741 merging b
1737 merging b
1742 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1738 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1743 abort: unresolved conflicts, can't continue
1739 abort: unresolved conflicts, can't continue
1744 (use 'hg resolve' and 'hg graft --continue')
1740 (use 'hg resolve' and 'hg graft --continue')
1745 [255]
1741 [255]
1746
1742
1747 $ echo wat > b
1743 $ echo wat > b
1748 $ hg resolve -m
1744 $ hg resolve -m
1749 (no more unresolved files)
1745 (no more unresolved files)
1750 continue: hg graft --continue
1746 continue: hg graft --continue
1751
1747
1752 $ hg graft --continue
1748 $ hg graft --continue
1753 grafting 1:80e6d2c47cfe "added b"
1749 grafting 1:80e6d2c47cfe "added b"
1754 grafting 2:8be98ac1a569 "added c"
1750 grafting 2:8be98ac1a569 "added c"
1755
1751
1756 $ hg log -Gr 3::
1752 $ hg log -Gr 3::
1757 @ changeset: 7:11a36ffaacf2
1753 @ changeset: 7:11a36ffaacf2
1758 | tag: tip
1754 | tag: tip
1759 | user: batman
1755 | user: batman
1760 | date: Thu Jan 01 00:00:00 1970 +0000
1756 | date: Thu Jan 01 00:00:00 1970 +0000
1761 | summary: added c
1757 | summary: added c
1762 |
1758 |
1763 o changeset: 6:76803afc6511
1759 o changeset: 6:76803afc6511
1764 | parent: 3:9e887f7a939c
1760 | parent: 3:9e887f7a939c
1765 | user: batman
1761 | user: batman
1766 | date: Thu Jan 01 00:00:00 1970 +0000
1762 | date: Thu Jan 01 00:00:00 1970 +0000
1767 | summary: added b
1763 | summary: added b
1768 |
1764 |
1769 | o changeset: 5:711e9fa999f1
1765 | o changeset: 5:711e9fa999f1
1770 | | user: test
1766 | | user: test
1771 | | date: Thu Jan 01 00:00:00 1970 +0000
1767 | | date: Thu Jan 01 00:00:00 1970 +0000
1772 | | summary: added c
1768 | | summary: added c
1773 | |
1769 | |
1774 | o changeset: 4:e5ad7353b408
1770 | o changeset: 4:e5ad7353b408
1775 |/ user: test
1771 |/ user: test
1776 | date: Thu Jan 01 00:00:00 1970 +0000
1772 | date: Thu Jan 01 00:00:00 1970 +0000
1777 | summary: added b
1773 | summary: added b
1778 |
1774 |
1779 o changeset: 3:9e887f7a939c
1775 o changeset: 3:9e887f7a939c
1780 | parent: 0:f7ad41964313
1776 | parent: 0:f7ad41964313
1781 ~ user: test
1777 ~ user: test
1782 date: Thu Jan 01 00:00:00 1970 +0000
1778 date: Thu Jan 01 00:00:00 1970 +0000
1783 summary: bar to b
1779 summary: bar to b
1784
1780
1785 Test that --date is preserved and reused in `hg graft --continue`
1781 Test that --date is preserved and reused in `hg graft --continue`
1786
1782
1787 $ hg up '.^^'
1783 $ hg up '.^^'
1788 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1784 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1789 $ hg graft -r 1 -r 2 --date '1234560000 120'
1785 $ hg graft -r 1 -r 2 --date '1234560000 120'
1790 grafting 1:80e6d2c47cfe "added b"
1786 grafting 1:80e6d2c47cfe "added b"
1791 merging b
1787 merging b
1792 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1788 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1793 abort: unresolved conflicts, can't continue
1789 abort: unresolved conflicts, can't continue
1794 (use 'hg resolve' and 'hg graft --continue')
1790 (use 'hg resolve' and 'hg graft --continue')
1795 [255]
1791 [255]
1796
1792
1797 $ echo foobar > b
1793 $ echo foobar > b
1798 $ hg resolve -m
1794 $ hg resolve -m
1799 (no more unresolved files)
1795 (no more unresolved files)
1800 continue: hg graft --continue
1796 continue: hg graft --continue
1801 $ hg graft --continue
1797 $ hg graft --continue
1802 grafting 1:80e6d2c47cfe "added b"
1798 grafting 1:80e6d2c47cfe "added b"
1803 grafting 2:8be98ac1a569 "added c"
1799 grafting 2:8be98ac1a569 "added c"
1804
1800
1805 $ hg log -Gr '.^^::.'
1801 $ hg log -Gr '.^^::.'
1806 @ changeset: 9:1896b76e007a
1802 @ changeset: 9:1896b76e007a
1807 | tag: tip
1803 | tag: tip
1808 | user: test
1804 | user: test
1809 | date: Fri Feb 13 21:18:00 2009 -0002
1805 | date: Fri Feb 13 21:18:00 2009 -0002
1810 | summary: added c
1806 | summary: added c
1811 |
1807 |
1812 o changeset: 8:ce2b4f1632af
1808 o changeset: 8:ce2b4f1632af
1813 | parent: 3:9e887f7a939c
1809 | parent: 3:9e887f7a939c
1814 | user: test
1810 | user: test
1815 | date: Fri Feb 13 21:18:00 2009 -0002
1811 | date: Fri Feb 13 21:18:00 2009 -0002
1816 | summary: added b
1812 | summary: added b
1817 |
1813 |
1818 o changeset: 3:9e887f7a939c
1814 o changeset: 3:9e887f7a939c
1819 | parent: 0:f7ad41964313
1815 | parent: 0:f7ad41964313
1820 ~ user: test
1816 ~ user: test
1821 date: Thu Jan 01 00:00:00 1970 +0000
1817 date: Thu Jan 01 00:00:00 1970 +0000
1822 summary: bar to b
1818 summary: bar to b
1823
1819
1824 Test that --log is preserved and reused in `hg graft --continue`
1820 Test that --log is preserved and reused in `hg graft --continue`
1825
1821
1826 $ hg up '.^^'
1822 $ hg up '.^^'
1827 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1823 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1828 $ hg graft -r 1 -r 2 --log
1824 $ hg graft -r 1 -r 2 --log
1829 grafting 1:80e6d2c47cfe "added b"
1825 grafting 1:80e6d2c47cfe "added b"
1830 merging b
1826 merging b
1831 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1827 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1832 abort: unresolved conflicts, can't continue
1828 abort: unresolved conflicts, can't continue
1833 (use 'hg resolve' and 'hg graft --continue')
1829 (use 'hg resolve' and 'hg graft --continue')
1834 [255]
1830 [255]
1835
1831
1836 $ echo foobar > b
1832 $ echo foobar > b
1837 $ hg resolve -m
1833 $ hg resolve -m
1838 (no more unresolved files)
1834 (no more unresolved files)
1839 continue: hg graft --continue
1835 continue: hg graft --continue
1840
1836
1841 $ hg graft --continue
1837 $ hg graft --continue
1842 grafting 1:80e6d2c47cfe "added b"
1838 grafting 1:80e6d2c47cfe "added b"
1843 grafting 2:8be98ac1a569 "added c"
1839 grafting 2:8be98ac1a569 "added c"
1844
1840
1845 $ hg log -GT "{rev}:{node|short} {desc}" -r '.^^::.'
1841 $ hg log -GT "{rev}:{node|short} {desc}" -r '.^^::.'
1846 @ 11:30c1050a58b2 added c
1842 @ 11:30c1050a58b2 added c
1847 | (grafted from 8be98ac1a56990c2d9ca6861041b8390af7bd6f3)
1843 | (grafted from 8be98ac1a56990c2d9ca6861041b8390af7bd6f3)
1848 o 10:ec7eda2313e2 added b
1844 o 10:ec7eda2313e2 added b
1849 | (grafted from 80e6d2c47cfe5b3185519568327a17a061c7efb6)
1845 | (grafted from 80e6d2c47cfe5b3185519568327a17a061c7efb6)
1850 o 3:9e887f7a939c bar to b
1846 o 3:9e887f7a939c bar to b
1851 |
1847 |
1852 ~
1848 ~
1853
1849
1854 $ cd ..
1850 $ cd ..
1855
1851
1856 Testing the --stop flag of `hg graft` which stops the interrupted graft
1852 Testing the --stop flag of `hg graft` which stops the interrupted graft
1857
1853
1858 $ hg init stopgraft
1854 $ hg init stopgraft
1859 $ cd stopgraft
1855 $ cd stopgraft
1860 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1856 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1861
1857
1862 $ hg log -G
1858 $ hg log -G
1863 @ changeset: 3:9150fe93bec6
1859 @ changeset: 3:9150fe93bec6
1864 | tag: tip
1860 | tag: tip
1865 | user: test
1861 | user: test
1866 | date: Thu Jan 01 00:00:00 1970 +0000
1862 | date: Thu Jan 01 00:00:00 1970 +0000
1867 | summary: added d
1863 | summary: added d
1868 |
1864 |
1869 o changeset: 2:155349b645be
1865 o changeset: 2:155349b645be
1870 | user: test
1866 | user: test
1871 | date: Thu Jan 01 00:00:00 1970 +0000
1867 | date: Thu Jan 01 00:00:00 1970 +0000
1872 | summary: added c
1868 | summary: added c
1873 |
1869 |
1874 o changeset: 1:5f6d8a4bf34a
1870 o changeset: 1:5f6d8a4bf34a
1875 | user: test
1871 | user: test
1876 | date: Thu Jan 01 00:00:00 1970 +0000
1872 | date: Thu Jan 01 00:00:00 1970 +0000
1877 | summary: added b
1873 | summary: added b
1878 |
1874 |
1879 o changeset: 0:9092f1db7931
1875 o changeset: 0:9092f1db7931
1880 user: test
1876 user: test
1881 date: Thu Jan 01 00:00:00 1970 +0000
1877 date: Thu Jan 01 00:00:00 1970 +0000
1882 summary: added a
1878 summary: added a
1883
1879
1884 $ hg up '.^^'
1880 $ hg up '.^^'
1885 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1881 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1886
1882
1887 $ echo foo > d
1883 $ echo foo > d
1888 $ hg ci -Aqm "added foo to d"
1884 $ hg ci -Aqm "added foo to d"
1889
1885
1890 $ hg graft --stop
1886 $ hg graft --stop
1891 abort: no interrupted graft found
1887 abort: no interrupted graft found
1892 [255]
1888 [255]
1893
1889
1894 $ hg graft -r 3
1890 $ hg graft -r 3
1895 grafting 3:9150fe93bec6 "added d"
1891 grafting 3:9150fe93bec6 "added d"
1896 merging d
1892 merging d
1897 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1893 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1898 abort: unresolved conflicts, can't continue
1894 abort: unresolved conflicts, can't continue
1899 (use 'hg resolve' and 'hg graft --continue')
1895 (use 'hg resolve' and 'hg graft --continue')
1900 [255]
1896 [255]
1901
1897
1902 $ hg graft --stop --continue
1898 $ hg graft --stop --continue
1903 abort: cannot use '--continue' and '--stop' together
1899 abort: cannot use '--continue' and '--stop' together
1904 [255]
1900 [255]
1905
1901
1906 $ hg graft --stop -U
1902 $ hg graft --stop -U
1907 abort: cannot specify any other flag with '--stop'
1903 abort: cannot specify any other flag with '--stop'
1908 [255]
1904 [255]
1909 $ hg graft --stop --rev 4
1905 $ hg graft --stop --rev 4
1910 abort: cannot specify any other flag with '--stop'
1906 abort: cannot specify any other flag with '--stop'
1911 [255]
1907 [255]
1912 $ hg graft --stop --log
1908 $ hg graft --stop --log
1913 abort: cannot specify any other flag with '--stop'
1909 abort: cannot specify any other flag with '--stop'
1914 [255]
1910 [255]
1915
1911
1916 $ hg graft --stop
1912 $ hg graft --stop
1917 stopped the interrupted graft
1913 stopped the interrupted graft
1918 working directory is now at a0deacecd59d
1914 working directory is now at a0deacecd59d
1919
1915
1920 $ hg diff
1916 $ hg diff
1921
1917
1922 $ hg log -Gr '.'
1918 $ hg log -Gr '.'
1923 @ changeset: 4:a0deacecd59d
1919 @ changeset: 4:a0deacecd59d
1924 | tag: tip
1920 | tag: tip
1925 ~ parent: 1:5f6d8a4bf34a
1921 ~ parent: 1:5f6d8a4bf34a
1926 user: test
1922 user: test
1927 date: Thu Jan 01 00:00:00 1970 +0000
1923 date: Thu Jan 01 00:00:00 1970 +0000
1928 summary: added foo to d
1924 summary: added foo to d
1929
1925
1930 $ hg graft -r 2 -r 3
1926 $ hg graft -r 2 -r 3
1931 grafting 2:155349b645be "added c"
1927 grafting 2:155349b645be "added c"
1932 grafting 3:9150fe93bec6 "added d"
1928 grafting 3:9150fe93bec6 "added d"
1933 merging d
1929 merging d
1934 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1930 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1935 abort: unresolved conflicts, can't continue
1931 abort: unresolved conflicts, can't continue
1936 (use 'hg resolve' and 'hg graft --continue')
1932 (use 'hg resolve' and 'hg graft --continue')
1937 [255]
1933 [255]
1938
1934
1939 $ hg graft --stop
1935 $ hg graft --stop
1940 stopped the interrupted graft
1936 stopped the interrupted graft
1941 working directory is now at 75b447541a9e
1937 working directory is now at 75b447541a9e
1942
1938
1943 $ hg diff
1939 $ hg diff
1944
1940
1945 $ hg log -G -T "{rev}:{node|short} {desc}"
1941 $ hg log -G -T "{rev}:{node|short} {desc}"
1946 @ 5:75b447541a9e added c
1942 @ 5:75b447541a9e added c
1947 |
1943 |
1948 o 4:a0deacecd59d added foo to d
1944 o 4:a0deacecd59d added foo to d
1949 |
1945 |
1950 | o 3:9150fe93bec6 added d
1946 | o 3:9150fe93bec6 added d
1951 | |
1947 | |
1952 | o 2:155349b645be added c
1948 | o 2:155349b645be added c
1953 |/
1949 |/
1954 o 1:5f6d8a4bf34a added b
1950 o 1:5f6d8a4bf34a added b
1955 |
1951 |
1956 o 0:9092f1db7931 added a
1952 o 0:9092f1db7931 added a
1957
1953
1958 $ cd ..
1954 $ cd ..
1959
1955
1960 Testing the --abort flag for `hg graft` which aborts and rollback to state
1956 Testing the --abort flag for `hg graft` which aborts and rollback to state
1961 before the graft
1957 before the graft
1962
1958
1963 $ hg init abortgraft
1959 $ hg init abortgraft
1964 $ cd abortgraft
1960 $ cd abortgraft
1965 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1961 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1966
1962
1967 $ hg up '.^^'
1963 $ hg up '.^^'
1968 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1964 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1969
1965
1970 $ echo x > x
1966 $ echo x > x
1971 $ hg ci -Aqm "added x"
1967 $ hg ci -Aqm "added x"
1972 $ hg up '.^'
1968 $ hg up '.^'
1973 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1969 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1974 $ echo foo > c
1970 $ echo foo > c
1975 $ hg ci -Aqm "added foo to c"
1971 $ hg ci -Aqm "added foo to c"
1976
1972
1977 $ hg log -GT "{rev}:{node|short} {desc}"
1973 $ hg log -GT "{rev}:{node|short} {desc}"
1978 @ 5:36b793615f78 added foo to c
1974 @ 5:36b793615f78 added foo to c
1979 |
1975 |
1980 | o 4:863a25e1a9ea added x
1976 | o 4:863a25e1a9ea added x
1981 |/
1977 |/
1982 | o 3:9150fe93bec6 added d
1978 | o 3:9150fe93bec6 added d
1983 | |
1979 | |
1984 | o 2:155349b645be added c
1980 | o 2:155349b645be added c
1985 |/
1981 |/
1986 o 1:5f6d8a4bf34a added b
1982 o 1:5f6d8a4bf34a added b
1987 |
1983 |
1988 o 0:9092f1db7931 added a
1984 o 0:9092f1db7931 added a
1989
1985
1990 $ hg up 9150fe93bec6
1986 $ hg up 9150fe93bec6
1991 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1987 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1992
1988
1993 $ hg graft --abort
1989 $ hg graft --abort
1994 abort: no interrupted graft to abort
1990 abort: no interrupted graft to abort
1995 [255]
1991 [255]
1996
1992
1997 when stripping is required
1993 when stripping is required
1998 $ hg graft -r 4 -r 5
1994 $ hg graft -r 4 -r 5
1999 grafting 4:863a25e1a9ea "added x"
1995 grafting 4:863a25e1a9ea "added x"
2000 grafting 5:36b793615f78 "added foo to c" (tip)
1996 grafting 5:36b793615f78 "added foo to c" (tip)
2001 merging c
1997 merging c
2002 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
1998 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2003 abort: unresolved conflicts, can't continue
1999 abort: unresolved conflicts, can't continue
2004 (use 'hg resolve' and 'hg graft --continue')
2000 (use 'hg resolve' and 'hg graft --continue')
2005 [255]
2001 [255]
2006
2002
2007 $ hg graft --continue --abort
2003 $ hg graft --continue --abort
2008 abort: cannot use '--continue' and '--abort' together
2004 abort: cannot use '--continue' and '--abort' together
2009 [255]
2005 [255]
2010
2006
2011 $ hg graft --abort --stop
2007 $ hg graft --abort --stop
2012 abort: cannot use '--abort' and '--stop' together
2008 abort: cannot use '--abort' and '--stop' together
2013 [255]
2009 [255]
2014
2010
2015 $ hg graft --abort --currentuser
2011 $ hg graft --abort --currentuser
2016 abort: cannot specify any other flag with '--abort'
2012 abort: cannot specify any other flag with '--abort'
2017 [255]
2013 [255]
2018
2014
2019 $ hg graft --abort --edit
2015 $ hg graft --abort --edit
2020 abort: cannot specify any other flag with '--abort'
2016 abort: cannot specify any other flag with '--abort'
2021 [255]
2017 [255]
2022
2018
2023 $ hg graft --abort
2019 $ hg graft --abort
2024 graft aborted
2020 graft aborted
2025 working directory is now at 9150fe93bec6
2021 working directory is now at 9150fe93bec6
2026 $ hg log -GT "{rev}:{node|short} {desc}"
2022 $ hg log -GT "{rev}:{node|short} {desc}"
2027 o 5:36b793615f78 added foo to c
2023 o 5:36b793615f78 added foo to c
2028 |
2024 |
2029 | o 4:863a25e1a9ea added x
2025 | o 4:863a25e1a9ea added x
2030 |/
2026 |/
2031 | @ 3:9150fe93bec6 added d
2027 | @ 3:9150fe93bec6 added d
2032 | |
2028 | |
2033 | o 2:155349b645be added c
2029 | o 2:155349b645be added c
2034 |/
2030 |/
2035 o 1:5f6d8a4bf34a added b
2031 o 1:5f6d8a4bf34a added b
2036 |
2032 |
2037 o 0:9092f1db7931 added a
2033 o 0:9092f1db7931 added a
2038
2034
2039 when stripping is not required
2035 when stripping is not required
2040 $ hg graft -r 5
2036 $ hg graft -r 5
2041 grafting 5:36b793615f78 "added foo to c" (tip)
2037 grafting 5:36b793615f78 "added foo to c" (tip)
2042 merging c
2038 merging c
2043 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2039 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2044 abort: unresolved conflicts, can't continue
2040 abort: unresolved conflicts, can't continue
2045 (use 'hg resolve' and 'hg graft --continue')
2041 (use 'hg resolve' and 'hg graft --continue')
2046 [255]
2042 [255]
2047
2043
2048 $ hg graft --abort
2044 $ hg graft --abort
2049 graft aborted
2045 graft aborted
2050 working directory is now at 9150fe93bec6
2046 working directory is now at 9150fe93bec6
2051 $ hg log -GT "{rev}:{node|short} {desc}"
2047 $ hg log -GT "{rev}:{node|short} {desc}"
2052 o 5:36b793615f78 added foo to c
2048 o 5:36b793615f78 added foo to c
2053 |
2049 |
2054 | o 4:863a25e1a9ea added x
2050 | o 4:863a25e1a9ea added x
2055 |/
2051 |/
2056 | @ 3:9150fe93bec6 added d
2052 | @ 3:9150fe93bec6 added d
2057 | |
2053 | |
2058 | o 2:155349b645be added c
2054 | o 2:155349b645be added c
2059 |/
2055 |/
2060 o 1:5f6d8a4bf34a added b
2056 o 1:5f6d8a4bf34a added b
2061 |
2057 |
2062 o 0:9092f1db7931 added a
2058 o 0:9092f1db7931 added a
2063
2059
2064 when some of the changesets became public
2060 when some of the changesets became public
2065
2061
2066 $ hg graft -r 4 -r 5
2062 $ hg graft -r 4 -r 5
2067 grafting 4:863a25e1a9ea "added x"
2063 grafting 4:863a25e1a9ea "added x"
2068 grafting 5:36b793615f78 "added foo to c" (tip)
2064 grafting 5:36b793615f78 "added foo to c" (tip)
2069 merging c
2065 merging c
2070 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2066 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2071 abort: unresolved conflicts, can't continue
2067 abort: unresolved conflicts, can't continue
2072 (use 'hg resolve' and 'hg graft --continue')
2068 (use 'hg resolve' and 'hg graft --continue')
2073 [255]
2069 [255]
2074
2070
2075 $ hg log -GT "{rev}:{node|short} {desc}"
2071 $ hg log -GT "{rev}:{node|short} {desc}"
2076 @ 6:6ec71c037d94 added x
2072 @ 6:6ec71c037d94 added x
2077 |
2073 |
2078 | o 5:36b793615f78 added foo to c
2074 | o 5:36b793615f78 added foo to c
2079 | |
2075 | |
2080 | | o 4:863a25e1a9ea added x
2076 | | o 4:863a25e1a9ea added x
2081 | |/
2077 | |/
2082 o | 3:9150fe93bec6 added d
2078 o | 3:9150fe93bec6 added d
2083 | |
2079 | |
2084 o | 2:155349b645be added c
2080 o | 2:155349b645be added c
2085 |/
2081 |/
2086 o 1:5f6d8a4bf34a added b
2082 o 1:5f6d8a4bf34a added b
2087 |
2083 |
2088 o 0:9092f1db7931 added a
2084 o 0:9092f1db7931 added a
2089
2085
2090 $ hg phase -r 6 --public
2086 $ hg phase -r 6 --public
2091
2087
2092 $ hg graft --abort
2088 $ hg graft --abort
2093 cannot clean up public changesets 6ec71c037d94
2089 cannot clean up public changesets 6ec71c037d94
2094 graft aborted
2090 graft aborted
2095 working directory is now at 6ec71c037d94
2091 working directory is now at 6ec71c037d94
2096
2092
2097 when we created new changesets on top of existing one
2093 when we created new changesets on top of existing one
2098
2094
2099 $ hg up '.^^'
2095 $ hg up '.^^'
2100 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2096 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2101 $ echo y > y
2097 $ echo y > y
2102 $ hg ci -Aqm "added y"
2098 $ hg ci -Aqm "added y"
2103 $ echo z > z
2099 $ echo z > z
2104 $ hg ci -Aqm "added z"
2100 $ hg ci -Aqm "added z"
2105
2101
2106 $ hg up 3
2102 $ hg up 3
2107 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
2103 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
2108 $ hg log -GT "{rev}:{node|short} {desc}"
2104 $ hg log -GT "{rev}:{node|short} {desc}"
2109 o 8:637f9e9bbfd4 added z
2105 o 8:637f9e9bbfd4 added z
2110 |
2106 |
2111 o 7:123221671fd4 added y
2107 o 7:123221671fd4 added y
2112 |
2108 |
2113 | o 6:6ec71c037d94 added x
2109 | o 6:6ec71c037d94 added x
2114 | |
2110 | |
2115 | | o 5:36b793615f78 added foo to c
2111 | | o 5:36b793615f78 added foo to c
2116 | | |
2112 | | |
2117 | | | o 4:863a25e1a9ea added x
2113 | | | o 4:863a25e1a9ea added x
2118 | | |/
2114 | | |/
2119 | @ | 3:9150fe93bec6 added d
2115 | @ | 3:9150fe93bec6 added d
2120 |/ /
2116 |/ /
2121 o / 2:155349b645be added c
2117 o / 2:155349b645be added c
2122 |/
2118 |/
2123 o 1:5f6d8a4bf34a added b
2119 o 1:5f6d8a4bf34a added b
2124 |
2120 |
2125 o 0:9092f1db7931 added a
2121 o 0:9092f1db7931 added a
2126
2122
2127 $ hg graft -r 8 -r 7 -r 5
2123 $ hg graft -r 8 -r 7 -r 5
2128 grafting 8:637f9e9bbfd4 "added z" (tip)
2124 grafting 8:637f9e9bbfd4 "added z" (tip)
2129 grafting 7:123221671fd4 "added y"
2125 grafting 7:123221671fd4 "added y"
2130 grafting 5:36b793615f78 "added foo to c"
2126 grafting 5:36b793615f78 "added foo to c"
2131 merging c
2127 merging c
2132 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2128 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2133 abort: unresolved conflicts, can't continue
2129 abort: unresolved conflicts, can't continue
2134 (use 'hg resolve' and 'hg graft --continue')
2130 (use 'hg resolve' and 'hg graft --continue')
2135 [255]
2131 [255]
2136
2132
2137 $ cd ..
2133 $ cd ..
2138 $ hg init pullrepo
2134 $ hg init pullrepo
2139 $ cd pullrepo
2135 $ cd pullrepo
2140 $ cat >> .hg/hgrc <<EOF
2136 $ cat >> .hg/hgrc <<EOF
2141 > [phases]
2137 > [phases]
2142 > publish=False
2138 > publish=False
2143 > EOF
2139 > EOF
2144 $ hg pull ../abortgraft --config phases.publish=False
2140 $ hg pull ../abortgraft --config phases.publish=False
2145 pulling from ../abortgraft
2141 pulling from ../abortgraft
2146 requesting all changes
2142 requesting all changes
2147 adding changesets
2143 adding changesets
2148 adding manifests
2144 adding manifests
2149 adding file changes
2145 adding file changes
2150 added 11 changesets with 9 changes to 8 files (+4 heads)
2146 added 11 changesets with 9 changes to 8 files (+4 heads)
2151 new changesets 9092f1db7931:6b98ff0062dd (6 drafts)
2147 new changesets 9092f1db7931:6b98ff0062dd (6 drafts)
2152 (run 'hg heads' to see heads, 'hg merge' to merge)
2148 (run 'hg heads' to see heads, 'hg merge' to merge)
2153 $ hg up 9
2149 $ hg up 9
2154 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
2150 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
2155 $ echo w > w
2151 $ echo w > w
2156 $ hg ci -Aqm "added w" --config phases.publish=False
2152 $ hg ci -Aqm "added w" --config phases.publish=False
2157
2153
2158 $ cd ../abortgraft
2154 $ cd ../abortgraft
2159 $ hg pull ../pullrepo
2155 $ hg pull ../pullrepo
2160 pulling from ../pullrepo
2156 pulling from ../pullrepo
2161 searching for changes
2157 searching for changes
2162 adding changesets
2158 adding changesets
2163 adding manifests
2159 adding manifests
2164 adding file changes
2160 adding file changes
2165 added 1 changesets with 1 changes to 1 files (+1 heads)
2161 added 1 changesets with 1 changes to 1 files (+1 heads)
2166 new changesets 311dfc6cf3bf (1 drafts)
2162 new changesets 311dfc6cf3bf (1 drafts)
2167 (run 'hg heads .' to see heads, 'hg merge' to merge)
2163 (run 'hg heads .' to see heads, 'hg merge' to merge)
2168
2164
2169 $ hg graft --abort
2165 $ hg graft --abort
2170 new changesets detected on destination branch, can't strip
2166 new changesets detected on destination branch, can't strip
2171 graft aborted
2167 graft aborted
2172 working directory is now at 6b98ff0062dd
2168 working directory is now at 6b98ff0062dd
2173
2169
2174 $ cd ..
2170 $ cd ..
2175
2171
2176 ============================
2172 ============================
2177 Testing --no-commit option:|
2173 Testing --no-commit option:|
2178 ============================
2174 ============================
2179
2175
2180 $ hg init nocommit
2176 $ hg init nocommit
2181 $ cd nocommit
2177 $ cd nocommit
2182 $ echo a > a
2178 $ echo a > a
2183 $ hg ci -qAma
2179 $ hg ci -qAma
2184 $ echo b > b
2180 $ echo b > b
2185 $ hg ci -qAmb
2181 $ hg ci -qAmb
2186 $ hg up -q 0
2182 $ hg up -q 0
2187 $ echo c > c
2183 $ echo c > c
2188 $ hg ci -qAmc
2184 $ hg ci -qAmc
2189 $ hg log -GT "{rev}:{node|short} {desc}\n"
2185 $ hg log -GT "{rev}:{node|short} {desc}\n"
2190 @ 2:d36c0562f908 c
2186 @ 2:d36c0562f908 c
2191 |
2187 |
2192 | o 1:d2ae7f538514 b
2188 | o 1:d2ae7f538514 b
2193 |/
2189 |/
2194 o 0:cb9a9f314b8b a
2190 o 0:cb9a9f314b8b a
2195
2191
2196
2192
2197 Check reporting when --no-commit used with non-applicable options:
2193 Check reporting when --no-commit used with non-applicable options:
2198
2194
2199 $ hg graft 1 --no-commit -e
2195 $ hg graft 1 --no-commit -e
2200 abort: cannot specify --no-commit and --edit together
2196 abort: cannot specify --no-commit and --edit together
2201 [255]
2197 [255]
2202
2198
2203 $ hg graft 1 --no-commit --log
2199 $ hg graft 1 --no-commit --log
2204 abort: cannot specify --no-commit and --log together
2200 abort: cannot specify --no-commit and --log together
2205 [255]
2201 [255]
2206
2202
2207 $ hg graft 1 --no-commit -D
2203 $ hg graft 1 --no-commit -D
2208 abort: cannot specify --no-commit and --currentdate together
2204 abort: cannot specify --no-commit and --currentdate together
2209 [255]
2205 [255]
2210
2206
2211 Test --no-commit is working:
2207 Test --no-commit is working:
2212 $ hg graft 1 --no-commit
2208 $ hg graft 1 --no-commit
2213 grafting 1:d2ae7f538514 "b"
2209 grafting 1:d2ae7f538514 "b"
2214
2210
2215 $ hg log -GT "{rev}:{node|short} {desc}\n"
2211 $ hg log -GT "{rev}:{node|short} {desc}\n"
2216 @ 2:d36c0562f908 c
2212 @ 2:d36c0562f908 c
2217 |
2213 |
2218 | o 1:d2ae7f538514 b
2214 | o 1:d2ae7f538514 b
2219 |/
2215 |/
2220 o 0:cb9a9f314b8b a
2216 o 0:cb9a9f314b8b a
2221
2217
2222
2218
2223 $ hg diff
2219 $ hg diff
2224 diff -r d36c0562f908 b
2220 diff -r d36c0562f908 b
2225 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2221 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2226 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2222 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2227 @@ -0,0 +1,1 @@
2223 @@ -0,0 +1,1 @@
2228 +b
2224 +b
2229
2225
2230 Prepare wrdir to check --no-commit is resepected after --continue:
2226 Prepare wrdir to check --no-commit is resepected after --continue:
2231
2227
2232 $ hg up -qC
2228 $ hg up -qC
2233 $ echo A>a
2229 $ echo A>a
2234 $ hg ci -qm "A in file a"
2230 $ hg ci -qm "A in file a"
2235 $ hg up -q 1
2231 $ hg up -q 1
2236 $ echo B>a
2232 $ echo B>a
2237 $ hg ci -qm "B in file a"
2233 $ hg ci -qm "B in file a"
2238 $ hg log -GT "{rev}:{node|short} {desc}\n"
2234 $ hg log -GT "{rev}:{node|short} {desc}\n"
2239 @ 4:2aa9ad1006ff B in file a
2235 @ 4:2aa9ad1006ff B in file a
2240 |
2236 |
2241 | o 3:09e253b87e17 A in file a
2237 | o 3:09e253b87e17 A in file a
2242 | |
2238 | |
2243 | o 2:d36c0562f908 c
2239 | o 2:d36c0562f908 c
2244 | |
2240 | |
2245 o | 1:d2ae7f538514 b
2241 o | 1:d2ae7f538514 b
2246 |/
2242 |/
2247 o 0:cb9a9f314b8b a
2243 o 0:cb9a9f314b8b a
2248
2244
2249
2245
2250 $ hg graft 3 --no-commit
2246 $ hg graft 3 --no-commit
2251 grafting 3:09e253b87e17 "A in file a"
2247 grafting 3:09e253b87e17 "A in file a"
2252 merging a
2248 merging a
2253 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2249 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2254 abort: unresolved conflicts, can't continue
2250 abort: unresolved conflicts, can't continue
2255 (use 'hg resolve' and 'hg graft --continue')
2251 (use 'hg resolve' and 'hg graft --continue')
2256 [255]
2252 [255]
2257
2253
2258 Resolve conflict:
2254 Resolve conflict:
2259 $ echo A>a
2255 $ echo A>a
2260 $ hg resolve --mark
2256 $ hg resolve --mark
2261 (no more unresolved files)
2257 (no more unresolved files)
2262 continue: hg graft --continue
2258 continue: hg graft --continue
2263
2259
2264 $ hg graft --continue
2260 $ hg graft --continue
2265 grafting 3:09e253b87e17 "A in file a"
2261 grafting 3:09e253b87e17 "A in file a"
2266 $ hg log -GT "{rev}:{node|short} {desc}\n"
2262 $ hg log -GT "{rev}:{node|short} {desc}\n"
2267 @ 4:2aa9ad1006ff B in file a
2263 @ 4:2aa9ad1006ff B in file a
2268 |
2264 |
2269 | o 3:09e253b87e17 A in file a
2265 | o 3:09e253b87e17 A in file a
2270 | |
2266 | |
2271 | o 2:d36c0562f908 c
2267 | o 2:d36c0562f908 c
2272 | |
2268 | |
2273 o | 1:d2ae7f538514 b
2269 o | 1:d2ae7f538514 b
2274 |/
2270 |/
2275 o 0:cb9a9f314b8b a
2271 o 0:cb9a9f314b8b a
2276
2272
2277 $ hg diff
2273 $ hg diff
2278 diff -r 2aa9ad1006ff a
2274 diff -r 2aa9ad1006ff a
2279 --- a/a Thu Jan 01 00:00:00 1970 +0000
2275 --- a/a Thu Jan 01 00:00:00 1970 +0000
2280 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2276 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2281 @@ -1,1 +1,1 @@
2277 @@ -1,1 +1,1 @@
2282 -B
2278 -B
2283 +A
2279 +A
2284
2280
2285 $ hg up -qC
2281 $ hg up -qC
2286
2282
2287 Check --no-commit is resepected when passed with --continue:
2283 Check --no-commit is resepected when passed with --continue:
2288
2284
2289 $ hg graft 3
2285 $ hg graft 3
2290 grafting 3:09e253b87e17 "A in file a"
2286 grafting 3:09e253b87e17 "A in file a"
2291 merging a
2287 merging a
2292 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2288 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2293 abort: unresolved conflicts, can't continue
2289 abort: unresolved conflicts, can't continue
2294 (use 'hg resolve' and 'hg graft --continue')
2290 (use 'hg resolve' and 'hg graft --continue')
2295 [255]
2291 [255]
2296
2292
2297 Resolve conflict:
2293 Resolve conflict:
2298 $ echo A>a
2294 $ echo A>a
2299 $ hg resolve --mark
2295 $ hg resolve --mark
2300 (no more unresolved files)
2296 (no more unresolved files)
2301 continue: hg graft --continue
2297 continue: hg graft --continue
2302
2298
2303 $ hg graft --continue --no-commit
2299 $ hg graft --continue --no-commit
2304 grafting 3:09e253b87e17 "A in file a"
2300 grafting 3:09e253b87e17 "A in file a"
2305 $ hg diff
2301 $ hg diff
2306 diff -r 2aa9ad1006ff a
2302 diff -r 2aa9ad1006ff a
2307 --- a/a Thu Jan 01 00:00:00 1970 +0000
2303 --- a/a Thu Jan 01 00:00:00 1970 +0000
2308 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2304 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2309 @@ -1,1 +1,1 @@
2305 @@ -1,1 +1,1 @@
2310 -B
2306 -B
2311 +A
2307 +A
2312
2308
2313 $ hg log -GT "{rev}:{node|short} {desc}\n"
2309 $ hg log -GT "{rev}:{node|short} {desc}\n"
2314 @ 4:2aa9ad1006ff B in file a
2310 @ 4:2aa9ad1006ff B in file a
2315 |
2311 |
2316 | o 3:09e253b87e17 A in file a
2312 | o 3:09e253b87e17 A in file a
2317 | |
2313 | |
2318 | o 2:d36c0562f908 c
2314 | o 2:d36c0562f908 c
2319 | |
2315 | |
2320 o | 1:d2ae7f538514 b
2316 o | 1:d2ae7f538514 b
2321 |/
2317 |/
2322 o 0:cb9a9f314b8b a
2318 o 0:cb9a9f314b8b a
2323
2319
2324 $ hg up -qC
2320 $ hg up -qC
2325
2321
2326 Test --no-commit when graft multiple revisions:
2322 Test --no-commit when graft multiple revisions:
2327 When there is conflict:
2323 When there is conflict:
2328 $ hg graft -r "2::3" --no-commit
2324 $ hg graft -r "2::3" --no-commit
2329 grafting 2:d36c0562f908 "c"
2325 grafting 2:d36c0562f908 "c"
2330 grafting 3:09e253b87e17 "A in file a"
2326 grafting 3:09e253b87e17 "A in file a"
2331 merging a
2327 merging a
2332 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2328 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2333 abort: unresolved conflicts, can't continue
2329 abort: unresolved conflicts, can't continue
2334 (use 'hg resolve' and 'hg graft --continue')
2330 (use 'hg resolve' and 'hg graft --continue')
2335 [255]
2331 [255]
2336
2332
2337 $ echo A>a
2333 $ echo A>a
2338 $ hg resolve --mark
2334 $ hg resolve --mark
2339 (no more unresolved files)
2335 (no more unresolved files)
2340 continue: hg graft --continue
2336 continue: hg graft --continue
2341 $ hg graft --continue
2337 $ hg graft --continue
2342 grafting 3:09e253b87e17 "A in file a"
2338 grafting 3:09e253b87e17 "A in file a"
2343 $ hg diff
2339 $ hg diff
2344 diff -r 2aa9ad1006ff a
2340 diff -r 2aa9ad1006ff a
2345 --- a/a Thu Jan 01 00:00:00 1970 +0000
2341 --- a/a Thu Jan 01 00:00:00 1970 +0000
2346 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2342 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2347 @@ -1,1 +1,1 @@
2343 @@ -1,1 +1,1 @@
2348 -B
2344 -B
2349 +A
2345 +A
2350 diff -r 2aa9ad1006ff c
2346 diff -r 2aa9ad1006ff c
2351 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2347 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2352 +++ b/c Thu Jan 01 00:00:00 1970 +0000
2348 +++ b/c Thu Jan 01 00:00:00 1970 +0000
2353 @@ -0,0 +1,1 @@
2349 @@ -0,0 +1,1 @@
2354 +c
2350 +c
2355
2351
2356 $ hg log -GT "{rev}:{node|short} {desc}\n"
2352 $ hg log -GT "{rev}:{node|short} {desc}\n"
2357 @ 4:2aa9ad1006ff B in file a
2353 @ 4:2aa9ad1006ff B in file a
2358 |
2354 |
2359 | o 3:09e253b87e17 A in file a
2355 | o 3:09e253b87e17 A in file a
2360 | |
2356 | |
2361 | o 2:d36c0562f908 c
2357 | o 2:d36c0562f908 c
2362 | |
2358 | |
2363 o | 1:d2ae7f538514 b
2359 o | 1:d2ae7f538514 b
2364 |/
2360 |/
2365 o 0:cb9a9f314b8b a
2361 o 0:cb9a9f314b8b a
2366
2362
2367 $ hg up -qC
2363 $ hg up -qC
2368
2364
2369 When there is no conflict:
2365 When there is no conflict:
2370 $ echo d>d
2366 $ echo d>d
2371 $ hg add d -q
2367 $ hg add d -q
2372 $ hg ci -qmd
2368 $ hg ci -qmd
2373 $ hg up 3 -q
2369 $ hg up 3 -q
2374 $ hg log -GT "{rev}:{node|short} {desc}\n"
2370 $ hg log -GT "{rev}:{node|short} {desc}\n"
2375 o 5:baefa8927fc0 d
2371 o 5:baefa8927fc0 d
2376 |
2372 |
2377 o 4:2aa9ad1006ff B in file a
2373 o 4:2aa9ad1006ff B in file a
2378 |
2374 |
2379 | @ 3:09e253b87e17 A in file a
2375 | @ 3:09e253b87e17 A in file a
2380 | |
2376 | |
2381 | o 2:d36c0562f908 c
2377 | o 2:d36c0562f908 c
2382 | |
2378 | |
2383 o | 1:d2ae7f538514 b
2379 o | 1:d2ae7f538514 b
2384 |/
2380 |/
2385 o 0:cb9a9f314b8b a
2381 o 0:cb9a9f314b8b a
2386
2382
2387
2383
2388 $ hg graft -r 1 -r 5 --no-commit
2384 $ hg graft -r 1 -r 5 --no-commit
2389 grafting 1:d2ae7f538514 "b"
2385 grafting 1:d2ae7f538514 "b"
2390 grafting 5:baefa8927fc0 "d" (tip)
2386 grafting 5:baefa8927fc0 "d" (tip)
2391 $ hg diff
2387 $ hg diff
2392 diff -r 09e253b87e17 b
2388 diff -r 09e253b87e17 b
2393 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2389 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2394 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2390 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2395 @@ -0,0 +1,1 @@
2391 @@ -0,0 +1,1 @@
2396 +b
2392 +b
2397 diff -r 09e253b87e17 d
2393 diff -r 09e253b87e17 d
2398 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2394 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2399 +++ b/d Thu Jan 01 00:00:00 1970 +0000
2395 +++ b/d Thu Jan 01 00:00:00 1970 +0000
2400 @@ -0,0 +1,1 @@
2396 @@ -0,0 +1,1 @@
2401 +d
2397 +d
2402 $ hg log -GT "{rev}:{node|short} {desc}\n"
2398 $ hg log -GT "{rev}:{node|short} {desc}\n"
2403 o 5:baefa8927fc0 d
2399 o 5:baefa8927fc0 d
2404 |
2400 |
2405 o 4:2aa9ad1006ff B in file a
2401 o 4:2aa9ad1006ff B in file a
2406 |
2402 |
2407 | @ 3:09e253b87e17 A in file a
2403 | @ 3:09e253b87e17 A in file a
2408 | |
2404 | |
2409 | o 2:d36c0562f908 c
2405 | o 2:d36c0562f908 c
2410 | |
2406 | |
2411 o | 1:d2ae7f538514 b
2407 o | 1:d2ae7f538514 b
2412 |/
2408 |/
2413 o 0:cb9a9f314b8b a
2409 o 0:cb9a9f314b8b a
2414
2410
2415 $ cd ..
2411 $ cd ..
@@ -1,73 +1,72 b''
1 #require execbit
1 #require execbit
2
2
3 Create extension that can disable exec checks:
3 Create extension that can disable exec checks:
4
4
5 $ cat > noexec.py <<EOF
5 $ cat > noexec.py <<EOF
6 > from mercurial import extensions, util
6 > from mercurial import extensions, util
7 > def setflags(orig, f, l, x):
7 > def setflags(orig, f, l, x):
8 > pass
8 > pass
9 > def checkexec(orig, path):
9 > def checkexec(orig, path):
10 > return False
10 > return False
11 > def extsetup(ui):
11 > def extsetup(ui):
12 > extensions.wrapfunction(util, 'setflags', setflags)
12 > extensions.wrapfunction(util, 'setflags', setflags)
13 > extensions.wrapfunction(util, 'checkexec', checkexec)
13 > extensions.wrapfunction(util, 'checkexec', checkexec)
14 > EOF
14 > EOF
15
15
16 $ hg init unix-repo
16 $ hg init unix-repo
17 $ cd unix-repo
17 $ cd unix-repo
18 $ touch a
18 $ touch a
19 $ hg add a
19 $ hg add a
20 $ hg commit -m 'unix: add a'
20 $ hg commit -m 'unix: add a'
21 $ hg clone . ../win-repo
21 $ hg clone . ../win-repo
22 updating to branch default
22 updating to branch default
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 $ chmod +x a
24 $ chmod +x a
25 $ hg commit -m 'unix: chmod a'
25 $ hg commit -m 'unix: chmod a'
26 $ hg manifest -v
26 $ hg manifest -v
27 755 * a
27 755 * a
28
28
29 $ cd ../win-repo
29 $ cd ../win-repo
30
30
31 $ touch b
31 $ touch b
32 $ hg add b
32 $ hg add b
33 $ hg commit -m 'win: add b'
33 $ hg commit -m 'win: add b'
34
34
35 $ hg manifest -v
35 $ hg manifest -v
36 644 a
36 644 a
37 644 b
37 644 b
38
38
39 $ hg pull
39 $ hg pull
40 pulling from $TESTTMP/unix-repo
40 pulling from $TESTTMP/unix-repo
41 searching for changes
41 searching for changes
42 adding changesets
42 adding changesets
43 adding manifests
43 adding manifests
44 adding file changes
44 adding file changes
45 added 1 changesets with 0 changes to 0 files (+1 heads)
45 added 1 changesets with 0 changes to 0 files (+1 heads)
46 new changesets 2d8bcf2dda39
46 new changesets 2d8bcf2dda39
47 (run 'hg heads' to see heads, 'hg merge' to merge)
47 (run 'hg heads' to see heads, 'hg merge' to merge)
48
48
49 $ hg manifest -v -r tip
49 $ hg manifest -v -r tip
50 755 * a
50 755 * a
51
51
52 Simulate a Windows merge:
52 Simulate a Windows merge:
53
53
54 $ hg --config extensions.n=$TESTTMP/noexec.py merge --debug
54 $ hg --config extensions.n=$TESTTMP/noexec.py merge --debug
55 searching for copies back to rev 1
56 unmatched files in local:
55 unmatched files in local:
57 b
56 b
58 resolving manifests
57 resolving manifests
59 branchmerge: True, force: False, partial: False
58 branchmerge: True, force: False, partial: False
60 ancestor: a03b0deabf2b, local: d6fa54f68ae1+, remote: 2d8bcf2dda39
59 ancestor: a03b0deabf2b, local: d6fa54f68ae1+, remote: 2d8bcf2dda39
61 a: update permissions -> e
60 a: update permissions -> e
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 (branch merge, don't forget to commit)
62 (branch merge, don't forget to commit)
64
63
65 Simulate a Windows commit:
64 Simulate a Windows commit:
66
65
67 $ hg --config extensions.n=$TESTTMP/noexec.py commit -m 'win: merge'
66 $ hg --config extensions.n=$TESTTMP/noexec.py commit -m 'win: merge'
68
67
69 $ hg manifest -v
68 $ hg manifest -v
70 755 * a
69 755 * a
71 644 b
70 644 b
72
71
73 $ cd ..
72 $ cd ..
@@ -1,55 +1,54 b''
1 https://bz.mercurial-scm.org/522
1 https://bz.mercurial-scm.org/522
2
2
3 In the merge below, the file "foo" has the same contents in both
3 In the merge below, the file "foo" has the same contents in both
4 parents, but if we look at the file-level history, we'll notice that
4 parents, but if we look at the file-level history, we'll notice that
5 the version in p1 is an ancestor of the version in p2. This test makes
5 the version in p1 is an ancestor of the version in p2. This test makes
6 sure that we'll use the version from p2 in the manifest of the merge
6 sure that we'll use the version from p2 in the manifest of the merge
7 revision.
7 revision.
8
8
9 $ hg init
9 $ hg init
10
10
11 $ echo foo > foo
11 $ echo foo > foo
12 $ hg ci -qAm 'add foo'
12 $ hg ci -qAm 'add foo'
13
13
14 $ echo bar >> foo
14 $ echo bar >> foo
15 $ hg ci -m 'change foo'
15 $ hg ci -m 'change foo'
16
16
17 $ hg backout -r tip -m 'backout changed foo'
17 $ hg backout -r tip -m 'backout changed foo'
18 reverting foo
18 reverting foo
19 changeset 2:4d9e78aaceee backs out changeset 1:b515023e500e
19 changeset 2:4d9e78aaceee backs out changeset 1:b515023e500e
20
20
21 $ hg up -C 0
21 $ hg up -C 0
22 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
23
23
24 $ touch bar
24 $ touch bar
25 $ hg ci -qAm 'add bar'
25 $ hg ci -qAm 'add bar'
26
26
27 $ hg merge --debug
27 $ hg merge --debug
28 searching for copies back to rev 1
29 unmatched files in local:
28 unmatched files in local:
30 bar
29 bar
31 resolving manifests
30 resolving manifests
32 branchmerge: True, force: False, partial: False
31 branchmerge: True, force: False, partial: False
33 ancestor: bbd179dfa0a7, local: 71766447bdbb+, remote: 4d9e78aaceee
32 ancestor: bbd179dfa0a7, local: 71766447bdbb+, remote: 4d9e78aaceee
34 foo: remote is newer -> g
33 foo: remote is newer -> g
35 getting foo
34 getting foo
36 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
35 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 (branch merge, don't forget to commit)
36 (branch merge, don't forget to commit)
38
37
39 $ hg debugstate | grep foo
38 $ hg debugstate | grep foo
40 m 0 -2 unset foo
39 m 0 -2 unset foo
41
40
42 $ hg st -A foo
41 $ hg st -A foo
43 M foo
42 M foo
44
43
45 $ hg ci -m 'merge'
44 $ hg ci -m 'merge'
46
45
47 $ hg manifest --debug | grep foo
46 $ hg manifest --debug | grep foo
48 c6fc755d7e68f49f880599da29f15add41f42f5a 644 foo
47 c6fc755d7e68f49f880599da29f15add41f42f5a 644 foo
49
48
50 $ hg debugindex foo
49 $ hg debugindex foo
51 rev linkrev nodeid p1 p2
50 rev linkrev nodeid p1 p2
52 0 0 2ed2a3912a0b 000000000000 000000000000
51 0 0 2ed2a3912a0b 000000000000 000000000000
53 1 1 6f4310b00b9a 2ed2a3912a0b 000000000000
52 1 1 6f4310b00b9a 2ed2a3912a0b 000000000000
54 2 2 c6fc755d7e68 6f4310b00b9a 000000000000
53 2 2 c6fc755d7e68 6f4310b00b9a 000000000000
55
54
@@ -1,99 +1,96 b''
1 https://bz.mercurial-scm.org/672
1 https://bz.mercurial-scm.org/672
2
2
3 # 0-2-4
3 # 0-2-4
4 # \ \ \
4 # \ \ \
5 # 1-3-5
5 # 1-3-5
6 #
6 #
7 # rename in #1, content change in #4.
7 # rename in #1, content change in #4.
8
8
9 $ hg init
9 $ hg init
10
10
11 $ touch 1
11 $ touch 1
12 $ touch 2
12 $ touch 2
13 $ hg commit -Am init # 0
13 $ hg commit -Am init # 0
14 adding 1
14 adding 1
15 adding 2
15 adding 2
16
16
17 $ hg rename 1 1a
17 $ hg rename 1 1a
18 $ hg commit -m rename # 1
18 $ hg commit -m rename # 1
19
19
20 $ hg co -C 0
20 $ hg co -C 0
21 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
21 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
22
22
23 $ echo unrelated >> 2
23 $ echo unrelated >> 2
24 $ hg ci -m unrelated1 # 2
24 $ hg ci -m unrelated1 # 2
25 created new head
25 created new head
26
26
27 $ hg merge --debug 1
27 $ hg merge --debug 1
28 searching for copies back to rev 1
29 unmatched files in other:
28 unmatched files in other:
30 1a
29 1a
31 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
30 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
32 src: '1' -> dst: '1a'
31 src: '1' -> dst: '1a'
33 checking for directory renames
32 checking for directory renames
34 resolving manifests
33 resolving manifests
35 branchmerge: True, force: False, partial: False
34 branchmerge: True, force: False, partial: False
36 ancestor: 81f4b099af3d, local: c64f439569a9+, remote: c12dcd37c90a
35 ancestor: 81f4b099af3d, local: c64f439569a9+, remote: c12dcd37c90a
37 1: other deleted -> r
36 1: other deleted -> r
38 removing 1
37 removing 1
39 1a: remote created -> g
38 1a: remote created -> g
40 getting 1a
39 getting 1a
41 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
40 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
42 (branch merge, don't forget to commit)
41 (branch merge, don't forget to commit)
43
42
44 $ hg ci -m merge1 # 3
43 $ hg ci -m merge1 # 3
45
44
46 $ hg co -C 2
45 $ hg co -C 2
47 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
46 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
48
47
49 $ echo hello >> 1
48 $ echo hello >> 1
50 $ hg ci -m unrelated2 # 4
49 $ hg ci -m unrelated2 # 4
51 created new head
50 created new head
52
51
53 $ hg co -C 3
52 $ hg co -C 3
54 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
53 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
55
54
56 $ hg merge -y --debug 4
55 $ hg merge -y --debug 4
57 searching for copies back to rev 1
58 unmatched files in local:
56 unmatched files in local:
59 1a
57 1a
60 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
58 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
61 src: '1' -> dst: '1a' *
59 src: '1' -> dst: '1a' *
62 checking for directory renames
60 checking for directory renames
63 resolving manifests
61 resolving manifests
64 branchmerge: True, force: False, partial: False
62 branchmerge: True, force: False, partial: False
65 ancestor: c64f439569a9, local: e327dca35ac8+, remote: 746e9549ea96
63 ancestor: c64f439569a9, local: e327dca35ac8+, remote: 746e9549ea96
66 preserving 1a for resolve of 1a
64 preserving 1a for resolve of 1a
65 1a: local copied/moved from 1 -> m (premerge)
67 starting 4 threads for background file closing (?)
66 starting 4 threads for background file closing (?)
68 1a: local copied/moved from 1 -> m (premerge)
69 picked tool ':merge' for 1a (binary False symlink False changedelete False)
67 picked tool ':merge' for 1a (binary False symlink False changedelete False)
70 merging 1a and 1 to 1a
68 merging 1a and 1 to 1a
71 my 1a@e327dca35ac8+ other 1@746e9549ea96 ancestor 1@c64f439569a9
69 my 1a@e327dca35ac8+ other 1@746e9549ea96 ancestor 1@c64f439569a9
72 premerge successful
70 premerge successful
73 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
71 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
74 (branch merge, don't forget to commit)
72 (branch merge, don't forget to commit)
75
73
76 $ hg co -C 4
74 $ hg co -C 4
77 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
75 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
78
76
79 $ hg merge -y --debug 3
77 $ hg merge -y --debug 3
80 searching for copies back to rev 1
81 unmatched files in other:
78 unmatched files in other:
82 1a
79 1a
83 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
80 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
84 src: '1' -> dst: '1a' *
81 src: '1' -> dst: '1a' *
85 checking for directory renames
82 checking for directory renames
86 resolving manifests
83 resolving manifests
87 branchmerge: True, force: False, partial: False
84 branchmerge: True, force: False, partial: False
88 ancestor: c64f439569a9, local: 746e9549ea96+, remote: e327dca35ac8
85 ancestor: c64f439569a9, local: 746e9549ea96+, remote: e327dca35ac8
89 preserving 1 for resolve of 1a
86 preserving 1 for resolve of 1a
90 removing 1
87 removing 1
88 1a: remote moved from 1 -> m (premerge)
91 starting 4 threads for background file closing (?)
89 starting 4 threads for background file closing (?)
92 1a: remote moved from 1 -> m (premerge)
93 picked tool ':merge' for 1a (binary False symlink False changedelete False)
90 picked tool ':merge' for 1a (binary False symlink False changedelete False)
94 merging 1 and 1a to 1a
91 merging 1 and 1a to 1a
95 my 1a@746e9549ea96+ other 1a@e327dca35ac8 ancestor 1@c64f439569a9
92 my 1a@746e9549ea96+ other 1a@e327dca35ac8 ancestor 1@c64f439569a9
96 premerge successful
93 premerge successful
97 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
94 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
98 (branch merge, don't forget to commit)
95 (branch merge, don't forget to commit)
99
96
@@ -1,185 +1,183 b''
1 Check that renames are correctly saved by a commit after a merge
1 Check that renames are correctly saved by a commit after a merge
2
2
3 Test with the merge on 3 having the rename on the local parent
3 Test with the merge on 3 having the rename on the local parent
4
4
5 $ hg init a
5 $ hg init a
6 $ cd a
6 $ cd a
7
7
8 $ echo line1 > foo
8 $ echo line1 > foo
9 $ hg add foo
9 $ hg add foo
10 $ hg ci -m '0: add foo'
10 $ hg ci -m '0: add foo'
11
11
12 $ echo line2 >> foo
12 $ echo line2 >> foo
13 $ hg ci -m '1: change foo'
13 $ hg ci -m '1: change foo'
14
14
15 $ hg up -C 0
15 $ hg up -C 0
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
17
17
18 $ hg mv foo bar
18 $ hg mv foo bar
19 $ rm bar
19 $ rm bar
20 $ echo line0 > bar
20 $ echo line0 > bar
21 $ echo line1 >> bar
21 $ echo line1 >> bar
22 $ hg ci -m '2: mv foo bar; change bar'
22 $ hg ci -m '2: mv foo bar; change bar'
23 created new head
23 created new head
24
24
25 $ hg merge 1
25 $ hg merge 1
26 merging bar and foo to bar
26 merging bar and foo to bar
27 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
27 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
28 (branch merge, don't forget to commit)
28 (branch merge, don't forget to commit)
29
29
30 $ cat bar
30 $ cat bar
31 line0
31 line0
32 line1
32 line1
33 line2
33 line2
34
34
35 $ hg ci -m '3: merge with local rename'
35 $ hg ci -m '3: merge with local rename'
36
36
37 $ hg debugindex bar
37 $ hg debugindex bar
38 rev linkrev nodeid p1 p2
38 rev linkrev nodeid p1 p2
39 0 2 d35118874825 000000000000 000000000000
39 0 2 d35118874825 000000000000 000000000000
40 1 3 5345f5ab8abd 000000000000 d35118874825
40 1 3 5345f5ab8abd 000000000000 d35118874825
41
41
42 $ hg debugrename bar
42 $ hg debugrename bar
43 bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
43 bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
44
44
45 $ hg debugindex foo
45 $ hg debugindex foo
46 rev linkrev nodeid p1 p2
46 rev linkrev nodeid p1 p2
47 0 0 690b295714ae 000000000000 000000000000
47 0 0 690b295714ae 000000000000 000000000000
48 1 1 9e25c27b8757 690b295714ae 000000000000
48 1 1 9e25c27b8757 690b295714ae 000000000000
49
49
50
50
51 Revert the content change from rev 2:
51 Revert the content change from rev 2:
52
52
53 $ hg up -C 2
53 $ hg up -C 2
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 $ rm bar
55 $ rm bar
56 $ echo line1 > bar
56 $ echo line1 > bar
57 $ hg ci -m '4: revert content change from rev 2'
57 $ hg ci -m '4: revert content change from rev 2'
58 created new head
58 created new head
59
59
60 $ hg log --template '{rev}:{node|short} {parents}\n'
60 $ hg log --template '{rev}:{node|short} {parents}\n'
61 4:2263c1be0967 2:0f2ff26688b9
61 4:2263c1be0967 2:0f2ff26688b9
62 3:0555950ead28 2:0f2ff26688b9 1:5cd961e4045d
62 3:0555950ead28 2:0f2ff26688b9 1:5cd961e4045d
63 2:0f2ff26688b9 0:2665aaee66e9
63 2:0f2ff26688b9 0:2665aaee66e9
64 1:5cd961e4045d
64 1:5cd961e4045d
65 0:2665aaee66e9
65 0:2665aaee66e9
66
66
67 This should use bar@rev2 as the ancestor:
67 This should use bar@rev2 as the ancestor:
68
68
69 $ hg --debug merge 3
69 $ hg --debug merge 3
70 searching for copies back to rev 1
71 resolving manifests
70 resolving manifests
72 branchmerge: True, force: False, partial: False
71 branchmerge: True, force: False, partial: False
73 ancestor: 0f2ff26688b9, local: 2263c1be0967+, remote: 0555950ead28
72 ancestor: 0f2ff26688b9, local: 2263c1be0967+, remote: 0555950ead28
74 preserving bar for resolve of bar
73 preserving bar for resolve of bar
75 starting 4 threads for background file closing (?)
74 starting 4 threads for background file closing (?)
76 bar: versions differ -> m (premerge)
75 bar: versions differ -> m (premerge)
77 picked tool ':merge' for bar (binary False symlink False changedelete False)
76 picked tool ':merge' for bar (binary False symlink False changedelete False)
78 merging bar
77 merging bar
79 my bar@2263c1be0967+ other bar@0555950ead28 ancestor bar@0f2ff26688b9
78 my bar@2263c1be0967+ other bar@0555950ead28 ancestor bar@0f2ff26688b9
80 premerge successful
79 premerge successful
81 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
80 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
82 (branch merge, don't forget to commit)
81 (branch merge, don't forget to commit)
83
82
84 $ cat bar
83 $ cat bar
85 line1
84 line1
86 line2
85 line2
87
86
88 $ hg ci -m '5: merge'
87 $ hg ci -m '5: merge'
89
88
90 $ hg debugindex bar
89 $ hg debugindex bar
91 rev linkrev nodeid p1 p2
90 rev linkrev nodeid p1 p2
92 0 2 d35118874825 000000000000 000000000000
91 0 2 d35118874825 000000000000 000000000000
93 1 3 5345f5ab8abd 000000000000 d35118874825
92 1 3 5345f5ab8abd 000000000000 d35118874825
94 2 4 ff4b45017382 d35118874825 000000000000
93 2 4 ff4b45017382 d35118874825 000000000000
95 3 5 3701b4893544 ff4b45017382 5345f5ab8abd
94 3 5 3701b4893544 ff4b45017382 5345f5ab8abd
96
95
97
96
98 Same thing, but with the merge on 3 having the rename
97 Same thing, but with the merge on 3 having the rename
99 on the remote parent:
98 on the remote parent:
100
99
101 $ cd ..
100 $ cd ..
102 $ hg clone -U -r 1 -r 2 a b
101 $ hg clone -U -r 1 -r 2 a b
103 adding changesets
102 adding changesets
104 adding manifests
103 adding manifests
105 adding file changes
104 adding file changes
106 added 3 changesets with 3 changes to 2 files (+1 heads)
105 added 3 changesets with 3 changes to 2 files (+1 heads)
107 new changesets 2665aaee66e9:0f2ff26688b9
106 new changesets 2665aaee66e9:0f2ff26688b9
108 $ cd b
107 $ cd b
109
108
110 $ hg up -C 1
109 $ hg up -C 1
111 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
112
111
113 $ hg merge 2
112 $ hg merge 2
114 merging foo and bar to bar
113 merging foo and bar to bar
115 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
114 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
116 (branch merge, don't forget to commit)
115 (branch merge, don't forget to commit)
117
116
118 $ cat bar
117 $ cat bar
119 line0
118 line0
120 line1
119 line1
121 line2
120 line2
122
121
123 $ hg ci -m '3: merge with remote rename'
122 $ hg ci -m '3: merge with remote rename'
124
123
125 $ hg debugindex bar
124 $ hg debugindex bar
126 rev linkrev nodeid p1 p2
125 rev linkrev nodeid p1 p2
127 0 2 d35118874825 000000000000 000000000000
126 0 2 d35118874825 000000000000 000000000000
128 1 3 5345f5ab8abd 000000000000 d35118874825
127 1 3 5345f5ab8abd 000000000000 d35118874825
129
128
130 $ hg debugrename bar
129 $ hg debugrename bar
131 bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
130 bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
132
131
133 $ hg debugindex foo
132 $ hg debugindex foo
134 rev linkrev nodeid p1 p2
133 rev linkrev nodeid p1 p2
135 0 0 690b295714ae 000000000000 000000000000
134 0 0 690b295714ae 000000000000 000000000000
136 1 1 9e25c27b8757 690b295714ae 000000000000
135 1 1 9e25c27b8757 690b295714ae 000000000000
137
136
138
137
139 Revert the content change from rev 2:
138 Revert the content change from rev 2:
140
139
141 $ hg up -C 2
140 $ hg up -C 2
142 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
143 $ rm bar
142 $ rm bar
144 $ echo line1 > bar
143 $ echo line1 > bar
145 $ hg ci -m '4: revert content change from rev 2'
144 $ hg ci -m '4: revert content change from rev 2'
146 created new head
145 created new head
147
146
148 $ hg log --template '{rev}:{node|short} {parents}\n'
147 $ hg log --template '{rev}:{node|short} {parents}\n'
149 4:2263c1be0967 2:0f2ff26688b9
148 4:2263c1be0967 2:0f2ff26688b9
150 3:3ffa6b9e35f0 1:5cd961e4045d 2:0f2ff26688b9
149 3:3ffa6b9e35f0 1:5cd961e4045d 2:0f2ff26688b9
151 2:0f2ff26688b9 0:2665aaee66e9
150 2:0f2ff26688b9 0:2665aaee66e9
152 1:5cd961e4045d
151 1:5cd961e4045d
153 0:2665aaee66e9
152 0:2665aaee66e9
154
153
155 This should use bar@rev2 as the ancestor:
154 This should use bar@rev2 as the ancestor:
156
155
157 $ hg --debug merge 3
156 $ hg --debug merge 3
158 searching for copies back to rev 1
159 resolving manifests
157 resolving manifests
160 branchmerge: True, force: False, partial: False
158 branchmerge: True, force: False, partial: False
161 ancestor: 0f2ff26688b9, local: 2263c1be0967+, remote: 3ffa6b9e35f0
159 ancestor: 0f2ff26688b9, local: 2263c1be0967+, remote: 3ffa6b9e35f0
162 preserving bar for resolve of bar
160 preserving bar for resolve of bar
163 starting 4 threads for background file closing (?)
161 starting 4 threads for background file closing (?)
164 bar: versions differ -> m (premerge)
162 bar: versions differ -> m (premerge)
165 picked tool ':merge' for bar (binary False symlink False changedelete False)
163 picked tool ':merge' for bar (binary False symlink False changedelete False)
166 merging bar
164 merging bar
167 my bar@2263c1be0967+ other bar@3ffa6b9e35f0 ancestor bar@0f2ff26688b9
165 my bar@2263c1be0967+ other bar@3ffa6b9e35f0 ancestor bar@0f2ff26688b9
168 premerge successful
166 premerge successful
169 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
167 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
170 (branch merge, don't forget to commit)
168 (branch merge, don't forget to commit)
171
169
172 $ cat bar
170 $ cat bar
173 line1
171 line1
174 line2
172 line2
175
173
176 $ hg ci -m '5: merge'
174 $ hg ci -m '5: merge'
177
175
178 $ hg debugindex bar
176 $ hg debugindex bar
179 rev linkrev nodeid p1 p2
177 rev linkrev nodeid p1 p2
180 0 2 d35118874825 000000000000 000000000000
178 0 2 d35118874825 000000000000 000000000000
181 1 3 5345f5ab8abd 000000000000 d35118874825
179 1 3 5345f5ab8abd 000000000000 d35118874825
182 2 4 ff4b45017382 d35118874825 000000000000
180 2 4 ff4b45017382 d35118874825 000000000000
183 3 5 3701b4893544 ff4b45017382 5345f5ab8abd
181 3 5 3701b4893544 ff4b45017382 5345f5ab8abd
184
182
185 $ cd ..
183 $ cd ..
@@ -1,459 +1,450 b''
1 Criss cross merging
1 Criss cross merging
2
2
3 $ hg init criss-cross
3 $ hg init criss-cross
4 $ cd criss-cross
4 $ cd criss-cross
5 $ echo '0 base' > f1
5 $ echo '0 base' > f1
6 $ echo '0 base' > f2
6 $ echo '0 base' > f2
7 $ hg ci -Aqm '0 base'
7 $ hg ci -Aqm '0 base'
8
8
9 $ echo '1 first change' > f1
9 $ echo '1 first change' > f1
10 $ hg ci -m '1 first change f1'
10 $ hg ci -m '1 first change f1'
11
11
12 $ hg up -qr0
12 $ hg up -qr0
13 $ echo '2 first change' > f2
13 $ echo '2 first change' > f2
14 $ hg ci -qm '2 first change f2'
14 $ hg ci -qm '2 first change f2'
15
15
16 $ hg merge -qr 1
16 $ hg merge -qr 1
17 $ hg ci -m '3 merge'
17 $ hg ci -m '3 merge'
18
18
19 $ hg up -qr2
19 $ hg up -qr2
20 $ hg merge -qr1
20 $ hg merge -qr1
21 $ hg ci -qm '4 merge'
21 $ hg ci -qm '4 merge'
22
22
23 $ echo '5 second change' > f1
23 $ echo '5 second change' > f1
24 $ hg ci -m '5 second change f1'
24 $ hg ci -m '5 second change f1'
25
25
26 $ hg up -r3
26 $ hg up -r3
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 $ echo '6 second change' > f2
28 $ echo '6 second change' > f2
29 $ hg ci -m '6 second change f2'
29 $ hg ci -m '6 second change f2'
30
30
31 $ hg log -G
31 $ hg log -G
32 @ changeset: 6:3b08d01b0ab5
32 @ changeset: 6:3b08d01b0ab5
33 | tag: tip
33 | tag: tip
34 | parent: 3:cf89f02107e5
34 | parent: 3:cf89f02107e5
35 | user: test
35 | user: test
36 | date: Thu Jan 01 00:00:00 1970 +0000
36 | date: Thu Jan 01 00:00:00 1970 +0000
37 | summary: 6 second change f2
37 | summary: 6 second change f2
38 |
38 |
39 | o changeset: 5:adfe50279922
39 | o changeset: 5:adfe50279922
40 | | user: test
40 | | user: test
41 | | date: Thu Jan 01 00:00:00 1970 +0000
41 | | date: Thu Jan 01 00:00:00 1970 +0000
42 | | summary: 5 second change f1
42 | | summary: 5 second change f1
43 | |
43 | |
44 | o changeset: 4:7d3e55501ae6
44 | o changeset: 4:7d3e55501ae6
45 | |\ parent: 2:40663881a6dd
45 | |\ parent: 2:40663881a6dd
46 | | | parent: 1:0f6b37dbe527
46 | | | parent: 1:0f6b37dbe527
47 | | | user: test
47 | | | user: test
48 | | | date: Thu Jan 01 00:00:00 1970 +0000
48 | | | date: Thu Jan 01 00:00:00 1970 +0000
49 | | | summary: 4 merge
49 | | | summary: 4 merge
50 | | |
50 | | |
51 o---+ changeset: 3:cf89f02107e5
51 o---+ changeset: 3:cf89f02107e5
52 | | | parent: 2:40663881a6dd
52 | | | parent: 2:40663881a6dd
53 |/ / parent: 1:0f6b37dbe527
53 |/ / parent: 1:0f6b37dbe527
54 | | user: test
54 | | user: test
55 | | date: Thu Jan 01 00:00:00 1970 +0000
55 | | date: Thu Jan 01 00:00:00 1970 +0000
56 | | summary: 3 merge
56 | | summary: 3 merge
57 | |
57 | |
58 | o changeset: 2:40663881a6dd
58 | o changeset: 2:40663881a6dd
59 | | parent: 0:40494bf2444c
59 | | parent: 0:40494bf2444c
60 | | user: test
60 | | user: test
61 | | date: Thu Jan 01 00:00:00 1970 +0000
61 | | date: Thu Jan 01 00:00:00 1970 +0000
62 | | summary: 2 first change f2
62 | | summary: 2 first change f2
63 | |
63 | |
64 o | changeset: 1:0f6b37dbe527
64 o | changeset: 1:0f6b37dbe527
65 |/ user: test
65 |/ user: test
66 | date: Thu Jan 01 00:00:00 1970 +0000
66 | date: Thu Jan 01 00:00:00 1970 +0000
67 | summary: 1 first change f1
67 | summary: 1 first change f1
68 |
68 |
69 o changeset: 0:40494bf2444c
69 o changeset: 0:40494bf2444c
70 user: test
70 user: test
71 date: Thu Jan 01 00:00:00 1970 +0000
71 date: Thu Jan 01 00:00:00 1970 +0000
72 summary: 0 base
72 summary: 0 base
73
73
74
74
75 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor='!'
75 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor='!'
76 note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922
76 note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922
77 alternatively, use --config merge.preferancestor=40663881a6dd
77 alternatively, use --config merge.preferancestor=40663881a6dd
78 searching for copies back to rev 3
79 resolving manifests
78 resolving manifests
80 branchmerge: True, force: False, partial: False
79 branchmerge: True, force: False, partial: False
81 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
80 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
82 preserving f2 for resolve of f2
81 preserving f2 for resolve of f2
83 f1: remote is newer -> g
82 f1: remote is newer -> g
84 getting f1
83 getting f1
85 f2: versions differ -> m (premerge)
84 f2: versions differ -> m (premerge)
86 picked tool ':dump' for f2 (binary False symlink False changedelete False)
85 picked tool ':dump' for f2 (binary False symlink False changedelete False)
87 merging f2
86 merging f2
88 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
87 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
89 f2: versions differ -> m (merge)
88 f2: versions differ -> m (merge)
90 picked tool ':dump' for f2 (binary False symlink False changedelete False)
89 picked tool ':dump' for f2 (binary False symlink False changedelete False)
91 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
90 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
92 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
91 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
93 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
92 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
94 [1]
93 [1]
95
94
96 $ f --dump *
95 $ f --dump *
97 f1:
96 f1:
98 >>>
97 >>>
99 5 second change
98 5 second change
100 <<<
99 <<<
101 f2:
100 f2:
102 >>>
101 >>>
103 6 second change
102 6 second change
104 <<<
103 <<<
105 f2.base:
104 f2.base:
106 >>>
105 >>>
107 0 base
106 0 base
108 <<<
107 <<<
109 f2.local:
108 f2.local:
110 >>>
109 >>>
111 6 second change
110 6 second change
112 <<<
111 <<<
113 f2.orig:
112 f2.orig:
114 >>>
113 >>>
115 6 second change
114 6 second change
116 <<<
115 <<<
117 f2.other:
116 f2.other:
118 >>>
117 >>>
119 2 first change
118 2 first change
120 <<<
119 <<<
121
120
122 $ hg up -qC .
121 $ hg up -qC .
123 $ hg merge -v --tool internal:dump 5 --config merge.preferancestor="null 40663881 3b08d"
122 $ hg merge -v --tool internal:dump 5 --config merge.preferancestor="null 40663881 3b08d"
124 note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922
123 note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922
125 alternatively, use --config merge.preferancestor=0f6b37dbe527
124 alternatively, use --config merge.preferancestor=0f6b37dbe527
126 resolving manifests
125 resolving manifests
127 merging f1
126 merging f1
128 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
127 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
129 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
128 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
130 [1]
129 [1]
131
130
132 Redo merge with merge.preferancestor="*" to enable bid merge
131 Redo merge with merge.preferancestor="*" to enable bid merge
133
132
134 $ rm f*
133 $ rm f*
135 $ hg up -qC .
134 $ hg up -qC .
136 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor="*"
135 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor="*"
137 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
136 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
138
137
139 calculating bids for ancestor 0f6b37dbe527
138 calculating bids for ancestor 0f6b37dbe527
140 searching for copies back to rev 3
141 resolving manifests
139 resolving manifests
142 branchmerge: True, force: False, partial: False
140 branchmerge: True, force: False, partial: False
143 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
141 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
144 f1: remote is newer -> g
142 f1: remote is newer -> g
145 f2: versions differ -> m
143 f2: versions differ -> m
146
144
147 calculating bids for ancestor 40663881a6dd
145 calculating bids for ancestor 40663881a6dd
148 searching for copies back to rev 3
149 resolving manifests
146 resolving manifests
150 branchmerge: True, force: False, partial: False
147 branchmerge: True, force: False, partial: False
151 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
148 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
152 f1: versions differ -> m
149 f1: versions differ -> m
153 f2: remote unchanged -> k
150 f2: remote unchanged -> k
154
151
155 auction for merging merge bids
152 auction for merging merge bids
156 f1: picking 'get' action
153 f1: picking 'get' action
157 f2: picking 'keep' action
154 f2: picking 'keep' action
158 end of auction
155 end of auction
159
156
160 f1: remote is newer -> g
157 f1: remote is newer -> g
161 getting f1
158 getting f1
162 f2: remote unchanged -> k
159 f2: remote unchanged -> k
163 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
164 (branch merge, don't forget to commit)
161 (branch merge, don't forget to commit)
165
162
166 $ f --dump *
163 $ f --dump *
167 f1:
164 f1:
168 >>>
165 >>>
169 5 second change
166 5 second change
170 <<<
167 <<<
171 f2:
168 f2:
172 >>>
169 >>>
173 6 second change
170 6 second change
174 <<<
171 <<<
175
172
176
173
177 The other way around:
174 The other way around:
178
175
179 $ hg up -C -r5
176 $ hg up -C -r5
180 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
177 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 $ hg merge -v --debug --config merge.preferancestor="*"
178 $ hg merge -v --debug --config merge.preferancestor="*"
182 note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
179 note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
183
180
184 calculating bids for ancestor 0f6b37dbe527
181 calculating bids for ancestor 0f6b37dbe527
185 searching for copies back to rev 3
186 resolving manifests
182 resolving manifests
187 branchmerge: True, force: False, partial: False
183 branchmerge: True, force: False, partial: False
188 ancestor: 0f6b37dbe527, local: adfe50279922+, remote: 3b08d01b0ab5
184 ancestor: 0f6b37dbe527, local: adfe50279922+, remote: 3b08d01b0ab5
189 f1: remote unchanged -> k
185 f1: remote unchanged -> k
190 f2: versions differ -> m
186 f2: versions differ -> m
191
187
192 calculating bids for ancestor 40663881a6dd
188 calculating bids for ancestor 40663881a6dd
193 searching for copies back to rev 3
194 resolving manifests
189 resolving manifests
195 branchmerge: True, force: False, partial: False
190 branchmerge: True, force: False, partial: False
196 ancestor: 40663881a6dd, local: adfe50279922+, remote: 3b08d01b0ab5
191 ancestor: 40663881a6dd, local: adfe50279922+, remote: 3b08d01b0ab5
197 f1: versions differ -> m
192 f1: versions differ -> m
198 f2: remote is newer -> g
193 f2: remote is newer -> g
199
194
200 auction for merging merge bids
195 auction for merging merge bids
201 f1: picking 'keep' action
196 f1: picking 'keep' action
202 f2: picking 'get' action
197 f2: picking 'get' action
203 end of auction
198 end of auction
204
199
205 f2: remote is newer -> g
200 f2: remote is newer -> g
206 getting f2
201 getting f2
207 f1: remote unchanged -> k
202 f1: remote unchanged -> k
208 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 (branch merge, don't forget to commit)
204 (branch merge, don't forget to commit)
210
205
211 $ f --dump *
206 $ f --dump *
212 f1:
207 f1:
213 >>>
208 >>>
214 5 second change
209 5 second change
215 <<<
210 <<<
216 f2:
211 f2:
217 >>>
212 >>>
218 6 second change
213 6 second change
219 <<<
214 <<<
220
215
221 Verify how the output looks and and how verbose it is:
216 Verify how the output looks and and how verbose it is:
222
217
223 $ hg up -qC
218 $ hg up -qC
224 $ hg merge
219 $ hg merge
225 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
220 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
226 (branch merge, don't forget to commit)
221 (branch merge, don't forget to commit)
227
222
228 $ hg up -qC tip
223 $ hg up -qC tip
229 $ hg merge -v
224 $ hg merge -v
230 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
225 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
231
226
232 calculating bids for ancestor 0f6b37dbe527
227 calculating bids for ancestor 0f6b37dbe527
233 resolving manifests
228 resolving manifests
234
229
235 calculating bids for ancestor 40663881a6dd
230 calculating bids for ancestor 40663881a6dd
236 resolving manifests
231 resolving manifests
237
232
238 auction for merging merge bids
233 auction for merging merge bids
239 f1: picking 'get' action
234 f1: picking 'get' action
240 f2: picking 'keep' action
235 f2: picking 'keep' action
241 end of auction
236 end of auction
242
237
243 getting f1
238 getting f1
244 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
239 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
245 (branch merge, don't forget to commit)
240 (branch merge, don't forget to commit)
246
241
247 $ hg up -qC
242 $ hg up -qC
248 $ hg merge -v --debug --config merge.preferancestor="*"
243 $ hg merge -v --debug --config merge.preferancestor="*"
249 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
244 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
250
245
251 calculating bids for ancestor 0f6b37dbe527
246 calculating bids for ancestor 0f6b37dbe527
252 searching for copies back to rev 3
253 resolving manifests
247 resolving manifests
254 branchmerge: True, force: False, partial: False
248 branchmerge: True, force: False, partial: False
255 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
249 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
256 f1: remote is newer -> g
250 f1: remote is newer -> g
257 f2: versions differ -> m
251 f2: versions differ -> m
258
252
259 calculating bids for ancestor 40663881a6dd
253 calculating bids for ancestor 40663881a6dd
260 searching for copies back to rev 3
261 resolving manifests
254 resolving manifests
262 branchmerge: True, force: False, partial: False
255 branchmerge: True, force: False, partial: False
263 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
256 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
264 f1: versions differ -> m
257 f1: versions differ -> m
265 f2: remote unchanged -> k
258 f2: remote unchanged -> k
266
259
267 auction for merging merge bids
260 auction for merging merge bids
268 f1: picking 'get' action
261 f1: picking 'get' action
269 f2: picking 'keep' action
262 f2: picking 'keep' action
270 end of auction
263 end of auction
271
264
272 f1: remote is newer -> g
265 f1: remote is newer -> g
273 getting f1
266 getting f1
274 f2: remote unchanged -> k
267 f2: remote unchanged -> k
275 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 (branch merge, don't forget to commit)
269 (branch merge, don't forget to commit)
277
270
278 Test the greatest common ancestor returning multiple changesets
271 Test the greatest common ancestor returning multiple changesets
279
272
280 $ hg log -r 'heads(commonancestors(head()))'
273 $ hg log -r 'heads(commonancestors(head()))'
281 changeset: 1:0f6b37dbe527
274 changeset: 1:0f6b37dbe527
282 user: test
275 user: test
283 date: Thu Jan 01 00:00:00 1970 +0000
276 date: Thu Jan 01 00:00:00 1970 +0000
284 summary: 1 first change f1
277 summary: 1 first change f1
285
278
286 changeset: 2:40663881a6dd
279 changeset: 2:40663881a6dd
287 parent: 0:40494bf2444c
280 parent: 0:40494bf2444c
288 user: test
281 user: test
289 date: Thu Jan 01 00:00:00 1970 +0000
282 date: Thu Jan 01 00:00:00 1970 +0000
290 summary: 2 first change f2
283 summary: 2 first change f2
291
284
292
285
293 $ cd ..
286 $ cd ..
294
287
295 http://stackoverflow.com/questions/9350005/how-do-i-specify-a-merge-base-to-use-in-a-hg-merge/9430810
288 http://stackoverflow.com/questions/9350005/how-do-i-specify-a-merge-base-to-use-in-a-hg-merge/9430810
296
289
297 $ hg init ancestor-merging
290 $ hg init ancestor-merging
298 $ cd ancestor-merging
291 $ cd ancestor-merging
299 $ echo a > x
292 $ echo a > x
300 $ hg commit -A -m a x
293 $ hg commit -A -m a x
301 $ hg update -q 0
294 $ hg update -q 0
302 $ echo b >> x
295 $ echo b >> x
303 $ hg commit -m b
296 $ hg commit -m b
304 $ hg update -q 0
297 $ hg update -q 0
305 $ echo c >> x
298 $ echo c >> x
306 $ hg commit -qm c
299 $ hg commit -qm c
307 $ hg update -q 1
300 $ hg update -q 1
308 $ hg merge -q --tool internal:local 2
301 $ hg merge -q --tool internal:local 2
309 $ echo c >> x
302 $ echo c >> x
310 $ hg commit -m bc
303 $ hg commit -m bc
311 $ hg update -q 2
304 $ hg update -q 2
312 $ hg merge -q --tool internal:local 1
305 $ hg merge -q --tool internal:local 1
313 $ echo b >> x
306 $ echo b >> x
314 $ hg commit -qm cb
307 $ hg commit -qm cb
315
308
316 $ hg merge --config merge.preferancestor='!'
309 $ hg merge --config merge.preferancestor='!'
317 note: using 70008a2163f6 as ancestor of 0d355fdef312 and 4b8b546a3eef
310 note: using 70008a2163f6 as ancestor of 0d355fdef312 and 4b8b546a3eef
318 alternatively, use --config merge.preferancestor=b211bbc6eb3c
311 alternatively, use --config merge.preferancestor=b211bbc6eb3c
319 merging x
312 merging x
320 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
313 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
321 (branch merge, don't forget to commit)
314 (branch merge, don't forget to commit)
322 $ cat x
315 $ cat x
323 a
316 a
324 c
317 c
325 b
318 b
326 c
319 c
327
320
328 $ hg up -qC .
321 $ hg up -qC .
329
322
330 $ hg merge --config merge.preferancestor=b211bbc6eb3c
323 $ hg merge --config merge.preferancestor=b211bbc6eb3c
331 note: using b211bbc6eb3c as ancestor of 0d355fdef312 and 4b8b546a3eef
324 note: using b211bbc6eb3c as ancestor of 0d355fdef312 and 4b8b546a3eef
332 alternatively, use --config merge.preferancestor=70008a2163f6
325 alternatively, use --config merge.preferancestor=70008a2163f6
333 merging x
326 merging x
334 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
327 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
335 (branch merge, don't forget to commit)
328 (branch merge, don't forget to commit)
336 $ cat x
329 $ cat x
337 a
330 a
338 b
331 b
339 c
332 c
340 b
333 b
341
334
342 $ hg up -qC .
335 $ hg up -qC .
343
336
344 $ hg merge -v --config merge.preferancestor="*"
337 $ hg merge -v --config merge.preferancestor="*"
345 note: merging 0d355fdef312+ and 4b8b546a3eef using bids from ancestors 70008a2163f6 and b211bbc6eb3c
338 note: merging 0d355fdef312+ and 4b8b546a3eef using bids from ancestors 70008a2163f6 and b211bbc6eb3c
346
339
347 calculating bids for ancestor 70008a2163f6
340 calculating bids for ancestor 70008a2163f6
348 resolving manifests
341 resolving manifests
349
342
350 calculating bids for ancestor b211bbc6eb3c
343 calculating bids for ancestor b211bbc6eb3c
351 resolving manifests
344 resolving manifests
352
345
353 auction for merging merge bids
346 auction for merging merge bids
354 x: multiple bids for merge action:
347 x: multiple bids for merge action:
355 versions differ -> m
348 versions differ -> m
356 versions differ -> m
349 versions differ -> m
357 x: ambiguous merge - picked m action
350 x: ambiguous merge - picked m action
358 end of auction
351 end of auction
359
352
360 merging x
353 merging x
361 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
354 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
362 (branch merge, don't forget to commit)
355 (branch merge, don't forget to commit)
363 $ cat x
356 $ cat x
364 a
357 a
365 c
358 c
366 b
359 b
367 c
360 c
368
361
369 Verify that the old context ancestor works with / despite preferancestor:
362 Verify that the old context ancestor works with / despite preferancestor:
370
363
371 $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n'
364 $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n'
372 1
365 1
373 $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n'
366 $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n'
374 2
367 2
375 $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n'
368 $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n'
376 1
369 1
377 $ hg log -r 'ancestor(head())' --config merge.preferancestor='1337 * - 2' -T '{rev}\n'
370 $ hg log -r 'ancestor(head())' --config merge.preferancestor='1337 * - 2' -T '{rev}\n'
378 2
371 2
379
372
380 $ cd ..
373 $ cd ..
381
374
382 $ hg init issue5020
375 $ hg init issue5020
383 $ cd issue5020
376 $ cd issue5020
384
377
385 $ echo a > noop
378 $ echo a > noop
386 $ hg ci -qAm initial
379 $ hg ci -qAm initial
387
380
388 $ echo b > noop
381 $ echo b > noop
389 $ hg ci -qAm 'uninteresting change'
382 $ hg ci -qAm 'uninteresting change'
390
383
391 $ hg up -q 0
384 $ hg up -q 0
392 $ mkdir d1
385 $ mkdir d1
393 $ echo a > d1/a
386 $ echo a > d1/a
394 $ echo b > d1/b
387 $ echo b > d1/b
395 $ hg ci -qAm 'add d1/a and d1/b'
388 $ hg ci -qAm 'add d1/a and d1/b'
396
389
397 $ hg merge -q 1
390 $ hg merge -q 1
398 $ hg rm d1/a
391 $ hg rm d1/a
399 $ hg mv -q d1 d2
392 $ hg mv -q d1 d2
400 $ hg ci -qm 'merge while removing d1/a and moving d1/b to d2/b'
393 $ hg ci -qm 'merge while removing d1/a and moving d1/b to d2/b'
401
394
402 $ hg up -q 1
395 $ hg up -q 1
403 $ hg merge -q 2
396 $ hg merge -q 2
404 $ hg ci -qm 'merge (no changes while merging)'
397 $ hg ci -qm 'merge (no changes while merging)'
405 $ hg log -G -T '{rev}:{node|short} {desc}'
398 $ hg log -G -T '{rev}:{node|short} {desc}'
406 @ 4:c0ef19750a22 merge (no changes while merging)
399 @ 4:c0ef19750a22 merge (no changes while merging)
407 |\
400 |\
408 +---o 3:6ca01f7342b9 merge while removing d1/a and moving d1/b to d2/b
401 +---o 3:6ca01f7342b9 merge while removing d1/a and moving d1/b to d2/b
409 | |/
402 | |/
410 | o 2:154e6000f54e add d1/a and d1/b
403 | o 2:154e6000f54e add d1/a and d1/b
411 | |
404 | |
412 o | 1:11b5b303e36c uninteresting change
405 o | 1:11b5b303e36c uninteresting change
413 |/
406 |/
414 o 0:7b54db1ebf33 initial
407 o 0:7b54db1ebf33 initial
415
408
416 $ hg merge 3 --debug
409 $ hg merge 3 --debug
417 note: merging c0ef19750a22+ and 6ca01f7342b9 using bids from ancestors 11b5b303e36c and 154e6000f54e
410 note: merging c0ef19750a22+ and 6ca01f7342b9 using bids from ancestors 11b5b303e36c and 154e6000f54e
418
411
419 calculating bids for ancestor 11b5b303e36c
412 calculating bids for ancestor 11b5b303e36c
420 searching for copies back to rev 3
421 unmatched files in local:
413 unmatched files in local:
422 d1/a
414 d1/a
423 d1/b
415 d1/b
424 unmatched files in other:
416 unmatched files in other:
425 d2/b
417 d2/b
426 resolving manifests
418 resolving manifests
427 branchmerge: True, force: False, partial: False
419 branchmerge: True, force: False, partial: False
428 ancestor: 11b5b303e36c, local: c0ef19750a22+, remote: 6ca01f7342b9
420 ancestor: 11b5b303e36c, local: c0ef19750a22+, remote: 6ca01f7342b9
429 d2/b: remote created -> g
421 d2/b: remote created -> g
430
422
431 calculating bids for ancestor 154e6000f54e
423 calculating bids for ancestor 154e6000f54e
432 searching for copies back to rev 3
433 unmatched files in other:
424 unmatched files in other:
434 d2/b
425 d2/b
435 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
426 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
436 src: 'd1/b' -> dst: 'd2/b'
427 src: 'd1/b' -> dst: 'd2/b'
437 checking for directory renames
428 checking for directory renames
438 discovered dir src: 'd1/' -> dst: 'd2/'
429 discovered dir src: 'd1/' -> dst: 'd2/'
439 resolving manifests
430 resolving manifests
440 branchmerge: True, force: False, partial: False
431 branchmerge: True, force: False, partial: False
441 ancestor: 154e6000f54e, local: c0ef19750a22+, remote: 6ca01f7342b9
432 ancestor: 154e6000f54e, local: c0ef19750a22+, remote: 6ca01f7342b9
442 d1/a: other deleted -> r
433 d1/a: other deleted -> r
443 d1/b: other deleted -> r
434 d1/b: other deleted -> r
444 d2/b: remote created -> g
435 d2/b: remote created -> g
445
436
446 auction for merging merge bids
437 auction for merging merge bids
447 d1/a: consensus for r
438 d1/a: consensus for r
448 d1/b: consensus for r
439 d1/b: consensus for r
449 d2/b: consensus for g
440 d2/b: consensus for g
450 end of auction
441 end of auction
451
442
452 d1/a: other deleted -> r
443 d1/a: other deleted -> r
453 removing d1/a
444 removing d1/a
454 d1/b: other deleted -> r
445 d1/b: other deleted -> r
455 removing d1/b
446 removing d1/b
456 d2/b: remote created -> g
447 d2/b: remote created -> g
457 getting d2/b
448 getting d2/b
458 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
449 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
459 (branch merge, don't forget to commit)
450 (branch merge, don't forget to commit)
@@ -1,454 +1,448 b''
1 #require symlink execbit
1 #require symlink execbit
2
2
3 $ tellmeabout() {
3 $ tellmeabout() {
4 > if [ -h $1 ]; then
4 > if [ -h $1 ]; then
5 > echo $1 is a symlink:
5 > echo $1 is a symlink:
6 > $TESTDIR/readlink.py $1
6 > $TESTDIR/readlink.py $1
7 > elif [ -x $1 ]; then
7 > elif [ -x $1 ]; then
8 > echo $1 is an executable file with content:
8 > echo $1 is an executable file with content:
9 > cat $1
9 > cat $1
10 > else
10 > else
11 > echo $1 is a plain file with content:
11 > echo $1 is a plain file with content:
12 > cat $1
12 > cat $1
13 > fi
13 > fi
14 > }
14 > }
15
15
16 $ hg init test1
16 $ hg init test1
17 $ cd test1
17 $ cd test1
18
18
19 $ echo a > a
19 $ echo a > a
20 $ hg ci -Aqmadd
20 $ hg ci -Aqmadd
21 $ chmod +x a
21 $ chmod +x a
22 $ hg ci -mexecutable
22 $ hg ci -mexecutable
23
23
24 $ hg up -q 0
24 $ hg up -q 0
25 $ rm a
25 $ rm a
26 $ ln -s symlink a
26 $ ln -s symlink a
27 $ hg ci -msymlink
27 $ hg ci -msymlink
28 created new head
28 created new head
29
29
30 Symlink is local parent, executable is other:
30 Symlink is local parent, executable is other:
31
31
32 $ hg merge --debug
32 $ hg merge --debug
33 searching for copies back to rev 1
34 resolving manifests
33 resolving manifests
35 branchmerge: True, force: False, partial: False
34 branchmerge: True, force: False, partial: False
36 ancestor: c334dc3be0da, local: 521a1e40188f+, remote: 3574f3e69b1c
35 ancestor: c334dc3be0da, local: 521a1e40188f+, remote: 3574f3e69b1c
37 preserving a for resolve of a
36 preserving a for resolve of a
38 a: versions differ -> m (premerge)
37 a: versions differ -> m (premerge)
39 tool internal:merge (for pattern a) can't handle symlinks
38 tool internal:merge (for pattern a) can't handle symlinks
40 couldn't find merge tool hgmerge
39 couldn't find merge tool hgmerge
41 no tool found to merge a
40 no tool found to merge a
42 picked tool ':prompt' for a (binary False symlink True changedelete False)
41 picked tool ':prompt' for a (binary False symlink True changedelete False)
43 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for a? u
42 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for a? u
44 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
43 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
45 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
44 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
46 [1]
45 [1]
47
46
48 $ tellmeabout a
47 $ tellmeabout a
49 a is a symlink:
48 a is a symlink:
50 a -> symlink
49 a -> symlink
51 $ hg resolve a --tool internal:other
50 $ hg resolve a --tool internal:other
52 (no more unresolved files)
51 (no more unresolved files)
53 $ tellmeabout a
52 $ tellmeabout a
54 a is an executable file with content:
53 a is an executable file with content:
55 a
54 a
56 $ hg st
55 $ hg st
57 M a
56 M a
58 ? a.orig
57 ? a.orig
59
58
60 Symlink is other parent, executable is local:
59 Symlink is other parent, executable is local:
61
60
62 $ hg update -C 1
61 $ hg update -C 1
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64
63
65 $ hg merge --debug --tool :union
64 $ hg merge --debug --tool :union
66 searching for copies back to rev 1
67 resolving manifests
65 resolving manifests
68 branchmerge: True, force: False, partial: False
66 branchmerge: True, force: False, partial: False
69 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
67 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
70 preserving a for resolve of a
68 preserving a for resolve of a
71 a: versions differ -> m (premerge)
69 a: versions differ -> m (premerge)
72 picked tool ':union' for a (binary False symlink True changedelete False)
70 picked tool ':union' for a (binary False symlink True changedelete False)
73 merging a
71 merging a
74 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
72 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
75 warning: internal :union cannot merge symlinks for a
73 warning: internal :union cannot merge symlinks for a
76 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
74 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
77 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
75 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
78 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
76 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
79 [1]
77 [1]
80
78
81 $ tellmeabout a
79 $ tellmeabout a
82 a is an executable file with content:
80 a is an executable file with content:
83 a
81 a
84
82
85 $ hg update -C 1
83 $ hg update -C 1
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87
85
88 $ hg merge --debug --tool :merge3
86 $ hg merge --debug --tool :merge3
89 searching for copies back to rev 1
90 resolving manifests
87 resolving manifests
91 branchmerge: True, force: False, partial: False
88 branchmerge: True, force: False, partial: False
92 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
89 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
93 preserving a for resolve of a
90 preserving a for resolve of a
94 a: versions differ -> m (premerge)
91 a: versions differ -> m (premerge)
95 picked tool ':merge3' for a (binary False symlink True changedelete False)
92 picked tool ':merge3' for a (binary False symlink True changedelete False)
96 merging a
93 merging a
97 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
94 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
98 warning: internal :merge3 cannot merge symlinks for a
95 warning: internal :merge3 cannot merge symlinks for a
99 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
96 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
100 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
97 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
101 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
98 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
102 [1]
99 [1]
103
100
104 $ tellmeabout a
101 $ tellmeabout a
105 a is an executable file with content:
102 a is an executable file with content:
106 a
103 a
107
104
108 $ hg update -C 1
105 $ hg update -C 1
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110
107
111 $ hg merge --debug --tool :merge-local
108 $ hg merge --debug --tool :merge-local
112 searching for copies back to rev 1
113 resolving manifests
109 resolving manifests
114 branchmerge: True, force: False, partial: False
110 branchmerge: True, force: False, partial: False
115 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
111 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
116 preserving a for resolve of a
112 preserving a for resolve of a
117 a: versions differ -> m (premerge)
113 a: versions differ -> m (premerge)
118 picked tool ':merge-local' for a (binary False symlink True changedelete False)
114 picked tool ':merge-local' for a (binary False symlink True changedelete False)
119 merging a
115 merging a
120 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
116 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
121 warning: internal :merge-local cannot merge symlinks for a
117 warning: internal :merge-local cannot merge symlinks for a
122 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
118 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
123 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
119 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
124 [1]
120 [1]
125
121
126 $ tellmeabout a
122 $ tellmeabout a
127 a is an executable file with content:
123 a is an executable file with content:
128 a
124 a
129
125
130 $ hg update -C 1
126 $ hg update -C 1
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
127 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132
128
133 $ hg merge --debug --tool :merge-other
129 $ hg merge --debug --tool :merge-other
134 searching for copies back to rev 1
135 resolving manifests
130 resolving manifests
136 branchmerge: True, force: False, partial: False
131 branchmerge: True, force: False, partial: False
137 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
132 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
138 preserving a for resolve of a
133 preserving a for resolve of a
139 a: versions differ -> m (premerge)
134 a: versions differ -> m (premerge)
140 picked tool ':merge-other' for a (binary False symlink True changedelete False)
135 picked tool ':merge-other' for a (binary False symlink True changedelete False)
141 merging a
136 merging a
142 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
137 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
143 warning: internal :merge-other cannot merge symlinks for a
138 warning: internal :merge-other cannot merge symlinks for a
144 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
139 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
145 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
140 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
146 [1]
141 [1]
147
142
148 $ tellmeabout a
143 $ tellmeabout a
149 a is an executable file with content:
144 a is an executable file with content:
150 a
145 a
151
146
152 Update to link without local change should get us a symlink (issue3316):
147 Update to link without local change should get us a symlink (issue3316):
153
148
154 $ hg up -C 0
149 $ hg up -C 0
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 $ hg up
151 $ hg up
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 updated to "521a1e40188f: symlink"
153 updated to "521a1e40188f: symlink"
159 1 other heads for branch "default"
154 1 other heads for branch "default"
160 $ hg st
155 $ hg st
161 ? a.orig
156 ? a.orig
162
157
163 Update to link with local change should cause a merge prompt (issue3200):
158 Update to link with local change should cause a merge prompt (issue3200):
164
159
165 $ hg up -Cq 0
160 $ hg up -Cq 0
166 $ echo data > a
161 $ echo data > a
167 $ HGMERGE= hg up -y --debug --config ui.merge=
162 $ HGMERGE= hg up -y --debug --config ui.merge=
168 searching for copies back to rev 2
169 resolving manifests
163 resolving manifests
170 branchmerge: False, force: False, partial: False
164 branchmerge: False, force: False, partial: False
171 ancestor: c334dc3be0da, local: c334dc3be0da+, remote: 521a1e40188f
165 ancestor: c334dc3be0da, local: c334dc3be0da+, remote: 521a1e40188f
172 preserving a for resolve of a
166 preserving a for resolve of a
173 a: versions differ -> m (premerge)
167 a: versions differ -> m (premerge)
174 (couldn't find merge tool hgmerge|tool hgmerge can't handle symlinks) (re)
168 (couldn't find merge tool hgmerge|tool hgmerge can't handle symlinks) (re)
175 no tool found to merge a
169 no tool found to merge a
176 picked tool ':prompt' for a (binary False symlink True changedelete False)
170 picked tool ':prompt' for a (binary False symlink True changedelete False)
177 keep (l)ocal [working copy], take (o)ther [destination], or leave (u)nresolved for a? u
171 keep (l)ocal [working copy], take (o)ther [destination], or leave (u)nresolved for a? u
178 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
172 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
179 use 'hg resolve' to retry unresolved file merges
173 use 'hg resolve' to retry unresolved file merges
180 updated to "521a1e40188f: symlink"
174 updated to "521a1e40188f: symlink"
181 1 other heads for branch "default"
175 1 other heads for branch "default"
182 [1]
176 [1]
183 $ hg diff --git
177 $ hg diff --git
184 diff --git a/a b/a
178 diff --git a/a b/a
185 old mode 120000
179 old mode 120000
186 new mode 100644
180 new mode 100644
187 --- a/a
181 --- a/a
188 +++ b/a
182 +++ b/a
189 @@ -1,1 +1,1 @@
183 @@ -1,1 +1,1 @@
190 -symlink
184 -symlink
191 \ No newline at end of file
185 \ No newline at end of file
192 +data
186 +data
193
187
194
188
195 Test only 'l' change - happens rarely, except when recovering from situations
189 Test only 'l' change - happens rarely, except when recovering from situations
196 where that was what happened.
190 where that was what happened.
197
191
198 $ hg init test2
192 $ hg init test2
199 $ cd test2
193 $ cd test2
200 $ printf base > f
194 $ printf base > f
201 $ hg ci -Aqm0
195 $ hg ci -Aqm0
202 $ echo file > f
196 $ echo file > f
203 $ echo content >> f
197 $ echo content >> f
204 $ hg ci -qm1
198 $ hg ci -qm1
205 $ hg up -qr0
199 $ hg up -qr0
206 $ rm f
200 $ rm f
207 $ ln -s base f
201 $ ln -s base f
208 $ hg ci -qm2
202 $ hg ci -qm2
209 $ hg merge
203 $ hg merge
210 tool internal:merge (for pattern f) can't handle symlinks
204 tool internal:merge (for pattern f) can't handle symlinks
211 no tool found to merge f
205 no tool found to merge f
212 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
206 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
213 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
207 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
214 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
208 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
215 [1]
209 [1]
216 $ tellmeabout f
210 $ tellmeabout f
217 f is a symlink:
211 f is a symlink:
218 f -> base
212 f -> base
219
213
220 $ hg up -Cqr1
214 $ hg up -Cqr1
221 $ hg merge
215 $ hg merge
222 tool internal:merge (for pattern f) can't handle symlinks
216 tool internal:merge (for pattern f) can't handle symlinks
223 no tool found to merge f
217 no tool found to merge f
224 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
218 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
225 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
219 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
226 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
220 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
227 [1]
221 [1]
228 $ tellmeabout f
222 $ tellmeabout f
229 f is a plain file with content:
223 f is a plain file with content:
230 file
224 file
231 content
225 content
232
226
233 $ cd ..
227 $ cd ..
234
228
235 Test removed 'x' flag merged with change to symlink
229 Test removed 'x' flag merged with change to symlink
236
230
237 $ hg init test3
231 $ hg init test3
238 $ cd test3
232 $ cd test3
239 $ echo f > f
233 $ echo f > f
240 $ chmod +x f
234 $ chmod +x f
241 $ hg ci -Aqm0
235 $ hg ci -Aqm0
242 $ chmod -x f
236 $ chmod -x f
243 $ hg ci -qm1
237 $ hg ci -qm1
244 $ hg up -qr0
238 $ hg up -qr0
245 $ rm f
239 $ rm f
246 $ ln -s dangling f
240 $ ln -s dangling f
247 $ hg ci -qm2
241 $ hg ci -qm2
248 $ hg merge
242 $ hg merge
249 tool internal:merge (for pattern f) can't handle symlinks
243 tool internal:merge (for pattern f) can't handle symlinks
250 no tool found to merge f
244 no tool found to merge f
251 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
245 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
252 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
246 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
253 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
247 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
254 [1]
248 [1]
255 $ tellmeabout f
249 $ tellmeabout f
256 f is a symlink:
250 f is a symlink:
257 f -> dangling
251 f -> dangling
258
252
259 $ hg up -Cqr1
253 $ hg up -Cqr1
260 $ hg merge
254 $ hg merge
261 tool internal:merge (for pattern f) can't handle symlinks
255 tool internal:merge (for pattern f) can't handle symlinks
262 no tool found to merge f
256 no tool found to merge f
263 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
257 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
264 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
258 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
265 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
259 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
266 [1]
260 [1]
267 $ tellmeabout f
261 $ tellmeabout f
268 f is a plain file with content:
262 f is a plain file with content:
269 f
263 f
270
264
271 Test removed 'x' flag merged with content change - both ways
265 Test removed 'x' flag merged with content change - both ways
272
266
273 $ hg up -Cqr0
267 $ hg up -Cqr0
274 $ echo change > f
268 $ echo change > f
275 $ hg ci -qm3
269 $ hg ci -qm3
276 $ hg merge -r1
270 $ hg merge -r1
277 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
278 (branch merge, don't forget to commit)
272 (branch merge, don't forget to commit)
279 $ tellmeabout f
273 $ tellmeabout f
280 f is a plain file with content:
274 f is a plain file with content:
281 change
275 change
282
276
283 $ hg up -qCr1
277 $ hg up -qCr1
284 $ hg merge -r3
278 $ hg merge -r3
285 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
286 (branch merge, don't forget to commit)
280 (branch merge, don't forget to commit)
287 $ tellmeabout f
281 $ tellmeabout f
288 f is a plain file with content:
282 f is a plain file with content:
289 change
283 change
290
284
291 $ cd ..
285 $ cd ..
292
286
293 Test merge with no common ancestor:
287 Test merge with no common ancestor:
294 a: just different
288 a: just different
295 b: x vs -, different (cannot calculate x, cannot ask merge tool)
289 b: x vs -, different (cannot calculate x, cannot ask merge tool)
296 c: x vs -, same (cannot calculate x, merge tool is no good)
290 c: x vs -, same (cannot calculate x, merge tool is no good)
297 d: x vs l, different
291 d: x vs l, different
298 e: x vs l, same
292 e: x vs l, same
299 f: - vs l, different
293 f: - vs l, different
300 g: - vs l, same
294 g: - vs l, same
301 h: l vs l, different
295 h: l vs l, different
302 (where same means the filelog entry is shared and there thus is an ancestor!)
296 (where same means the filelog entry is shared and there thus is an ancestor!)
303
297
304 $ hg init test4
298 $ hg init test4
305 $ cd test4
299 $ cd test4
306 $ echo 0 > 0
300 $ echo 0 > 0
307 $ hg ci -Aqm0
301 $ hg ci -Aqm0
308
302
309 $ echo 1 > a
303 $ echo 1 > a
310 $ echo 1 > b
304 $ echo 1 > b
311 $ chmod +x b
305 $ chmod +x b
312 $ echo 1 > bx
306 $ echo 1 > bx
313 $ chmod +x bx
307 $ chmod +x bx
314 $ echo x > c
308 $ echo x > c
315 $ chmod +x c
309 $ chmod +x c
316 $ echo 1 > d
310 $ echo 1 > d
317 $ chmod +x d
311 $ chmod +x d
318 $ printf x > e
312 $ printf x > e
319 $ chmod +x e
313 $ chmod +x e
320 $ echo 1 > f
314 $ echo 1 > f
321 $ printf x > g
315 $ printf x > g
322 $ ln -s 1 h
316 $ ln -s 1 h
323 $ hg ci -qAm1
317 $ hg ci -qAm1
324
318
325 $ hg up -qr0
319 $ hg up -qr0
326 $ echo 2 > a
320 $ echo 2 > a
327 $ echo 2 > b
321 $ echo 2 > b
328 $ echo 2 > bx
322 $ echo 2 > bx
329 $ chmod +x bx
323 $ chmod +x bx
330 $ echo x > c
324 $ echo x > c
331 $ ln -s 2 d
325 $ ln -s 2 d
332 $ ln -s x e
326 $ ln -s x e
333 $ ln -s 2 f
327 $ ln -s 2 f
334 $ ln -s x g
328 $ ln -s x g
335 $ ln -s 2 h
329 $ ln -s 2 h
336 $ hg ci -Aqm2
330 $ hg ci -Aqm2
337
331
338 $ hg merge
332 $ hg merge
339 merging a
333 merging a
340 warning: cannot merge flags for b without common ancestor - keeping local flags
334 warning: cannot merge flags for b without common ancestor - keeping local flags
341 merging b
335 merging b
342 merging bx
336 merging bx
343 warning: cannot merge flags for c without common ancestor - keeping local flags
337 warning: cannot merge flags for c without common ancestor - keeping local flags
344 tool internal:merge (for pattern d) can't handle symlinks
338 tool internal:merge (for pattern d) can't handle symlinks
345 no tool found to merge d
339 no tool found to merge d
346 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for d? u
340 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for d? u
347 tool internal:merge (for pattern f) can't handle symlinks
341 tool internal:merge (for pattern f) can't handle symlinks
348 no tool found to merge f
342 no tool found to merge f
349 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
343 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
350 tool internal:merge (for pattern h) can't handle symlinks
344 tool internal:merge (for pattern h) can't handle symlinks
351 no tool found to merge h
345 no tool found to merge h
352 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for h? u
346 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for h? u
353 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
347 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
354 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
348 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
355 warning: conflicts while merging bx! (edit, then use 'hg resolve --mark')
349 warning: conflicts while merging bx! (edit, then use 'hg resolve --mark')
356 3 files updated, 0 files merged, 0 files removed, 6 files unresolved
350 3 files updated, 0 files merged, 0 files removed, 6 files unresolved
357 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
351 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
358 [1]
352 [1]
359 $ hg resolve -l
353 $ hg resolve -l
360 U a
354 U a
361 U b
355 U b
362 U bx
356 U bx
363 U d
357 U d
364 U f
358 U f
365 U h
359 U h
366 $ tellmeabout a
360 $ tellmeabout a
367 a is a plain file with content:
361 a is a plain file with content:
368 <<<<<<< working copy: 0c617753b41b - test: 2
362 <<<<<<< working copy: 0c617753b41b - test: 2
369 2
363 2
370 =======
364 =======
371 1
365 1
372 >>>>>>> merge rev: 2e60aa20b912 - test: 1
366 >>>>>>> merge rev: 2e60aa20b912 - test: 1
373 $ tellmeabout b
367 $ tellmeabout b
374 b is a plain file with content:
368 b is a plain file with content:
375 <<<<<<< working copy: 0c617753b41b - test: 2
369 <<<<<<< working copy: 0c617753b41b - test: 2
376 2
370 2
377 =======
371 =======
378 1
372 1
379 >>>>>>> merge rev: 2e60aa20b912 - test: 1
373 >>>>>>> merge rev: 2e60aa20b912 - test: 1
380 $ tellmeabout c
374 $ tellmeabout c
381 c is a plain file with content:
375 c is a plain file with content:
382 x
376 x
383 $ tellmeabout d
377 $ tellmeabout d
384 d is a symlink:
378 d is a symlink:
385 d -> 2
379 d -> 2
386 $ tellmeabout e
380 $ tellmeabout e
387 e is a symlink:
381 e is a symlink:
388 e -> x
382 e -> x
389 $ tellmeabout f
383 $ tellmeabout f
390 f is a symlink:
384 f is a symlink:
391 f -> 2
385 f -> 2
392 $ tellmeabout g
386 $ tellmeabout g
393 g is a symlink:
387 g is a symlink:
394 g -> x
388 g -> x
395 $ tellmeabout h
389 $ tellmeabout h
396 h is a symlink:
390 h is a symlink:
397 h -> 2
391 h -> 2
398
392
399 $ hg up -Cqr1
393 $ hg up -Cqr1
400 $ hg merge
394 $ hg merge
401 merging a
395 merging a
402 warning: cannot merge flags for b without common ancestor - keeping local flags
396 warning: cannot merge flags for b without common ancestor - keeping local flags
403 merging b
397 merging b
404 merging bx
398 merging bx
405 warning: cannot merge flags for c without common ancestor - keeping local flags
399 warning: cannot merge flags for c without common ancestor - keeping local flags
406 tool internal:merge (for pattern d) can't handle symlinks
400 tool internal:merge (for pattern d) can't handle symlinks
407 no tool found to merge d
401 no tool found to merge d
408 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for d? u
402 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for d? u
409 tool internal:merge (for pattern f) can't handle symlinks
403 tool internal:merge (for pattern f) can't handle symlinks
410 no tool found to merge f
404 no tool found to merge f
411 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
405 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
412 tool internal:merge (for pattern h) can't handle symlinks
406 tool internal:merge (for pattern h) can't handle symlinks
413 no tool found to merge h
407 no tool found to merge h
414 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for h? u
408 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for h? u
415 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
409 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
416 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
410 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
417 warning: conflicts while merging bx! (edit, then use 'hg resolve --mark')
411 warning: conflicts while merging bx! (edit, then use 'hg resolve --mark')
418 3 files updated, 0 files merged, 0 files removed, 6 files unresolved
412 3 files updated, 0 files merged, 0 files removed, 6 files unresolved
419 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
413 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
420 [1]
414 [1]
421 $ tellmeabout a
415 $ tellmeabout a
422 a is a plain file with content:
416 a is a plain file with content:
423 <<<<<<< working copy: 2e60aa20b912 - test: 1
417 <<<<<<< working copy: 2e60aa20b912 - test: 1
424 1
418 1
425 =======
419 =======
426 2
420 2
427 >>>>>>> merge rev: 0c617753b41b - test: 2
421 >>>>>>> merge rev: 0c617753b41b - test: 2
428 $ tellmeabout b
422 $ tellmeabout b
429 b is an executable file with content:
423 b is an executable file with content:
430 <<<<<<< working copy: 2e60aa20b912 - test: 1
424 <<<<<<< working copy: 2e60aa20b912 - test: 1
431 1
425 1
432 =======
426 =======
433 2
427 2
434 >>>>>>> merge rev: 0c617753b41b - test: 2
428 >>>>>>> merge rev: 0c617753b41b - test: 2
435 $ tellmeabout c
429 $ tellmeabout c
436 c is an executable file with content:
430 c is an executable file with content:
437 x
431 x
438 $ tellmeabout d
432 $ tellmeabout d
439 d is an executable file with content:
433 d is an executable file with content:
440 1
434 1
441 $ tellmeabout e
435 $ tellmeabout e
442 e is an executable file with content:
436 e is an executable file with content:
443 x (no-eol)
437 x (no-eol)
444 $ tellmeabout f
438 $ tellmeabout f
445 f is a plain file with content:
439 f is a plain file with content:
446 1
440 1
447 $ tellmeabout g
441 $ tellmeabout g
448 g is a plain file with content:
442 g is a plain file with content:
449 x (no-eol)
443 x (no-eol)
450 $ tellmeabout h
444 $ tellmeabout h
451 h is a symlink:
445 h is a symlink:
452 h -> 1
446 h -> 1
453
447
454 $ cd ..
448 $ cd ..
@@ -1,151 +1,150 b''
1 initial
1 initial
2 $ hg init test-a
2 $ hg init test-a
3 $ cd test-a
3 $ cd test-a
4 $ cat >test.txt <<"EOF"
4 $ cat >test.txt <<"EOF"
5 > 1
5 > 1
6 > 2
6 > 2
7 > 3
7 > 3
8 > EOF
8 > EOF
9 $ hg add test.txt
9 $ hg add test.txt
10 $ hg commit -m "Initial"
10 $ hg commit -m "Initial"
11
11
12 clone
12 clone
13 $ cd ..
13 $ cd ..
14 $ hg clone test-a test-b
14 $ hg clone test-a test-b
15 updating to branch default
15 updating to branch default
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
17
17
18 change test-a
18 change test-a
19 $ cd test-a
19 $ cd test-a
20 $ cat >test.txt <<"EOF"
20 $ cat >test.txt <<"EOF"
21 > one
21 > one
22 > two
22 > two
23 > three
23 > three
24 > EOF
24 > EOF
25 $ hg commit -m "Numbers as words"
25 $ hg commit -m "Numbers as words"
26
26
27 change test-b
27 change test-b
28 $ cd ../test-b
28 $ cd ../test-b
29 $ cat >test.txt <<"EOF"
29 $ cat >test.txt <<"EOF"
30 > 1
30 > 1
31 > 2.5
31 > 2.5
32 > 3
32 > 3
33 > EOF
33 > EOF
34 $ hg commit -m "2 -> 2.5"
34 $ hg commit -m "2 -> 2.5"
35
35
36 now pull and merge from test-a
36 now pull and merge from test-a
37 $ hg pull ../test-a
37 $ hg pull ../test-a
38 pulling from ../test-a
38 pulling from ../test-a
39 searching for changes
39 searching for changes
40 adding changesets
40 adding changesets
41 adding manifests
41 adding manifests
42 adding file changes
42 adding file changes
43 added 1 changesets with 1 changes to 1 files (+1 heads)
43 added 1 changesets with 1 changes to 1 files (+1 heads)
44 new changesets 96b70246a118
44 new changesets 96b70246a118
45 (run 'hg heads' to see heads, 'hg merge' to merge)
45 (run 'hg heads' to see heads, 'hg merge' to merge)
46 $ hg merge
46 $ hg merge
47 merging test.txt
47 merging test.txt
48 warning: conflicts while merging test.txt! (edit, then use 'hg resolve --mark')
48 warning: conflicts while merging test.txt! (edit, then use 'hg resolve --mark')
49 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
49 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
50 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
50 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
51 [1]
51 [1]
52 resolve conflict
52 resolve conflict
53 $ cat >test.txt <<"EOF"
53 $ cat >test.txt <<"EOF"
54 > one
54 > one
55 > two-point-five
55 > two-point-five
56 > three
56 > three
57 > EOF
57 > EOF
58 $ rm -f *.orig
58 $ rm -f *.orig
59 $ hg resolve -m test.txt
59 $ hg resolve -m test.txt
60 (no more unresolved files)
60 (no more unresolved files)
61 $ hg commit -m "Merge 1"
61 $ hg commit -m "Merge 1"
62
62
63 change test-a again
63 change test-a again
64 $ cd ../test-a
64 $ cd ../test-a
65 $ cat >test.txt <<"EOF"
65 $ cat >test.txt <<"EOF"
66 > one
66 > one
67 > two-point-one
67 > two-point-one
68 > three
68 > three
69 > EOF
69 > EOF
70 $ hg commit -m "two -> two-point-one"
70 $ hg commit -m "two -> two-point-one"
71
71
72 pull and merge from test-a again
72 pull and merge from test-a again
73 $ cd ../test-b
73 $ cd ../test-b
74 $ hg pull ../test-a
74 $ hg pull ../test-a
75 pulling from ../test-a
75 pulling from ../test-a
76 searching for changes
76 searching for changes
77 adding changesets
77 adding changesets
78 adding manifests
78 adding manifests
79 adding file changes
79 adding file changes
80 added 1 changesets with 1 changes to 1 files (+1 heads)
80 added 1 changesets with 1 changes to 1 files (+1 heads)
81 new changesets 40d11a4173a8
81 new changesets 40d11a4173a8
82 (run 'hg heads' to see heads, 'hg merge' to merge)
82 (run 'hg heads' to see heads, 'hg merge' to merge)
83 $ hg merge --debug
83 $ hg merge --debug
84 searching for copies back to rev 1
85 resolving manifests
84 resolving manifests
86 branchmerge: True, force: False, partial: False
85 branchmerge: True, force: False, partial: False
87 ancestor: 96b70246a118, local: 50c3a7e29886+, remote: 40d11a4173a8
86 ancestor: 96b70246a118, local: 50c3a7e29886+, remote: 40d11a4173a8
88 preserving test.txt for resolve of test.txt
87 preserving test.txt for resolve of test.txt
89 starting 4 threads for background file closing (?)
88 starting 4 threads for background file closing (?)
90 test.txt: versions differ -> m (premerge)
89 test.txt: versions differ -> m (premerge)
91 picked tool ':merge' for test.txt (binary False symlink False changedelete False)
90 picked tool ':merge' for test.txt (binary False symlink False changedelete False)
92 merging test.txt
91 merging test.txt
93 my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
92 my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
94 test.txt: versions differ -> m (merge)
93 test.txt: versions differ -> m (merge)
95 picked tool ':merge' for test.txt (binary False symlink False changedelete False)
94 picked tool ':merge' for test.txt (binary False symlink False changedelete False)
96 my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
95 my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
97 warning: conflicts while merging test.txt! (edit, then use 'hg resolve --mark')
96 warning: conflicts while merging test.txt! (edit, then use 'hg resolve --mark')
98 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
97 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
99 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
98 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
100 [1]
99 [1]
101
100
102 $ cat test.txt
101 $ cat test.txt
103 one
102 one
104 <<<<<<< working copy: 50c3a7e29886 - test: Merge 1
103 <<<<<<< working copy: 50c3a7e29886 - test: Merge 1
105 two-point-five
104 two-point-five
106 =======
105 =======
107 two-point-one
106 two-point-one
108 >>>>>>> merge rev: 40d11a4173a8 - test: two -> two-point-one
107 >>>>>>> merge rev: 40d11a4173a8 - test: two -> two-point-one
109 three
108 three
110
109
111 $ hg debugindex test.txt
110 $ hg debugindex test.txt
112 rev linkrev nodeid p1 p2
111 rev linkrev nodeid p1 p2
113 0 0 01365c4cca56 000000000000 000000000000
112 0 0 01365c4cca56 000000000000 000000000000
114 1 1 7b013192566a 01365c4cca56 000000000000
113 1 1 7b013192566a 01365c4cca56 000000000000
115 2 2 8fe46a3eb557 01365c4cca56 000000000000
114 2 2 8fe46a3eb557 01365c4cca56 000000000000
116 3 3 fc3148072371 7b013192566a 8fe46a3eb557
115 3 3 fc3148072371 7b013192566a 8fe46a3eb557
117 4 4 d40249267ae3 8fe46a3eb557 000000000000
116 4 4 d40249267ae3 8fe46a3eb557 000000000000
118
117
119 $ hg log
118 $ hg log
120 changeset: 4:40d11a4173a8
119 changeset: 4:40d11a4173a8
121 tag: tip
120 tag: tip
122 parent: 2:96b70246a118
121 parent: 2:96b70246a118
123 user: test
122 user: test
124 date: Thu Jan 01 00:00:00 1970 +0000
123 date: Thu Jan 01 00:00:00 1970 +0000
125 summary: two -> two-point-one
124 summary: two -> two-point-one
126
125
127 changeset: 3:50c3a7e29886
126 changeset: 3:50c3a7e29886
128 parent: 1:d1e159716d41
127 parent: 1:d1e159716d41
129 parent: 2:96b70246a118
128 parent: 2:96b70246a118
130 user: test
129 user: test
131 date: Thu Jan 01 00:00:00 1970 +0000
130 date: Thu Jan 01 00:00:00 1970 +0000
132 summary: Merge 1
131 summary: Merge 1
133
132
134 changeset: 2:96b70246a118
133 changeset: 2:96b70246a118
135 parent: 0:b1832b9d912a
134 parent: 0:b1832b9d912a
136 user: test
135 user: test
137 date: Thu Jan 01 00:00:00 1970 +0000
136 date: Thu Jan 01 00:00:00 1970 +0000
138 summary: Numbers as words
137 summary: Numbers as words
139
138
140 changeset: 1:d1e159716d41
139 changeset: 1:d1e159716d41
141 user: test
140 user: test
142 date: Thu Jan 01 00:00:00 1970 +0000
141 date: Thu Jan 01 00:00:00 1970 +0000
143 summary: 2 -> 2.5
142 summary: 2 -> 2.5
144
143
145 changeset: 0:b1832b9d912a
144 changeset: 0:b1832b9d912a
146 user: test
145 user: test
147 date: Thu Jan 01 00:00:00 1970 +0000
146 date: Thu Jan 01 00:00:00 1970 +0000
148 summary: Initial
147 summary: Initial
149
148
150
149
151 $ cd ..
150 $ cd ..
@@ -1,436 +1,434 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 > drawdag=$TESTDIR/drawdag.py
4 > drawdag=$TESTDIR/drawdag.py
5 >
5 >
6 > [phases]
6 > [phases]
7 > publish=False
7 > publish=False
8 >
8 >
9 > [alias]
9 > [alias]
10 > tglog = log -G --template "{rev}:{phase} '{desc}' {branches} {bookmarks}\n"
10 > tglog = log -G --template "{rev}:{phase} '{desc}' {branches} {bookmarks}\n"
11 > EOF
11 > EOF
12
12
13 $ hg init a
13 $ hg init a
14 $ cd a
14 $ cd a
15 $ echo c1 >common
15 $ echo c1 >common
16 $ hg add common
16 $ hg add common
17 $ hg ci -m C1
17 $ hg ci -m C1
18
18
19 $ echo c2 >>common
19 $ echo c2 >>common
20 $ hg ci -m C2
20 $ hg ci -m C2
21
21
22 $ echo c3 >>common
22 $ echo c3 >>common
23 $ hg ci -m C3
23 $ hg ci -m C3
24
24
25 $ hg up -q -C 1
25 $ hg up -q -C 1
26
26
27 $ echo l1 >>extra
27 $ echo l1 >>extra
28 $ hg add extra
28 $ hg add extra
29 $ hg ci -m L1
29 $ hg ci -m L1
30 created new head
30 created new head
31
31
32 $ sed -e 's/c2/l2/' common > common.new
32 $ sed -e 's/c2/l2/' common > common.new
33 $ mv common.new common
33 $ mv common.new common
34 $ hg ci -m L2
34 $ hg ci -m L2
35
35
36 $ echo l3 >> extra2
36 $ echo l3 >> extra2
37 $ hg add extra2
37 $ hg add extra2
38 $ hg ci -m L3
38 $ hg ci -m L3
39 $ hg bookmark mybook
39 $ hg bookmark mybook
40
40
41 $ hg phase --force --secret 4
41 $ hg phase --force --secret 4
42
42
43 $ hg tglog
43 $ hg tglog
44 @ 5:secret 'L3' mybook
44 @ 5:secret 'L3' mybook
45 |
45 |
46 o 4:secret 'L2'
46 o 4:secret 'L2'
47 |
47 |
48 o 3:draft 'L1'
48 o 3:draft 'L1'
49 |
49 |
50 | o 2:draft 'C3'
50 | o 2:draft 'C3'
51 |/
51 |/
52 o 1:draft 'C2'
52 o 1:draft 'C2'
53 |
53 |
54 o 0:draft 'C1'
54 o 0:draft 'C1'
55
55
56 Try to call --continue:
56 Try to call --continue:
57
57
58 $ hg rebase --continue
58 $ hg rebase --continue
59 abort: no rebase in progress
59 abort: no rebase in progress
60 [255]
60 [255]
61
61
62 Conflicting rebase:
62 Conflicting rebase:
63
63
64 $ hg rebase -s 3 -d 2
64 $ hg rebase -s 3 -d 2
65 rebasing 3:3163e20567cc "L1"
65 rebasing 3:3163e20567cc "L1"
66 rebasing 4:46f0b057b5c0 "L2"
66 rebasing 4:46f0b057b5c0 "L2"
67 merging common
67 merging common
68 warning: conflicts while merging common! (edit, then use 'hg resolve --mark')
68 warning: conflicts while merging common! (edit, then use 'hg resolve --mark')
69 unresolved conflicts (see hg resolve, then hg rebase --continue)
69 unresolved conflicts (see hg resolve, then hg rebase --continue)
70 [1]
70 [1]
71
71
72 $ hg status --config commands.status.verbose=1
72 $ hg status --config commands.status.verbose=1
73 M common
73 M common
74 ? common.orig
74 ? common.orig
75 # The repository is in an unfinished *rebase* state.
75 # The repository is in an unfinished *rebase* state.
76
76
77 # Unresolved merge conflicts:
77 # Unresolved merge conflicts:
78 #
78 #
79 # common
79 # common
80 #
80 #
81 # To mark files as resolved: hg resolve --mark FILE
81 # To mark files as resolved: hg resolve --mark FILE
82
82
83 # To continue: hg rebase --continue
83 # To continue: hg rebase --continue
84 # To abort: hg rebase --abort
84 # To abort: hg rebase --abort
85
85
86
86
87 Try to continue without solving the conflict:
87 Try to continue without solving the conflict:
88
88
89 $ hg rebase --continue
89 $ hg rebase --continue
90 abort: unresolved merge conflicts (see 'hg help resolve')
90 abort: unresolved merge conflicts (see 'hg help resolve')
91 [255]
91 [255]
92
92
93 Conclude rebase:
93 Conclude rebase:
94
94
95 $ echo 'resolved merge' >common
95 $ echo 'resolved merge' >common
96 $ hg resolve -m common
96 $ hg resolve -m common
97 (no more unresolved files)
97 (no more unresolved files)
98 continue: hg rebase --continue
98 continue: hg rebase --continue
99 $ hg rebase --continue
99 $ hg rebase --continue
100 already rebased 3:3163e20567cc "L1" as 3e046f2ecedb
100 already rebased 3:3163e20567cc "L1" as 3e046f2ecedb
101 rebasing 4:46f0b057b5c0 "L2"
101 rebasing 4:46f0b057b5c0 "L2"
102 rebasing 5:8029388f38dc "L3" (mybook)
102 rebasing 5:8029388f38dc "L3" (mybook)
103 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3163e20567cc-5ca4656e-rebase.hg
103 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3163e20567cc-5ca4656e-rebase.hg
104
104
105 $ hg tglog
105 $ hg tglog
106 @ 5:secret 'L3' mybook
106 @ 5:secret 'L3' mybook
107 |
107 |
108 o 4:secret 'L2'
108 o 4:secret 'L2'
109 |
109 |
110 o 3:draft 'L1'
110 o 3:draft 'L1'
111 |
111 |
112 o 2:draft 'C3'
112 o 2:draft 'C3'
113 |
113 |
114 o 1:draft 'C2'
114 o 1:draft 'C2'
115 |
115 |
116 o 0:draft 'C1'
116 o 0:draft 'C1'
117
117
118 Check correctness:
118 Check correctness:
119
119
120 $ hg cat -r 0 common
120 $ hg cat -r 0 common
121 c1
121 c1
122
122
123 $ hg cat -r 1 common
123 $ hg cat -r 1 common
124 c1
124 c1
125 c2
125 c2
126
126
127 $ hg cat -r 2 common
127 $ hg cat -r 2 common
128 c1
128 c1
129 c2
129 c2
130 c3
130 c3
131
131
132 $ hg cat -r 3 common
132 $ hg cat -r 3 common
133 c1
133 c1
134 c2
134 c2
135 c3
135 c3
136
136
137 $ hg cat -r 4 common
137 $ hg cat -r 4 common
138 resolved merge
138 resolved merge
139
139
140 $ hg cat -r 5 common
140 $ hg cat -r 5 common
141 resolved merge
141 resolved merge
142
142
143 Bookmark stays active after --continue
143 Bookmark stays active after --continue
144 $ hg bookmarks
144 $ hg bookmarks
145 * mybook 5:d67b21408fc0
145 * mybook 5:d67b21408fc0
146
146
147 $ cd ..
147 $ cd ..
148
148
149 Check that the right ancestors is used while rebasing a merge (issue4041)
149 Check that the right ancestors is used while rebasing a merge (issue4041)
150
150
151 $ hg init issue4041
151 $ hg init issue4041
152 $ cd issue4041
152 $ cd issue4041
153 $ hg unbundle "$TESTDIR/bundles/issue4041.hg"
153 $ hg unbundle "$TESTDIR/bundles/issue4041.hg"
154 adding changesets
154 adding changesets
155 adding manifests
155 adding manifests
156 adding file changes
156 adding file changes
157 added 11 changesets with 8 changes to 3 files (+1 heads)
157 added 11 changesets with 8 changes to 3 files (+1 heads)
158 new changesets 24797d4f68de:2f2496ddf49d (11 drafts)
158 new changesets 24797d4f68de:2f2496ddf49d (11 drafts)
159 (run 'hg heads' to see heads)
159 (run 'hg heads' to see heads)
160 $ hg up default
160 $ hg up default
161 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 $ hg log -G
162 $ hg log -G
163 o changeset: 10:2f2496ddf49d
163 o changeset: 10:2f2496ddf49d
164 |\ branch: f1
164 |\ branch: f1
165 | | tag: tip
165 | | tag: tip
166 | | parent: 7:4c9fbe56a16f
166 | | parent: 7:4c9fbe56a16f
167 | | parent: 9:e31216eec445
167 | | parent: 9:e31216eec445
168 | | user: szhang
168 | | user: szhang
169 | | date: Thu Sep 05 12:59:39 2013 -0400
169 | | date: Thu Sep 05 12:59:39 2013 -0400
170 | | summary: merge
170 | | summary: merge
171 | |
171 | |
172 | o changeset: 9:e31216eec445
172 | o changeset: 9:e31216eec445
173 | | branch: f1
173 | | branch: f1
174 | | user: szhang
174 | | user: szhang
175 | | date: Thu Sep 05 12:59:10 2013 -0400
175 | | date: Thu Sep 05 12:59:10 2013 -0400
176 | | summary: more changes to f1
176 | | summary: more changes to f1
177 | |
177 | |
178 | o changeset: 8:8e4e2c1a07ae
178 | o changeset: 8:8e4e2c1a07ae
179 | |\ branch: f1
179 | |\ branch: f1
180 | | | parent: 2:4bc80088dc6b
180 | | | parent: 2:4bc80088dc6b
181 | | | parent: 6:400110238667
181 | | | parent: 6:400110238667
182 | | | user: szhang
182 | | | user: szhang
183 | | | date: Thu Sep 05 12:57:59 2013 -0400
183 | | | date: Thu Sep 05 12:57:59 2013 -0400
184 | | | summary: bad merge
184 | | | summary: bad merge
185 | | |
185 | | |
186 o | | changeset: 7:4c9fbe56a16f
186 o | | changeset: 7:4c9fbe56a16f
187 |/ / branch: f1
187 |/ / branch: f1
188 | | parent: 2:4bc80088dc6b
188 | | parent: 2:4bc80088dc6b
189 | | user: szhang
189 | | user: szhang
190 | | date: Thu Sep 05 12:54:00 2013 -0400
190 | | date: Thu Sep 05 12:54:00 2013 -0400
191 | | summary: changed f1
191 | | summary: changed f1
192 | |
192 | |
193 | o changeset: 6:400110238667
193 | o changeset: 6:400110238667
194 | | branch: f2
194 | | branch: f2
195 | | parent: 4:12e8ec6bb010
195 | | parent: 4:12e8ec6bb010
196 | | user: szhang
196 | | user: szhang
197 | | date: Tue Sep 03 13:58:02 2013 -0400
197 | | date: Tue Sep 03 13:58:02 2013 -0400
198 | | summary: changed f2 on f2
198 | | summary: changed f2 on f2
199 | |
199 | |
200 | | @ changeset: 5:d79e2059b5c0
200 | | @ changeset: 5:d79e2059b5c0
201 | | | parent: 3:8a951942e016
201 | | | parent: 3:8a951942e016
202 | | | user: szhang
202 | | | user: szhang
203 | | | date: Tue Sep 03 13:57:39 2013 -0400
203 | | | date: Tue Sep 03 13:57:39 2013 -0400
204 | | | summary: changed f2 on default
204 | | | summary: changed f2 on default
205 | | |
205 | | |
206 | o | changeset: 4:12e8ec6bb010
206 | o | changeset: 4:12e8ec6bb010
207 | |/ branch: f2
207 | |/ branch: f2
208 | | user: szhang
208 | | user: szhang
209 | | date: Tue Sep 03 13:57:18 2013 -0400
209 | | date: Tue Sep 03 13:57:18 2013 -0400
210 | | summary: created f2 branch
210 | | summary: created f2 branch
211 | |
211 | |
212 | o changeset: 3:8a951942e016
212 | o changeset: 3:8a951942e016
213 | | parent: 0:24797d4f68de
213 | | parent: 0:24797d4f68de
214 | | user: szhang
214 | | user: szhang
215 | | date: Tue Sep 03 13:57:11 2013 -0400
215 | | date: Tue Sep 03 13:57:11 2013 -0400
216 | | summary: added f2.txt
216 | | summary: added f2.txt
217 | |
217 | |
218 o | changeset: 2:4bc80088dc6b
218 o | changeset: 2:4bc80088dc6b
219 | | branch: f1
219 | | branch: f1
220 | | user: szhang
220 | | user: szhang
221 | | date: Tue Sep 03 13:56:20 2013 -0400
221 | | date: Tue Sep 03 13:56:20 2013 -0400
222 | | summary: added f1.txt
222 | | summary: added f1.txt
223 | |
223 | |
224 o | changeset: 1:ef53c9e6b608
224 o | changeset: 1:ef53c9e6b608
225 |/ branch: f1
225 |/ branch: f1
226 | user: szhang
226 | user: szhang
227 | date: Tue Sep 03 13:55:26 2013 -0400
227 | date: Tue Sep 03 13:55:26 2013 -0400
228 | summary: created f1 branch
228 | summary: created f1 branch
229 |
229 |
230 o changeset: 0:24797d4f68de
230 o changeset: 0:24797d4f68de
231 user: szhang
231 user: szhang
232 date: Tue Sep 03 13:55:08 2013 -0400
232 date: Tue Sep 03 13:55:08 2013 -0400
233 summary: added default.txt
233 summary: added default.txt
234
234
235 $ hg rebase -s9 -d2 --debug # use debug to really check merge base used
235 $ hg rebase -s9 -d2 --debug # use debug to really check merge base used
236 rebase onto 4bc80088dc6b starting from e31216eec445
236 rebase onto 4bc80088dc6b starting from e31216eec445
237 rebasing on disk
237 rebasing on disk
238 rebase status stored
238 rebase status stored
239 rebasing 9:e31216eec445 "more changes to f1"
239 rebasing 9:e31216eec445 "more changes to f1"
240 future parents are 2 and -1
240 future parents are 2 and -1
241 update to 2:4bc80088dc6b
241 update to 2:4bc80088dc6b
242 resolving manifests
242 resolving manifests
243 branchmerge: False, force: True, partial: False
243 branchmerge: False, force: True, partial: False
244 ancestor: d79e2059b5c0+, local: d79e2059b5c0+, remote: 4bc80088dc6b
244 ancestor: d79e2059b5c0+, local: d79e2059b5c0+, remote: 4bc80088dc6b
245 f2.txt: other deleted -> r
245 f2.txt: other deleted -> r
246 removing f2.txt
246 removing f2.txt
247 f1.txt: remote created -> g
247 f1.txt: remote created -> g
248 getting f1.txt
248 getting f1.txt
249 merge against 9:e31216eec445
249 merge against 9:e31216eec445
250 detach base 8:8e4e2c1a07ae
250 detach base 8:8e4e2c1a07ae
251 searching for copies back to rev 3
252 unmatched files in other (from topological common ancestor):
251 unmatched files in other (from topological common ancestor):
253 f2.txt
252 f2.txt
254 resolving manifests
253 resolving manifests
255 branchmerge: True, force: True, partial: False
254 branchmerge: True, force: True, partial: False
256 ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
255 ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
257 f1.txt: remote is newer -> g
256 f1.txt: remote is newer -> g
258 getting f1.txt
257 getting f1.txt
259 committing files:
258 committing files:
260 f1.txt
259 f1.txt
261 committing manifest
260 committing manifest
262 committing changelog
261 committing changelog
263 updating the branch cache
262 updating the branch cache
264 rebased as 19c888675e13
263 rebased as 19c888675e13
265 rebase status stored
264 rebase status stored
266 rebasing 10:2f2496ddf49d "merge" (tip)
265 rebasing 10:2f2496ddf49d "merge" (tip)
267 future parents are 11 and 7
266 future parents are 11 and 7
268 already in destination
267 already in destination
269 merge against 10:2f2496ddf49d
268 merge against 10:2f2496ddf49d
270 detach base 9:e31216eec445
269 detach base 9:e31216eec445
271 searching for copies back to rev 3
272 unmatched files in other (from topological common ancestor):
270 unmatched files in other (from topological common ancestor):
273 f2.txt
271 f2.txt
274 resolving manifests
272 resolving manifests
275 branchmerge: True, force: True, partial: False
273 branchmerge: True, force: True, partial: False
276 ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
274 ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
277 f1.txt: remote is newer -> g
275 f1.txt: remote is newer -> g
278 getting f1.txt
276 getting f1.txt
279 committing files:
277 committing files:
280 f1.txt
278 f1.txt
281 committing manifest
279 committing manifest
282 committing changelog
280 committing changelog
283 updating the branch cache
281 updating the branch cache
284 rebased as 2a7f09cac94c
282 rebased as 2a7f09cac94c
285 rebase status stored
283 rebase status stored
286 rebase merging completed
284 rebase merging completed
287 update back to initial working directory parent
285 update back to initial working directory parent
288 resolving manifests
286 resolving manifests
289 branchmerge: False, force: False, partial: False
287 branchmerge: False, force: False, partial: False
290 ancestor: 2a7f09cac94c, local: 2a7f09cac94c+, remote: d79e2059b5c0
288 ancestor: 2a7f09cac94c, local: 2a7f09cac94c+, remote: d79e2059b5c0
291 f1.txt: other deleted -> r
289 f1.txt: other deleted -> r
292 removing f1.txt
290 removing f1.txt
293 f2.txt: remote created -> g
291 f2.txt: remote created -> g
294 getting f2.txt
292 getting f2.txt
295 2 changesets found
293 2 changesets found
296 list of changesets:
294 list of changesets:
297 e31216eec445e44352c5f01588856059466a24c9
295 e31216eec445e44352c5f01588856059466a24c9
298 2f2496ddf49d69b5ef23ad8cf9fb2e0e4faf0ac2
296 2f2496ddf49d69b5ef23ad8cf9fb2e0e4faf0ac2
299 bundle2-output-bundle: "HG20", (1 params) 3 parts total
297 bundle2-output-bundle: "HG20", (1 params) 3 parts total
300 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
298 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
301 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
299 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
302 bundle2-output-part: "phase-heads" 24 bytes payload
300 bundle2-output-part: "phase-heads" 24 bytes payload
303 saved backup bundle to $TESTTMP/issue4041/.hg/strip-backup/e31216eec445-15f7a814-rebase.hg
301 saved backup bundle to $TESTTMP/issue4041/.hg/strip-backup/e31216eec445-15f7a814-rebase.hg
304 3 changesets found
302 3 changesets found
305 list of changesets:
303 list of changesets:
306 4c9fbe56a16f30c0d5dcc40ec1a97bbe3325209c
304 4c9fbe56a16f30c0d5dcc40ec1a97bbe3325209c
307 19c888675e133ab5dff84516926a65672eaf04d9
305 19c888675e133ab5dff84516926a65672eaf04d9
308 2a7f09cac94c7f4b73ebd5cd1a62d3b2e8e336bf
306 2a7f09cac94c7f4b73ebd5cd1a62d3b2e8e336bf
309 bundle2-output-bundle: "HG20", 3 parts total
307 bundle2-output-bundle: "HG20", 3 parts total
310 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
308 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
311 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
309 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
312 bundle2-output-part: "phase-heads" 24 bytes payload
310 bundle2-output-part: "phase-heads" 24 bytes payload
313 adding branch
311 adding branch
314 bundle2-input-bundle: with-transaction
312 bundle2-input-bundle: with-transaction
315 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
313 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
316 adding changesets
314 adding changesets
317 add changeset 4c9fbe56a16f
315 add changeset 4c9fbe56a16f
318 add changeset 19c888675e13
316 add changeset 19c888675e13
319 add changeset 2a7f09cac94c
317 add changeset 2a7f09cac94c
320 adding manifests
318 adding manifests
321 adding file changes
319 adding file changes
322 adding f1.txt revisions
320 adding f1.txt revisions
323 added 2 changesets with 2 changes to 1 files
321 added 2 changesets with 2 changes to 1 files
324 bundle2-input-part: total payload size 1686
322 bundle2-input-part: total payload size 1686
325 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
323 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
326 bundle2-input-part: total payload size 74
324 bundle2-input-part: total payload size 74
327 truncating cache/rbc-revs-v1 to 56
325 truncating cache/rbc-revs-v1 to 56
328 bundle2-input-part: "phase-heads" supported
326 bundle2-input-part: "phase-heads" supported
329 bundle2-input-part: total payload size 24
327 bundle2-input-part: total payload size 24
330 bundle2-input-bundle: 2 parts total
328 bundle2-input-bundle: 2 parts total
331 updating the branch cache
329 updating the branch cache
332 invalid branchheads cache (served): tip differs
330 invalid branchheads cache (served): tip differs
333 invalid branchheads cache (served.hidden): tip differs
331 invalid branchheads cache (served.hidden): tip differs
334 rebase completed
332 rebase completed
335
333
336 Test minimization of merge conflicts
334 Test minimization of merge conflicts
337 $ hg up -q null
335 $ hg up -q null
338 $ echo a > a
336 $ echo a > a
339 $ hg add a
337 $ hg add a
340 $ hg commit -q -m 'a'
338 $ hg commit -q -m 'a'
341 $ echo b >> a
339 $ echo b >> a
342 $ hg commit -q -m 'ab'
340 $ hg commit -q -m 'ab'
343 $ hg bookmark ab
341 $ hg bookmark ab
344 $ hg up -q '.^'
342 $ hg up -q '.^'
345 $ echo b >> a
343 $ echo b >> a
346 $ echo c >> a
344 $ echo c >> a
347 $ hg commit -q -m 'abc'
345 $ hg commit -q -m 'abc'
348 $ hg rebase -s 7bc217434fc1 -d ab --keep
346 $ hg rebase -s 7bc217434fc1 -d ab --keep
349 rebasing 13:7bc217434fc1 "abc" (tip)
347 rebasing 13:7bc217434fc1 "abc" (tip)
350 merging a
348 merging a
351 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
349 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
352 unresolved conflicts (see hg resolve, then hg rebase --continue)
350 unresolved conflicts (see hg resolve, then hg rebase --continue)
353 [1]
351 [1]
354 $ hg diff
352 $ hg diff
355 diff -r 328e4ab1f7cc a
353 diff -r 328e4ab1f7cc a
356 --- a/a Thu Jan 01 00:00:00 1970 +0000
354 --- a/a Thu Jan 01 00:00:00 1970 +0000
357 +++ b/a * (glob)
355 +++ b/a * (glob)
358 @@ -1,2 +1,6 @@
356 @@ -1,2 +1,6 @@
359 a
357 a
360 b
358 b
361 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
359 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
362 +=======
360 +=======
363 +c
361 +c
364 +>>>>>>> source: 7bc217434fc1 - test: abc
362 +>>>>>>> source: 7bc217434fc1 - test: abc
365 $ hg rebase --abort
363 $ hg rebase --abort
366 rebase aborted
364 rebase aborted
367 $ hg up -q -C 7bc217434fc1
365 $ hg up -q -C 7bc217434fc1
368 $ hg rebase -s . -d ab --keep -t internal:merge3
366 $ hg rebase -s . -d ab --keep -t internal:merge3
369 rebasing 13:7bc217434fc1 "abc" (tip)
367 rebasing 13:7bc217434fc1 "abc" (tip)
370 merging a
368 merging a
371 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
369 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
372 unresolved conflicts (see hg resolve, then hg rebase --continue)
370 unresolved conflicts (see hg resolve, then hg rebase --continue)
373 [1]
371 [1]
374 $ hg diff
372 $ hg diff
375 diff -r 328e4ab1f7cc a
373 diff -r 328e4ab1f7cc a
376 --- a/a Thu Jan 01 00:00:00 1970 +0000
374 --- a/a Thu Jan 01 00:00:00 1970 +0000
377 +++ b/a * (glob)
375 +++ b/a * (glob)
378 @@ -1,2 +1,8 @@
376 @@ -1,2 +1,8 @@
379 a
377 a
380 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
378 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
381 b
379 b
382 +||||||| base
380 +||||||| base
383 +=======
381 +=======
384 +b
382 +b
385 +c
383 +c
386 +>>>>>>> source: 7bc217434fc1 - test: abc
384 +>>>>>>> source: 7bc217434fc1 - test: abc
387
385
388 Test rebase with obsstore turned on and off (issue5606)
386 Test rebase with obsstore turned on and off (issue5606)
389
387
390 $ cd $TESTTMP
388 $ cd $TESTTMP
391 $ hg init b
389 $ hg init b
392 $ cd b
390 $ cd b
393 $ hg debugdrawdag <<'EOS'
391 $ hg debugdrawdag <<'EOS'
394 > D
392 > D
395 > |
393 > |
396 > C
394 > C
397 > |
395 > |
398 > B E
396 > B E
399 > |/
397 > |/
400 > A
398 > A
401 > EOS
399 > EOS
402
400
403 $ hg update E -q
401 $ hg update E -q
404 $ echo 3 > B
402 $ echo 3 > B
405 $ hg commit --amend -m E -A B -q
403 $ hg commit --amend -m E -A B -q
406 $ hg rebase -r B+D -d . --config experimental.evolution=true
404 $ hg rebase -r B+D -d . --config experimental.evolution=true
407 rebasing 1:112478962961 "B" (B)
405 rebasing 1:112478962961 "B" (B)
408 merging B
406 merging B
409 warning: conflicts while merging B! (edit, then use 'hg resolve --mark')
407 warning: conflicts while merging B! (edit, then use 'hg resolve --mark')
410 unresolved conflicts (see hg resolve, then hg rebase --continue)
408 unresolved conflicts (see hg resolve, then hg rebase --continue)
411 [1]
409 [1]
412
410
413 $ echo 4 > B
411 $ echo 4 > B
414 $ hg resolve -m
412 $ hg resolve -m
415 (no more unresolved files)
413 (no more unresolved files)
416 continue: hg rebase --continue
414 continue: hg rebase --continue
417 $ hg rebase --continue --config experimental.evolution=none
415 $ hg rebase --continue --config experimental.evolution=none
418 rebasing 1:112478962961 "B" (B)
416 rebasing 1:112478962961 "B" (B)
419 rebasing 3:f585351a92f8 "D" (D)
417 rebasing 3:f585351a92f8 "D" (D)
420 warning: orphaned descendants detected, not stripping 112478962961
418 warning: orphaned descendants detected, not stripping 112478962961
421 saved backup bundle to $TESTTMP/b/.hg/strip-backup/f585351a92f8-e536a9e4-rebase.hg
419 saved backup bundle to $TESTTMP/b/.hg/strip-backup/f585351a92f8-e536a9e4-rebase.hg
422
420
423 $ rm .hg/localtags
421 $ rm .hg/localtags
424 $ hg tglog
422 $ hg tglog
425 o 5:draft 'D'
423 o 5:draft 'D'
426 |
424 |
427 o 4:draft 'B'
425 o 4:draft 'B'
428 |
426 |
429 @ 3:draft 'E'
427 @ 3:draft 'E'
430 |
428 |
431 | o 2:draft 'C'
429 | o 2:draft 'C'
432 | |
430 | |
433 | o 1:draft 'B'
431 | o 1:draft 'B'
434 |/
432 |/
435 o 0:draft 'A'
433 o 0:draft 'A'
436
434
@@ -1,296 +1,294 b''
1 $ hg init t
1 $ hg init t
2 $ cd t
2 $ cd t
3
3
4 $ mkdir a
4 $ mkdir a
5 $ echo foo > a/a
5 $ echo foo > a/a
6 $ echo bar > a/b
6 $ echo bar > a/b
7 $ hg ci -Am "0"
7 $ hg ci -Am "0"
8 adding a/a
8 adding a/a
9 adding a/b
9 adding a/b
10
10
11 $ hg co -C 0
11 $ hg co -C 0
12 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 $ hg mv a b
13 $ hg mv a b
14 moving a/a to b/a
14 moving a/a to b/a
15 moving a/b to b/b
15 moving a/b to b/b
16 $ hg ci -m "1 mv a/ b/"
16 $ hg ci -m "1 mv a/ b/"
17
17
18 $ hg co -C 0
18 $ hg co -C 0
19 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
19 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
20 $ echo baz > a/c
20 $ echo baz > a/c
21 $ echo quux > a/d
21 $ echo quux > a/d
22 $ hg add a/c
22 $ hg add a/c
23 $ hg ci -m "2 add a/c"
23 $ hg ci -m "2 add a/c"
24 created new head
24 created new head
25
25
26 $ hg merge --debug 1
26 $ hg merge --debug 1
27 searching for copies back to rev 1
28 unmatched files in local:
27 unmatched files in local:
29 a/c
28 a/c
30 unmatched files in other:
29 unmatched files in other:
31 b/a
30 b/a
32 b/b
31 b/b
33 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
32 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
34 src: 'a/a' -> dst: 'b/a'
33 src: 'a/a' -> dst: 'b/a'
35 src: 'a/b' -> dst: 'b/b'
34 src: 'a/b' -> dst: 'b/b'
36 checking for directory renames
35 checking for directory renames
37 discovered dir src: 'a/' -> dst: 'b/'
36 discovered dir src: 'a/' -> dst: 'b/'
38 pending file src: 'a/c' -> dst: 'b/c'
37 pending file src: 'a/c' -> dst: 'b/c'
39 resolving manifests
38 resolving manifests
40 branchmerge: True, force: False, partial: False
39 branchmerge: True, force: False, partial: False
41 ancestor: f9b20c0d4c51, local: ce36d17b18fb+, remote: 397f8b00a740
40 ancestor: f9b20c0d4c51, local: ce36d17b18fb+, remote: 397f8b00a740
42 a/a: other deleted -> r
41 a/a: other deleted -> r
43 removing a/a
42 removing a/a
44 a/b: other deleted -> r
43 a/b: other deleted -> r
45 removing a/b
44 removing a/b
46 b/a: remote created -> g
45 b/a: remote created -> g
47 getting b/a
46 getting b/a
48 b/b: remote created -> g
47 b/b: remote created -> g
49 getting b/b
48 getting b/b
50 b/c: remote directory rename - move from a/c -> dm
49 b/c: remote directory rename - move from a/c -> dm
51 moving a/c to b/c
50 moving a/c to b/c
52 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
51 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
53 (branch merge, don't forget to commit)
52 (branch merge, don't forget to commit)
54
53
55 $ echo a/* b/*
54 $ echo a/* b/*
56 a/d b/a b/b b/c
55 a/d b/a b/b b/c
57 $ hg st -C
56 $ hg st -C
58 M b/a
57 M b/a
59 M b/b
58 M b/b
60 A b/c
59 A b/c
61 a/c
60 a/c
62 R a/a
61 R a/a
63 R a/b
62 R a/b
64 R a/c
63 R a/c
65 ? a/d
64 ? a/d
66 $ hg ci -m "3 merge 2+1"
65 $ hg ci -m "3 merge 2+1"
67 $ hg debugrename b/c
66 $ hg debugrename b/c
68 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
67 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
69
68
70 $ hg co -C 1
69 $ hg co -C 1
71 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
70 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
72 $ hg merge --debug 2
71 $ hg merge --debug 2
73 searching for copies back to rev 1
74 unmatched files in local:
72 unmatched files in local:
75 b/a
73 b/a
76 b/b
74 b/b
77 unmatched files in other:
75 unmatched files in other:
78 a/c
76 a/c
79 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
77 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
80 src: 'a/a' -> dst: 'b/a'
78 src: 'a/a' -> dst: 'b/a'
81 src: 'a/b' -> dst: 'b/b'
79 src: 'a/b' -> dst: 'b/b'
82 checking for directory renames
80 checking for directory renames
83 discovered dir src: 'a/' -> dst: 'b/'
81 discovered dir src: 'a/' -> dst: 'b/'
84 pending file src: 'a/c' -> dst: 'b/c'
82 pending file src: 'a/c' -> dst: 'b/c'
85 resolving manifests
83 resolving manifests
86 branchmerge: True, force: False, partial: False
84 branchmerge: True, force: False, partial: False
87 ancestor: f9b20c0d4c51, local: 397f8b00a740+, remote: ce36d17b18fb
85 ancestor: f9b20c0d4c51, local: 397f8b00a740+, remote: ce36d17b18fb
88 starting 4 threads for background file closing (?)
86 starting 4 threads for background file closing (?)
89 b/c: local directory rename - get from a/c -> dg
87 b/c: local directory rename - get from a/c -> dg
90 getting a/c to b/c
88 getting a/c to b/c
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 (branch merge, don't forget to commit)
90 (branch merge, don't forget to commit)
93
91
94 $ echo a/* b/*
92 $ echo a/* b/*
95 a/d b/a b/b b/c
93 a/d b/a b/b b/c
96 $ hg st -C
94 $ hg st -C
97 A b/c
95 A b/c
98 a/c
96 a/c
99 ? a/d
97 ? a/d
100 $ hg ci -m "4 merge 1+2"
98 $ hg ci -m "4 merge 1+2"
101 created new head
99 created new head
102 $ hg debugrename b/c
100 $ hg debugrename b/c
103 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
101 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
104
102
105 Local directory rename with conflicting file added in remote source directory
103 Local directory rename with conflicting file added in remote source directory
106 and untracked in local target directory.
104 and untracked in local target directory.
107
105
108 $ hg co -qC 1
106 $ hg co -qC 1
109 $ echo target > b/c
107 $ echo target > b/c
110 $ hg merge 2
108 $ hg merge 2
111 b/c: untracked file differs
109 b/c: untracked file differs
112 abort: untracked files in working directory differ from files in requested revision
110 abort: untracked files in working directory differ from files in requested revision
113 [255]
111 [255]
114 $ cat b/c
112 $ cat b/c
115 target
113 target
116 but it should succeed if the content matches
114 but it should succeed if the content matches
117 $ hg cat -r 2 a/c > b/c
115 $ hg cat -r 2 a/c > b/c
118 $ hg merge 2
116 $ hg merge 2
119 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
117 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
120 (branch merge, don't forget to commit)
118 (branch merge, don't forget to commit)
121 $ hg st -C
119 $ hg st -C
122 A b/c
120 A b/c
123 a/c
121 a/c
124 ? a/d
122 ? a/d
125
123
126 Local directory rename with conflicting file added in remote source directory
124 Local directory rename with conflicting file added in remote source directory
127 and committed in local target directory.
125 and committed in local target directory.
128
126
129 $ hg co -qC 1
127 $ hg co -qC 1
130 $ echo target > b/c
128 $ echo target > b/c
131 $ hg add b/c
129 $ hg add b/c
132 $ hg commit -qm 'new file in target directory'
130 $ hg commit -qm 'new file in target directory'
133 $ hg merge 2
131 $ hg merge 2
134 merging b/c and a/c to b/c
132 merging b/c and a/c to b/c
135 warning: conflicts while merging b/c! (edit, then use 'hg resolve --mark')
133 warning: conflicts while merging b/c! (edit, then use 'hg resolve --mark')
136 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
134 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
137 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
135 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
138 [1]
136 [1]
139 $ hg st -A
137 $ hg st -A
140 M b/c
138 M b/c
141 a/c
139 a/c
142 ? a/d
140 ? a/d
143 ? b/c.orig
141 ? b/c.orig
144 C b/a
142 C b/a
145 C b/b
143 C b/b
146 $ cat b/c
144 $ cat b/c
147 <<<<<<< working copy: f1c50ca4f127 - test: new file in target directory
145 <<<<<<< working copy: f1c50ca4f127 - test: new file in target directory
148 target
146 target
149 =======
147 =======
150 baz
148 baz
151 >>>>>>> merge rev: ce36d17b18fb - test: 2 add a/c
149 >>>>>>> merge rev: ce36d17b18fb - test: 2 add a/c
152 $ rm b/c.orig
150 $ rm b/c.orig
153
151
154 Remote directory rename with conflicting file added in remote target directory
152 Remote directory rename with conflicting file added in remote target directory
155 and committed in local source directory.
153 and committed in local source directory.
156
154
157 $ hg co -qC 2
155 $ hg co -qC 2
158 $ hg st -A
156 $ hg st -A
159 ? a/d
157 ? a/d
160 C a/a
158 C a/a
161 C a/b
159 C a/b
162 C a/c
160 C a/c
163 $ hg merge 5
161 $ hg merge 5
164 merging a/c and b/c to b/c
162 merging a/c and b/c to b/c
165 warning: conflicts while merging b/c! (edit, then use 'hg resolve --mark')
163 warning: conflicts while merging b/c! (edit, then use 'hg resolve --mark')
166 2 files updated, 0 files merged, 2 files removed, 1 files unresolved
164 2 files updated, 0 files merged, 2 files removed, 1 files unresolved
167 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
165 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
168 [1]
166 [1]
169 $ hg st -A
167 $ hg st -A
170 M b/a
168 M b/a
171 M b/b
169 M b/b
172 M b/c
170 M b/c
173 a/c
171 a/c
174 R a/a
172 R a/a
175 R a/b
173 R a/b
176 R a/c
174 R a/c
177 ? a/d
175 ? a/d
178 ? b/c.orig
176 ? b/c.orig
179 $ cat b/c
177 $ cat b/c
180 <<<<<<< working copy: ce36d17b18fb - test: 2 add a/c
178 <<<<<<< working copy: ce36d17b18fb - test: 2 add a/c
181 baz
179 baz
182 =======
180 =======
183 target
181 target
184 >>>>>>> merge rev: f1c50ca4f127 - test: new file in target directory
182 >>>>>>> merge rev: f1c50ca4f127 - test: new file in target directory
185
183
186 Second scenario with two repos:
184 Second scenario with two repos:
187
185
188 $ cd ..
186 $ cd ..
189 $ hg init r1
187 $ hg init r1
190 $ cd r1
188 $ cd r1
191 $ mkdir a
189 $ mkdir a
192 $ echo foo > a/f
190 $ echo foo > a/f
193 $ hg add a
191 $ hg add a
194 adding a/f
192 adding a/f
195 $ hg ci -m "a/f == foo"
193 $ hg ci -m "a/f == foo"
196 $ cd ..
194 $ cd ..
197
195
198 $ hg clone r1 r2
196 $ hg clone r1 r2
199 updating to branch default
197 updating to branch default
200 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
198 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
201 $ cd r2
199 $ cd r2
202 $ hg mv a b
200 $ hg mv a b
203 moving a/f to b/f
201 moving a/f to b/f
204 $ echo foo1 > b/f
202 $ echo foo1 > b/f
205 $ hg ci -m" a -> b, b/f == foo1"
203 $ hg ci -m" a -> b, b/f == foo1"
206 $ cd ..
204 $ cd ..
207
205
208 $ cd r1
206 $ cd r1
209 $ mkdir a/aa
207 $ mkdir a/aa
210 $ echo bar > a/aa/g
208 $ echo bar > a/aa/g
211 $ hg add a/aa
209 $ hg add a/aa
212 adding a/aa/g
210 adding a/aa/g
213 $ hg ci -m "a/aa/g"
211 $ hg ci -m "a/aa/g"
214 $ hg pull ../r2
212 $ hg pull ../r2
215 pulling from ../r2
213 pulling from ../r2
216 searching for changes
214 searching for changes
217 adding changesets
215 adding changesets
218 adding manifests
216 adding manifests
219 adding file changes
217 adding file changes
220 added 1 changesets with 1 changes to 1 files (+1 heads)
218 added 1 changesets with 1 changes to 1 files (+1 heads)
221 new changesets 7d51ed18da25
219 new changesets 7d51ed18da25
222 1 local changesets published
220 1 local changesets published
223 (run 'hg heads' to see heads, 'hg merge' to merge)
221 (run 'hg heads' to see heads, 'hg merge' to merge)
224
222
225 $ hg merge
223 $ hg merge
226 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
224 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
227 (branch merge, don't forget to commit)
225 (branch merge, don't forget to commit)
228
226
229 $ hg st -C
227 $ hg st -C
230 M b/f
228 M b/f
231 A b/aa/g
229 A b/aa/g
232 a/aa/g
230 a/aa/g
233 R a/aa/g
231 R a/aa/g
234 R a/f
232 R a/f
235
233
236 $ cd ..
234 $ cd ..
237
235
238 Test renames to separate directories
236 Test renames to separate directories
239
237
240 $ hg init a
238 $ hg init a
241 $ cd a
239 $ cd a
242 $ mkdir a
240 $ mkdir a
243 $ touch a/s
241 $ touch a/s
244 $ touch a/t
242 $ touch a/t
245 $ hg ci -Am0
243 $ hg ci -Am0
246 adding a/s
244 adding a/s
247 adding a/t
245 adding a/t
248
246
249 Add more files
247 Add more files
250
248
251 $ touch a/s2
249 $ touch a/s2
252 $ touch a/t2
250 $ touch a/t2
253 $ hg ci -Am1
251 $ hg ci -Am1
254 adding a/s2
252 adding a/s2
255 adding a/t2
253 adding a/t2
256
254
257 Do moves on a branch
255 Do moves on a branch
258
256
259 $ hg up 0
257 $ hg up 0
260 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
258 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
261 $ mkdir s
259 $ mkdir s
262 $ mkdir t
260 $ mkdir t
263 $ hg mv a/s s
261 $ hg mv a/s s
264 $ hg mv a/t t
262 $ hg mv a/t t
265 $ hg ci -Am2
263 $ hg ci -Am2
266 created new head
264 created new head
267 $ hg st --copies --change .
265 $ hg st --copies --change .
268 A s/s
266 A s/s
269 a/s
267 a/s
270 A t/t
268 A t/t
271 a/t
269 a/t
272 R a/s
270 R a/s
273 R a/t
271 R a/t
274
272
275 Merge shouldn't move s2, t2
273 Merge shouldn't move s2, t2
276
274
277 $ hg merge
275 $ hg merge
278 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 (branch merge, don't forget to commit)
277 (branch merge, don't forget to commit)
280 $ hg st --copies
278 $ hg st --copies
281 M a/s2
279 M a/s2
282 M a/t2
280 M a/t2
283
281
284 Try the merge in the other direction. It may or may not be appropriate for
282 Try the merge in the other direction. It may or may not be appropriate for
285 status to list copies here.
283 status to list copies here.
286
284
287 $ hg up -C 1
285 $ hg up -C 1
288 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
286 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
289 $ hg merge
287 $ hg merge
290 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
288 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
291 (branch merge, don't forget to commit)
289 (branch merge, don't forget to commit)
292 $ hg st --copies
290 $ hg st --copies
293 M s/s
291 M s/s
294 M t/t
292 M t/t
295 R a/s
293 R a/s
296 R a/t
294 R a/t
@@ -1,188 +1,186 b''
1 $ hg init
1 $ hg init
2
2
3 $ echo "[merge]" >> .hg/hgrc
3 $ echo "[merge]" >> .hg/hgrc
4 $ echo "followcopies = 1" >> .hg/hgrc
4 $ echo "followcopies = 1" >> .hg/hgrc
5
5
6 $ echo foo > a
6 $ echo foo > a
7 $ echo foo > a2
7 $ echo foo > a2
8 $ hg add a a2
8 $ hg add a a2
9 $ hg ci -m "start"
9 $ hg ci -m "start"
10
10
11 $ hg mv a b
11 $ hg mv a b
12 $ hg mv a2 b2
12 $ hg mv a2 b2
13 $ hg ci -m "rename"
13 $ hg ci -m "rename"
14
14
15 $ hg co 0
15 $ hg co 0
16 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
16 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
17
17
18 $ echo blahblah > a
18 $ echo blahblah > a
19 $ echo blahblah > a2
19 $ echo blahblah > a2
20 $ hg mv a2 c2
20 $ hg mv a2 c2
21 $ hg ci -m "modify"
21 $ hg ci -m "modify"
22 created new head
22 created new head
23
23
24 $ hg merge -y --debug
24 $ hg merge -y --debug
25 searching for copies back to rev 1
26 unmatched files in local:
25 unmatched files in local:
27 c2
26 c2
28 unmatched files in other:
27 unmatched files in other:
29 b
28 b
30 b2
29 b2
31 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
30 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
32 src: 'a' -> dst: 'b' *
31 src: 'a' -> dst: 'b' *
33 src: 'a2' -> dst: 'b2' !
32 src: 'a2' -> dst: 'b2' !
34 src: 'a2' -> dst: 'c2' !
33 src: 'a2' -> dst: 'c2' !
35 checking for directory renames
34 checking for directory renames
36 resolving manifests
35 resolving manifests
37 branchmerge: True, force: False, partial: False
36 branchmerge: True, force: False, partial: False
38 ancestor: af1939970a1c, local: 044f8520aeeb+, remote: 85c198ef2f6c
37 ancestor: af1939970a1c, local: 044f8520aeeb+, remote: 85c198ef2f6c
39 note: possible conflict - a2 was renamed multiple times to:
38 note: possible conflict - a2 was renamed multiple times to:
40 b2
39 b2
41 c2
40 c2
42 preserving a for resolve of b
41 preserving a for resolve of b
43 removing a
42 removing a
44 b2: remote created -> g
43 b2: remote created -> g
45 getting b2
44 getting b2
46 b: remote moved from a -> m (premerge)
45 b: remote moved from a -> m (premerge)
47 picked tool ':merge' for b (binary False symlink False changedelete False)
46 picked tool ':merge' for b (binary False symlink False changedelete False)
48 merging a and b to b
47 merging a and b to b
49 my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
48 my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
50 premerge successful
49 premerge successful
51 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
50 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
52 (branch merge, don't forget to commit)
51 (branch merge, don't forget to commit)
53
52
54 $ hg status -AC
53 $ hg status -AC
55 M b
54 M b
56 a
55 a
57 M b2
56 M b2
58 R a
57 R a
59 C c2
58 C c2
60
59
61 $ cat b
60 $ cat b
62 blahblah
61 blahblah
63
62
64 $ hg ci -m "merge"
63 $ hg ci -m "merge"
65
64
66 $ hg debugindex b
65 $ hg debugindex b
67 rev linkrev nodeid p1 p2
66 rev linkrev nodeid p1 p2
68 0 1 57eacc201a7f 000000000000 000000000000
67 0 1 57eacc201a7f 000000000000 000000000000
69 1 3 4727ba907962 000000000000 57eacc201a7f
68 1 3 4727ba907962 000000000000 57eacc201a7f
70
69
71 $ hg debugrename b
70 $ hg debugrename b
72 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
71 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
73
72
74 This used to trigger a "divergent renames" warning, despite no renames
73 This used to trigger a "divergent renames" warning, despite no renames
75
74
76 $ hg cp b b3
75 $ hg cp b b3
77 $ hg cp b b4
76 $ hg cp b b4
78 $ hg ci -A -m 'copy b twice'
77 $ hg ci -A -m 'copy b twice'
79 $ hg up eb92d88a9712
78 $ hg up eb92d88a9712
80 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
79 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
81 $ hg up
80 $ hg up
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 $ hg rm b3 b4
82 $ hg rm b3 b4
84 $ hg ci -m 'clean up a bit of our mess'
83 $ hg ci -m 'clean up a bit of our mess'
85
84
86 We'd rather not warn on divergent renames done in the same changeset (issue2113)
85 We'd rather not warn on divergent renames done in the same changeset (issue2113)
87
86
88 $ hg cp b b3
87 $ hg cp b b3
89 $ hg mv b b4
88 $ hg mv b b4
90 $ hg ci -A -m 'divergent renames in same changeset'
89 $ hg ci -A -m 'divergent renames in same changeset'
91 $ hg up c761c6948de0
90 $ hg up c761c6948de0
92 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
91 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
93 $ hg up
92 $ hg up
94 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
93 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
95
94
96 Check for issue2642
95 Check for issue2642
97
96
98 $ hg init t
97 $ hg init t
99 $ cd t
98 $ cd t
100
99
101 $ echo c0 > f1
100 $ echo c0 > f1
102 $ hg ci -Aqm0
101 $ hg ci -Aqm0
103
102
104 $ hg up null -q
103 $ hg up null -q
105 $ echo c1 > f1 # backport
104 $ echo c1 > f1 # backport
106 $ hg ci -Aqm1
105 $ hg ci -Aqm1
107 $ hg mv f1 f2
106 $ hg mv f1 f2
108 $ hg ci -qm2
107 $ hg ci -qm2
109
108
110 $ hg up 0 -q
109 $ hg up 0 -q
111 $ hg merge 1 -q --tool internal:local
110 $ hg merge 1 -q --tool internal:local
112 $ hg ci -qm3
111 $ hg ci -qm3
113
112
114 $ hg merge 2
113 $ hg merge 2
115 merging f1 and f2 to f2
114 merging f1 and f2 to f2
116 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
115 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
117 (branch merge, don't forget to commit)
116 (branch merge, don't forget to commit)
118
117
119 $ cat f2
118 $ cat f2
120 c0
119 c0
121
120
122 $ cd ..
121 $ cd ..
123
122
124 Check for issue2089
123 Check for issue2089
125
124
126 $ hg init repo2089
125 $ hg init repo2089
127 $ cd repo2089
126 $ cd repo2089
128
127
129 $ echo c0 > f1
128 $ echo c0 > f1
130 $ hg ci -Aqm0
129 $ hg ci -Aqm0
131
130
132 $ hg up null -q
131 $ hg up null -q
133 $ echo c1 > f1
132 $ echo c1 > f1
134 $ hg ci -Aqm1
133 $ hg ci -Aqm1
135
134
136 $ hg up 0 -q
135 $ hg up 0 -q
137 $ hg merge 1 -q --tool internal:local
136 $ hg merge 1 -q --tool internal:local
138 $ echo c2 > f1
137 $ echo c2 > f1
139 $ hg ci -qm2
138 $ hg ci -qm2
140
139
141 $ hg up 1 -q
140 $ hg up 1 -q
142 $ hg mv f1 f2
141 $ hg mv f1 f2
143 $ hg ci -Aqm3
142 $ hg ci -Aqm3
144
143
145 $ hg up 2 -q
144 $ hg up 2 -q
146 $ hg merge 3
145 $ hg merge 3
147 merging f1 and f2 to f2
146 merging f1 and f2 to f2
148 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
147 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
149 (branch merge, don't forget to commit)
148 (branch merge, don't forget to commit)
150
149
151 $ cat f2
150 $ cat f2
152 c2
151 c2
153
152
154 $ cd ..
153 $ cd ..
155
154
156 Check for issue3074
155 Check for issue3074
157
156
158 $ hg init repo3074
157 $ hg init repo3074
159 $ cd repo3074
158 $ cd repo3074
160 $ echo foo > file
159 $ echo foo > file
161 $ hg add file
160 $ hg add file
162 $ hg commit -m "added file"
161 $ hg commit -m "added file"
163 $ hg mv file newfile
162 $ hg mv file newfile
164 $ hg commit -m "renamed file"
163 $ hg commit -m "renamed file"
165 $ hg update 0
164 $ hg update 0
166 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
165 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
167 $ hg rm file
166 $ hg rm file
168 $ hg commit -m "deleted file"
167 $ hg commit -m "deleted file"
169 created new head
168 created new head
170 $ hg merge --debug
169 $ hg merge --debug
171 searching for copies back to rev 1
172 unmatched files in other:
170 unmatched files in other:
173 newfile
171 newfile
174 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
172 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
175 src: 'file' -> dst: 'newfile' %
173 src: 'file' -> dst: 'newfile' %
176 checking for directory renames
174 checking for directory renames
177 resolving manifests
175 resolving manifests
178 branchmerge: True, force: False, partial: False
176 branchmerge: True, force: False, partial: False
179 ancestor: 19d7f95df299, local: 0084274f6b67+, remote: 5d32493049f0
177 ancestor: 19d7f95df299, local: 0084274f6b67+, remote: 5d32493049f0
180 note: possible conflict - file was deleted and renamed to:
178 note: possible conflict - file was deleted and renamed to:
181 newfile
179 newfile
182 newfile: remote created -> g
180 newfile: remote created -> g
183 getting newfile
181 getting newfile
184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
182 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
185 (branch merge, don't forget to commit)
183 (branch merge, don't forget to commit)
186 $ hg status
184 $ hg status
187 M newfile
185 M newfile
188 $ cd ..
186 $ cd ..
@@ -1,1074 +1,1052 b''
1
1
2 $ mkdir -p t
2 $ mkdir -p t
3 $ cd t
3 $ cd t
4 $ cat <<EOF > merge
4 $ cat <<EOF > merge
5 > import sys, os
5 > import sys, os
6 > f = open(sys.argv[1], "w")
6 > f = open(sys.argv[1], "w")
7 > f.write("merge %s %s %s" % (sys.argv[1], sys.argv[2], sys.argv[3]))
7 > f.write("merge %s %s %s" % (sys.argv[1], sys.argv[2], sys.argv[3]))
8 > f.close()
8 > f.close()
9 > EOF
9 > EOF
10
10
11 perform a test merge with possible renaming
11 perform a test merge with possible renaming
12 args:
12 args:
13 $1 = action in local branch
13 $1 = action in local branch
14 $2 = action in remote branch
14 $2 = action in remote branch
15 $3 = action in working dir
15 $3 = action in working dir
16 $4 = expected result
16 $4 = expected result
17
17
18 $ tm()
18 $ tm()
19 > {
19 > {
20 > hg init t
20 > hg init t
21 > cd t
21 > cd t
22 > echo "[merge]" >> .hg/hgrc
22 > echo "[merge]" >> .hg/hgrc
23 > echo "followcopies = 1" >> .hg/hgrc
23 > echo "followcopies = 1" >> .hg/hgrc
24 >
24 >
25 > # base
25 > # base
26 > echo base > a
26 > echo base > a
27 > echo base > rev # used to force commits
27 > echo base > rev # used to force commits
28 > hg add a rev
28 > hg add a rev
29 > hg ci -m "base"
29 > hg ci -m "base"
30 >
30 >
31 > # remote
31 > # remote
32 > echo remote > rev
32 > echo remote > rev
33 > if [ "$2" != "" ] ; then $2 ; fi
33 > if [ "$2" != "" ] ; then $2 ; fi
34 > hg ci -m "remote"
34 > hg ci -m "remote"
35 >
35 >
36 > # local
36 > # local
37 > hg co -q 0
37 > hg co -q 0
38 > echo local > rev
38 > echo local > rev
39 > if [ "$1" != "" ] ; then $1 ; fi
39 > if [ "$1" != "" ] ; then $1 ; fi
40 > hg ci -m "local"
40 > hg ci -m "local"
41 >
41 >
42 > # working dir
42 > # working dir
43 > echo local > rev
43 > echo local > rev
44 > if [ "$3" != "" ] ; then $3 ; fi
44 > if [ "$3" != "" ] ; then $3 ; fi
45 >
45 >
46 > # merge
46 > # merge
47 > echo "--------------"
47 > echo "--------------"
48 > echo "test L:$1 R:$2 W:$3 - $4"
48 > echo "test L:$1 R:$2 W:$3 - $4"
49 > echo "--------------"
49 > echo "--------------"
50 > hg merge -y --debug --traceback --tool="\"$PYTHON\" ../merge"
50 > hg merge -y --debug --traceback --tool="\"$PYTHON\" ../merge"
51 >
51 >
52 > echo "--------------"
52 > echo "--------------"
53 > hg status -camC -X rev
53 > hg status -camC -X rev
54 >
54 >
55 > hg ci -m "merge"
55 > hg ci -m "merge"
56 >
56 >
57 > echo "--------------"
57 > echo "--------------"
58 > echo
58 > echo
59 >
59 >
60 > cd ..
60 > cd ..
61 > rm -r t
61 > rm -r t
62 > }
62 > }
63 $ up() {
63 $ up() {
64 > cp rev $1
64 > cp rev $1
65 > hg add $1 2> /dev/null
65 > hg add $1 2> /dev/null
66 > if [ "$2" != "" ] ; then
66 > if [ "$2" != "" ] ; then
67 > cp rev $2
67 > cp rev $2
68 > hg add $2 2> /dev/null
68 > hg add $2 2> /dev/null
69 > fi
69 > fi
70 > }
70 > }
71 $ um() { up $1; hg mv $1 $2; }
71 $ um() { up $1; hg mv $1 $2; }
72 $ nc() { hg cp $1 $2; } # just copy
72 $ nc() { hg cp $1 $2; } # just copy
73 $ nm() { hg mv $1 $2; } # just move
73 $ nm() { hg mv $1 $2; } # just move
74 $ tm "up a " "nc a b" " " "1 get local a to b"
74 $ tm "up a " "nc a b" " " "1 get local a to b"
75 created new head
75 created new head
76 --------------
76 --------------
77 test L:up a R:nc a b W: - 1 get local a to b
77 test L:up a R:nc a b W: - 1 get local a to b
78 --------------
78 --------------
79 searching for copies back to rev 1
80 unmatched files in other:
79 unmatched files in other:
81 b
80 b
82 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
81 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
83 src: 'a' -> dst: 'b' *
82 src: 'a' -> dst: 'b' *
84 checking for directory renames
83 checking for directory renames
85 resolving manifests
84 resolving manifests
86 branchmerge: True, force: False, partial: False
85 branchmerge: True, force: False, partial: False
87 ancestor: 924404dff337, local: e300d1c794ec+, remote: 4ce40f5aca24
86 ancestor: 924404dff337, local: e300d1c794ec+, remote: 4ce40f5aca24
88 preserving a for resolve of b
87 preserving a for resolve of b
89 preserving rev for resolve of rev
88 preserving rev for resolve of rev
90 starting 4 threads for background file closing (?)
89 starting 4 threads for background file closing (?)
91 b: remote copied from a -> m (premerge)
90 b: remote copied from a -> m (premerge)
92 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
91 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
93 merging a and b to b
92 merging a and b to b
94 my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337
93 my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337
95 premerge successful
94 premerge successful
96 rev: versions differ -> m (premerge)
95 rev: versions differ -> m (premerge)
97 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
96 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
98 merging rev
97 merging rev
99 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
98 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
100 rev: versions differ -> m (merge)
99 rev: versions differ -> m (merge)
101 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
100 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
102 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
101 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
103 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
102 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
104 merge tool returned: 0
103 merge tool returned: 0
105 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
104 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
106 (branch merge, don't forget to commit)
105 (branch merge, don't forget to commit)
107 --------------
106 --------------
108 M b
107 M b
109 a
108 a
110 C a
109 C a
111 --------------
110 --------------
112
111
113 $ tm "nc a b" "up a " " " "2 get rem change to a and b"
112 $ tm "nc a b" "up a " " " "2 get rem change to a and b"
114 created new head
113 created new head
115 --------------
114 --------------
116 test L:nc a b R:up a W: - 2 get rem change to a and b
115 test L:nc a b R:up a W: - 2 get rem change to a and b
117 --------------
116 --------------
118 searching for copies back to rev 1
119 unmatched files in local:
117 unmatched files in local:
120 b
118 b
121 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
119 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
122 src: 'a' -> dst: 'b' *
120 src: 'a' -> dst: 'b' *
123 checking for directory renames
121 checking for directory renames
124 resolving manifests
122 resolving manifests
125 branchmerge: True, force: False, partial: False
123 branchmerge: True, force: False, partial: False
126 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: f4db7e329e71
124 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: f4db7e329e71
127 preserving b for resolve of b
125 preserving b for resolve of b
128 preserving rev for resolve of rev
126 preserving rev for resolve of rev
129 a: remote is newer -> g
127 a: remote is newer -> g
130 getting a
128 getting a
131 b: local copied/moved from a -> m (premerge)
129 b: local copied/moved from a -> m (premerge)
132 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
130 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
133 merging b and a to b
131 merging b and a to b
134 my b@86a2aa42fc76+ other a@f4db7e329e71 ancestor a@924404dff337
132 my b@86a2aa42fc76+ other a@f4db7e329e71 ancestor a@924404dff337
135 premerge successful
133 premerge successful
136 rev: versions differ -> m (premerge)
134 rev: versions differ -> m (premerge)
137 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
135 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
138 merging rev
136 merging rev
139 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
137 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
140 rev: versions differ -> m (merge)
138 rev: versions differ -> m (merge)
141 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
139 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
142 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
140 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
143 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
141 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
144 merge tool returned: 0
142 merge tool returned: 0
145 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
143 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
146 (branch merge, don't forget to commit)
144 (branch merge, don't forget to commit)
147 --------------
145 --------------
148 M a
146 M a
149 M b
147 M b
150 a
148 a
151 --------------
149 --------------
152
150
153 $ tm "up a " "nm a b" " " "3 get local a change to b, remove a"
151 $ tm "up a " "nm a b" " " "3 get local a change to b, remove a"
154 created new head
152 created new head
155 --------------
153 --------------
156 test L:up a R:nm a b W: - 3 get local a change to b, remove a
154 test L:up a R:nm a b W: - 3 get local a change to b, remove a
157 --------------
155 --------------
158 searching for copies back to rev 1
159 unmatched files in other:
156 unmatched files in other:
160 b
157 b
161 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
158 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
162 src: 'a' -> dst: 'b' *
159 src: 'a' -> dst: 'b' *
163 checking for directory renames
160 checking for directory renames
164 resolving manifests
161 resolving manifests
165 branchmerge: True, force: False, partial: False
162 branchmerge: True, force: False, partial: False
166 ancestor: 924404dff337, local: e300d1c794ec+, remote: bdb19105162a
163 ancestor: 924404dff337, local: e300d1c794ec+, remote: bdb19105162a
167 preserving a for resolve of b
164 preserving a for resolve of b
168 preserving rev for resolve of rev
165 preserving rev for resolve of rev
169 removing a
166 removing a
170 starting 4 threads for background file closing (?)
167 starting 4 threads for background file closing (?)
171 b: remote moved from a -> m (premerge)
168 b: remote moved from a -> m (premerge)
172 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
169 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
173 merging a and b to b
170 merging a and b to b
174 my b@e300d1c794ec+ other b@bdb19105162a ancestor a@924404dff337
171 my b@e300d1c794ec+ other b@bdb19105162a ancestor a@924404dff337
175 premerge successful
172 premerge successful
176 rev: versions differ -> m (premerge)
173 rev: versions differ -> m (premerge)
177 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
174 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
178 merging rev
175 merging rev
179 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
176 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
180 rev: versions differ -> m (merge)
177 rev: versions differ -> m (merge)
181 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
178 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
182 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
179 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
183 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
180 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
184 merge tool returned: 0
181 merge tool returned: 0
185 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
182 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
186 (branch merge, don't forget to commit)
183 (branch merge, don't forget to commit)
187 --------------
184 --------------
188 M b
185 M b
189 a
186 a
190 --------------
187 --------------
191
188
192 $ tm "nm a b" "up a " " " "4 get remote change to b"
189 $ tm "nm a b" "up a " " " "4 get remote change to b"
193 created new head
190 created new head
194 --------------
191 --------------
195 test L:nm a b R:up a W: - 4 get remote change to b
192 test L:nm a b R:up a W: - 4 get remote change to b
196 --------------
193 --------------
197 searching for copies back to rev 1
198 unmatched files in local:
194 unmatched files in local:
199 b
195 b
200 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
196 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
201 src: 'a' -> dst: 'b' *
197 src: 'a' -> dst: 'b' *
202 checking for directory renames
198 checking for directory renames
203 resolving manifests
199 resolving manifests
204 branchmerge: True, force: False, partial: False
200 branchmerge: True, force: False, partial: False
205 ancestor: 924404dff337, local: 02963e448370+, remote: f4db7e329e71
201 ancestor: 924404dff337, local: 02963e448370+, remote: f4db7e329e71
206 preserving b for resolve of b
202 preserving b for resolve of b
207 preserving rev for resolve of rev
203 preserving rev for resolve of rev
208 starting 4 threads for background file closing (?)
204 starting 4 threads for background file closing (?)
209 b: local copied/moved from a -> m (premerge)
205 b: local copied/moved from a -> m (premerge)
210 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
206 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
211 merging b and a to b
207 merging b and a to b
212 my b@02963e448370+ other a@f4db7e329e71 ancestor a@924404dff337
208 my b@02963e448370+ other a@f4db7e329e71 ancestor a@924404dff337
213 premerge successful
209 premerge successful
214 rev: versions differ -> m (premerge)
210 rev: versions differ -> m (premerge)
215 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
211 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
216 merging rev
212 merging rev
217 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
213 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
218 rev: versions differ -> m (merge)
214 rev: versions differ -> m (merge)
219 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
215 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
220 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
216 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
221 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
217 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
222 merge tool returned: 0
218 merge tool returned: 0
223 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
219 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
224 (branch merge, don't forget to commit)
220 (branch merge, don't forget to commit)
225 --------------
221 --------------
226 M b
222 M b
227 a
223 a
228 --------------
224 --------------
229
225
230 $ tm " " "nc a b" " " "5 get b"
226 $ tm " " "nc a b" " " "5 get b"
231 created new head
227 created new head
232 --------------
228 --------------
233 test L: R:nc a b W: - 5 get b
229 test L: R:nc a b W: - 5 get b
234 --------------
230 --------------
235 searching for copies back to rev 1
236 unmatched files in other:
231 unmatched files in other:
237 b
232 b
238 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
233 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
239 src: 'a' -> dst: 'b'
234 src: 'a' -> dst: 'b'
240 checking for directory renames
235 checking for directory renames
241 resolving manifests
236 resolving manifests
242 branchmerge: True, force: False, partial: False
237 branchmerge: True, force: False, partial: False
243 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: 4ce40f5aca24
238 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: 4ce40f5aca24
244 preserving rev for resolve of rev
239 preserving rev for resolve of rev
245 b: remote created -> g
240 b: remote created -> g
246 getting b
241 getting b
247 rev: versions differ -> m (premerge)
242 rev: versions differ -> m (premerge)
248 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
243 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
249 merging rev
244 merging rev
250 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
245 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
251 rev: versions differ -> m (merge)
246 rev: versions differ -> m (merge)
252 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
247 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
253 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
248 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
254 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
249 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
255 merge tool returned: 0
250 merge tool returned: 0
256 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
251 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
257 (branch merge, don't forget to commit)
252 (branch merge, don't forget to commit)
258 --------------
253 --------------
259 M b
254 M b
260 C a
255 C a
261 --------------
256 --------------
262
257
263 $ tm "nc a b" " " " " "6 nothing"
258 $ tm "nc a b" " " " " "6 nothing"
264 created new head
259 created new head
265 --------------
260 --------------
266 test L:nc a b R: W: - 6 nothing
261 test L:nc a b R: W: - 6 nothing
267 --------------
262 --------------
268 searching for copies back to rev 1
269 unmatched files in local:
263 unmatched files in local:
270 b
264 b
271 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
265 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
272 src: 'a' -> dst: 'b'
266 src: 'a' -> dst: 'b'
273 checking for directory renames
267 checking for directory renames
274 resolving manifests
268 resolving manifests
275 branchmerge: True, force: False, partial: False
269 branchmerge: True, force: False, partial: False
276 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 97c705ade336
270 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 97c705ade336
277 preserving rev for resolve of rev
271 preserving rev for resolve of rev
278 starting 4 threads for background file closing (?)
272 starting 4 threads for background file closing (?)
279 rev: versions differ -> m (premerge)
273 rev: versions differ -> m (premerge)
280 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
274 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
281 merging rev
275 merging rev
282 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
276 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
283 rev: versions differ -> m (merge)
277 rev: versions differ -> m (merge)
284 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
278 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
285 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
279 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
286 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
280 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
287 merge tool returned: 0
281 merge tool returned: 0
288 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
282 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
289 (branch merge, don't forget to commit)
283 (branch merge, don't forget to commit)
290 --------------
284 --------------
291 C a
285 C a
292 C b
286 C b
293 --------------
287 --------------
294
288
295 $ tm " " "nm a b" " " "7 get b"
289 $ tm " " "nm a b" " " "7 get b"
296 created new head
290 created new head
297 --------------
291 --------------
298 test L: R:nm a b W: - 7 get b
292 test L: R:nm a b W: - 7 get b
299 --------------
293 --------------
300 searching for copies back to rev 1
301 unmatched files in other:
294 unmatched files in other:
302 b
295 b
303 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
296 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
304 src: 'a' -> dst: 'b'
297 src: 'a' -> dst: 'b'
305 checking for directory renames
298 checking for directory renames
306 resolving manifests
299 resolving manifests
307 branchmerge: True, force: False, partial: False
300 branchmerge: True, force: False, partial: False
308 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: bdb19105162a
301 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: bdb19105162a
309 preserving rev for resolve of rev
302 preserving rev for resolve of rev
310 a: other deleted -> r
303 a: other deleted -> r
311 removing a
304 removing a
312 b: remote created -> g
305 b: remote created -> g
313 getting b
306 getting b
314 rev: versions differ -> m (premerge)
307 rev: versions differ -> m (premerge)
315 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
308 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
316 merging rev
309 merging rev
317 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
310 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
318 rev: versions differ -> m (merge)
311 rev: versions differ -> m (merge)
319 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
312 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
320 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
313 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
321 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
314 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
322 merge tool returned: 0
315 merge tool returned: 0
323 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
316 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
324 (branch merge, don't forget to commit)
317 (branch merge, don't forget to commit)
325 --------------
318 --------------
326 M b
319 M b
327 --------------
320 --------------
328
321
329 $ tm "nm a b" " " " " "8 nothing"
322 $ tm "nm a b" " " " " "8 nothing"
330 created new head
323 created new head
331 --------------
324 --------------
332 test L:nm a b R: W: - 8 nothing
325 test L:nm a b R: W: - 8 nothing
333 --------------
326 --------------
334 searching for copies back to rev 1
335 unmatched files in local:
327 unmatched files in local:
336 b
328 b
337 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
329 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
338 src: 'a' -> dst: 'b'
330 src: 'a' -> dst: 'b'
339 checking for directory renames
331 checking for directory renames
340 resolving manifests
332 resolving manifests
341 branchmerge: True, force: False, partial: False
333 branchmerge: True, force: False, partial: False
342 ancestor: 924404dff337, local: 02963e448370+, remote: 97c705ade336
334 ancestor: 924404dff337, local: 02963e448370+, remote: 97c705ade336
343 preserving rev for resolve of rev
335 preserving rev for resolve of rev
344 starting 4 threads for background file closing (?)
336 starting 4 threads for background file closing (?)
345 rev: versions differ -> m (premerge)
337 rev: versions differ -> m (premerge)
346 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
338 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
347 merging rev
339 merging rev
348 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
340 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
349 rev: versions differ -> m (merge)
341 rev: versions differ -> m (merge)
350 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
342 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
351 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
343 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
352 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
344 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
353 merge tool returned: 0
345 merge tool returned: 0
354 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
346 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
355 (branch merge, don't forget to commit)
347 (branch merge, don't forget to commit)
356 --------------
348 --------------
357 C b
349 C b
358 --------------
350 --------------
359
351
360 $ tm "um a b" "um a b" " " "9 do merge with ancestor in a"
352 $ tm "um a b" "um a b" " " "9 do merge with ancestor in a"
361 created new head
353 created new head
362 --------------
354 --------------
363 test L:um a b R:um a b W: - 9 do merge with ancestor in a
355 test L:um a b R:um a b W: - 9 do merge with ancestor in a
364 --------------
356 --------------
365 searching for copies back to rev 1
366 unmatched files new in both:
357 unmatched files new in both:
367 b
358 b
368 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
359 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
369 src: 'a' -> dst: 'b' *
360 src: 'a' -> dst: 'b' *
370 checking for directory renames
361 checking for directory renames
371 resolving manifests
362 resolving manifests
372 branchmerge: True, force: False, partial: False
363 branchmerge: True, force: False, partial: False
373 ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493
364 ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493
374 preserving b for resolve of b
365 preserving b for resolve of b
375 preserving rev for resolve of rev
366 preserving rev for resolve of rev
376 starting 4 threads for background file closing (?)
367 starting 4 threads for background file closing (?)
377 b: both renamed from a -> m (premerge)
368 b: both renamed from a -> m (premerge)
378 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
369 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
379 merging b
370 merging b
380 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
371 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
381 rev: versions differ -> m (premerge)
372 rev: versions differ -> m (premerge)
382 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
373 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
383 merging rev
374 merging rev
384 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
375 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
385 b: both renamed from a -> m (merge)
376 b: both renamed from a -> m (merge)
386 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
377 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
387 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
378 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
388 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
379 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
389 merge tool returned: 0
380 merge tool returned: 0
390 rev: versions differ -> m (merge)
381 rev: versions differ -> m (merge)
391 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
382 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
392 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
383 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
393 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
384 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
394 merge tool returned: 0
385 merge tool returned: 0
395 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
386 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
396 (branch merge, don't forget to commit)
387 (branch merge, don't forget to commit)
397 --------------
388 --------------
398 M b
389 M b
399 --------------
390 --------------
400
391
401
392
402 m "um a c" "um x c" " " "10 do merge with no ancestor"
393 m "um a c" "um x c" " " "10 do merge with no ancestor"
403
394
404 $ tm "nm a b" "nm a c" " " "11 get c, keep b"
395 $ tm "nm a b" "nm a c" " " "11 get c, keep b"
405 created new head
396 created new head
406 --------------
397 --------------
407 test L:nm a b R:nm a c W: - 11 get c, keep b
398 test L:nm a b R:nm a c W: - 11 get c, keep b
408 --------------
399 --------------
409 searching for copies back to rev 1
410 unmatched files in local:
400 unmatched files in local:
411 b
401 b
412 unmatched files in other:
402 unmatched files in other:
413 c
403 c
414 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
404 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
415 src: 'a' -> dst: 'b' !
405 src: 'a' -> dst: 'b' !
416 src: 'a' -> dst: 'c' !
406 src: 'a' -> dst: 'c' !
417 checking for directory renames
407 checking for directory renames
418 resolving manifests
408 resolving manifests
419 branchmerge: True, force: False, partial: False
409 branchmerge: True, force: False, partial: False
420 ancestor: 924404dff337, local: 02963e448370+, remote: fe905ef2c33e
410 ancestor: 924404dff337, local: 02963e448370+, remote: fe905ef2c33e
421 note: possible conflict - a was renamed multiple times to:
411 note: possible conflict - a was renamed multiple times to:
422 b
412 b
423 c
413 c
424 preserving rev for resolve of rev
414 preserving rev for resolve of rev
425 c: remote created -> g
415 c: remote created -> g
426 getting c
416 getting c
427 rev: versions differ -> m (premerge)
417 rev: versions differ -> m (premerge)
428 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
418 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
429 merging rev
419 merging rev
430 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
420 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
431 rev: versions differ -> m (merge)
421 rev: versions differ -> m (merge)
432 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
422 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
433 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
423 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
434 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
424 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
435 merge tool returned: 0
425 merge tool returned: 0
436 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
426 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
437 (branch merge, don't forget to commit)
427 (branch merge, don't forget to commit)
438 --------------
428 --------------
439 M c
429 M c
440 C b
430 C b
441 --------------
431 --------------
442
432
443 $ tm "nc a b" "up b " " " "12 merge b no ancestor"
433 $ tm "nc a b" "up b " " " "12 merge b no ancestor"
444 created new head
434 created new head
445 --------------
435 --------------
446 test L:nc a b R:up b W: - 12 merge b no ancestor
436 test L:nc a b R:up b W: - 12 merge b no ancestor
447 --------------
437 --------------
448 searching for copies back to rev 1
449 unmatched files new in both:
438 unmatched files new in both:
450 b
439 b
451 resolving manifests
440 resolving manifests
452 branchmerge: True, force: False, partial: False
441 branchmerge: True, force: False, partial: False
453 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7
442 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7
454 preserving b for resolve of b
443 preserving b for resolve of b
455 preserving rev for resolve of rev
444 preserving rev for resolve of rev
456 starting 4 threads for background file closing (?)
445 starting 4 threads for background file closing (?)
457 b: both created -> m (premerge)
446 b: both created -> m (premerge)
458 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
447 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
459 merging b
448 merging b
460 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
449 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
461 rev: versions differ -> m (premerge)
450 rev: versions differ -> m (premerge)
462 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
451 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
463 merging rev
452 merging rev
464 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
453 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
465 b: both created -> m (merge)
454 b: both created -> m (merge)
466 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
455 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
467 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
456 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
468 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
457 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
469 merge tool returned: 0
458 merge tool returned: 0
470 rev: versions differ -> m (merge)
459 rev: versions differ -> m (merge)
471 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
460 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
472 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
461 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
473 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
462 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
474 merge tool returned: 0
463 merge tool returned: 0
475 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
464 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
476 (branch merge, don't forget to commit)
465 (branch merge, don't forget to commit)
477 --------------
466 --------------
478 M b
467 M b
479 C a
468 C a
480 --------------
469 --------------
481
470
482 $ tm "up b " "nm a b" " " "13 merge b no ancestor"
471 $ tm "up b " "nm a b" " " "13 merge b no ancestor"
483 created new head
472 created new head
484 --------------
473 --------------
485 test L:up b R:nm a b W: - 13 merge b no ancestor
474 test L:up b R:nm a b W: - 13 merge b no ancestor
486 --------------
475 --------------
487 searching for copies back to rev 1
488 unmatched files new in both:
476 unmatched files new in both:
489 b
477 b
490 resolving manifests
478 resolving manifests
491 branchmerge: True, force: False, partial: False
479 branchmerge: True, force: False, partial: False
492 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
480 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
493 preserving b for resolve of b
481 preserving b for resolve of b
494 preserving rev for resolve of rev
482 preserving rev for resolve of rev
495 a: other deleted -> r
483 a: other deleted -> r
496 removing a
484 removing a
497 starting 4 threads for background file closing (?)
485 starting 4 threads for background file closing (?)
498 b: both created -> m (premerge)
486 b: both created -> m (premerge)
499 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
487 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
500 merging b
488 merging b
501 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
489 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
502 rev: versions differ -> m (premerge)
490 rev: versions differ -> m (premerge)
503 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
491 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
504 merging rev
492 merging rev
505 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
493 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
506 b: both created -> m (merge)
494 b: both created -> m (merge)
507 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
495 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
508 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
496 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
509 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
497 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
510 merge tool returned: 0
498 merge tool returned: 0
511 rev: versions differ -> m (merge)
499 rev: versions differ -> m (merge)
512 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
500 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
513 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
501 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
514 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
502 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
515 merge tool returned: 0
503 merge tool returned: 0
516 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
504 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
517 (branch merge, don't forget to commit)
505 (branch merge, don't forget to commit)
518 --------------
506 --------------
519 M b
507 M b
520 --------------
508 --------------
521
509
522 $ tm "nc a b" "up a b" " " "14 merge b no ancestor"
510 $ tm "nc a b" "up a b" " " "14 merge b no ancestor"
523 created new head
511 created new head
524 --------------
512 --------------
525 test L:nc a b R:up a b W: - 14 merge b no ancestor
513 test L:nc a b R:up a b W: - 14 merge b no ancestor
526 --------------
514 --------------
527 searching for copies back to rev 1
528 unmatched files new in both:
515 unmatched files new in both:
529 b
516 b
530 resolving manifests
517 resolving manifests
531 branchmerge: True, force: False, partial: False
518 branchmerge: True, force: False, partial: False
532 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
519 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
533 preserving b for resolve of b
520 preserving b for resolve of b
534 preserving rev for resolve of rev
521 preserving rev for resolve of rev
535 a: remote is newer -> g
522 a: remote is newer -> g
536 getting a
523 getting a
537 b: both created -> m (premerge)
524 b: both created -> m (premerge)
538 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
525 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
539 merging b
526 merging b
540 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
527 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
541 rev: versions differ -> m (premerge)
528 rev: versions differ -> m (premerge)
542 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
529 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
543 merging rev
530 merging rev
544 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
531 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
545 b: both created -> m (merge)
532 b: both created -> m (merge)
546 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
533 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
547 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
534 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
548 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
535 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
549 merge tool returned: 0
536 merge tool returned: 0
550 rev: versions differ -> m (merge)
537 rev: versions differ -> m (merge)
551 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
538 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
552 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
539 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
553 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
540 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
554 merge tool returned: 0
541 merge tool returned: 0
555 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
542 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
556 (branch merge, don't forget to commit)
543 (branch merge, don't forget to commit)
557 --------------
544 --------------
558 M a
545 M a
559 M b
546 M b
560 --------------
547 --------------
561
548
562 $ tm "up b " "nm a b" " " "15 merge b no ancestor, remove a"
549 $ tm "up b " "nm a b" " " "15 merge b no ancestor, remove a"
563 created new head
550 created new head
564 --------------
551 --------------
565 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
552 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
566 --------------
553 --------------
567 searching for copies back to rev 1
568 unmatched files new in both:
554 unmatched files new in both:
569 b
555 b
570 resolving manifests
556 resolving manifests
571 branchmerge: True, force: False, partial: False
557 branchmerge: True, force: False, partial: False
572 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
558 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
573 preserving b for resolve of b
559 preserving b for resolve of b
574 preserving rev for resolve of rev
560 preserving rev for resolve of rev
575 a: other deleted -> r
561 a: other deleted -> r
576 removing a
562 removing a
577 starting 4 threads for background file closing (?)
563 starting 4 threads for background file closing (?)
578 b: both created -> m (premerge)
564 b: both created -> m (premerge)
579 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
565 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
580 merging b
566 merging b
581 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
567 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
582 rev: versions differ -> m (premerge)
568 rev: versions differ -> m (premerge)
583 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
569 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
584 merging rev
570 merging rev
585 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
571 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
586 b: both created -> m (merge)
572 b: both created -> m (merge)
587 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
573 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
588 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
574 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
589 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
575 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
590 merge tool returned: 0
576 merge tool returned: 0
591 rev: versions differ -> m (merge)
577 rev: versions differ -> m (merge)
592 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
578 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
593 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
579 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
594 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
580 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
595 merge tool returned: 0
581 merge tool returned: 0
596 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
582 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
597 (branch merge, don't forget to commit)
583 (branch merge, don't forget to commit)
598 --------------
584 --------------
599 M b
585 M b
600 --------------
586 --------------
601
587
602 $ tm "nc a b" "up a b" " " "16 get a, merge b no ancestor"
588 $ tm "nc a b" "up a b" " " "16 get a, merge b no ancestor"
603 created new head
589 created new head
604 --------------
590 --------------
605 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
591 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
606 --------------
592 --------------
607 searching for copies back to rev 1
608 unmatched files new in both:
593 unmatched files new in both:
609 b
594 b
610 resolving manifests
595 resolving manifests
611 branchmerge: True, force: False, partial: False
596 branchmerge: True, force: False, partial: False
612 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
597 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
613 preserving b for resolve of b
598 preserving b for resolve of b
614 preserving rev for resolve of rev
599 preserving rev for resolve of rev
615 a: remote is newer -> g
600 a: remote is newer -> g
616 getting a
601 getting a
617 b: both created -> m (premerge)
602 b: both created -> m (premerge)
618 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
603 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
619 merging b
604 merging b
620 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
605 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
621 rev: versions differ -> m (premerge)
606 rev: versions differ -> m (premerge)
622 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
607 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
623 merging rev
608 merging rev
624 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
609 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
625 b: both created -> m (merge)
610 b: both created -> m (merge)
626 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
611 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
627 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
612 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
628 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
613 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
629 merge tool returned: 0
614 merge tool returned: 0
630 rev: versions differ -> m (merge)
615 rev: versions differ -> m (merge)
631 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
616 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
632 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
617 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
633 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
618 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
634 merge tool returned: 0
619 merge tool returned: 0
635 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
620 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
636 (branch merge, don't forget to commit)
621 (branch merge, don't forget to commit)
637 --------------
622 --------------
638 M a
623 M a
639 M b
624 M b
640 --------------
625 --------------
641
626
642 $ tm "up a b" "nc a b" " " "17 keep a, merge b no ancestor"
627 $ tm "up a b" "nc a b" " " "17 keep a, merge b no ancestor"
643 created new head
628 created new head
644 --------------
629 --------------
645 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
630 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
646 --------------
631 --------------
647 searching for copies back to rev 1
648 unmatched files new in both:
632 unmatched files new in both:
649 b
633 b
650 resolving manifests
634 resolving manifests
651 branchmerge: True, force: False, partial: False
635 branchmerge: True, force: False, partial: False
652 ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
636 ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
653 preserving b for resolve of b
637 preserving b for resolve of b
654 preserving rev for resolve of rev
638 preserving rev for resolve of rev
655 starting 4 threads for background file closing (?)
639 starting 4 threads for background file closing (?)
656 b: both created -> m (premerge)
640 b: both created -> m (premerge)
657 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
641 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
658 merging b
642 merging b
659 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
643 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
660 rev: versions differ -> m (premerge)
644 rev: versions differ -> m (premerge)
661 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
645 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
662 merging rev
646 merging rev
663 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
647 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
664 b: both created -> m (merge)
648 b: both created -> m (merge)
665 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
649 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
666 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
650 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
667 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
651 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
668 merge tool returned: 0
652 merge tool returned: 0
669 rev: versions differ -> m (merge)
653 rev: versions differ -> m (merge)
670 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
654 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
671 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
655 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
672 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
656 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
673 merge tool returned: 0
657 merge tool returned: 0
674 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
658 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
675 (branch merge, don't forget to commit)
659 (branch merge, don't forget to commit)
676 --------------
660 --------------
677 M b
661 M b
678 C a
662 C a
679 --------------
663 --------------
680
664
681 $ tm "nm a b" "up a b" " " "18 merge b no ancestor"
665 $ tm "nm a b" "up a b" " " "18 merge b no ancestor"
682 created new head
666 created new head
683 --------------
667 --------------
684 test L:nm a b R:up a b W: - 18 merge b no ancestor
668 test L:nm a b R:up a b W: - 18 merge b no ancestor
685 --------------
669 --------------
686 searching for copies back to rev 1
687 unmatched files new in both:
670 unmatched files new in both:
688 b
671 b
689 resolving manifests
672 resolving manifests
690 branchmerge: True, force: False, partial: False
673 branchmerge: True, force: False, partial: False
691 ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a
674 ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a
692 preserving b for resolve of b
675 preserving b for resolve of b
693 preserving rev for resolve of rev
676 preserving rev for resolve of rev
694 starting 4 threads for background file closing (?)
677 starting 4 threads for background file closing (?)
695 a: prompt deleted/changed -> m (premerge)
678 a: prompt deleted/changed -> m (premerge)
696 picked tool ':prompt' for a (binary False symlink False changedelete True)
679 picked tool ':prompt' for a (binary False symlink False changedelete True)
697 file 'a' was deleted in local [working copy] but was modified in other [merge rev].
680 file 'a' was deleted in local [working copy] but was modified in other [merge rev].
698 What do you want to do?
681 What do you want to do?
699 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
682 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
700 b: both created -> m (premerge)
683 b: both created -> m (premerge)
701 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
684 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
702 merging b
685 merging b
703 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
686 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
704 rev: versions differ -> m (premerge)
687 rev: versions differ -> m (premerge)
705 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
688 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
706 merging rev
689 merging rev
707 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
690 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
708 b: both created -> m (merge)
691 b: both created -> m (merge)
709 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
692 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
710 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
693 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
711 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
694 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
712 merge tool returned: 0
695 merge tool returned: 0
713 rev: versions differ -> m (merge)
696 rev: versions differ -> m (merge)
714 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
697 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
715 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
698 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
716 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
699 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
717 merge tool returned: 0
700 merge tool returned: 0
718 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
701 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
719 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
702 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
720 --------------
703 --------------
721 M a
704 M a
722 M b
705 M b
723 abort: unresolved merge conflicts (see 'hg help resolve')
706 abort: unresolved merge conflicts (see 'hg help resolve')
724 --------------
707 --------------
725
708
726 $ tm "up a b" "nm a b" " " "19 merge b no ancestor, prompt remove a"
709 $ tm "up a b" "nm a b" " " "19 merge b no ancestor, prompt remove a"
727 created new head
710 created new head
728 --------------
711 --------------
729 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
712 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
730 --------------
713 --------------
731 searching for copies back to rev 1
732 unmatched files new in both:
714 unmatched files new in both:
733 b
715 b
734 resolving manifests
716 resolving manifests
735 branchmerge: True, force: False, partial: False
717 branchmerge: True, force: False, partial: False
736 ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a
718 ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a
737 preserving a for resolve of a
719 preserving a for resolve of a
738 preserving b for resolve of b
720 preserving b for resolve of b
739 preserving rev for resolve of rev
721 preserving rev for resolve of rev
740 starting 4 threads for background file closing (?)
722 starting 4 threads for background file closing (?)
741 a: prompt changed/deleted -> m (premerge)
723 a: prompt changed/deleted -> m (premerge)
742 picked tool ':prompt' for a (binary False symlink False changedelete True)
724 picked tool ':prompt' for a (binary False symlink False changedelete True)
743 file 'a' was deleted in other [merge rev] but was modified in local [working copy].
725 file 'a' was deleted in other [merge rev] but was modified in local [working copy].
744 What do you want to do?
726 What do you want to do?
745 use (c)hanged version, (d)elete, or leave (u)nresolved? u
727 use (c)hanged version, (d)elete, or leave (u)nresolved? u
746 b: both created -> m (premerge)
728 b: both created -> m (premerge)
747 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
729 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
748 merging b
730 merging b
749 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
731 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
750 rev: versions differ -> m (premerge)
732 rev: versions differ -> m (premerge)
751 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
733 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
752 merging rev
734 merging rev
753 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
735 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
754 b: both created -> m (merge)
736 b: both created -> m (merge)
755 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
737 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
756 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
738 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
757 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
739 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
758 merge tool returned: 0
740 merge tool returned: 0
759 rev: versions differ -> m (merge)
741 rev: versions differ -> m (merge)
760 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
742 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
761 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
743 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
762 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
744 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
763 merge tool returned: 0
745 merge tool returned: 0
764 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
746 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
765 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
747 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
766 --------------
748 --------------
767 M b
749 M b
768 C a
750 C a
769 abort: unresolved merge conflicts (see 'hg help resolve')
751 abort: unresolved merge conflicts (see 'hg help resolve')
770 --------------
752 --------------
771
753
772 $ tm "up a " "um a b" " " "20 merge a and b to b, remove a"
754 $ tm "up a " "um a b" " " "20 merge a and b to b, remove a"
773 created new head
755 created new head
774 --------------
756 --------------
775 test L:up a R:um a b W: - 20 merge a and b to b, remove a
757 test L:up a R:um a b W: - 20 merge a and b to b, remove a
776 --------------
758 --------------
777 searching for copies back to rev 1
778 unmatched files in other:
759 unmatched files in other:
779 b
760 b
780 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
761 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
781 src: 'a' -> dst: 'b' *
762 src: 'a' -> dst: 'b' *
782 checking for directory renames
763 checking for directory renames
783 resolving manifests
764 resolving manifests
784 branchmerge: True, force: False, partial: False
765 branchmerge: True, force: False, partial: False
785 ancestor: 924404dff337, local: e300d1c794ec+, remote: 49b6d8032493
766 ancestor: 924404dff337, local: e300d1c794ec+, remote: 49b6d8032493
786 preserving a for resolve of b
767 preserving a for resolve of b
787 preserving rev for resolve of rev
768 preserving rev for resolve of rev
788 removing a
769 removing a
789 starting 4 threads for background file closing (?)
770 starting 4 threads for background file closing (?)
790 b: remote moved from a -> m (premerge)
771 b: remote moved from a -> m (premerge)
791 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
772 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
792 merging a and b to b
773 merging a and b to b
793 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
774 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
794 rev: versions differ -> m (premerge)
775 rev: versions differ -> m (premerge)
795 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
776 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
796 merging rev
777 merging rev
797 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
778 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
798 b: remote moved from a -> m (merge)
779 b: remote moved from a -> m (merge)
799 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
780 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
800 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
781 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
801 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
782 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
802 merge tool returned: 0
783 merge tool returned: 0
803 rev: versions differ -> m (merge)
784 rev: versions differ -> m (merge)
804 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
785 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
805 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
786 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
806 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
787 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
807 merge tool returned: 0
788 merge tool returned: 0
808 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
789 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
809 (branch merge, don't forget to commit)
790 (branch merge, don't forget to commit)
810 --------------
791 --------------
811 M b
792 M b
812 a
793 a
813 --------------
794 --------------
814
795
815 $ tm "um a b" "up a " " " "21 merge a and b to b"
796 $ tm "um a b" "up a " " " "21 merge a and b to b"
816 created new head
797 created new head
817 --------------
798 --------------
818 test L:um a b R:up a W: - 21 merge a and b to b
799 test L:um a b R:up a W: - 21 merge a and b to b
819 --------------
800 --------------
820 searching for copies back to rev 1
821 unmatched files in local:
801 unmatched files in local:
822 b
802 b
823 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
803 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
824 src: 'a' -> dst: 'b' *
804 src: 'a' -> dst: 'b' *
825 checking for directory renames
805 checking for directory renames
826 resolving manifests
806 resolving manifests
827 branchmerge: True, force: False, partial: False
807 branchmerge: True, force: False, partial: False
828 ancestor: 924404dff337, local: 62e7bf090eba+, remote: f4db7e329e71
808 ancestor: 924404dff337, local: 62e7bf090eba+, remote: f4db7e329e71
829 preserving b for resolve of b
809 preserving b for resolve of b
830 preserving rev for resolve of rev
810 preserving rev for resolve of rev
831 starting 4 threads for background file closing (?)
811 starting 4 threads for background file closing (?)
832 b: local copied/moved from a -> m (premerge)
812 b: local copied/moved from a -> m (premerge)
833 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
813 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
834 merging b and a to b
814 merging b and a to b
835 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
815 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
836 rev: versions differ -> m (premerge)
816 rev: versions differ -> m (premerge)
837 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
817 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
838 merging rev
818 merging rev
839 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
819 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
840 b: local copied/moved from a -> m (merge)
820 b: local copied/moved from a -> m (merge)
841 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
821 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
842 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
822 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
843 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
823 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
844 merge tool returned: 0
824 merge tool returned: 0
845 rev: versions differ -> m (merge)
825 rev: versions differ -> m (merge)
846 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
826 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
847 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
827 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
848 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
828 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
849 merge tool returned: 0
829 merge tool returned: 0
850 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
830 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
851 (branch merge, don't forget to commit)
831 (branch merge, don't forget to commit)
852 --------------
832 --------------
853 M b
833 M b
854 a
834 a
855 --------------
835 --------------
856
836
857
837
858 m "nm a b" "um x a" " " "22 get a, keep b"
838 m "nm a b" "um x a" " " "22 get a, keep b"
859
839
860 $ tm "nm a b" "up a c" " " "23 get c, keep b"
840 $ tm "nm a b" "up a c" " " "23 get c, keep b"
861 created new head
841 created new head
862 --------------
842 --------------
863 test L:nm a b R:up a c W: - 23 get c, keep b
843 test L:nm a b R:up a c W: - 23 get c, keep b
864 --------------
844 --------------
865 searching for copies back to rev 1
866 unmatched files in local:
845 unmatched files in local:
867 b
846 b
868 unmatched files in other:
847 unmatched files in other:
869 c
848 c
870 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
849 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
871 src: 'a' -> dst: 'b' *
850 src: 'a' -> dst: 'b' *
872 checking for directory renames
851 checking for directory renames
873 resolving manifests
852 resolving manifests
874 branchmerge: True, force: False, partial: False
853 branchmerge: True, force: False, partial: False
875 ancestor: 924404dff337, local: 02963e448370+, remote: 2b958612230f
854 ancestor: 924404dff337, local: 02963e448370+, remote: 2b958612230f
876 preserving b for resolve of b
855 preserving b for resolve of b
877 preserving rev for resolve of rev
856 preserving rev for resolve of rev
878 c: remote created -> g
857 c: remote created -> g
879 getting c
858 getting c
880 b: local copied/moved from a -> m (premerge)
859 b: local copied/moved from a -> m (premerge)
881 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
860 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
882 merging b and a to b
861 merging b and a to b
883 my b@02963e448370+ other a@2b958612230f ancestor a@924404dff337
862 my b@02963e448370+ other a@2b958612230f ancestor a@924404dff337
884 premerge successful
863 premerge successful
885 rev: versions differ -> m (premerge)
864 rev: versions differ -> m (premerge)
886 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
865 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
887 merging rev
866 merging rev
888 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
867 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
889 rev: versions differ -> m (merge)
868 rev: versions differ -> m (merge)
890 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
869 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
891 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
870 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
892 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
871 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
893 merge tool returned: 0
872 merge tool returned: 0
894 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
873 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
895 (branch merge, don't forget to commit)
874 (branch merge, don't forget to commit)
896 --------------
875 --------------
897 M b
876 M b
898 a
877 a
899 M c
878 M c
900 --------------
879 --------------
901
880
902
881
903 $ cd ..
882 $ cd ..
904
883
905
884
906 Systematic and terse testing of merge merges and ancestor calculation:
885 Systematic and terse testing of merge merges and ancestor calculation:
907
886
908 Expected result:
887 Expected result:
909
888
910 \ a m1 m2 dst
889 \ a m1 m2 dst
911 0 - f f f "versions differ"
890 0 - f f f "versions differ"
912 1 f g g g "versions differ"
891 1 f g g g "versions differ"
913 2 f f f f "versions differ"
892 2 f f f f "versions differ"
914 3 f f g f+g "remote copied to " + f
893 3 f f g f+g "remote copied to " + f
915 4 f f g g "remote moved to " + f
894 4 f f g g "remote moved to " + f
916 5 f g f f+g "local copied to " + f2
895 5 f g f f+g "local copied to " + f2
917 6 f g f g "local moved to " + f2
896 6 f g f g "local moved to " + f2
918 7 - (f) f f "remote differs from untracked local"
897 7 - (f) f f "remote differs from untracked local"
919 8 f (f) f f "remote differs from untracked local"
898 8 f (f) f f "remote differs from untracked local"
920
899
921 $ hg init ancestortest
900 $ hg init ancestortest
922 $ cd ancestortest
901 $ cd ancestortest
923 $ for x in 1 2 3 4 5 6 8; do mkdir $x; echo a > $x/f; done
902 $ for x in 1 2 3 4 5 6 8; do mkdir $x; echo a > $x/f; done
924 $ hg ci -Aqm "a"
903 $ hg ci -Aqm "a"
925 $ mkdir 0
904 $ mkdir 0
926 $ touch 0/f
905 $ touch 0/f
927 $ hg mv 1/f 1/g
906 $ hg mv 1/f 1/g
928 $ hg cp 5/f 5/g
907 $ hg cp 5/f 5/g
929 $ hg mv 6/f 6/g
908 $ hg mv 6/f 6/g
930 $ hg rm 8/f
909 $ hg rm 8/f
931 $ for x in */*; do echo m1 > $x; done
910 $ for x in */*; do echo m1 > $x; done
932 $ hg ci -Aqm "m1"
911 $ hg ci -Aqm "m1"
933 $ hg up -qr0
912 $ hg up -qr0
934 $ mkdir 0 7
913 $ mkdir 0 7
935 $ touch 0/f 7/f
914 $ touch 0/f 7/f
936 $ hg mv 1/f 1/g
915 $ hg mv 1/f 1/g
937 $ hg cp 3/f 3/g
916 $ hg cp 3/f 3/g
938 $ hg mv 4/f 4/g
917 $ hg mv 4/f 4/g
939 $ for x in */*; do echo m2 > $x; done
918 $ for x in */*; do echo m2 > $x; done
940 $ hg ci -Aqm "m2"
919 $ hg ci -Aqm "m2"
941 $ hg up -qr1
920 $ hg up -qr1
942 $ mkdir 7 8
921 $ mkdir 7 8
943 $ echo m > 7/f
922 $ echo m > 7/f
944 $ echo m > 8/f
923 $ echo m > 8/f
945 $ hg merge -f --tool internal:dump -v --debug -r2 | sed '/^resolving manifests/,$d' 2> /dev/null
924 $ hg merge -f --tool internal:dump -v --debug -r2 | sed '/^resolving manifests/,$d' 2> /dev/null
946 searching for copies back to rev 1
947 unmatched files in local:
925 unmatched files in local:
948 5/g
926 5/g
949 6/g
927 6/g
950 unmatched files in other:
928 unmatched files in other:
951 3/g
929 3/g
952 4/g
930 4/g
953 7/f
931 7/f
954 unmatched files new in both:
932 unmatched files new in both:
955 0/f
933 0/f
956 1/g
934 1/g
957 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
935 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
958 src: '1/f' -> dst: '1/g' *
936 src: '1/f' -> dst: '1/g' *
959 src: '3/f' -> dst: '3/g' *
937 src: '3/f' -> dst: '3/g' *
960 src: '4/f' -> dst: '4/g' *
938 src: '4/f' -> dst: '4/g' *
961 src: '5/f' -> dst: '5/g' *
939 src: '5/f' -> dst: '5/g' *
962 src: '6/f' -> dst: '6/g' *
940 src: '6/f' -> dst: '6/g' *
963 checking for directory renames
941 checking for directory renames
964 $ hg mani
942 $ hg mani
965 0/f
943 0/f
966 1/g
944 1/g
967 2/f
945 2/f
968 3/f
946 3/f
969 4/f
947 4/f
970 5/f
948 5/f
971 5/g
949 5/g
972 6/g
950 6/g
973 $ for f in */*; do echo $f:; cat $f; done
951 $ for f in */*; do echo $f:; cat $f; done
974 0/f:
952 0/f:
975 m1
953 m1
976 0/f.base:
954 0/f.base:
977 0/f.local:
955 0/f.local:
978 m1
956 m1
979 0/f.orig:
957 0/f.orig:
980 m1
958 m1
981 0/f.other:
959 0/f.other:
982 m2
960 m2
983 1/g:
961 1/g:
984 m1
962 m1
985 1/g.base:
963 1/g.base:
986 a
964 a
987 1/g.local:
965 1/g.local:
988 m1
966 m1
989 1/g.orig:
967 1/g.orig:
990 m1
968 m1
991 1/g.other:
969 1/g.other:
992 m2
970 m2
993 2/f:
971 2/f:
994 m1
972 m1
995 2/f.base:
973 2/f.base:
996 a
974 a
997 2/f.local:
975 2/f.local:
998 m1
976 m1
999 2/f.orig:
977 2/f.orig:
1000 m1
978 m1
1001 2/f.other:
979 2/f.other:
1002 m2
980 m2
1003 3/f:
981 3/f:
1004 m1
982 m1
1005 3/f.base:
983 3/f.base:
1006 a
984 a
1007 3/f.local:
985 3/f.local:
1008 m1
986 m1
1009 3/f.orig:
987 3/f.orig:
1010 m1
988 m1
1011 3/f.other:
989 3/f.other:
1012 m2
990 m2
1013 3/g:
991 3/g:
1014 m1
992 m1
1015 3/g.base:
993 3/g.base:
1016 a
994 a
1017 3/g.local:
995 3/g.local:
1018 m1
996 m1
1019 3/g.orig:
997 3/g.orig:
1020 m1
998 m1
1021 3/g.other:
999 3/g.other:
1022 m2
1000 m2
1023 4/g:
1001 4/g:
1024 m1
1002 m1
1025 4/g.base:
1003 4/g.base:
1026 a
1004 a
1027 4/g.local:
1005 4/g.local:
1028 m1
1006 m1
1029 4/g.orig:
1007 4/g.orig:
1030 m1
1008 m1
1031 4/g.other:
1009 4/g.other:
1032 m2
1010 m2
1033 5/f:
1011 5/f:
1034 m1
1012 m1
1035 5/f.base:
1013 5/f.base:
1036 a
1014 a
1037 5/f.local:
1015 5/f.local:
1038 m1
1016 m1
1039 5/f.orig:
1017 5/f.orig:
1040 m1
1018 m1
1041 5/f.other:
1019 5/f.other:
1042 m2
1020 m2
1043 5/g:
1021 5/g:
1044 m1
1022 m1
1045 5/g.base:
1023 5/g.base:
1046 a
1024 a
1047 5/g.local:
1025 5/g.local:
1048 m1
1026 m1
1049 5/g.orig:
1027 5/g.orig:
1050 m1
1028 m1
1051 5/g.other:
1029 5/g.other:
1052 m2
1030 m2
1053 6/g:
1031 6/g:
1054 m1
1032 m1
1055 6/g.base:
1033 6/g.base:
1056 a
1034 a
1057 6/g.local:
1035 6/g.local:
1058 m1
1036 m1
1059 6/g.orig:
1037 6/g.orig:
1060 m1
1038 m1
1061 6/g.other:
1039 6/g.other:
1062 m2
1040 m2
1063 7/f:
1041 7/f:
1064 m
1042 m
1065 7/f.base:
1043 7/f.base:
1066 7/f.local:
1044 7/f.local:
1067 m
1045 m
1068 7/f.orig:
1046 7/f.orig:
1069 m
1047 m
1070 7/f.other:
1048 7/f.other:
1071 m2
1049 m2
1072 8/f:
1050 8/f:
1073 m2
1051 m2
1074 $ cd ..
1052 $ cd ..
@@ -1,2010 +1,2007 b''
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2
2
3 $ echo "[ui]" >> $HGRCPATH
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5
5
6 $ hg init t
6 $ hg init t
7 $ cd t
7 $ cd t
8
8
9 first revision, no sub
9 first revision, no sub
10
10
11 $ echo a > a
11 $ echo a > a
12 $ hg ci -Am0
12 $ hg ci -Am0
13 adding a
13 adding a
14
14
15 add first sub
15 add first sub
16
16
17 $ echo s = s > .hgsub
17 $ echo s = s > .hgsub
18 $ hg add .hgsub
18 $ hg add .hgsub
19 $ hg init s
19 $ hg init s
20 $ echo a > s/a
20 $ echo a > s/a
21
21
22 Issue2232: committing a subrepo without .hgsub
22 Issue2232: committing a subrepo without .hgsub
23
23
24 $ hg ci -mbad s
24 $ hg ci -mbad s
25 abort: can't commit subrepos without .hgsub
25 abort: can't commit subrepos without .hgsub
26 [255]
26 [255]
27
27
28 $ hg -R s add s/a
28 $ hg -R s add s/a
29 $ hg files -S
29 $ hg files -S
30 .hgsub
30 .hgsub
31 a
31 a
32 s/a
32 s/a
33
33
34 `hg files` respects ui.relative-paths
34 `hg files` respects ui.relative-paths
35 BROKEN: shows subrepo paths relative to the subrepo
35 BROKEN: shows subrepo paths relative to the subrepo
36 $ hg files -S --config ui.relative-paths=no
36 $ hg files -S --config ui.relative-paths=no
37 .hgsub
37 .hgsub
38 a
38 a
39 s/a
39 s/a
40
40
41 $ hg -R s ci -Ams0
41 $ hg -R s ci -Ams0
42 $ hg sum
42 $ hg sum
43 parent: 0:f7b1eb17ad24 tip
43 parent: 0:f7b1eb17ad24 tip
44 0
44 0
45 branch: default
45 branch: default
46 commit: 1 added, 1 subrepos
46 commit: 1 added, 1 subrepos
47 update: (current)
47 update: (current)
48 phases: 1 draft
48 phases: 1 draft
49 $ hg ci -m1
49 $ hg ci -m1
50
50
51 test handling .hgsubstate "added" explicitly.
51 test handling .hgsubstate "added" explicitly.
52
52
53 $ hg parents --template '{node}\n{files}\n'
53 $ hg parents --template '{node}\n{files}\n'
54 7cf8cfea66e410e8e3336508dfeec07b3192de51
54 7cf8cfea66e410e8e3336508dfeec07b3192de51
55 .hgsub .hgsubstate
55 .hgsub .hgsubstate
56 $ hg rollback -q
56 $ hg rollback -q
57 $ hg add .hgsubstate
57 $ hg add .hgsubstate
58 $ hg ci -m1
58 $ hg ci -m1
59 $ hg parents --template '{node}\n{files}\n'
59 $ hg parents --template '{node}\n{files}\n'
60 7cf8cfea66e410e8e3336508dfeec07b3192de51
60 7cf8cfea66e410e8e3336508dfeec07b3192de51
61 .hgsub .hgsubstate
61 .hgsub .hgsubstate
62
62
63 Subrepopath which overlaps with filepath, does not change warnings in remove()
63 Subrepopath which overlaps with filepath, does not change warnings in remove()
64
64
65 $ mkdir snot
65 $ mkdir snot
66 $ touch snot/file
66 $ touch snot/file
67 $ hg remove -S snot/file
67 $ hg remove -S snot/file
68 not removing snot/file: file is untracked
68 not removing snot/file: file is untracked
69 [1]
69 [1]
70 $ hg cat snot/filenot
70 $ hg cat snot/filenot
71 snot/filenot: no such file in rev 7cf8cfea66e4
71 snot/filenot: no such file in rev 7cf8cfea66e4
72 [1]
72 [1]
73 $ rm -r snot
73 $ rm -r snot
74
74
75 Revert subrepo and test subrepo fileset keyword:
75 Revert subrepo and test subrepo fileset keyword:
76
76
77 $ echo b > s/a
77 $ echo b > s/a
78 $ hg revert --dry-run "set:subrepo('glob:s*')"
78 $ hg revert --dry-run "set:subrepo('glob:s*')"
79 reverting subrepo s
79 reverting subrepo s
80 reverting s/a
80 reverting s/a
81 $ cat s/a
81 $ cat s/a
82 b
82 b
83 $ hg revert "set:subrepo('glob:s*')"
83 $ hg revert "set:subrepo('glob:s*')"
84 reverting subrepo s
84 reverting subrepo s
85 reverting s/a
85 reverting s/a
86 $ cat s/a
86 $ cat s/a
87 a
87 a
88 $ rm s/a.orig
88 $ rm s/a.orig
89
89
90 Revert subrepo with no backup. The "reverting s/a" line is gone since
90 Revert subrepo with no backup. The "reverting s/a" line is gone since
91 we're really running 'hg update' in the subrepo:
91 we're really running 'hg update' in the subrepo:
92
92
93 $ echo b > s/a
93 $ echo b > s/a
94 $ hg revert --no-backup s
94 $ hg revert --no-backup s
95 reverting subrepo s
95 reverting subrepo s
96
96
97 Issue2022: update -C
97 Issue2022: update -C
98
98
99 $ echo b > s/a
99 $ echo b > s/a
100 $ hg sum
100 $ hg sum
101 parent: 1:7cf8cfea66e4 tip
101 parent: 1:7cf8cfea66e4 tip
102 1
102 1
103 branch: default
103 branch: default
104 commit: 1 subrepos
104 commit: 1 subrepos
105 update: (current)
105 update: (current)
106 phases: 2 draft
106 phases: 2 draft
107 $ hg co -C 1
107 $ hg co -C 1
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 $ hg sum
109 $ hg sum
110 parent: 1:7cf8cfea66e4 tip
110 parent: 1:7cf8cfea66e4 tip
111 1
111 1
112 branch: default
112 branch: default
113 commit: (clean)
113 commit: (clean)
114 update: (current)
114 update: (current)
115 phases: 2 draft
115 phases: 2 draft
116
116
117 commands that require a clean repo should respect subrepos
117 commands that require a clean repo should respect subrepos
118
118
119 $ echo b >> s/a
119 $ echo b >> s/a
120 $ hg backout tip
120 $ hg backout tip
121 abort: uncommitted changes in subrepository "s"
121 abort: uncommitted changes in subrepository "s"
122 [255]
122 [255]
123 $ hg revert -C -R s s/a
123 $ hg revert -C -R s s/a
124
124
125 add sub sub
125 add sub sub
126
126
127 $ echo ss = ss > s/.hgsub
127 $ echo ss = ss > s/.hgsub
128 $ hg init s/ss
128 $ hg init s/ss
129 $ echo a > s/ss/a
129 $ echo a > s/ss/a
130 $ hg -R s add s/.hgsub
130 $ hg -R s add s/.hgsub
131 $ hg -R s/ss add s/ss/a
131 $ hg -R s/ss add s/ss/a
132 $ hg sum
132 $ hg sum
133 parent: 1:7cf8cfea66e4 tip
133 parent: 1:7cf8cfea66e4 tip
134 1
134 1
135 branch: default
135 branch: default
136 commit: 1 subrepos
136 commit: 1 subrepos
137 update: (current)
137 update: (current)
138 phases: 2 draft
138 phases: 2 draft
139 $ hg ci -m2
139 $ hg ci -m2
140 committing subrepository s
140 committing subrepository s
141 committing subrepository s/ss
141 committing subrepository s/ss
142 $ hg sum
142 $ hg sum
143 parent: 2:df30734270ae tip
143 parent: 2:df30734270ae tip
144 2
144 2
145 branch: default
145 branch: default
146 commit: (clean)
146 commit: (clean)
147 update: (current)
147 update: (current)
148 phases: 3 draft
148 phases: 3 draft
149
149
150 test handling .hgsubstate "modified" explicitly.
150 test handling .hgsubstate "modified" explicitly.
151
151
152 $ hg parents --template '{node}\n{files}\n'
152 $ hg parents --template '{node}\n{files}\n'
153 df30734270ae757feb35e643b7018e818e78a9aa
153 df30734270ae757feb35e643b7018e818e78a9aa
154 .hgsubstate
154 .hgsubstate
155 $ hg rollback -q
155 $ hg rollback -q
156 $ hg status -A .hgsubstate
156 $ hg status -A .hgsubstate
157 M .hgsubstate
157 M .hgsubstate
158 $ hg ci -m2
158 $ hg ci -m2
159 $ hg parents --template '{node}\n{files}\n'
159 $ hg parents --template '{node}\n{files}\n'
160 df30734270ae757feb35e643b7018e818e78a9aa
160 df30734270ae757feb35e643b7018e818e78a9aa
161 .hgsubstate
161 .hgsubstate
162
162
163 bump sub rev (and check it is ignored by ui.commitsubrepos)
163 bump sub rev (and check it is ignored by ui.commitsubrepos)
164
164
165 $ echo b > s/a
165 $ echo b > s/a
166 $ hg -R s ci -ms1
166 $ hg -R s ci -ms1
167 $ hg --config ui.commitsubrepos=no ci -m3
167 $ hg --config ui.commitsubrepos=no ci -m3
168
168
169 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
169 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
170
170
171 $ echo c > s/a
171 $ echo c > s/a
172 $ hg --config ui.commitsubrepos=no ci -m4
172 $ hg --config ui.commitsubrepos=no ci -m4
173 abort: uncommitted changes in subrepository "s"
173 abort: uncommitted changes in subrepository "s"
174 (use --subrepos for recursive commit)
174 (use --subrepos for recursive commit)
175 [255]
175 [255]
176 $ hg id
176 $ hg id
177 f6affe3fbfaa+ tip
177 f6affe3fbfaa+ tip
178 $ hg -R s ci -mc
178 $ hg -R s ci -mc
179 $ hg id
179 $ hg id
180 f6affe3fbfaa+ tip
180 f6affe3fbfaa+ tip
181 $ echo d > s/a
181 $ echo d > s/a
182 $ hg ci -m4
182 $ hg ci -m4
183 committing subrepository s
183 committing subrepository s
184 $ hg tip -R s
184 $ hg tip -R s
185 changeset: 4:02dcf1d70411
185 changeset: 4:02dcf1d70411
186 tag: tip
186 tag: tip
187 user: test
187 user: test
188 date: Thu Jan 01 00:00:00 1970 +0000
188 date: Thu Jan 01 00:00:00 1970 +0000
189 summary: 4
189 summary: 4
190
190
191
191
192 check caching
192 check caching
193
193
194 $ hg co 0
194 $ hg co 0
195 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
195 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
196 $ hg debugsub
196 $ hg debugsub
197
197
198 restore
198 restore
199
199
200 $ hg co
200 $ hg co
201 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
201 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
202 $ hg debugsub
202 $ hg debugsub
203 path s
203 path s
204 source s
204 source s
205 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
205 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
206
206
207 new branch for merge tests
207 new branch for merge tests
208
208
209 $ hg co 1
209 $ hg co 1
210 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
210 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
211 $ echo t = t >> .hgsub
211 $ echo t = t >> .hgsub
212 $ hg init t
212 $ hg init t
213 $ echo t > t/t
213 $ echo t > t/t
214 $ hg -R t add t
214 $ hg -R t add t
215 adding t/t
215 adding t/t
216
216
217 5
217 5
218
218
219 $ hg ci -m5 # add sub
219 $ hg ci -m5 # add sub
220 committing subrepository t
220 committing subrepository t
221 created new head
221 created new head
222 $ echo t2 > t/t
222 $ echo t2 > t/t
223
223
224 6
224 6
225
225
226 $ hg st -R s
226 $ hg st -R s
227 $ hg ci -m6 # change sub
227 $ hg ci -m6 # change sub
228 committing subrepository t
228 committing subrepository t
229 $ hg debugsub
229 $ hg debugsub
230 path s
230 path s
231 source s
231 source s
232 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
232 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
233 path t
233 path t
234 source t
234 source t
235 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
235 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
236 $ echo t3 > t/t
236 $ echo t3 > t/t
237
237
238 7
238 7
239
239
240 $ hg ci -m7 # change sub again for conflict test
240 $ hg ci -m7 # change sub again for conflict test
241 committing subrepository t
241 committing subrepository t
242 $ hg rm .hgsub
242 $ hg rm .hgsub
243
243
244 8
244 8
245
245
246 $ hg ci -m8 # remove sub
246 $ hg ci -m8 # remove sub
247
247
248 test handling .hgsubstate "removed" explicitly.
248 test handling .hgsubstate "removed" explicitly.
249
249
250 $ hg parents --template '{node}\n{files}\n'
250 $ hg parents --template '{node}\n{files}\n'
251 96615c1dad2dc8e3796d7332c77ce69156f7b78e
251 96615c1dad2dc8e3796d7332c77ce69156f7b78e
252 .hgsub .hgsubstate
252 .hgsub .hgsubstate
253 $ hg rollback -q
253 $ hg rollback -q
254 $ hg remove .hgsubstate
254 $ hg remove .hgsubstate
255 $ hg ci -m8
255 $ hg ci -m8
256 $ hg parents --template '{node}\n{files}\n'
256 $ hg parents --template '{node}\n{files}\n'
257 96615c1dad2dc8e3796d7332c77ce69156f7b78e
257 96615c1dad2dc8e3796d7332c77ce69156f7b78e
258 .hgsub .hgsubstate
258 .hgsub .hgsubstate
259
259
260 merge tests
260 merge tests
261
261
262 $ hg co -C 3
262 $ hg co -C 3
263 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
264 $ hg merge 5 # test adding
264 $ hg merge 5 # test adding
265 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
265 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 (branch merge, don't forget to commit)
266 (branch merge, don't forget to commit)
267 $ hg debugsub
267 $ hg debugsub
268 path s
268 path s
269 source s
269 source s
270 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
270 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
271 path t
271 path t
272 source t
272 source t
273 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
273 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
274 $ hg ci -m9
274 $ hg ci -m9
275 created new head
275 created new head
276 $ hg merge 6 --debug # test change
276 $ hg merge 6 --debug # test change
277 searching for copies back to rev 2
278 resolving manifests
277 resolving manifests
279 branchmerge: True, force: False, partial: False
278 branchmerge: True, force: False, partial: False
280 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
279 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
281 starting 4 threads for background file closing (?)
280 starting 4 threads for background file closing (?)
282 .hgsubstate: versions differ -> m (premerge)
281 .hgsubstate: versions differ -> m (premerge)
283 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
282 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
284 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
283 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
285 getting subrepo t
284 getting subrepo t
286 resolving manifests
285 resolving manifests
287 branchmerge: False, force: False, partial: False
286 branchmerge: False, force: False, partial: False
288 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
287 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
289 t: remote is newer -> g
288 t: remote is newer -> g
290 getting t
289 getting t
291 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
290 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
292 (branch merge, don't forget to commit)
291 (branch merge, don't forget to commit)
293 $ hg debugsub
292 $ hg debugsub
294 path s
293 path s
295 source s
294 source s
296 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
295 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
297 path t
296 path t
298 source t
297 source t
299 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
298 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
300 $ echo conflict > t/t
299 $ echo conflict > t/t
301 $ hg ci -m10
300 $ hg ci -m10
302 committing subrepository t
301 committing subrepository t
303 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
302 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
304 searching for copies back to rev 2
305 resolving manifests
303 resolving manifests
306 branchmerge: True, force: False, partial: False
304 branchmerge: True, force: False, partial: False
307 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
305 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
308 starting 4 threads for background file closing (?)
306 starting 4 threads for background file closing (?)
309 .hgsubstate: versions differ -> m (premerge)
307 .hgsubstate: versions differ -> m (premerge)
310 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
308 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
311 subrepo t: both sides changed
309 subrepo t: both sides changed
312 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
310 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
313 starting 4 threads for background file closing (?)
311 starting 4 threads for background file closing (?)
314 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
312 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
315 merging subrepository "t"
313 merging subrepository "t"
316 searching for copies back to rev 2
317 resolving manifests
314 resolving manifests
318 branchmerge: True, force: False, partial: False
315 branchmerge: True, force: False, partial: False
319 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
316 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
320 preserving t for resolve of t
317 preserving t for resolve of t
321 starting 4 threads for background file closing (?)
318 starting 4 threads for background file closing (?)
322 t: versions differ -> m (premerge)
319 t: versions differ -> m (premerge)
323 picked tool ':merge' for t (binary False symlink False changedelete False)
320 picked tool ':merge' for t (binary False symlink False changedelete False)
324 merging t
321 merging t
325 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
322 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
326 t: versions differ -> m (merge)
323 t: versions differ -> m (merge)
327 picked tool ':merge' for t (binary False symlink False changedelete False)
324 picked tool ':merge' for t (binary False symlink False changedelete False)
328 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
325 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
329 warning: conflicts while merging t! (edit, then use 'hg resolve --mark')
326 warning: conflicts while merging t! (edit, then use 'hg resolve --mark')
330 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
327 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
331 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
328 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
332 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
329 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
333 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
334 (branch merge, don't forget to commit)
331 (branch merge, don't forget to commit)
335
332
336 should conflict
333 should conflict
337
334
338 $ cat t/t
335 $ cat t/t
339 <<<<<<< local: 20a0db6fbf6c - test: 10
336 <<<<<<< local: 20a0db6fbf6c - test: 10
340 conflict
337 conflict
341 =======
338 =======
342 t3
339 t3
343 >>>>>>> other: 7af322bc1198 - test: 7
340 >>>>>>> other: 7af322bc1198 - test: 7
344
341
345 11: remove subrepo t
342 11: remove subrepo t
346
343
347 $ hg co -C 5
344 $ hg co -C 5
348 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
345 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
349 $ hg revert -r 4 .hgsub # remove t
346 $ hg revert -r 4 .hgsub # remove t
350 $ hg ci -m11
347 $ hg ci -m11
351 created new head
348 created new head
352 $ hg debugsub
349 $ hg debugsub
353 path s
350 path s
354 source s
351 source s
355 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
352 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
356
353
357 local removed, remote changed, keep changed
354 local removed, remote changed, keep changed
358
355
359 $ hg merge 6
356 $ hg merge 6
360 remote [merge rev] changed subrepository t which local [working copy] removed
357 remote [merge rev] changed subrepository t which local [working copy] removed
361 use (c)hanged version or (d)elete? c
358 use (c)hanged version or (d)elete? c
362 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
359 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
363 (branch merge, don't forget to commit)
360 (branch merge, don't forget to commit)
364 BROKEN: should include subrepo t
361 BROKEN: should include subrepo t
365 $ hg debugsub
362 $ hg debugsub
366 path s
363 path s
367 source s
364 source s
368 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
365 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
369 $ cat .hgsubstate
366 $ cat .hgsubstate
370 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
367 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
371 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
368 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
372 $ hg ci -m 'local removed, remote changed, keep changed'
369 $ hg ci -m 'local removed, remote changed, keep changed'
373 BROKEN: should include subrepo t
370 BROKEN: should include subrepo t
374 $ hg debugsub
371 $ hg debugsub
375 path s
372 path s
376 source s
373 source s
377 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
374 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
378 BROKEN: should include subrepo t
375 BROKEN: should include subrepo t
379 $ cat .hgsubstate
376 $ cat .hgsubstate
380 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
377 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
381 $ cat t/t
378 $ cat t/t
382 t2
379 t2
383
380
384 local removed, remote changed, keep removed
381 local removed, remote changed, keep removed
385
382
386 $ hg co -C 11
383 $ hg co -C 11
387 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
384 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
388 $ hg merge --config ui.interactive=true 6 <<EOF
385 $ hg merge --config ui.interactive=true 6 <<EOF
389 > d
386 > d
390 > EOF
387 > EOF
391 remote [merge rev] changed subrepository t which local [working copy] removed
388 remote [merge rev] changed subrepository t which local [working copy] removed
392 use (c)hanged version or (d)elete? d
389 use (c)hanged version or (d)elete? d
393 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
390 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
394 (branch merge, don't forget to commit)
391 (branch merge, don't forget to commit)
395 $ hg debugsub
392 $ hg debugsub
396 path s
393 path s
397 source s
394 source s
398 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
395 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
399 $ cat .hgsubstate
396 $ cat .hgsubstate
400 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
397 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
401 $ hg ci -m 'local removed, remote changed, keep removed'
398 $ hg ci -m 'local removed, remote changed, keep removed'
402 created new head
399 created new head
403 $ hg debugsub
400 $ hg debugsub
404 path s
401 path s
405 source s
402 source s
406 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
403 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
407 $ cat .hgsubstate
404 $ cat .hgsubstate
408 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
405 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
409
406
410 local changed, remote removed, keep changed
407 local changed, remote removed, keep changed
411
408
412 $ hg co -C 6
409 $ hg co -C 6
413 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
410 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 $ hg merge 11
411 $ hg merge 11
415 local [working copy] changed subrepository t which remote [merge rev] removed
412 local [working copy] changed subrepository t which remote [merge rev] removed
416 use (c)hanged version or (d)elete? c
413 use (c)hanged version or (d)elete? c
417 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
418 (branch merge, don't forget to commit)
415 (branch merge, don't forget to commit)
419 BROKEN: should include subrepo t
416 BROKEN: should include subrepo t
420 $ hg debugsub
417 $ hg debugsub
421 path s
418 path s
422 source s
419 source s
423 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
420 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
424 BROKEN: should include subrepo t
421 BROKEN: should include subrepo t
425 $ cat .hgsubstate
422 $ cat .hgsubstate
426 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
423 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
427 $ hg ci -m 'local changed, remote removed, keep changed'
424 $ hg ci -m 'local changed, remote removed, keep changed'
428 created new head
425 created new head
429 BROKEN: should include subrepo t
426 BROKEN: should include subrepo t
430 $ hg debugsub
427 $ hg debugsub
431 path s
428 path s
432 source s
429 source s
433 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
430 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
434 BROKEN: should include subrepo t
431 BROKEN: should include subrepo t
435 $ cat .hgsubstate
432 $ cat .hgsubstate
436 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
433 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
437 $ cat t/t
434 $ cat t/t
438 t2
435 t2
439
436
440 local changed, remote removed, keep removed
437 local changed, remote removed, keep removed
441
438
442 $ hg co -C 6
439 $ hg co -C 6
443 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
440 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
444 $ hg merge --config ui.interactive=true 11 <<EOF
441 $ hg merge --config ui.interactive=true 11 <<EOF
445 > d
442 > d
446 > EOF
443 > EOF
447 local [working copy] changed subrepository t which remote [merge rev] removed
444 local [working copy] changed subrepository t which remote [merge rev] removed
448 use (c)hanged version or (d)elete? d
445 use (c)hanged version or (d)elete? d
449 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
446 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 (branch merge, don't forget to commit)
447 (branch merge, don't forget to commit)
451 $ hg debugsub
448 $ hg debugsub
452 path s
449 path s
453 source s
450 source s
454 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
451 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
455 $ cat .hgsubstate
452 $ cat .hgsubstate
456 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
453 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
457 $ hg ci -m 'local changed, remote removed, keep removed'
454 $ hg ci -m 'local changed, remote removed, keep removed'
458 created new head
455 created new head
459 $ hg debugsub
456 $ hg debugsub
460 path s
457 path s
461 source s
458 source s
462 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
459 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
463 $ cat .hgsubstate
460 $ cat .hgsubstate
464 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
461 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
465
462
466 clean up to avoid having to fix up the tests below
463 clean up to avoid having to fix up the tests below
467
464
468 $ hg co -C 10
465 $ hg co -C 10
469 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
466 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
470 $ cat >> $HGRCPATH <<EOF
467 $ cat >> $HGRCPATH <<EOF
471 > [extensions]
468 > [extensions]
472 > strip=
469 > strip=
473 > EOF
470 > EOF
474 $ hg strip -r 11:15
471 $ hg strip -r 11:15
475 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
472 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
476
473
477 clone
474 clone
478
475
479 $ cd ..
476 $ cd ..
480 $ hg clone t tc
477 $ hg clone t tc
481 updating to branch default
478 updating to branch default
482 cloning subrepo s from $TESTTMP/t/s
479 cloning subrepo s from $TESTTMP/t/s
483 cloning subrepo s/ss from $TESTTMP/t/s/ss
480 cloning subrepo s/ss from $TESTTMP/t/s/ss
484 cloning subrepo t from $TESTTMP/t/t
481 cloning subrepo t from $TESTTMP/t/t
485 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
482 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
486 $ cd tc
483 $ cd tc
487 $ hg debugsub
484 $ hg debugsub
488 path s
485 path s
489 source s
486 source s
490 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
487 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
491 path t
488 path t
492 source t
489 source t
493 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
490 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
494 $ cd ..
491 $ cd ..
495
492
496 clone with subrepo disabled (update should fail)
493 clone with subrepo disabled (update should fail)
497
494
498 $ hg clone t -U tc2 --config subrepos.allowed=false
495 $ hg clone t -U tc2 --config subrepos.allowed=false
499 $ hg update -R tc2 --config subrepos.allowed=false
496 $ hg update -R tc2 --config subrepos.allowed=false
500 abort: subrepos not enabled
497 abort: subrepos not enabled
501 (see 'hg help config.subrepos' for details)
498 (see 'hg help config.subrepos' for details)
502 [255]
499 [255]
503 $ ls tc2
500 $ ls tc2
504 a
501 a
505
502
506 $ hg clone t tc3 --config subrepos.allowed=false
503 $ hg clone t tc3 --config subrepos.allowed=false
507 updating to branch default
504 updating to branch default
508 abort: subrepos not enabled
505 abort: subrepos not enabled
509 (see 'hg help config.subrepos' for details)
506 (see 'hg help config.subrepos' for details)
510 [255]
507 [255]
511 $ ls tc3
508 $ ls tc3
512 a
509 a
513
510
514 And again with just the hg type disabled
511 And again with just the hg type disabled
515
512
516 $ hg clone t -U tc4 --config subrepos.hg:allowed=false
513 $ hg clone t -U tc4 --config subrepos.hg:allowed=false
517 $ hg update -R tc4 --config subrepos.hg:allowed=false
514 $ hg update -R tc4 --config subrepos.hg:allowed=false
518 abort: hg subrepos not allowed
515 abort: hg subrepos not allowed
519 (see 'hg help config.subrepos' for details)
516 (see 'hg help config.subrepos' for details)
520 [255]
517 [255]
521 $ ls tc4
518 $ ls tc4
522 a
519 a
523
520
524 $ hg clone t tc5 --config subrepos.hg:allowed=false
521 $ hg clone t tc5 --config subrepos.hg:allowed=false
525 updating to branch default
522 updating to branch default
526 abort: hg subrepos not allowed
523 abort: hg subrepos not allowed
527 (see 'hg help config.subrepos' for details)
524 (see 'hg help config.subrepos' for details)
528 [255]
525 [255]
529 $ ls tc5
526 $ ls tc5
530 a
527 a
531
528
532 push
529 push
533
530
534 $ cd tc
531 $ cd tc
535 $ echo bah > t/t
532 $ echo bah > t/t
536 $ hg ci -m11
533 $ hg ci -m11
537 committing subrepository t
534 committing subrepository t
538 $ hg push
535 $ hg push
539 pushing to $TESTTMP/t
536 pushing to $TESTTMP/t
540 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
537 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
541 no changes made to subrepo s since last push to $TESTTMP/t/s
538 no changes made to subrepo s since last push to $TESTTMP/t/s
542 pushing subrepo t to $TESTTMP/t/t
539 pushing subrepo t to $TESTTMP/t/t
543 searching for changes
540 searching for changes
544 adding changesets
541 adding changesets
545 adding manifests
542 adding manifests
546 adding file changes
543 adding file changes
547 added 1 changesets with 1 changes to 1 files
544 added 1 changesets with 1 changes to 1 files
548 searching for changes
545 searching for changes
549 adding changesets
546 adding changesets
550 adding manifests
547 adding manifests
551 adding file changes
548 adding file changes
552 added 1 changesets with 1 changes to 1 files
549 added 1 changesets with 1 changes to 1 files
553
550
554 push -f
551 push -f
555
552
556 $ echo bah > s/a
553 $ echo bah > s/a
557 $ hg ci -m12
554 $ hg ci -m12
558 committing subrepository s
555 committing subrepository s
559 $ hg push
556 $ hg push
560 pushing to $TESTTMP/t
557 pushing to $TESTTMP/t
561 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
558 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
562 pushing subrepo s to $TESTTMP/t/s
559 pushing subrepo s to $TESTTMP/t/s
563 searching for changes
560 searching for changes
564 abort: push creates new remote head 12a213df6fa9! (in subrepository "s")
561 abort: push creates new remote head 12a213df6fa9! (in subrepository "s")
565 (merge or see 'hg help push' for details about pushing new heads)
562 (merge or see 'hg help push' for details about pushing new heads)
566 [255]
563 [255]
567 $ hg push -f
564 $ hg push -f
568 pushing to $TESTTMP/t
565 pushing to $TESTTMP/t
569 pushing subrepo s/ss to $TESTTMP/t/s/ss
566 pushing subrepo s/ss to $TESTTMP/t/s/ss
570 searching for changes
567 searching for changes
571 no changes found
568 no changes found
572 pushing subrepo s to $TESTTMP/t/s
569 pushing subrepo s to $TESTTMP/t/s
573 searching for changes
570 searching for changes
574 adding changesets
571 adding changesets
575 adding manifests
572 adding manifests
576 adding file changes
573 adding file changes
577 added 1 changesets with 1 changes to 1 files (+1 heads)
574 added 1 changesets with 1 changes to 1 files (+1 heads)
578 pushing subrepo t to $TESTTMP/t/t
575 pushing subrepo t to $TESTTMP/t/t
579 searching for changes
576 searching for changes
580 no changes found
577 no changes found
581 searching for changes
578 searching for changes
582 adding changesets
579 adding changesets
583 adding manifests
580 adding manifests
584 adding file changes
581 adding file changes
585 added 1 changesets with 1 changes to 1 files
582 added 1 changesets with 1 changes to 1 files
586
583
587 check that unmodified subrepos are not pushed
584 check that unmodified subrepos are not pushed
588
585
589 $ hg clone . ../tcc
586 $ hg clone . ../tcc
590 updating to branch default
587 updating to branch default
591 cloning subrepo s from $TESTTMP/tc/s
588 cloning subrepo s from $TESTTMP/tc/s
592 cloning subrepo s/ss from $TESTTMP/tc/s/ss
589 cloning subrepo s/ss from $TESTTMP/tc/s/ss
593 cloning subrepo t from $TESTTMP/tc/t
590 cloning subrepo t from $TESTTMP/tc/t
594 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
591 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
595
592
596 the subrepos on the new clone have nothing to push to its source
593 the subrepos on the new clone have nothing to push to its source
597
594
598 $ hg push -R ../tcc .
595 $ hg push -R ../tcc .
599 pushing to .
596 pushing to .
600 no changes made to subrepo s/ss since last push to s/ss
597 no changes made to subrepo s/ss since last push to s/ss
601 no changes made to subrepo s since last push to s
598 no changes made to subrepo s since last push to s
602 no changes made to subrepo t since last push to t
599 no changes made to subrepo t since last push to t
603 searching for changes
600 searching for changes
604 no changes found
601 no changes found
605 [1]
602 [1]
606
603
607 the subrepos on the source do not have a clean store versus the clone target
604 the subrepos on the source do not have a clean store versus the clone target
608 because they were never explicitly pushed to the source
605 because they were never explicitly pushed to the source
609
606
610 $ hg push ../tcc
607 $ hg push ../tcc
611 pushing to ../tcc
608 pushing to ../tcc
612 pushing subrepo s/ss to ../tcc/s/ss
609 pushing subrepo s/ss to ../tcc/s/ss
613 searching for changes
610 searching for changes
614 no changes found
611 no changes found
615 pushing subrepo s to ../tcc/s
612 pushing subrepo s to ../tcc/s
616 searching for changes
613 searching for changes
617 no changes found
614 no changes found
618 pushing subrepo t to ../tcc/t
615 pushing subrepo t to ../tcc/t
619 searching for changes
616 searching for changes
620 no changes found
617 no changes found
621 searching for changes
618 searching for changes
622 no changes found
619 no changes found
623 [1]
620 [1]
624
621
625 after push their stores become clean
622 after push their stores become clean
626
623
627 $ hg push ../tcc
624 $ hg push ../tcc
628 pushing to ../tcc
625 pushing to ../tcc
629 no changes made to subrepo s/ss since last push to ../tcc/s/ss
626 no changes made to subrepo s/ss since last push to ../tcc/s/ss
630 no changes made to subrepo s since last push to ../tcc/s
627 no changes made to subrepo s since last push to ../tcc/s
631 no changes made to subrepo t since last push to ../tcc/t
628 no changes made to subrepo t since last push to ../tcc/t
632 searching for changes
629 searching for changes
633 no changes found
630 no changes found
634 [1]
631 [1]
635
632
636 updating a subrepo to a different revision or changing
633 updating a subrepo to a different revision or changing
637 its working directory does not make its store dirty
634 its working directory does not make its store dirty
638
635
639 $ hg -R s update '.^'
636 $ hg -R s update '.^'
640 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
637 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
641 $ hg push
638 $ hg push
642 pushing to $TESTTMP/t
639 pushing to $TESTTMP/t
643 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
640 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
644 no changes made to subrepo s since last push to $TESTTMP/t/s
641 no changes made to subrepo s since last push to $TESTTMP/t/s
645 no changes made to subrepo t since last push to $TESTTMP/t/t
642 no changes made to subrepo t since last push to $TESTTMP/t/t
646 searching for changes
643 searching for changes
647 no changes found
644 no changes found
648 [1]
645 [1]
649 $ echo foo >> s/a
646 $ echo foo >> s/a
650 $ hg push
647 $ hg push
651 pushing to $TESTTMP/t
648 pushing to $TESTTMP/t
652 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
649 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
653 no changes made to subrepo s since last push to $TESTTMP/t/s
650 no changes made to subrepo s since last push to $TESTTMP/t/s
654 no changes made to subrepo t since last push to $TESTTMP/t/t
651 no changes made to subrepo t since last push to $TESTTMP/t/t
655 searching for changes
652 searching for changes
656 no changes found
653 no changes found
657 [1]
654 [1]
658 $ hg -R s update -C tip
655 $ hg -R s update -C tip
659 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
656 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
660
657
661 committing into a subrepo makes its store (but not its parent's store) dirty
658 committing into a subrepo makes its store (but not its parent's store) dirty
662
659
663 $ echo foo >> s/ss/a
660 $ echo foo >> s/ss/a
664 $ hg -R s/ss commit -m 'test dirty store detection'
661 $ hg -R s/ss commit -m 'test dirty store detection'
665
662
666 $ hg out -S -r `hg log -r tip -T "{node|short}"`
663 $ hg out -S -r `hg log -r tip -T "{node|short}"`
667 comparing with $TESTTMP/t
664 comparing with $TESTTMP/t
668 searching for changes
665 searching for changes
669 no changes found
666 no changes found
670 comparing with $TESTTMP/t/s
667 comparing with $TESTTMP/t/s
671 searching for changes
668 searching for changes
672 no changes found
669 no changes found
673 comparing with $TESTTMP/t/s/ss
670 comparing with $TESTTMP/t/s/ss
674 searching for changes
671 searching for changes
675 changeset: 1:79ea5566a333
672 changeset: 1:79ea5566a333
676 tag: tip
673 tag: tip
677 user: test
674 user: test
678 date: Thu Jan 01 00:00:00 1970 +0000
675 date: Thu Jan 01 00:00:00 1970 +0000
679 summary: test dirty store detection
676 summary: test dirty store detection
680
677
681 comparing with $TESTTMP/t/t
678 comparing with $TESTTMP/t/t
682 searching for changes
679 searching for changes
683 no changes found
680 no changes found
684
681
685 $ hg push
682 $ hg push
686 pushing to $TESTTMP/t
683 pushing to $TESTTMP/t
687 pushing subrepo s/ss to $TESTTMP/t/s/ss
684 pushing subrepo s/ss to $TESTTMP/t/s/ss
688 searching for changes
685 searching for changes
689 adding changesets
686 adding changesets
690 adding manifests
687 adding manifests
691 adding file changes
688 adding file changes
692 added 1 changesets with 1 changes to 1 files
689 added 1 changesets with 1 changes to 1 files
693 no changes made to subrepo s since last push to $TESTTMP/t/s
690 no changes made to subrepo s since last push to $TESTTMP/t/s
694 no changes made to subrepo t since last push to $TESTTMP/t/t
691 no changes made to subrepo t since last push to $TESTTMP/t/t
695 searching for changes
692 searching for changes
696 no changes found
693 no changes found
697 [1]
694 [1]
698
695
699 a subrepo store may be clean versus one repo but not versus another
696 a subrepo store may be clean versus one repo but not versus another
700
697
701 $ hg push
698 $ hg push
702 pushing to $TESTTMP/t
699 pushing to $TESTTMP/t
703 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
700 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
704 no changes made to subrepo s since last push to $TESTTMP/t/s
701 no changes made to subrepo s since last push to $TESTTMP/t/s
705 no changes made to subrepo t since last push to $TESTTMP/t/t
702 no changes made to subrepo t since last push to $TESTTMP/t/t
706 searching for changes
703 searching for changes
707 no changes found
704 no changes found
708 [1]
705 [1]
709 $ hg push ../tcc
706 $ hg push ../tcc
710 pushing to ../tcc
707 pushing to ../tcc
711 pushing subrepo s/ss to ../tcc/s/ss
708 pushing subrepo s/ss to ../tcc/s/ss
712 searching for changes
709 searching for changes
713 adding changesets
710 adding changesets
714 adding manifests
711 adding manifests
715 adding file changes
712 adding file changes
716 added 1 changesets with 1 changes to 1 files
713 added 1 changesets with 1 changes to 1 files
717 no changes made to subrepo s since last push to ../tcc/s
714 no changes made to subrepo s since last push to ../tcc/s
718 no changes made to subrepo t since last push to ../tcc/t
715 no changes made to subrepo t since last push to ../tcc/t
719 searching for changes
716 searching for changes
720 no changes found
717 no changes found
721 [1]
718 [1]
722
719
723 update
720 update
724
721
725 $ cd ../t
722 $ cd ../t
726 $ hg up -C # discard our earlier merge
723 $ hg up -C # discard our earlier merge
727 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
724 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
728 updated to "c373c8102e68: 12"
725 updated to "c373c8102e68: 12"
729 2 other heads for branch "default"
726 2 other heads for branch "default"
730 $ echo blah > t/t
727 $ echo blah > t/t
731 $ hg ci -m13
728 $ hg ci -m13
732 committing subrepository t
729 committing subrepository t
733
730
734 backout calls revert internally with minimal opts, which should not raise
731 backout calls revert internally with minimal opts, which should not raise
735 KeyError
732 KeyError
736
733
737 $ hg backout ".^" --no-commit
734 $ hg backout ".^" --no-commit
738 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
735 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
739 changeset c373c8102e68 backed out, don't forget to commit.
736 changeset c373c8102e68 backed out, don't forget to commit.
740
737
741 $ hg up -C # discard changes
738 $ hg up -C # discard changes
742 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
739 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
743 updated to "925c17564ef8: 13"
740 updated to "925c17564ef8: 13"
744 2 other heads for branch "default"
741 2 other heads for branch "default"
745
742
746 pull
743 pull
747
744
748 $ cd ../tc
745 $ cd ../tc
749 $ hg pull
746 $ hg pull
750 pulling from $TESTTMP/t
747 pulling from $TESTTMP/t
751 searching for changes
748 searching for changes
752 adding changesets
749 adding changesets
753 adding manifests
750 adding manifests
754 adding file changes
751 adding file changes
755 added 1 changesets with 1 changes to 1 files
752 added 1 changesets with 1 changes to 1 files
756 new changesets 925c17564ef8
753 new changesets 925c17564ef8
757 (run 'hg update' to get a working copy)
754 (run 'hg update' to get a working copy)
758
755
759 should pull t
756 should pull t
760
757
761 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
758 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
762 comparing with $TESTTMP/t
759 comparing with $TESTTMP/t
763 no changes found
760 no changes found
764 comparing with $TESTTMP/t/s
761 comparing with $TESTTMP/t/s
765 searching for changes
762 searching for changes
766 no changes found
763 no changes found
767 comparing with $TESTTMP/t/s/ss
764 comparing with $TESTTMP/t/s/ss
768 searching for changes
765 searching for changes
769 no changes found
766 no changes found
770 comparing with $TESTTMP/t/t
767 comparing with $TESTTMP/t/t
771 searching for changes
768 searching for changes
772 changeset: 5:52c0adc0515a
769 changeset: 5:52c0adc0515a
773 tag: tip
770 tag: tip
774 user: test
771 user: test
775 date: Thu Jan 01 00:00:00 1970 +0000
772 date: Thu Jan 01 00:00:00 1970 +0000
776 summary: 13
773 summary: 13
777
774
778
775
779 $ hg up
776 $ hg up
780 pulling subrepo t from $TESTTMP/t/t
777 pulling subrepo t from $TESTTMP/t/t
781 searching for changes
778 searching for changes
782 adding changesets
779 adding changesets
783 adding manifests
780 adding manifests
784 adding file changes
781 adding file changes
785 added 1 changesets with 1 changes to 1 files
782 added 1 changesets with 1 changes to 1 files
786 new changesets 52c0adc0515a
783 new changesets 52c0adc0515a
787 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
784 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
788 updated to "925c17564ef8: 13"
785 updated to "925c17564ef8: 13"
789 2 other heads for branch "default"
786 2 other heads for branch "default"
790 $ cat t/t
787 $ cat t/t
791 blah
788 blah
792
789
793 bogus subrepo path aborts
790 bogus subrepo path aborts
794
791
795 $ echo 'bogus=[boguspath' >> .hgsub
792 $ echo 'bogus=[boguspath' >> .hgsub
796 $ hg ci -m 'bogus subrepo path'
793 $ hg ci -m 'bogus subrepo path'
797 abort: missing ] in subrepository source
794 abort: missing ] in subrepository source
798 [255]
795 [255]
799
796
800 Issue1986: merge aborts when trying to merge a subrepo that
797 Issue1986: merge aborts when trying to merge a subrepo that
801 shouldn't need merging
798 shouldn't need merging
802
799
803 # subrepo layout
800 # subrepo layout
804 #
801 #
805 # o 5 br
802 # o 5 br
806 # /|
803 # /|
807 # o | 4 default
804 # o | 4 default
808 # | |
805 # | |
809 # | o 3 br
806 # | o 3 br
810 # |/|
807 # |/|
811 # o | 2 default
808 # o | 2 default
812 # | |
809 # | |
813 # | o 1 br
810 # | o 1 br
814 # |/
811 # |/
815 # o 0 default
812 # o 0 default
816
813
817 $ cd ..
814 $ cd ..
818 $ rm -rf sub
815 $ rm -rf sub
819 $ hg init main
816 $ hg init main
820 $ cd main
817 $ cd main
821 $ hg init s
818 $ hg init s
822 $ cd s
819 $ cd s
823 $ echo a > a
820 $ echo a > a
824 $ hg ci -Am1
821 $ hg ci -Am1
825 adding a
822 adding a
826 $ hg branch br
823 $ hg branch br
827 marked working directory as branch br
824 marked working directory as branch br
828 (branches are permanent and global, did you want a bookmark?)
825 (branches are permanent and global, did you want a bookmark?)
829 $ echo a >> a
826 $ echo a >> a
830 $ hg ci -m1
827 $ hg ci -m1
831 $ hg up default
828 $ hg up default
832 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
829 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
833 $ echo b > b
830 $ echo b > b
834 $ hg ci -Am1
831 $ hg ci -Am1
835 adding b
832 adding b
836 $ hg up br
833 $ hg up br
837 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
834 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
838 $ hg merge tip
835 $ hg merge tip
839 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
836 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
840 (branch merge, don't forget to commit)
837 (branch merge, don't forget to commit)
841 $ hg ci -m1
838 $ hg ci -m1
842 $ hg up 2
839 $ hg up 2
843 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
840 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
844 $ echo c > c
841 $ echo c > c
845 $ hg ci -Am1
842 $ hg ci -Am1
846 adding c
843 adding c
847 $ hg up 3
844 $ hg up 3
848 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
845 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
849 $ hg merge 4
846 $ hg merge 4
850 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
847 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
851 (branch merge, don't forget to commit)
848 (branch merge, don't forget to commit)
852 $ hg ci -m1
849 $ hg ci -m1
853
850
854 # main repo layout:
851 # main repo layout:
855 #
852 #
856 # * <-- try to merge default into br again
853 # * <-- try to merge default into br again
857 # .`|
854 # .`|
858 # . o 5 br --> substate = 5
855 # . o 5 br --> substate = 5
859 # . |
856 # . |
860 # o | 4 default --> substate = 4
857 # o | 4 default --> substate = 4
861 # | |
858 # | |
862 # | o 3 br --> substate = 2
859 # | o 3 br --> substate = 2
863 # |/|
860 # |/|
864 # o | 2 default --> substate = 2
861 # o | 2 default --> substate = 2
865 # | |
862 # | |
866 # | o 1 br --> substate = 3
863 # | o 1 br --> substate = 3
867 # |/
864 # |/
868 # o 0 default --> substate = 2
865 # o 0 default --> substate = 2
869
866
870 $ cd ..
867 $ cd ..
871 $ echo 's = s' > .hgsub
868 $ echo 's = s' > .hgsub
872 $ hg -R s up 2
869 $ hg -R s up 2
873 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
870 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
874 $ hg ci -Am1
871 $ hg ci -Am1
875 adding .hgsub
872 adding .hgsub
876 $ hg branch br
873 $ hg branch br
877 marked working directory as branch br
874 marked working directory as branch br
878 (branches are permanent and global, did you want a bookmark?)
875 (branches are permanent and global, did you want a bookmark?)
879 $ echo b > b
876 $ echo b > b
880 $ hg -R s up 3
877 $ hg -R s up 3
881 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
878 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
882 $ hg ci -Am1
879 $ hg ci -Am1
883 adding b
880 adding b
884 $ hg up default
881 $ hg up default
885 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
882 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
886 $ echo c > c
883 $ echo c > c
887 $ hg ci -Am1
884 $ hg ci -Am1
888 adding c
885 adding c
889 $ hg up 1
886 $ hg up 1
890 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
887 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
891 $ hg merge 2
888 $ hg merge 2
892 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
889 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
893 (branch merge, don't forget to commit)
890 (branch merge, don't forget to commit)
894 $ hg ci -m1
891 $ hg ci -m1
895 $ hg up 2
892 $ hg up 2
896 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
893 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
897 $ hg -R s up 4
894 $ hg -R s up 4
898 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
895 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
899 $ echo d > d
896 $ echo d > d
900 $ hg ci -Am1
897 $ hg ci -Am1
901 adding d
898 adding d
902 $ hg up 3
899 $ hg up 3
903 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
900 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
904 $ hg -R s up 5
901 $ hg -R s up 5
905 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
902 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
906 $ echo e > e
903 $ echo e > e
907 $ hg ci -Am1
904 $ hg ci -Am1
908 adding e
905 adding e
909
906
910 $ hg up 5
907 $ hg up 5
911 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
908 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
912 $ hg merge 4 # try to merge default into br again
909 $ hg merge 4 # try to merge default into br again
913 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
910 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
914 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
911 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
915 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
912 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
916 (branch merge, don't forget to commit)
913 (branch merge, don't forget to commit)
917 $ cd ..
914 $ cd ..
918
915
919 test subrepo delete from .hgsubstate
916 test subrepo delete from .hgsubstate
920
917
921 $ hg init testdelete
918 $ hg init testdelete
922 $ mkdir testdelete/nested testdelete/nested2
919 $ mkdir testdelete/nested testdelete/nested2
923 $ hg init testdelete/nested
920 $ hg init testdelete/nested
924 $ hg init testdelete/nested2
921 $ hg init testdelete/nested2
925 $ echo test > testdelete/nested/foo
922 $ echo test > testdelete/nested/foo
926 $ echo test > testdelete/nested2/foo
923 $ echo test > testdelete/nested2/foo
927 $ hg -R testdelete/nested add
924 $ hg -R testdelete/nested add
928 adding testdelete/nested/foo
925 adding testdelete/nested/foo
929 $ hg -R testdelete/nested2 add
926 $ hg -R testdelete/nested2 add
930 adding testdelete/nested2/foo
927 adding testdelete/nested2/foo
931 $ hg -R testdelete/nested ci -m test
928 $ hg -R testdelete/nested ci -m test
932 $ hg -R testdelete/nested2 ci -m test
929 $ hg -R testdelete/nested2 ci -m test
933 $ echo nested = nested > testdelete/.hgsub
930 $ echo nested = nested > testdelete/.hgsub
934 $ echo nested2 = nested2 >> testdelete/.hgsub
931 $ echo nested2 = nested2 >> testdelete/.hgsub
935 $ hg -R testdelete add
932 $ hg -R testdelete add
936 adding testdelete/.hgsub
933 adding testdelete/.hgsub
937 $ hg -R testdelete ci -m "nested 1 & 2 added"
934 $ hg -R testdelete ci -m "nested 1 & 2 added"
938 $ echo nested = nested > testdelete/.hgsub
935 $ echo nested = nested > testdelete/.hgsub
939 $ hg -R testdelete ci -m "nested 2 deleted"
936 $ hg -R testdelete ci -m "nested 2 deleted"
940 $ cat testdelete/.hgsubstate
937 $ cat testdelete/.hgsubstate
941 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
938 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
942 $ hg -R testdelete remove testdelete/.hgsub
939 $ hg -R testdelete remove testdelete/.hgsub
943 $ hg -R testdelete ci -m ".hgsub deleted"
940 $ hg -R testdelete ci -m ".hgsub deleted"
944 $ cat testdelete/.hgsubstate
941 $ cat testdelete/.hgsubstate
945 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
942 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
946
943
947 test repository cloning
944 test repository cloning
948
945
949 $ mkdir mercurial mercurial2
946 $ mkdir mercurial mercurial2
950 $ hg init nested_absolute
947 $ hg init nested_absolute
951 $ echo test > nested_absolute/foo
948 $ echo test > nested_absolute/foo
952 $ hg -R nested_absolute add
949 $ hg -R nested_absolute add
953 adding nested_absolute/foo
950 adding nested_absolute/foo
954 $ hg -R nested_absolute ci -mtest
951 $ hg -R nested_absolute ci -mtest
955 $ cd mercurial
952 $ cd mercurial
956 $ hg init nested_relative
953 $ hg init nested_relative
957 $ echo test2 > nested_relative/foo2
954 $ echo test2 > nested_relative/foo2
958 $ hg -R nested_relative add
955 $ hg -R nested_relative add
959 adding nested_relative/foo2
956 adding nested_relative/foo2
960 $ hg -R nested_relative ci -mtest2
957 $ hg -R nested_relative ci -mtest2
961 $ hg init main
958 $ hg init main
962 $ echo "nested_relative = ../nested_relative" > main/.hgsub
959 $ echo "nested_relative = ../nested_relative" > main/.hgsub
963 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
960 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
964 $ hg -R main add
961 $ hg -R main add
965 adding main/.hgsub
962 adding main/.hgsub
966 $ hg -R main ci -m "add subrepos"
963 $ hg -R main ci -m "add subrepos"
967 $ cd ..
964 $ cd ..
968 $ hg clone mercurial/main mercurial2/main
965 $ hg clone mercurial/main mercurial2/main
969 updating to branch default
966 updating to branch default
970 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
967 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
971 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
968 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
972 > mercurial2/main/nested_relative/.hg/hgrc
969 > mercurial2/main/nested_relative/.hg/hgrc
973 [paths]
970 [paths]
974 default = $TESTTMP/mercurial/nested_absolute
971 default = $TESTTMP/mercurial/nested_absolute
975 [paths]
972 [paths]
976 default = $TESTTMP/mercurial/nested_relative
973 default = $TESTTMP/mercurial/nested_relative
977 $ rm -rf mercurial mercurial2
974 $ rm -rf mercurial mercurial2
978
975
979 Issue1977: multirepo push should fail if subrepo push fails
976 Issue1977: multirepo push should fail if subrepo push fails
980
977
981 $ hg init repo
978 $ hg init repo
982 $ hg init repo/s
979 $ hg init repo/s
983 $ echo a > repo/s/a
980 $ echo a > repo/s/a
984 $ hg -R repo/s ci -Am0
981 $ hg -R repo/s ci -Am0
985 adding a
982 adding a
986 $ echo s = s > repo/.hgsub
983 $ echo s = s > repo/.hgsub
987 $ hg -R repo ci -Am1
984 $ hg -R repo ci -Am1
988 adding .hgsub
985 adding .hgsub
989 $ hg clone repo repo2
986 $ hg clone repo repo2
990 updating to branch default
987 updating to branch default
991 cloning subrepo s from $TESTTMP/repo/s
988 cloning subrepo s from $TESTTMP/repo/s
992 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
989 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
993 $ hg -q -R repo2 pull -u
990 $ hg -q -R repo2 pull -u
994 $ echo 1 > repo2/s/a
991 $ echo 1 > repo2/s/a
995 $ hg -R repo2/s ci -m2
992 $ hg -R repo2/s ci -m2
996 $ hg -q -R repo2/s push
993 $ hg -q -R repo2/s push
997 $ hg -R repo2/s up -C 0
994 $ hg -R repo2/s up -C 0
998 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
995 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
999 $ echo 2 > repo2/s/b
996 $ echo 2 > repo2/s/b
1000 $ hg -R repo2/s ci -m3 -A
997 $ hg -R repo2/s ci -m3 -A
1001 adding b
998 adding b
1002 created new head
999 created new head
1003 $ hg -R repo2 ci -m3
1000 $ hg -R repo2 ci -m3
1004 $ hg -q -R repo2 push
1001 $ hg -q -R repo2 push
1005 abort: push creates new remote head cc505f09a8b2! (in subrepository "s")
1002 abort: push creates new remote head cc505f09a8b2! (in subrepository "s")
1006 (merge or see 'hg help push' for details about pushing new heads)
1003 (merge or see 'hg help push' for details about pushing new heads)
1007 [255]
1004 [255]
1008 $ hg -R repo update
1005 $ hg -R repo update
1009 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1006 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1010
1007
1011 test if untracked file is not overwritten
1008 test if untracked file is not overwritten
1012
1009
1013 (this also tests that updated .hgsubstate is treated as "modified",
1010 (this also tests that updated .hgsubstate is treated as "modified",
1014 when 'merge.update()' is aborted before 'merge.recordupdates()', even
1011 when 'merge.update()' is aborted before 'merge.recordupdates()', even
1015 if none of mode, size and timestamp of it isn't changed on the
1012 if none of mode, size and timestamp of it isn't changed on the
1016 filesystem (see also issue4583))
1013 filesystem (see also issue4583))
1017
1014
1018 $ echo issue3276_ok > repo/s/b
1015 $ echo issue3276_ok > repo/s/b
1019 $ hg -R repo2 push -f -q
1016 $ hg -R repo2 push -f -q
1020 $ touch -t 200001010000 repo/.hgsubstate
1017 $ touch -t 200001010000 repo/.hgsubstate
1021
1018
1022 $ cat >> repo/.hg/hgrc <<EOF
1019 $ cat >> repo/.hg/hgrc <<EOF
1023 > [fakedirstatewritetime]
1020 > [fakedirstatewritetime]
1024 > # emulate invoking dirstate.write() via repo.status()
1021 > # emulate invoking dirstate.write() via repo.status()
1025 > # at 2000-01-01 00:00
1022 > # at 2000-01-01 00:00
1026 > fakenow = 200001010000
1023 > fakenow = 200001010000
1027 >
1024 >
1028 > [extensions]
1025 > [extensions]
1029 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1026 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1030 > EOF
1027 > EOF
1031 $ hg -R repo update
1028 $ hg -R repo update
1032 b: untracked file differs
1029 b: untracked file differs
1033 abort: untracked files in working directory differ from files in requested revision (in subrepository "s")
1030 abort: untracked files in working directory differ from files in requested revision (in subrepository "s")
1034 [255]
1031 [255]
1035 $ cat >> repo/.hg/hgrc <<EOF
1032 $ cat >> repo/.hg/hgrc <<EOF
1036 > [extensions]
1033 > [extensions]
1037 > fakedirstatewritetime = !
1034 > fakedirstatewritetime = !
1038 > EOF
1035 > EOF
1039
1036
1040 $ cat repo/s/b
1037 $ cat repo/s/b
1041 issue3276_ok
1038 issue3276_ok
1042 $ rm repo/s/b
1039 $ rm repo/s/b
1043 $ touch -t 200001010000 repo/.hgsubstate
1040 $ touch -t 200001010000 repo/.hgsubstate
1044 $ hg -R repo revert --all
1041 $ hg -R repo revert --all
1045 reverting repo/.hgsubstate
1042 reverting repo/.hgsubstate
1046 reverting subrepo s
1043 reverting subrepo s
1047 $ hg -R repo update
1044 $ hg -R repo update
1048 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1045 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1049 $ cat repo/s/b
1046 $ cat repo/s/b
1050 2
1047 2
1051 $ rm -rf repo2 repo
1048 $ rm -rf repo2 repo
1052
1049
1053
1050
1054 Issue1852 subrepos with relative paths always push/pull relative to default
1051 Issue1852 subrepos with relative paths always push/pull relative to default
1055
1052
1056 Prepare a repo with subrepo
1053 Prepare a repo with subrepo
1057
1054
1058 $ hg init issue1852a
1055 $ hg init issue1852a
1059 $ cd issue1852a
1056 $ cd issue1852a
1060 $ hg init sub/repo
1057 $ hg init sub/repo
1061 $ echo test > sub/repo/foo
1058 $ echo test > sub/repo/foo
1062 $ hg -R sub/repo add sub/repo/foo
1059 $ hg -R sub/repo add sub/repo/foo
1063 $ echo sub/repo = sub/repo > .hgsub
1060 $ echo sub/repo = sub/repo > .hgsub
1064 $ hg add .hgsub
1061 $ hg add .hgsub
1065 $ hg ci -mtest
1062 $ hg ci -mtest
1066 committing subrepository sub/repo
1063 committing subrepository sub/repo
1067 $ echo test >> sub/repo/foo
1064 $ echo test >> sub/repo/foo
1068 $ hg ci -mtest
1065 $ hg ci -mtest
1069 committing subrepository sub/repo
1066 committing subrepository sub/repo
1070 $ hg cat sub/repo/foo
1067 $ hg cat sub/repo/foo
1071 test
1068 test
1072 test
1069 test
1073 $ hg cat sub/repo/foo -Tjson | sed 's|\\\\|/|g'
1070 $ hg cat sub/repo/foo -Tjson | sed 's|\\\\|/|g'
1074 [
1071 [
1075 {
1072 {
1076 "data": "test\ntest\n",
1073 "data": "test\ntest\n",
1077 "path": "foo"
1074 "path": "foo"
1078 }
1075 }
1079 ]
1076 ]
1080
1077
1081 non-exact match:
1078 non-exact match:
1082
1079
1083 $ hg cat -T '{path|relpath}\n' 'glob:**'
1080 $ hg cat -T '{path|relpath}\n' 'glob:**'
1084 .hgsub
1081 .hgsub
1085 .hgsubstate
1082 .hgsubstate
1086 sub/repo/foo
1083 sub/repo/foo
1087 $ hg cat -T '{path|relpath}\n' 're:^sub'
1084 $ hg cat -T '{path|relpath}\n' 're:^sub'
1088 sub/repo/foo
1085 sub/repo/foo
1089
1086
1090 missing subrepos in working directory:
1087 missing subrepos in working directory:
1091
1088
1092 $ mkdir -p tmp/sub/repo
1089 $ mkdir -p tmp/sub/repo
1093 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1090 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1094 $ cat tmp/sub/repo/foo_p
1091 $ cat tmp/sub/repo/foo_p
1095 test
1092 test
1096 $ mv sub/repo sub_
1093 $ mv sub/repo sub_
1097 $ hg cat sub/repo/baz
1094 $ hg cat sub/repo/baz
1098 skipping missing subrepository: sub/repo
1095 skipping missing subrepository: sub/repo
1099 [1]
1096 [1]
1100 $ rm -rf sub/repo
1097 $ rm -rf sub/repo
1101 $ mv sub_ sub/repo
1098 $ mv sub_ sub/repo
1102 $ cd ..
1099 $ cd ..
1103
1100
1104 Create repo without default path, pull top repo, and see what happens on update
1101 Create repo without default path, pull top repo, and see what happens on update
1105
1102
1106 $ hg init issue1852b
1103 $ hg init issue1852b
1107 $ hg -R issue1852b pull issue1852a
1104 $ hg -R issue1852b pull issue1852a
1108 pulling from issue1852a
1105 pulling from issue1852a
1109 requesting all changes
1106 requesting all changes
1110 adding changesets
1107 adding changesets
1111 adding manifests
1108 adding manifests
1112 adding file changes
1109 adding file changes
1113 added 2 changesets with 3 changes to 2 files
1110 added 2 changesets with 3 changes to 2 files
1114 new changesets 19487b456929:be5eb94e7215
1111 new changesets 19487b456929:be5eb94e7215
1115 (run 'hg update' to get a working copy)
1112 (run 'hg update' to get a working copy)
1116 $ hg -R issue1852b update
1113 $ hg -R issue1852b update
1117 abort: default path for subrepository not found (in subrepository "sub/repo")
1114 abort: default path for subrepository not found (in subrepository "sub/repo")
1118 [255]
1115 [255]
1119
1116
1120 Ensure a full traceback, not just the SubrepoAbort part
1117 Ensure a full traceback, not just the SubrepoAbort part
1121
1118
1122 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort'
1119 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort'
1123 raise error.Abort(_("default path for subrepository not found"))
1120 raise error.Abort(_("default path for subrepository not found"))
1124
1121
1125 Pull -u now doesn't help
1122 Pull -u now doesn't help
1126
1123
1127 $ hg -R issue1852b pull -u issue1852a
1124 $ hg -R issue1852b pull -u issue1852a
1128 pulling from issue1852a
1125 pulling from issue1852a
1129 searching for changes
1126 searching for changes
1130 no changes found
1127 no changes found
1131
1128
1132 Try the same, but with pull -u
1129 Try the same, but with pull -u
1133
1130
1134 $ hg init issue1852c
1131 $ hg init issue1852c
1135 $ hg -R issue1852c pull -r0 -u issue1852a
1132 $ hg -R issue1852c pull -r0 -u issue1852a
1136 pulling from issue1852a
1133 pulling from issue1852a
1137 adding changesets
1134 adding changesets
1138 adding manifests
1135 adding manifests
1139 adding file changes
1136 adding file changes
1140 added 1 changesets with 2 changes to 2 files
1137 added 1 changesets with 2 changes to 2 files
1141 new changesets 19487b456929
1138 new changesets 19487b456929
1142 cloning subrepo sub/repo from issue1852a/sub/repo
1139 cloning subrepo sub/repo from issue1852a/sub/repo
1143 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1140 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1144
1141
1145 Try to push from the other side
1142 Try to push from the other side
1146
1143
1147 $ hg -R issue1852a push `pwd`/issue1852c
1144 $ hg -R issue1852a push `pwd`/issue1852c
1148 pushing to $TESTTMP/issue1852c
1145 pushing to $TESTTMP/issue1852c
1149 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo
1146 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo
1150 searching for changes
1147 searching for changes
1151 no changes found
1148 no changes found
1152 searching for changes
1149 searching for changes
1153 adding changesets
1150 adding changesets
1154 adding manifests
1151 adding manifests
1155 adding file changes
1152 adding file changes
1156 added 1 changesets with 1 changes to 1 files
1153 added 1 changesets with 1 changes to 1 files
1157
1154
1158 Incoming and outgoing should not use the default path:
1155 Incoming and outgoing should not use the default path:
1159
1156
1160 $ hg clone -q issue1852a issue1852d
1157 $ hg clone -q issue1852a issue1852d
1161 $ hg -R issue1852d outgoing --subrepos issue1852c
1158 $ hg -R issue1852d outgoing --subrepos issue1852c
1162 comparing with issue1852c
1159 comparing with issue1852c
1163 searching for changes
1160 searching for changes
1164 no changes found
1161 no changes found
1165 comparing with issue1852c/sub/repo
1162 comparing with issue1852c/sub/repo
1166 searching for changes
1163 searching for changes
1167 no changes found
1164 no changes found
1168 [1]
1165 [1]
1169 $ hg -R issue1852d incoming --subrepos issue1852c
1166 $ hg -R issue1852d incoming --subrepos issue1852c
1170 comparing with issue1852c
1167 comparing with issue1852c
1171 searching for changes
1168 searching for changes
1172 no changes found
1169 no changes found
1173 comparing with issue1852c/sub/repo
1170 comparing with issue1852c/sub/repo
1174 searching for changes
1171 searching for changes
1175 no changes found
1172 no changes found
1176 [1]
1173 [1]
1177
1174
1178 Check that merge of a new subrepo doesn't write the uncommitted state to
1175 Check that merge of a new subrepo doesn't write the uncommitted state to
1179 .hgsubstate (issue4622)
1176 .hgsubstate (issue4622)
1180
1177
1181 $ hg init issue1852a/addedsub
1178 $ hg init issue1852a/addedsub
1182 $ echo zzz > issue1852a/addedsub/zz.txt
1179 $ echo zzz > issue1852a/addedsub/zz.txt
1183 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1180 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1184
1181
1185 $ hg clone issue1852a/addedsub issue1852d/addedsub
1182 $ hg clone issue1852a/addedsub issue1852d/addedsub
1186 updating to branch default
1183 updating to branch default
1187 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1188
1185
1189 $ echo def > issue1852a/sub/repo/foo
1186 $ echo def > issue1852a/sub/repo/foo
1190 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1187 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1191 adding tmp/sub/repo/foo_p
1188 adding tmp/sub/repo/foo_p
1192 committing subrepository sub/repo
1189 committing subrepository sub/repo
1193
1190
1194 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1191 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1195 $ echo xyz > issue1852d/sub/repo/foo
1192 $ echo xyz > issue1852d/sub/repo/foo
1196 $ hg -R issue1852d pull -u
1193 $ hg -R issue1852d pull -u
1197 pulling from $TESTTMP/issue1852a
1194 pulling from $TESTTMP/issue1852a
1198 searching for changes
1195 searching for changes
1199 adding changesets
1196 adding changesets
1200 adding manifests
1197 adding manifests
1201 adding file changes
1198 adding file changes
1202 added 1 changesets with 2 changes to 2 files
1199 added 1 changesets with 2 changes to 2 files
1203 new changesets c82b79fdcc5b
1200 new changesets c82b79fdcc5b
1204 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1201 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1205 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1202 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1206 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo
1203 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo
1207 searching for changes
1204 searching for changes
1208 adding changesets
1205 adding changesets
1209 adding manifests
1206 adding manifests
1210 adding file changes
1207 adding file changes
1211 added 1 changesets with 1 changes to 1 files
1208 added 1 changesets with 1 changes to 1 files
1212 new changesets 46cd4aac504c
1209 new changesets 46cd4aac504c
1213 subrepository sources for sub/repo differ
1210 subrepository sources for sub/repo differ
1214 use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
1211 use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
1215 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1216 $ cat issue1852d/.hgsubstate
1213 $ cat issue1852d/.hgsubstate
1217 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1214 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1218
1215
1219 Check status of files when none of them belong to the first
1216 Check status of files when none of them belong to the first
1220 subrepository:
1217 subrepository:
1221
1218
1222 $ hg init subrepo-status
1219 $ hg init subrepo-status
1223 $ cd subrepo-status
1220 $ cd subrepo-status
1224 $ hg init subrepo-1
1221 $ hg init subrepo-1
1225 $ hg init subrepo-2
1222 $ hg init subrepo-2
1226 $ cd subrepo-2
1223 $ cd subrepo-2
1227 $ touch file
1224 $ touch file
1228 $ hg add file
1225 $ hg add file
1229 $ cd ..
1226 $ cd ..
1230 $ echo subrepo-1 = subrepo-1 > .hgsub
1227 $ echo subrepo-1 = subrepo-1 > .hgsub
1231 $ echo subrepo-2 = subrepo-2 >> .hgsub
1228 $ echo subrepo-2 = subrepo-2 >> .hgsub
1232 $ hg add .hgsub
1229 $ hg add .hgsub
1233 $ hg ci -m 'Added subrepos'
1230 $ hg ci -m 'Added subrepos'
1234 committing subrepository subrepo-2
1231 committing subrepository subrepo-2
1235 $ hg st subrepo-2/file
1232 $ hg st subrepo-2/file
1236
1233
1237 Check that share works with subrepo
1234 Check that share works with subrepo
1238 $ hg --config extensions.share= share . ../shared
1235 $ hg --config extensions.share= share . ../shared
1239 updating working directory
1236 updating working directory
1240 sharing subrepo subrepo-1 from $TESTTMP/subrepo-status/subrepo-1
1237 sharing subrepo subrepo-1 from $TESTTMP/subrepo-status/subrepo-1
1241 sharing subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1238 sharing subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1242 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1239 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1243 $ find ../shared/* | sort
1240 $ find ../shared/* | sort
1244 ../shared/subrepo-1
1241 ../shared/subrepo-1
1245 ../shared/subrepo-1/.hg
1242 ../shared/subrepo-1/.hg
1246 ../shared/subrepo-1/.hg/cache
1243 ../shared/subrepo-1/.hg/cache
1247 ../shared/subrepo-1/.hg/cache/storehash
1244 ../shared/subrepo-1/.hg/cache/storehash
1248 ../shared/subrepo-1/.hg/cache/storehash/* (glob)
1245 ../shared/subrepo-1/.hg/cache/storehash/* (glob)
1249 ../shared/subrepo-1/.hg/hgrc
1246 ../shared/subrepo-1/.hg/hgrc
1250 ../shared/subrepo-1/.hg/requires
1247 ../shared/subrepo-1/.hg/requires
1251 ../shared/subrepo-1/.hg/sharedpath
1248 ../shared/subrepo-1/.hg/sharedpath
1252 ../shared/subrepo-1/.hg/wcache
1249 ../shared/subrepo-1/.hg/wcache
1253 ../shared/subrepo-2
1250 ../shared/subrepo-2
1254 ../shared/subrepo-2/.hg
1251 ../shared/subrepo-2/.hg
1255 ../shared/subrepo-2/.hg/branch
1252 ../shared/subrepo-2/.hg/branch
1256 ../shared/subrepo-2/.hg/cache
1253 ../shared/subrepo-2/.hg/cache
1257 ../shared/subrepo-2/.hg/cache/storehash
1254 ../shared/subrepo-2/.hg/cache/storehash
1258 ../shared/subrepo-2/.hg/cache/storehash/* (glob)
1255 ../shared/subrepo-2/.hg/cache/storehash/* (glob)
1259 ../shared/subrepo-2/.hg/dirstate
1256 ../shared/subrepo-2/.hg/dirstate
1260 ../shared/subrepo-2/.hg/hgrc
1257 ../shared/subrepo-2/.hg/hgrc
1261 ../shared/subrepo-2/.hg/requires
1258 ../shared/subrepo-2/.hg/requires
1262 ../shared/subrepo-2/.hg/sharedpath
1259 ../shared/subrepo-2/.hg/sharedpath
1263 ../shared/subrepo-2/.hg/wcache
1260 ../shared/subrepo-2/.hg/wcache
1264 ../shared/subrepo-2/.hg/wcache/checkisexec (execbit !)
1261 ../shared/subrepo-2/.hg/wcache/checkisexec (execbit !)
1265 ../shared/subrepo-2/.hg/wcache/checklink (symlink !)
1262 ../shared/subrepo-2/.hg/wcache/checklink (symlink !)
1266 ../shared/subrepo-2/.hg/wcache/checklink-target (symlink !)
1263 ../shared/subrepo-2/.hg/wcache/checklink-target (symlink !)
1267 ../shared/subrepo-2/.hg/wcache/manifestfulltextcache (reporevlogstore !)
1264 ../shared/subrepo-2/.hg/wcache/manifestfulltextcache (reporevlogstore !)
1268 ../shared/subrepo-2/file
1265 ../shared/subrepo-2/file
1269 $ hg -R ../shared in
1266 $ hg -R ../shared in
1270 abort: repository default not found!
1267 abort: repository default not found!
1271 [255]
1268 [255]
1272 $ hg -R ../shared/subrepo-2 showconfig paths
1269 $ hg -R ../shared/subrepo-2 showconfig paths
1273 paths.default=$TESTTMP/subrepo-status/subrepo-2
1270 paths.default=$TESTTMP/subrepo-status/subrepo-2
1274 $ hg -R ../shared/subrepo-1 sum --remote
1271 $ hg -R ../shared/subrepo-1 sum --remote
1275 parent: -1:000000000000 tip (empty repository)
1272 parent: -1:000000000000 tip (empty repository)
1276 branch: default
1273 branch: default
1277 commit: (clean)
1274 commit: (clean)
1278 update: (current)
1275 update: (current)
1279 remote: (synced)
1276 remote: (synced)
1280
1277
1281 Check hg update --clean
1278 Check hg update --clean
1282 $ cd $TESTTMP/t
1279 $ cd $TESTTMP/t
1283 $ rm -r t/t.orig
1280 $ rm -r t/t.orig
1284 $ hg status -S --all
1281 $ hg status -S --all
1285 C .hgsub
1282 C .hgsub
1286 C .hgsubstate
1283 C .hgsubstate
1287 C a
1284 C a
1288 C s/.hgsub
1285 C s/.hgsub
1289 C s/.hgsubstate
1286 C s/.hgsubstate
1290 C s/a
1287 C s/a
1291 C s/ss/a
1288 C s/ss/a
1292 C t/t
1289 C t/t
1293 $ echo c1 > s/a
1290 $ echo c1 > s/a
1294 $ cd s
1291 $ cd s
1295 $ echo c1 > b
1292 $ echo c1 > b
1296 $ echo c1 > c
1293 $ echo c1 > c
1297 $ hg add b
1294 $ hg add b
1298 $ cd ..
1295 $ cd ..
1299 $ hg status -S
1296 $ hg status -S
1300 M s/a
1297 M s/a
1301 A s/b
1298 A s/b
1302 ? s/c
1299 ? s/c
1303 $ hg update -C
1300 $ hg update -C
1304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1301 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1305 updated to "925c17564ef8: 13"
1302 updated to "925c17564ef8: 13"
1306 2 other heads for branch "default"
1303 2 other heads for branch "default"
1307 $ hg status -S
1304 $ hg status -S
1308 ? s/b
1305 ? s/b
1309 ? s/c
1306 ? s/c
1310
1307
1311 Sticky subrepositories, no changes
1308 Sticky subrepositories, no changes
1312 $ cd $TESTTMP/t
1309 $ cd $TESTTMP/t
1313 $ hg id
1310 $ hg id
1314 925c17564ef8 tip
1311 925c17564ef8 tip
1315 $ hg -R s id
1312 $ hg -R s id
1316 12a213df6fa9 tip
1313 12a213df6fa9 tip
1317 $ hg -R t id
1314 $ hg -R t id
1318 52c0adc0515a tip
1315 52c0adc0515a tip
1319 $ hg update 11
1316 $ hg update 11
1320 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1317 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1321 $ hg id
1318 $ hg id
1322 365661e5936a
1319 365661e5936a
1323 $ hg -R s id
1320 $ hg -R s id
1324 fc627a69481f
1321 fc627a69481f
1325 $ hg -R t id
1322 $ hg -R t id
1326 e95bcfa18a35
1323 e95bcfa18a35
1327
1324
1328 Sticky subrepositories, file changes
1325 Sticky subrepositories, file changes
1329 $ touch s/f1
1326 $ touch s/f1
1330 $ touch t/f1
1327 $ touch t/f1
1331 $ hg add -S s/f1
1328 $ hg add -S s/f1
1332 $ hg add -S t/f1
1329 $ hg add -S t/f1
1333 $ hg id
1330 $ hg id
1334 365661e5936a+
1331 365661e5936a+
1335 $ hg -R s id
1332 $ hg -R s id
1336 fc627a69481f+
1333 fc627a69481f+
1337 $ hg -R t id
1334 $ hg -R t id
1338 e95bcfa18a35+
1335 e95bcfa18a35+
1339 $ hg update tip
1336 $ hg update tip
1340 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1337 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1341 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1338 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1342 subrepository sources for s differ
1339 subrepository sources for s differ
1343 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
1340 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
1344 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1341 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1345 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1342 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1346 subrepository sources for t differ
1343 subrepository sources for t differ
1347 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
1344 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
1348 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1345 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1349 $ hg id
1346 $ hg id
1350 925c17564ef8+ tip
1347 925c17564ef8+ tip
1351 $ hg -R s id
1348 $ hg -R s id
1352 fc627a69481f+
1349 fc627a69481f+
1353 $ hg -R t id
1350 $ hg -R t id
1354 e95bcfa18a35+
1351 e95bcfa18a35+
1355 $ hg update --clean tip
1352 $ hg update --clean tip
1356 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1353 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1357
1354
1358 Sticky subrepository, revision updates
1355 Sticky subrepository, revision updates
1359 $ hg id
1356 $ hg id
1360 925c17564ef8 tip
1357 925c17564ef8 tip
1361 $ hg -R s id
1358 $ hg -R s id
1362 12a213df6fa9 tip
1359 12a213df6fa9 tip
1363 $ hg -R t id
1360 $ hg -R t id
1364 52c0adc0515a tip
1361 52c0adc0515a tip
1365 $ cd s
1362 $ cd s
1366 $ hg update -r -2
1363 $ hg update -r -2
1367 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1364 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1368 $ cd ../t
1365 $ cd ../t
1369 $ hg update -r 2
1366 $ hg update -r 2
1370 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1367 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1371 $ cd ..
1368 $ cd ..
1372 $ hg update 10
1369 $ hg update 10
1373 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1370 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1374 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1371 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1375 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1372 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1376 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1373 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1377 subrepository sources for t differ (in checked out version)
1374 subrepository sources for t differ (in checked out version)
1378 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
1375 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
1379 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1376 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1380 $ hg id
1377 $ hg id
1381 e45c8b14af55+
1378 e45c8b14af55+
1382 $ hg -R s id
1379 $ hg -R s id
1383 02dcf1d70411
1380 02dcf1d70411
1384 $ hg -R t id
1381 $ hg -R t id
1385 7af322bc1198
1382 7af322bc1198
1386
1383
1387 Sticky subrepository, file changes and revision updates
1384 Sticky subrepository, file changes and revision updates
1388 $ touch s/f1
1385 $ touch s/f1
1389 $ touch t/f1
1386 $ touch t/f1
1390 $ hg add -S s/f1
1387 $ hg add -S s/f1
1391 $ hg add -S t/f1
1388 $ hg add -S t/f1
1392 $ hg id
1389 $ hg id
1393 e45c8b14af55+
1390 e45c8b14af55+
1394 $ hg -R s id
1391 $ hg -R s id
1395 02dcf1d70411+
1392 02dcf1d70411+
1396 $ hg -R t id
1393 $ hg -R t id
1397 7af322bc1198+
1394 7af322bc1198+
1398 $ hg update tip
1395 $ hg update tip
1399 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1396 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1400 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1397 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1401 subrepository sources for s differ
1398 subrepository sources for s differ
1402 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
1399 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
1403 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1400 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1404 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1401 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1405 subrepository sources for t differ
1402 subrepository sources for t differ
1406 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
1403 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
1407 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1404 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1408 $ hg id
1405 $ hg id
1409 925c17564ef8+ tip
1406 925c17564ef8+ tip
1410 $ hg -R s id
1407 $ hg -R s id
1411 02dcf1d70411+
1408 02dcf1d70411+
1412 $ hg -R t id
1409 $ hg -R t id
1413 7af322bc1198+
1410 7af322bc1198+
1414
1411
1415 Sticky repository, update --clean
1412 Sticky repository, update --clean
1416 $ hg update --clean tip
1413 $ hg update --clean tip
1417 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1418 $ hg id
1415 $ hg id
1419 925c17564ef8 tip
1416 925c17564ef8 tip
1420 $ hg -R s id
1417 $ hg -R s id
1421 12a213df6fa9 tip
1418 12a213df6fa9 tip
1422 $ hg -R t id
1419 $ hg -R t id
1423 52c0adc0515a tip
1420 52c0adc0515a tip
1424
1421
1425 Test subrepo already at intended revision:
1422 Test subrepo already at intended revision:
1426 $ cd s
1423 $ cd s
1427 $ hg update fc627a69481f
1424 $ hg update fc627a69481f
1428 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1425 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1429 $ cd ..
1426 $ cd ..
1430 $ hg update 11
1427 $ hg update 11
1431 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1428 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1432 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1429 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1433 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1430 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1434 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1431 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1435 $ hg id -n
1432 $ hg id -n
1436 11+
1433 11+
1437 $ hg -R s id
1434 $ hg -R s id
1438 fc627a69481f
1435 fc627a69481f
1439 $ hg -R t id
1436 $ hg -R t id
1440 e95bcfa18a35
1437 e95bcfa18a35
1441
1438
1442 Test that removing .hgsubstate doesn't break anything:
1439 Test that removing .hgsubstate doesn't break anything:
1443
1440
1444 $ hg rm -f .hgsubstate
1441 $ hg rm -f .hgsubstate
1445 $ hg ci -mrm
1442 $ hg ci -mrm
1446 nothing changed
1443 nothing changed
1447 [1]
1444 [1]
1448 $ hg log -vr tip
1445 $ hg log -vr tip
1449 changeset: 13:925c17564ef8
1446 changeset: 13:925c17564ef8
1450 tag: tip
1447 tag: tip
1451 user: test
1448 user: test
1452 date: Thu Jan 01 00:00:00 1970 +0000
1449 date: Thu Jan 01 00:00:00 1970 +0000
1453 files: .hgsubstate
1450 files: .hgsubstate
1454 description:
1451 description:
1455 13
1452 13
1456
1453
1457
1454
1458
1455
1459 Test that removing .hgsub removes .hgsubstate:
1456 Test that removing .hgsub removes .hgsubstate:
1460
1457
1461 $ hg rm .hgsub
1458 $ hg rm .hgsub
1462 $ hg ci -mrm2
1459 $ hg ci -mrm2
1463 created new head
1460 created new head
1464 $ hg log -vr tip
1461 $ hg log -vr tip
1465 changeset: 14:2400bccd50af
1462 changeset: 14:2400bccd50af
1466 tag: tip
1463 tag: tip
1467 parent: 11:365661e5936a
1464 parent: 11:365661e5936a
1468 user: test
1465 user: test
1469 date: Thu Jan 01 00:00:00 1970 +0000
1466 date: Thu Jan 01 00:00:00 1970 +0000
1470 files: .hgsub .hgsubstate
1467 files: .hgsub .hgsubstate
1471 description:
1468 description:
1472 rm2
1469 rm2
1473
1470
1474
1471
1475 Test issue3153: diff -S with deleted subrepos
1472 Test issue3153: diff -S with deleted subrepos
1476
1473
1477 $ hg diff --nodates -S -c .
1474 $ hg diff --nodates -S -c .
1478 diff -r 365661e5936a -r 2400bccd50af .hgsub
1475 diff -r 365661e5936a -r 2400bccd50af .hgsub
1479 --- a/.hgsub
1476 --- a/.hgsub
1480 +++ /dev/null
1477 +++ /dev/null
1481 @@ -1,2 +0,0 @@
1478 @@ -1,2 +0,0 @@
1482 -s = s
1479 -s = s
1483 -t = t
1480 -t = t
1484 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1481 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1485 --- a/.hgsubstate
1482 --- a/.hgsubstate
1486 +++ /dev/null
1483 +++ /dev/null
1487 @@ -1,2 +0,0 @@
1484 @@ -1,2 +0,0 @@
1488 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1485 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1489 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1486 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1490
1487
1491 Test behavior of add for explicit path in subrepo:
1488 Test behavior of add for explicit path in subrepo:
1492 $ cd ..
1489 $ cd ..
1493 $ hg init explicit
1490 $ hg init explicit
1494 $ cd explicit
1491 $ cd explicit
1495 $ echo s = s > .hgsub
1492 $ echo s = s > .hgsub
1496 $ hg add .hgsub
1493 $ hg add .hgsub
1497 $ hg init s
1494 $ hg init s
1498 $ hg ci -m0
1495 $ hg ci -m0
1499 Adding with an explicit path in a subrepo adds the file
1496 Adding with an explicit path in a subrepo adds the file
1500 $ echo c1 > f1
1497 $ echo c1 > f1
1501 $ echo c2 > s/f2
1498 $ echo c2 > s/f2
1502 $ hg st -S
1499 $ hg st -S
1503 ? f1
1500 ? f1
1504 ? s/f2
1501 ? s/f2
1505 $ hg add s/f2
1502 $ hg add s/f2
1506 $ hg st -S
1503 $ hg st -S
1507 A s/f2
1504 A s/f2
1508 ? f1
1505 ? f1
1509 $ hg ci -R s -m0
1506 $ hg ci -R s -m0
1510 $ hg ci -Am1
1507 $ hg ci -Am1
1511 adding f1
1508 adding f1
1512 Adding with an explicit path in a subrepo with -S has the same behavior
1509 Adding with an explicit path in a subrepo with -S has the same behavior
1513 $ echo c3 > f3
1510 $ echo c3 > f3
1514 $ echo c4 > s/f4
1511 $ echo c4 > s/f4
1515 $ hg st -S
1512 $ hg st -S
1516 ? f3
1513 ? f3
1517 ? s/f4
1514 ? s/f4
1518 $ hg add -S s/f4
1515 $ hg add -S s/f4
1519 $ hg st -S
1516 $ hg st -S
1520 A s/f4
1517 A s/f4
1521 ? f3
1518 ? f3
1522 $ hg ci -R s -m1
1519 $ hg ci -R s -m1
1523 $ hg ci -Ama2
1520 $ hg ci -Ama2
1524 adding f3
1521 adding f3
1525 Adding without a path or pattern silently ignores subrepos
1522 Adding without a path or pattern silently ignores subrepos
1526 $ echo c5 > f5
1523 $ echo c5 > f5
1527 $ echo c6 > s/f6
1524 $ echo c6 > s/f6
1528 $ echo c7 > s/f7
1525 $ echo c7 > s/f7
1529 $ hg st -S
1526 $ hg st -S
1530 ? f5
1527 ? f5
1531 ? s/f6
1528 ? s/f6
1532 ? s/f7
1529 ? s/f7
1533 $ hg add
1530 $ hg add
1534 adding f5
1531 adding f5
1535 $ hg st -S
1532 $ hg st -S
1536 A f5
1533 A f5
1537 ? s/f6
1534 ? s/f6
1538 ? s/f7
1535 ? s/f7
1539 $ hg ci -R s -Am2
1536 $ hg ci -R s -Am2
1540 adding f6
1537 adding f6
1541 adding f7
1538 adding f7
1542 $ hg ci -m3
1539 $ hg ci -m3
1543 Adding without a path or pattern with -S also adds files in subrepos
1540 Adding without a path or pattern with -S also adds files in subrepos
1544 $ echo c8 > f8
1541 $ echo c8 > f8
1545 $ echo c9 > s/f9
1542 $ echo c9 > s/f9
1546 $ echo c10 > s/f10
1543 $ echo c10 > s/f10
1547 $ hg st -S
1544 $ hg st -S
1548 ? f8
1545 ? f8
1549 ? s/f10
1546 ? s/f10
1550 ? s/f9
1547 ? s/f9
1551 $ hg add -S
1548 $ hg add -S
1552 adding f8
1549 adding f8
1553 adding s/f10
1550 adding s/f10
1554 adding s/f9
1551 adding s/f9
1555 $ hg st -S
1552 $ hg st -S
1556 A f8
1553 A f8
1557 A s/f10
1554 A s/f10
1558 A s/f9
1555 A s/f9
1559 $ hg ci -R s -m3
1556 $ hg ci -R s -m3
1560 $ hg ci -m4
1557 $ hg ci -m4
1561 Adding with a pattern silently ignores subrepos
1558 Adding with a pattern silently ignores subrepos
1562 $ echo c11 > fm11
1559 $ echo c11 > fm11
1563 $ echo c12 > fn12
1560 $ echo c12 > fn12
1564 $ echo c13 > s/fm13
1561 $ echo c13 > s/fm13
1565 $ echo c14 > s/fn14
1562 $ echo c14 > s/fn14
1566 $ hg st -S
1563 $ hg st -S
1567 ? fm11
1564 ? fm11
1568 ? fn12
1565 ? fn12
1569 ? s/fm13
1566 ? s/fm13
1570 ? s/fn14
1567 ? s/fn14
1571 $ hg add 'glob:**fm*'
1568 $ hg add 'glob:**fm*'
1572 adding fm11
1569 adding fm11
1573 $ hg st -S
1570 $ hg st -S
1574 A fm11
1571 A fm11
1575 ? fn12
1572 ? fn12
1576 ? s/fm13
1573 ? s/fm13
1577 ? s/fn14
1574 ? s/fn14
1578 $ hg ci -R s -Am4
1575 $ hg ci -R s -Am4
1579 adding fm13
1576 adding fm13
1580 adding fn14
1577 adding fn14
1581 $ hg ci -Am5
1578 $ hg ci -Am5
1582 adding fn12
1579 adding fn12
1583 Adding with a pattern with -S also adds matches in subrepos
1580 Adding with a pattern with -S also adds matches in subrepos
1584 $ echo c15 > fm15
1581 $ echo c15 > fm15
1585 $ echo c16 > fn16
1582 $ echo c16 > fn16
1586 $ echo c17 > s/fm17
1583 $ echo c17 > s/fm17
1587 $ echo c18 > s/fn18
1584 $ echo c18 > s/fn18
1588 $ hg st -S
1585 $ hg st -S
1589 ? fm15
1586 ? fm15
1590 ? fn16
1587 ? fn16
1591 ? s/fm17
1588 ? s/fm17
1592 ? s/fn18
1589 ? s/fn18
1593 $ hg add -S 'glob:**fm*'
1590 $ hg add -S 'glob:**fm*'
1594 adding fm15
1591 adding fm15
1595 adding s/fm17
1592 adding s/fm17
1596 $ hg st -S
1593 $ hg st -S
1597 A fm15
1594 A fm15
1598 A s/fm17
1595 A s/fm17
1599 ? fn16
1596 ? fn16
1600 ? s/fn18
1597 ? s/fn18
1601 $ hg ci -R s -Am5
1598 $ hg ci -R s -Am5
1602 adding fn18
1599 adding fn18
1603 $ hg ci -Am6
1600 $ hg ci -Am6
1604 adding fn16
1601 adding fn16
1605
1602
1606 Test behavior of forget for explicit path in subrepo:
1603 Test behavior of forget for explicit path in subrepo:
1607 Forgetting an explicit path in a subrepo untracks the file
1604 Forgetting an explicit path in a subrepo untracks the file
1608 $ echo c19 > s/f19
1605 $ echo c19 > s/f19
1609 $ hg add s/f19
1606 $ hg add s/f19
1610 $ hg st -S
1607 $ hg st -S
1611 A s/f19
1608 A s/f19
1612 $ hg forget s/f19
1609 $ hg forget s/f19
1613 $ hg st -S
1610 $ hg st -S
1614 ? s/f19
1611 ? s/f19
1615 $ rm s/f19
1612 $ rm s/f19
1616 $ cd ..
1613 $ cd ..
1617
1614
1618 Courtesy phases synchronisation to publishing server does not block the push
1615 Courtesy phases synchronisation to publishing server does not block the push
1619 (issue3781)
1616 (issue3781)
1620
1617
1621 $ cp -R main issue3781
1618 $ cp -R main issue3781
1622 $ cp -R main issue3781-dest
1619 $ cp -R main issue3781-dest
1623 $ cd issue3781-dest/s
1620 $ cd issue3781-dest/s
1624 $ hg phase tip # show we have draft changeset
1621 $ hg phase tip # show we have draft changeset
1625 5: draft
1622 5: draft
1626 $ chmod a-w .hg/store/phaseroots # prevent phase push
1623 $ chmod a-w .hg/store/phaseroots # prevent phase push
1627 $ cd ../../issue3781
1624 $ cd ../../issue3781
1628 $ cat >> .hg/hgrc << EOF
1625 $ cat >> .hg/hgrc << EOF
1629 > [paths]
1626 > [paths]
1630 > default=../issue3781-dest/
1627 > default=../issue3781-dest/
1631 > EOF
1628 > EOF
1632 $ hg push --config devel.legacy.exchange=bundle1
1629 $ hg push --config devel.legacy.exchange=bundle1
1633 pushing to $TESTTMP/issue3781-dest
1630 pushing to $TESTTMP/issue3781-dest
1634 pushing subrepo s to $TESTTMP/issue3781-dest/s
1631 pushing subrepo s to $TESTTMP/issue3781-dest/s
1635 searching for changes
1632 searching for changes
1636 no changes found
1633 no changes found
1637 searching for changes
1634 searching for changes
1638 no changes found
1635 no changes found
1639 [1]
1636 [1]
1640 # clean the push cache
1637 # clean the push cache
1641 $ rm s/.hg/cache/storehash/*
1638 $ rm s/.hg/cache/storehash/*
1642 $ hg push # bundle2+
1639 $ hg push # bundle2+
1643 pushing to $TESTTMP/issue3781-dest
1640 pushing to $TESTTMP/issue3781-dest
1644 pushing subrepo s to $TESTTMP/issue3781-dest/s
1641 pushing subrepo s to $TESTTMP/issue3781-dest/s
1645 searching for changes
1642 searching for changes
1646 no changes found
1643 no changes found
1647 searching for changes
1644 searching for changes
1648 no changes found
1645 no changes found
1649 [1]
1646 [1]
1650 $ cd ..
1647 $ cd ..
1651
1648
1652 Test phase choice for newly created commit with "phases.subrepochecks"
1649 Test phase choice for newly created commit with "phases.subrepochecks"
1653 configuration
1650 configuration
1654
1651
1655 $ cd t
1652 $ cd t
1656 $ hg update -q -r 12
1653 $ hg update -q -r 12
1657
1654
1658 $ cat >> s/ss/.hg/hgrc <<EOF
1655 $ cat >> s/ss/.hg/hgrc <<EOF
1659 > [phases]
1656 > [phases]
1660 > new-commit = secret
1657 > new-commit = secret
1661 > EOF
1658 > EOF
1662 $ cat >> s/.hg/hgrc <<EOF
1659 $ cat >> s/.hg/hgrc <<EOF
1663 > [phases]
1660 > [phases]
1664 > new-commit = draft
1661 > new-commit = draft
1665 > EOF
1662 > EOF
1666 $ echo phasecheck1 >> s/ss/a
1663 $ echo phasecheck1 >> s/ss/a
1667 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1664 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1668 committing subrepository ss
1665 committing subrepository ss
1669 transaction abort!
1666 transaction abort!
1670 rollback completed
1667 rollback completed
1671 abort: can't commit in draft phase conflicting secret from subrepository ss
1668 abort: can't commit in draft phase conflicting secret from subrepository ss
1672 [255]
1669 [255]
1673 $ echo phasecheck2 >> s/ss/a
1670 $ echo phasecheck2 >> s/ss/a
1674 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1671 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1675 committing subrepository ss
1672 committing subrepository ss
1676 $ hg -R s/ss phase tip
1673 $ hg -R s/ss phase tip
1677 3: secret
1674 3: secret
1678 $ hg -R s phase tip
1675 $ hg -R s phase tip
1679 6: draft
1676 6: draft
1680 $ echo phasecheck3 >> s/ss/a
1677 $ echo phasecheck3 >> s/ss/a
1681 $ hg -R s commit -S -m phasecheck3
1678 $ hg -R s commit -S -m phasecheck3
1682 committing subrepository ss
1679 committing subrepository ss
1683 warning: changes are committed in secret phase from subrepository ss
1680 warning: changes are committed in secret phase from subrepository ss
1684 $ hg -R s/ss phase tip
1681 $ hg -R s/ss phase tip
1685 4: secret
1682 4: secret
1686 $ hg -R s phase tip
1683 $ hg -R s phase tip
1687 7: secret
1684 7: secret
1688
1685
1689 $ cat >> t/.hg/hgrc <<EOF
1686 $ cat >> t/.hg/hgrc <<EOF
1690 > [phases]
1687 > [phases]
1691 > new-commit = draft
1688 > new-commit = draft
1692 > EOF
1689 > EOF
1693 $ cat >> .hg/hgrc <<EOF
1690 $ cat >> .hg/hgrc <<EOF
1694 > [phases]
1691 > [phases]
1695 > new-commit = public
1692 > new-commit = public
1696 > EOF
1693 > EOF
1697 $ echo phasecheck4 >> s/ss/a
1694 $ echo phasecheck4 >> s/ss/a
1698 $ echo phasecheck4 >> t/t
1695 $ echo phasecheck4 >> t/t
1699 $ hg commit -S -m phasecheck4
1696 $ hg commit -S -m phasecheck4
1700 committing subrepository s
1697 committing subrepository s
1701 committing subrepository s/ss
1698 committing subrepository s/ss
1702 warning: changes are committed in secret phase from subrepository ss
1699 warning: changes are committed in secret phase from subrepository ss
1703 committing subrepository t
1700 committing subrepository t
1704 warning: changes are committed in secret phase from subrepository s
1701 warning: changes are committed in secret phase from subrepository s
1705 created new head
1702 created new head
1706 $ hg -R s/ss phase tip
1703 $ hg -R s/ss phase tip
1707 5: secret
1704 5: secret
1708 $ hg -R s phase tip
1705 $ hg -R s phase tip
1709 8: secret
1706 8: secret
1710 $ hg -R t phase tip
1707 $ hg -R t phase tip
1711 6: draft
1708 6: draft
1712 $ hg phase tip
1709 $ hg phase tip
1713 15: secret
1710 15: secret
1714
1711
1715 $ cd ..
1712 $ cd ..
1716
1713
1717
1714
1718 Test that commit --secret works on both repo and subrepo (issue4182)
1715 Test that commit --secret works on both repo and subrepo (issue4182)
1719
1716
1720 $ cd main
1717 $ cd main
1721 $ echo secret >> b
1718 $ echo secret >> b
1722 $ echo secret >> s/b
1719 $ echo secret >> s/b
1723 $ hg commit --secret --subrepo -m "secret"
1720 $ hg commit --secret --subrepo -m "secret"
1724 committing subrepository s
1721 committing subrepository s
1725 $ hg phase -r .
1722 $ hg phase -r .
1726 6: secret
1723 6: secret
1727 $ cd s
1724 $ cd s
1728 $ hg phase -r .
1725 $ hg phase -r .
1729 6: secret
1726 6: secret
1730 $ cd ../../
1727 $ cd ../../
1731
1728
1732 Test "subrepos" template keyword
1729 Test "subrepos" template keyword
1733
1730
1734 $ cd t
1731 $ cd t
1735 $ hg update -q 15
1732 $ hg update -q 15
1736 $ cat > .hgsub <<EOF
1733 $ cat > .hgsub <<EOF
1737 > s = s
1734 > s = s
1738 > EOF
1735 > EOF
1739 $ hg commit -m "16"
1736 $ hg commit -m "16"
1740 warning: changes are committed in secret phase from subrepository s
1737 warning: changes are committed in secret phase from subrepository s
1741
1738
1742 (addition of ".hgsub" itself)
1739 (addition of ".hgsub" itself)
1743
1740
1744 $ hg diff --nodates -c 1 .hgsubstate
1741 $ hg diff --nodates -c 1 .hgsubstate
1745 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1742 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1746 --- /dev/null
1743 --- /dev/null
1747 +++ b/.hgsubstate
1744 +++ b/.hgsubstate
1748 @@ -0,0 +1,1 @@
1745 @@ -0,0 +1,1 @@
1749 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1746 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1750 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1747 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1751 f7b1eb17ad24 000000000000
1748 f7b1eb17ad24 000000000000
1752 s
1749 s
1753
1750
1754 (modification of existing entry)
1751 (modification of existing entry)
1755
1752
1756 $ hg diff --nodates -c 2 .hgsubstate
1753 $ hg diff --nodates -c 2 .hgsubstate
1757 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1754 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1758 --- a/.hgsubstate
1755 --- a/.hgsubstate
1759 +++ b/.hgsubstate
1756 +++ b/.hgsubstate
1760 @@ -1,1 +1,1 @@
1757 @@ -1,1 +1,1 @@
1761 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1758 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1762 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1759 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1763 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1760 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1764 7cf8cfea66e4 000000000000
1761 7cf8cfea66e4 000000000000
1765 s
1762 s
1766
1763
1767 (addition of entry)
1764 (addition of entry)
1768
1765
1769 $ hg diff --nodates -c 5 .hgsubstate
1766 $ hg diff --nodates -c 5 .hgsubstate
1770 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1767 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1771 --- a/.hgsubstate
1768 --- a/.hgsubstate
1772 +++ b/.hgsubstate
1769 +++ b/.hgsubstate
1773 @@ -1,1 +1,2 @@
1770 @@ -1,1 +1,2 @@
1774 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1771 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1775 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1772 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1776 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1773 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1777 7cf8cfea66e4 000000000000
1774 7cf8cfea66e4 000000000000
1778 t
1775 t
1779
1776
1780 (removal of existing entry)
1777 (removal of existing entry)
1781
1778
1782 $ hg diff --nodates -c 16 .hgsubstate
1779 $ hg diff --nodates -c 16 .hgsubstate
1783 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1780 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1784 --- a/.hgsubstate
1781 --- a/.hgsubstate
1785 +++ b/.hgsubstate
1782 +++ b/.hgsubstate
1786 @@ -1,2 +1,1 @@
1783 @@ -1,2 +1,1 @@
1787 0731af8ca9423976d3743119d0865097c07bdc1b s
1784 0731af8ca9423976d3743119d0865097c07bdc1b s
1788 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1785 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1789 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1786 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1790 8bec38d2bd0b 000000000000
1787 8bec38d2bd0b 000000000000
1791 t
1788 t
1792
1789
1793 (merging)
1790 (merging)
1794
1791
1795 $ hg diff --nodates -c 9 .hgsubstate
1792 $ hg diff --nodates -c 9 .hgsubstate
1796 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1793 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1797 --- a/.hgsubstate
1794 --- a/.hgsubstate
1798 +++ b/.hgsubstate
1795 +++ b/.hgsubstate
1799 @@ -1,1 +1,2 @@
1796 @@ -1,1 +1,2 @@
1800 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1797 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1801 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1798 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1802 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1799 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1803 f6affe3fbfaa 1f14a2e2d3ec
1800 f6affe3fbfaa 1f14a2e2d3ec
1804 t
1801 t
1805
1802
1806 (removal of ".hgsub" itself)
1803 (removal of ".hgsub" itself)
1807
1804
1808 $ hg diff --nodates -c 8 .hgsubstate
1805 $ hg diff --nodates -c 8 .hgsubstate
1809 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1806 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1810 --- a/.hgsubstate
1807 --- a/.hgsubstate
1811 +++ /dev/null
1808 +++ /dev/null
1812 @@ -1,2 +0,0 @@
1809 @@ -1,2 +0,0 @@
1813 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1810 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1814 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1811 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1815 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1812 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1816 f94576341bcf 000000000000
1813 f94576341bcf 000000000000
1817
1814
1818 Test that '[paths]' is configured correctly at subrepo creation
1815 Test that '[paths]' is configured correctly at subrepo creation
1819
1816
1820 $ cd $TESTTMP/tc
1817 $ cd $TESTTMP/tc
1821 $ cat > .hgsub <<EOF
1818 $ cat > .hgsub <<EOF
1822 > # to clear bogus subrepo path 'bogus=[boguspath'
1819 > # to clear bogus subrepo path 'bogus=[boguspath'
1823 > s = s
1820 > s = s
1824 > t = t
1821 > t = t
1825 > EOF
1822 > EOF
1826 $ hg update -q --clean null
1823 $ hg update -q --clean null
1827 $ rm -rf s t
1824 $ rm -rf s t
1828 $ cat >> .hg/hgrc <<EOF
1825 $ cat >> .hg/hgrc <<EOF
1829 > [paths]
1826 > [paths]
1830 > default-push = /foo/bar
1827 > default-push = /foo/bar
1831 > EOF
1828 > EOF
1832 $ hg update -q
1829 $ hg update -q
1833 $ cat s/.hg/hgrc
1830 $ cat s/.hg/hgrc
1834 [paths]
1831 [paths]
1835 default = $TESTTMP/t/s
1832 default = $TESTTMP/t/s
1836 default-push = /foo/bar/s
1833 default-push = /foo/bar/s
1837 $ cat s/ss/.hg/hgrc
1834 $ cat s/ss/.hg/hgrc
1838 [paths]
1835 [paths]
1839 default = $TESTTMP/t/s/ss
1836 default = $TESTTMP/t/s/ss
1840 default-push = /foo/bar/s/ss
1837 default-push = /foo/bar/s/ss
1841 $ cat t/.hg/hgrc
1838 $ cat t/.hg/hgrc
1842 [paths]
1839 [paths]
1843 default = $TESTTMP/t/t
1840 default = $TESTTMP/t/t
1844 default-push = /foo/bar/t
1841 default-push = /foo/bar/t
1845
1842
1846 $ cd $TESTTMP/t
1843 $ cd $TESTTMP/t
1847 $ hg up -qC 0
1844 $ hg up -qC 0
1848 $ echo 'bar' > bar.txt
1845 $ echo 'bar' > bar.txt
1849 $ hg ci -Am 'branch before subrepo add'
1846 $ hg ci -Am 'branch before subrepo add'
1850 adding bar.txt
1847 adding bar.txt
1851 created new head
1848 created new head
1852 $ hg merge -r "first(subrepo('s'))"
1849 $ hg merge -r "first(subrepo('s'))"
1853 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1850 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1854 (branch merge, don't forget to commit)
1851 (branch merge, don't forget to commit)
1855 $ hg status -S -X '.hgsub*'
1852 $ hg status -S -X '.hgsub*'
1856 A s/a
1853 A s/a
1857 ? s/b
1854 ? s/b
1858 ? s/c
1855 ? s/c
1859 ? s/f1
1856 ? s/f1
1860 $ hg status -S --rev 'p2()'
1857 $ hg status -S --rev 'p2()'
1861 A bar.txt
1858 A bar.txt
1862 ? s/b
1859 ? s/b
1863 ? s/c
1860 ? s/c
1864 ? s/f1
1861 ? s/f1
1865 $ hg diff -S -X '.hgsub*' --nodates
1862 $ hg diff -S -X '.hgsub*' --nodates
1866 diff -r 000000000000 s/a
1863 diff -r 000000000000 s/a
1867 --- /dev/null
1864 --- /dev/null
1868 +++ b/s/a
1865 +++ b/s/a
1869 @@ -0,0 +1,1 @@
1866 @@ -0,0 +1,1 @@
1870 +a
1867 +a
1871 $ hg diff -S --rev 'p2()' --nodates
1868 $ hg diff -S --rev 'p2()' --nodates
1872 diff -r 7cf8cfea66e4 bar.txt
1869 diff -r 7cf8cfea66e4 bar.txt
1873 --- /dev/null
1870 --- /dev/null
1874 +++ b/bar.txt
1871 +++ b/bar.txt
1875 @@ -0,0 +1,1 @@
1872 @@ -0,0 +1,1 @@
1876 +bar
1873 +bar
1877
1874
1878 $ hg diff -X '.hgsub*' --nodates s
1875 $ hg diff -X '.hgsub*' --nodates s
1879 diff -r 000000000000 s/a
1876 diff -r 000000000000 s/a
1880 --- /dev/null
1877 --- /dev/null
1881 +++ b/s/a
1878 +++ b/s/a
1882 @@ -0,0 +1,1 @@
1879 @@ -0,0 +1,1 @@
1883 +a
1880 +a
1884 $ hg diff -X '.hgsub*' --nodates s/a
1881 $ hg diff -X '.hgsub*' --nodates s/a
1885 diff -r 000000000000 s/a
1882 diff -r 000000000000 s/a
1886 --- /dev/null
1883 --- /dev/null
1887 +++ b/s/a
1884 +++ b/s/a
1888 @@ -0,0 +1,1 @@
1885 @@ -0,0 +1,1 @@
1889 +a
1886 +a
1890
1887
1891 $ cd ..
1888 $ cd ..
1892
1889
1893 test for ssh exploit 2017-07-25
1890 test for ssh exploit 2017-07-25
1894
1891
1895 $ cat >> $HGRCPATH << EOF
1892 $ cat >> $HGRCPATH << EOF
1896 > [ui]
1893 > [ui]
1897 > ssh = sh -c "read l; read l; read l"
1894 > ssh = sh -c "read l; read l; read l"
1898 > EOF
1895 > EOF
1899
1896
1900 $ hg init malicious-proxycommand
1897 $ hg init malicious-proxycommand
1901 $ cd malicious-proxycommand
1898 $ cd malicious-proxycommand
1902 $ echo 's = [hg]ssh://-oProxyCommand=touch${IFS}owned/path' > .hgsub
1899 $ echo 's = [hg]ssh://-oProxyCommand=touch${IFS}owned/path' > .hgsub
1903 $ hg init s
1900 $ hg init s
1904 $ cd s
1901 $ cd s
1905 $ echo init > init
1902 $ echo init > init
1906 $ hg add
1903 $ hg add
1907 adding init
1904 adding init
1908 $ hg commit -m init
1905 $ hg commit -m init
1909 $ cd ..
1906 $ cd ..
1910 $ hg add .hgsub
1907 $ hg add .hgsub
1911 $ hg ci -m 'add subrepo'
1908 $ hg ci -m 'add subrepo'
1912 $ cd ..
1909 $ cd ..
1913 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1910 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1914 updating to branch default
1911 updating to branch default
1915 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
1912 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
1916 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1913 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1917 [255]
1914 [255]
1918
1915
1919 also check that a percent encoded '-' (%2D) doesn't work
1916 also check that a percent encoded '-' (%2D) doesn't work
1920
1917
1921 $ cd malicious-proxycommand
1918 $ cd malicious-proxycommand
1922 $ echo 's = [hg]ssh://%2DoProxyCommand=touch${IFS}owned/path' > .hgsub
1919 $ echo 's = [hg]ssh://%2DoProxyCommand=touch${IFS}owned/path' > .hgsub
1923 $ hg ci -m 'change url to percent encoded'
1920 $ hg ci -m 'change url to percent encoded'
1924 $ cd ..
1921 $ cd ..
1925 $ rm -r malicious-proxycommand-clone
1922 $ rm -r malicious-proxycommand-clone
1926 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1923 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1927 updating to branch default
1924 updating to branch default
1928 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
1925 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
1929 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1926 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1930 [255]
1927 [255]
1931
1928
1932 also check for a pipe
1929 also check for a pipe
1933
1930
1934 $ cd malicious-proxycommand
1931 $ cd malicious-proxycommand
1935 $ echo 's = [hg]ssh://fakehost|touch${IFS}owned/path' > .hgsub
1932 $ echo 's = [hg]ssh://fakehost|touch${IFS}owned/path' > .hgsub
1936 $ hg ci -m 'change url to pipe'
1933 $ hg ci -m 'change url to pipe'
1937 $ cd ..
1934 $ cd ..
1938 $ rm -r malicious-proxycommand-clone
1935 $ rm -r malicious-proxycommand-clone
1939 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1936 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1940 updating to branch default
1937 updating to branch default
1941 cloning subrepo s from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
1938 cloning subrepo s from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
1942 abort: no suitable response from remote hg!
1939 abort: no suitable response from remote hg!
1943 [255]
1940 [255]
1944 $ [ ! -f owned ] || echo 'you got owned'
1941 $ [ ! -f owned ] || echo 'you got owned'
1945
1942
1946 also check that a percent encoded '|' (%7C) doesn't work
1943 also check that a percent encoded '|' (%7C) doesn't work
1947
1944
1948 $ cd malicious-proxycommand
1945 $ cd malicious-proxycommand
1949 $ echo 's = [hg]ssh://fakehost%7Ctouch%20owned/path' > .hgsub
1946 $ echo 's = [hg]ssh://fakehost%7Ctouch%20owned/path' > .hgsub
1950 $ hg ci -m 'change url to percent encoded pipe'
1947 $ hg ci -m 'change url to percent encoded pipe'
1951 $ cd ..
1948 $ cd ..
1952 $ rm -r malicious-proxycommand-clone
1949 $ rm -r malicious-proxycommand-clone
1953 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1950 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1954 updating to branch default
1951 updating to branch default
1955 cloning subrepo s from ssh://fakehost%7Ctouch%20owned/path
1952 cloning subrepo s from ssh://fakehost%7Ctouch%20owned/path
1956 abort: no suitable response from remote hg!
1953 abort: no suitable response from remote hg!
1957 [255]
1954 [255]
1958 $ [ ! -f owned ] || echo 'you got owned'
1955 $ [ ! -f owned ] || echo 'you got owned'
1959
1956
1960 and bad usernames:
1957 and bad usernames:
1961 $ cd malicious-proxycommand
1958 $ cd malicious-proxycommand
1962 $ echo 's = [hg]ssh://-oProxyCommand=touch owned@example.com/path' > .hgsub
1959 $ echo 's = [hg]ssh://-oProxyCommand=touch owned@example.com/path' > .hgsub
1963 $ hg ci -m 'owned username'
1960 $ hg ci -m 'owned username'
1964 $ cd ..
1961 $ cd ..
1965 $ rm -r malicious-proxycommand-clone
1962 $ rm -r malicious-proxycommand-clone
1966 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1963 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1967 updating to branch default
1964 updating to branch default
1968 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%20owned@example.com/path
1965 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%20owned@example.com/path
1969 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s")
1966 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s")
1970 [255]
1967 [255]
1971
1968
1972 Test convert subrepositories including merge (issue5526):
1969 Test convert subrepositories including merge (issue5526):
1973
1970
1974 $ hg init tconv
1971 $ hg init tconv
1975 $ hg convert --config extensions.convert= -q t/s tconv/s
1972 $ hg convert --config extensions.convert= -q t/s tconv/s
1976 $ hg convert --config extensions.convert= -q t/s/ss tconv/s/ss
1973 $ hg convert --config extensions.convert= -q t/s/ss tconv/s/ss
1977 $ hg convert --config extensions.convert= -q t/t tconv/t
1974 $ hg convert --config extensions.convert= -q t/t tconv/t
1978
1975
1979 convert shouldn't fail because of pseudo filenode:
1976 convert shouldn't fail because of pseudo filenode:
1980
1977
1981 $ hg convert --config extensions.convert= t tconv
1978 $ hg convert --config extensions.convert= t tconv
1982 scanning source...
1979 scanning source...
1983 sorting...
1980 sorting...
1984 converting...
1981 converting...
1985 17 0
1982 17 0
1986 16 1
1983 16 1
1987 15 2
1984 15 2
1988 14 3
1985 14 3
1989 13 4
1986 13 4
1990 12 5
1987 12 5
1991 11 6
1988 11 6
1992 10 7
1989 10 7
1993 9 8
1990 9 8
1994 8 9
1991 8 9
1995 7 10
1992 7 10
1996 6 11
1993 6 11
1997 5 12
1994 5 12
1998 4 13
1995 4 13
1999 3 rm2
1996 3 rm2
2000 2 phasecheck4
1997 2 phasecheck4
2001 1 16
1998 1 16
2002 0 branch before subrepo add
1999 0 branch before subrepo add
2003
2000
2004 converted .hgsubstate should point to valid nodes:
2001 converted .hgsubstate should point to valid nodes:
2005
2002
2006 $ hg up -R tconv 9
2003 $ hg up -R tconv 9
2007 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
2004 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
2008 $ cat tconv/.hgsubstate
2005 $ cat tconv/.hgsubstate
2009 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
2006 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
2010 60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
2007 60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
@@ -1,254 +1,251 b''
1 $ HGMERGE=true; export HGMERGE
1 $ HGMERGE=true; export HGMERGE
2
2
3 $ hg init r1
3 $ hg init r1
4 $ cd r1
4 $ cd r1
5 $ echo a > a
5 $ echo a > a
6 $ hg addremove
6 $ hg addremove
7 adding a
7 adding a
8 $ hg commit -m "1"
8 $ hg commit -m "1"
9
9
10 $ hg clone . ../r2
10 $ hg clone . ../r2
11 updating to branch default
11 updating to branch default
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 $ cd ../r2
13 $ cd ../r2
14 $ hg up
14 $ hg up
15 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 $ echo abc > a
16 $ echo abc > a
17 $ hg diff --nodates
17 $ hg diff --nodates
18 diff -r c19d34741b0a a
18 diff -r c19d34741b0a a
19 --- a/a
19 --- a/a
20 +++ b/a
20 +++ b/a
21 @@ -1,1 +1,1 @@
21 @@ -1,1 +1,1 @@
22 -a
22 -a
23 +abc
23 +abc
24
24
25 $ cd ../r1
25 $ cd ../r1
26 $ echo b > b
26 $ echo b > b
27 $ echo a2 > a
27 $ echo a2 > a
28 $ hg addremove
28 $ hg addremove
29 adding b
29 adding b
30 $ hg commit -m "2"
30 $ hg commit -m "2"
31
31
32 $ cd ../r2
32 $ cd ../r2
33 $ hg -q pull ../r1
33 $ hg -q pull ../r1
34 $ hg status
34 $ hg status
35 M a
35 M a
36 $ hg parents
36 $ hg parents
37 changeset: 0:c19d34741b0a
37 changeset: 0:c19d34741b0a
38 user: test
38 user: test
39 date: Thu Jan 01 00:00:00 1970 +0000
39 date: Thu Jan 01 00:00:00 1970 +0000
40 summary: 1
40 summary: 1
41
41
42 $ hg --debug up
42 $ hg --debug up
43 searching for copies back to rev 1
44 unmatched files in other:
43 unmatched files in other:
45 b
44 b
46 resolving manifests
45 resolving manifests
47 branchmerge: False, force: False, partial: False
46 branchmerge: False, force: False, partial: False
48 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
47 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
49 preserving a for resolve of a
48 preserving a for resolve of a
50 b: remote created -> g
49 b: remote created -> g
51 getting b
50 getting b
52 a: versions differ -> m (premerge)
51 a: versions differ -> m (premerge)
53 picked tool 'true' for a (binary False symlink False changedelete False)
52 picked tool 'true' for a (binary False symlink False changedelete False)
54 merging a
53 merging a
55 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
54 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
56 a: versions differ -> m (merge)
55 a: versions differ -> m (merge)
57 picked tool 'true' for a (binary False symlink False changedelete False)
56 picked tool 'true' for a (binary False symlink False changedelete False)
58 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
57 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
59 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
58 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
60 merge tool returned: 0
59 merge tool returned: 0
61 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
60 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
62 $ hg parents
61 $ hg parents
63 changeset: 1:1e71731e6fbb
62 changeset: 1:1e71731e6fbb
64 tag: tip
63 tag: tip
65 user: test
64 user: test
66 date: Thu Jan 01 00:00:00 1970 +0000
65 date: Thu Jan 01 00:00:00 1970 +0000
67 summary: 2
66 summary: 2
68
67
69 $ hg --debug up 0
68 $ hg --debug up 0
70 starting 4 threads for background file closing (?)
69 starting 4 threads for background file closing (?)
71 searching for copies back to rev 0
72 unmatched files in local (from topological common ancestor):
70 unmatched files in local (from topological common ancestor):
73 b
71 b
74 resolving manifests
72 resolving manifests
75 branchmerge: False, force: False, partial: False
73 branchmerge: False, force: False, partial: False
76 ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
74 ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
77 preserving a for resolve of a
75 preserving a for resolve of a
78 b: other deleted -> r
76 b: other deleted -> r
79 removing b
77 removing b
80 starting 4 threads for background file closing (?)
78 starting 4 threads for background file closing (?)
81 a: versions differ -> m (premerge)
79 a: versions differ -> m (premerge)
82 picked tool 'true' for a (binary False symlink False changedelete False)
80 picked tool 'true' for a (binary False symlink False changedelete False)
83 merging a
81 merging a
84 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
82 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
85 a: versions differ -> m (merge)
83 a: versions differ -> m (merge)
86 picked tool 'true' for a (binary False symlink False changedelete False)
84 picked tool 'true' for a (binary False symlink False changedelete False)
87 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
85 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
88 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
86 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
89 merge tool returned: 0
87 merge tool returned: 0
90 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
88 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
91 $ hg parents
89 $ hg parents
92 changeset: 0:c19d34741b0a
90 changeset: 0:c19d34741b0a
93 user: test
91 user: test
94 date: Thu Jan 01 00:00:00 1970 +0000
92 date: Thu Jan 01 00:00:00 1970 +0000
95 summary: 1
93 summary: 1
96
94
97 $ hg --debug up
95 $ hg --debug up
98 searching for copies back to rev 1
99 unmatched files in other:
96 unmatched files in other:
100 b
97 b
101 resolving manifests
98 resolving manifests
102 branchmerge: False, force: False, partial: False
99 branchmerge: False, force: False, partial: False
103 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
100 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
104 preserving a for resolve of a
101 preserving a for resolve of a
105 b: remote created -> g
102 b: remote created -> g
106 getting b
103 getting b
107 a: versions differ -> m (premerge)
104 a: versions differ -> m (premerge)
108 picked tool 'true' for a (binary False symlink False changedelete False)
105 picked tool 'true' for a (binary False symlink False changedelete False)
109 merging a
106 merging a
110 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
107 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
111 a: versions differ -> m (merge)
108 a: versions differ -> m (merge)
112 picked tool 'true' for a (binary False symlink False changedelete False)
109 picked tool 'true' for a (binary False symlink False changedelete False)
113 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
110 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
114 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
111 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
115 merge tool returned: 0
112 merge tool returned: 0
116 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
113 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
117 $ hg parents
114 $ hg parents
118 changeset: 1:1e71731e6fbb
115 changeset: 1:1e71731e6fbb
119 tag: tip
116 tag: tip
120 user: test
117 user: test
121 date: Thu Jan 01 00:00:00 1970 +0000
118 date: Thu Jan 01 00:00:00 1970 +0000
122 summary: 2
119 summary: 2
123
120
124 $ hg -v history
121 $ hg -v history
125 changeset: 1:1e71731e6fbb
122 changeset: 1:1e71731e6fbb
126 tag: tip
123 tag: tip
127 user: test
124 user: test
128 date: Thu Jan 01 00:00:00 1970 +0000
125 date: Thu Jan 01 00:00:00 1970 +0000
129 files: a b
126 files: a b
130 description:
127 description:
131 2
128 2
132
129
133
130
134 changeset: 0:c19d34741b0a
131 changeset: 0:c19d34741b0a
135 user: test
132 user: test
136 date: Thu Jan 01 00:00:00 1970 +0000
133 date: Thu Jan 01 00:00:00 1970 +0000
137 files: a
134 files: a
138 description:
135 description:
139 1
136 1
140
137
141
138
142 $ hg diff --nodates
139 $ hg diff --nodates
143 diff -r 1e71731e6fbb a
140 diff -r 1e71731e6fbb a
144 --- a/a
141 --- a/a
145 +++ b/a
142 +++ b/a
146 @@ -1,1 +1,1 @@
143 @@ -1,1 +1,1 @@
147 -a2
144 -a2
148 +abc
145 +abc
149
146
150
147
151 create a second head
148 create a second head
152
149
153 $ cd ../r1
150 $ cd ../r1
154 $ hg up 0
151 $ hg up 0
155 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
152 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
156 $ echo b2 > b
153 $ echo b2 > b
157 $ echo a3 > a
154 $ echo a3 > a
158 $ hg addremove
155 $ hg addremove
159 adding b
156 adding b
160 $ hg commit -m "3"
157 $ hg commit -m "3"
161 created new head
158 created new head
162
159
163 $ cd ../r2
160 $ cd ../r2
164 $ hg -q pull ../r1
161 $ hg -q pull ../r1
165 $ hg status
162 $ hg status
166 M a
163 M a
167 $ hg parents
164 $ hg parents
168 changeset: 1:1e71731e6fbb
165 changeset: 1:1e71731e6fbb
169 user: test
166 user: test
170 date: Thu Jan 01 00:00:00 1970 +0000
167 date: Thu Jan 01 00:00:00 1970 +0000
171 summary: 2
168 summary: 2
172
169
173 $ hg --debug up
170 $ hg --debug up
174 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
171 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 updated to "1e71731e6fbb: 2"
172 updated to "1e71731e6fbb: 2"
176 1 other heads for branch "default"
173 1 other heads for branch "default"
177
174
178 test conflicting untracked files
175 test conflicting untracked files
179
176
180 $ hg up -qC 0
177 $ hg up -qC 0
181 $ echo untracked > b
178 $ echo untracked > b
182 $ hg st
179 $ hg st
183 ? b
180 ? b
184 $ hg up 1
181 $ hg up 1
185 b: untracked file differs
182 b: untracked file differs
186 abort: untracked files in working directory differ from files in requested revision
183 abort: untracked files in working directory differ from files in requested revision
187 [255]
184 [255]
188 $ rm b
185 $ rm b
189
186
190 test conflicting untracked ignored file
187 test conflicting untracked ignored file
191
188
192 $ hg up -qC 0
189 $ hg up -qC 0
193 $ echo ignored > .hgignore
190 $ echo ignored > .hgignore
194 $ hg add .hgignore
191 $ hg add .hgignore
195 $ hg ci -m 'add .hgignore'
192 $ hg ci -m 'add .hgignore'
196 created new head
193 created new head
197 $ echo ignored > ignored
194 $ echo ignored > ignored
198 $ hg add ignored
195 $ hg add ignored
199 $ hg ci -m 'add ignored file'
196 $ hg ci -m 'add ignored file'
200
197
201 $ hg up -q 'desc("add .hgignore")'
198 $ hg up -q 'desc("add .hgignore")'
202 $ echo untracked > ignored
199 $ echo untracked > ignored
203 $ hg st
200 $ hg st
204 $ hg up 'desc("add ignored file")'
201 $ hg up 'desc("add ignored file")'
205 ignored: untracked file differs
202 ignored: untracked file differs
206 abort: untracked files in working directory differ from files in requested revision
203 abort: untracked files in working directory differ from files in requested revision
207 [255]
204 [255]
208
205
209 test a local add
206 test a local add
210
207
211 $ cd ..
208 $ cd ..
212 $ hg init a
209 $ hg init a
213 $ hg init b
210 $ hg init b
214 $ echo a > a/a
211 $ echo a > a/a
215 $ echo a > b/a
212 $ echo a > b/a
216 $ hg --cwd a commit -A -m a
213 $ hg --cwd a commit -A -m a
217 adding a
214 adding a
218 $ cd b
215 $ cd b
219 $ hg add a
216 $ hg add a
220 $ hg pull -u ../a
217 $ hg pull -u ../a
221 pulling from ../a
218 pulling from ../a
222 requesting all changes
219 requesting all changes
223 adding changesets
220 adding changesets
224 adding manifests
221 adding manifests
225 adding file changes
222 adding file changes
226 added 1 changesets with 1 changes to 1 files
223 added 1 changesets with 1 changes to 1 files
227 new changesets cb9a9f314b8b
224 new changesets cb9a9f314b8b
228 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
225 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
229 $ hg st
226 $ hg st
230
227
231 test updating backwards through a rename
228 test updating backwards through a rename
232
229
233 $ hg mv a b
230 $ hg mv a b
234 $ hg ci -m b
231 $ hg ci -m b
235 $ echo b > b
232 $ echo b > b
236 $ hg up -q 0
233 $ hg up -q 0
237 $ hg st
234 $ hg st
238 M a
235 M a
239 $ hg diff --nodates
236 $ hg diff --nodates
240 diff -r cb9a9f314b8b a
237 diff -r cb9a9f314b8b a
241 --- a/a
238 --- a/a
242 +++ b/a
239 +++ b/a
243 @@ -1,1 +1,1 @@
240 @@ -1,1 +1,1 @@
244 -a
241 -a
245 +b
242 +b
246
243
247 test for superfluous filemerge of clean files renamed in the past
244 test for superfluous filemerge of clean files renamed in the past
248
245
249 $ hg up -qC tip
246 $ hg up -qC tip
250 $ echo c > c
247 $ echo c > c
251 $ hg add c
248 $ hg add c
252 $ hg up -qt:fail 0
249 $ hg up -qt:fail 0
253
250
254 $ cd ..
251 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now