##// END OF EJS Templates
copies: delete debug message about "unmatched files new in both"...
Martin von Zweigbergk -
r42350:a68036b8 default
parent child Browse files
Show More
@@ -1,1021 +1,1018 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, debug=True):
356 def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, debug=True):
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 u1 = sorted(addedinm1 - addedinm2)
364 u1 = sorted(addedinm1 - addedinm2)
365 u2 = sorted(addedinm2 - addedinm1)
365 u2 = sorted(addedinm2 - addedinm1)
366
366
367 if debug:
367 if debug:
368 header = " unmatched files in %s"
368 header = " unmatched files in %s"
369 if u1:
369 if u1:
370 repo.ui.debug("%s:\n %s\n" % (header % 'local', "\n ".join(u1)))
370 repo.ui.debug("%s:\n %s\n" % (header % 'local', "\n ".join(u1)))
371 if u2:
371 if u2:
372 repo.ui.debug("%s:\n %s\n" % (header % 'other', "\n ".join(u2)))
372 repo.ui.debug("%s:\n %s\n" % (header % 'other', "\n ".join(u2)))
373
373
374 return u1, u2
374 return u1, u2
375
375
376 def _makegetfctx(ctx):
376 def _makegetfctx(ctx):
377 """return a 'getfctx' function suitable for _checkcopies usage
377 """return a 'getfctx' function suitable for _checkcopies usage
378
378
379 We have to re-setup the function building 'filectx' for each
379 We have to re-setup the function building 'filectx' for each
380 '_checkcopies' to ensure the linkrev adjustment is properly setup for
380 '_checkcopies' to ensure the linkrev adjustment is properly setup for
381 each. Linkrev adjustment is important to avoid bug in rename
381 each. Linkrev adjustment is important to avoid bug in rename
382 detection. Moreover, having a proper '_ancestrycontext' setup ensures
382 detection. Moreover, having a proper '_ancestrycontext' setup ensures
383 the performance impact of this adjustment is kept limited. Without it,
383 the performance impact of this adjustment is kept limited. Without it,
384 each file could do a full dag traversal making the time complexity of
384 each file could do a full dag traversal making the time complexity of
385 the operation explode (see issue4537).
385 the operation explode (see issue4537).
386
386
387 This function exists here mostly to limit the impact on stable. Feel
387 This function exists here mostly to limit the impact on stable. Feel
388 free to refactor on default.
388 free to refactor on default.
389 """
389 """
390 rev = ctx.rev()
390 rev = ctx.rev()
391 repo = ctx._repo
391 repo = ctx._repo
392 ac = getattr(ctx, '_ancestrycontext', None)
392 ac = getattr(ctx, '_ancestrycontext', None)
393 if ac is None:
393 if ac is None:
394 revs = [rev]
394 revs = [rev]
395 if rev is None:
395 if rev is None:
396 revs = [p.rev() for p in ctx.parents()]
396 revs = [p.rev() for p in ctx.parents()]
397 ac = repo.changelog.ancestors(revs, inclusive=True)
397 ac = repo.changelog.ancestors(revs, inclusive=True)
398 ctx._ancestrycontext = ac
398 ctx._ancestrycontext = ac
399 def makectx(f, n):
399 def makectx(f, n):
400 if n in node.wdirfilenodeids: # in a working context?
400 if n in node.wdirfilenodeids: # in a working context?
401 if ctx.rev() is None:
401 if ctx.rev() is None:
402 return ctx.filectx(f)
402 return ctx.filectx(f)
403 return repo[None][f]
403 return repo[None][f]
404 fctx = repo.filectx(f, fileid=n)
404 fctx = repo.filectx(f, fileid=n)
405 # setup only needed for filectx not create from a changectx
405 # setup only needed for filectx not create from a changectx
406 fctx._ancestrycontext = ac
406 fctx._ancestrycontext = ac
407 fctx._descendantrev = rev
407 fctx._descendantrev = rev
408 return fctx
408 return fctx
409 return util.lrucachefunc(makectx)
409 return util.lrucachefunc(makectx)
410
410
411 def _combinecopies(copyfrom, copyto, finalcopy, diverge, incompletediverge):
411 def _combinecopies(copyfrom, copyto, finalcopy, diverge, incompletediverge):
412 """combine partial copy paths"""
412 """combine partial copy paths"""
413 remainder = {}
413 remainder = {}
414 for f in copyfrom:
414 for f in copyfrom:
415 if f in copyto:
415 if f in copyto:
416 finalcopy[copyto[f]] = copyfrom[f]
416 finalcopy[copyto[f]] = copyfrom[f]
417 del copyto[f]
417 del copyto[f]
418 for f in incompletediverge:
418 for f in incompletediverge:
419 assert f not in diverge
419 assert f not in diverge
420 ic = incompletediverge[f]
420 ic = incompletediverge[f]
421 if ic[0] in copyto:
421 if ic[0] in copyto:
422 diverge[f] = [copyto[ic[0]], ic[1]]
422 diverge[f] = [copyto[ic[0]], ic[1]]
423 else:
423 else:
424 remainder[f] = ic
424 remainder[f] = ic
425 return remainder
425 return remainder
426
426
427 def mergecopies(repo, c1, c2, base):
427 def mergecopies(repo, c1, c2, base):
428 """
428 """
429 Finds moves and copies between context c1 and c2 that are relevant for
429 Finds moves and copies between context c1 and c2 that are relevant for
430 merging. 'base' will be used as the merge base.
430 merging. 'base' will be used as the merge base.
431
431
432 Copytracing is used in commands like rebase, merge, unshelve, etc to merge
432 Copytracing is used in commands like rebase, merge, unshelve, etc to merge
433 files that were moved/ copied in one merge parent and modified in another.
433 files that were moved/ copied in one merge parent and modified in another.
434 For example:
434 For example:
435
435
436 o ---> 4 another commit
436 o ---> 4 another commit
437 |
437 |
438 | o ---> 3 commit that modifies a.txt
438 | o ---> 3 commit that modifies a.txt
439 | /
439 | /
440 o / ---> 2 commit that moves a.txt to b.txt
440 o / ---> 2 commit that moves a.txt to b.txt
441 |/
441 |/
442 o ---> 1 merge base
442 o ---> 1 merge base
443
443
444 If we try to rebase revision 3 on revision 4, since there is no a.txt in
444 If we try to rebase revision 3 on revision 4, since there is no a.txt in
445 revision 4, and if user have copytrace disabled, we prints the following
445 revision 4, and if user have copytrace disabled, we prints the following
446 message:
446 message:
447
447
448 ```other changed <file> which local deleted```
448 ```other changed <file> which local deleted```
449
449
450 Returns five dicts: "copy", "movewithdir", "diverge", "renamedelete" and
450 Returns five dicts: "copy", "movewithdir", "diverge", "renamedelete" and
451 "dirmove".
451 "dirmove".
452
452
453 "copy" is a mapping from destination name -> source name,
453 "copy" is a mapping from destination name -> source name,
454 where source is in c1 and destination is in c2 or vice-versa.
454 where source is in c1 and destination is in c2 or vice-versa.
455
455
456 "movewithdir" is a mapping from source name -> destination name,
456 "movewithdir" is a mapping from source name -> destination name,
457 where the file at source present in one context but not the other
457 where the file at source present in one context but not the other
458 needs to be moved to destination by the merge process, because the
458 needs to be moved to destination by the merge process, because the
459 other context moved the directory it is in.
459 other context moved the directory it is in.
460
460
461 "diverge" is a mapping of source name -> list of destination names
461 "diverge" is a mapping of source name -> list of destination names
462 for divergent renames.
462 for divergent renames.
463
463
464 "renamedelete" is a mapping of source name -> list of destination
464 "renamedelete" is a mapping of source name -> list of destination
465 names for files deleted in c1 that were renamed in c2 or vice-versa.
465 names for files deleted in c1 that were renamed in c2 or vice-versa.
466
466
467 "dirmove" is a mapping of detected source dir -> destination dir renames.
467 "dirmove" is a mapping of detected source dir -> destination dir renames.
468 This is needed for handling changes to new files previously grafted into
468 This is needed for handling changes to new files previously grafted into
469 renamed directories.
469 renamed directories.
470
470
471 This function calls different copytracing algorithms based on config.
471 This function calls different copytracing algorithms based on config.
472 """
472 """
473 # avoid silly behavior for update from empty dir
473 # avoid silly behavior for update from empty dir
474 if not c1 or not c2 or c1 == c2:
474 if not c1 or not c2 or c1 == c2:
475 return {}, {}, {}, {}, {}
475 return {}, {}, {}, {}, {}
476
476
477 narrowmatch = c1.repo().narrowmatch()
477 narrowmatch = c1.repo().narrowmatch()
478
478
479 # avoid silly behavior for parent -> working dir
479 # avoid silly behavior for parent -> working dir
480 if c2.node() is None and c1.node() == repo.dirstate.p1():
480 if c2.node() is None and c1.node() == repo.dirstate.p1():
481 return _dirstatecopies(repo, narrowmatch), {}, {}, {}, {}
481 return _dirstatecopies(repo, narrowmatch), {}, {}, {}, {}
482
482
483 copytracing = repo.ui.config('experimental', 'copytrace')
483 copytracing = repo.ui.config('experimental', 'copytrace')
484 boolctrace = stringutil.parsebool(copytracing)
484 boolctrace = stringutil.parsebool(copytracing)
485
485
486 # Copy trace disabling is explicitly below the node == p1 logic above
486 # Copy trace disabling is explicitly below the node == p1 logic above
487 # because the logic above is required for a simple copy to be kept across a
487 # because the logic above is required for a simple copy to be kept across a
488 # rebase.
488 # rebase.
489 if copytracing == 'heuristics':
489 if copytracing == 'heuristics':
490 # Do full copytracing if only non-public revisions are involved as
490 # Do full copytracing if only non-public revisions are involved as
491 # that will be fast enough and will also cover the copies which could
491 # that will be fast enough and will also cover the copies which could
492 # be missed by heuristics
492 # be missed by heuristics
493 if _isfullcopytraceable(repo, c1, base):
493 if _isfullcopytraceable(repo, c1, base):
494 return _fullcopytracing(repo, c1, c2, base)
494 return _fullcopytracing(repo, c1, c2, base)
495 return _heuristicscopytracing(repo, c1, c2, base)
495 return _heuristicscopytracing(repo, c1, c2, base)
496 elif boolctrace is False:
496 elif boolctrace is False:
497 # stringutil.parsebool() returns None when it is unable to parse the
497 # stringutil.parsebool() returns None when it is unable to parse the
498 # value, so we should rely on making sure copytracing is on such cases
498 # value, so we should rely on making sure copytracing is on such cases
499 return {}, {}, {}, {}, {}
499 return {}, {}, {}, {}, {}
500 else:
500 else:
501 return _fullcopytracing(repo, c1, c2, base)
501 return _fullcopytracing(repo, c1, c2, base)
502
502
503 def _isfullcopytraceable(repo, c1, base):
503 def _isfullcopytraceable(repo, c1, base):
504 """ Checks that if base, source and destination are all no-public branches,
504 """ Checks that if base, source and destination are all no-public branches,
505 if yes let's use the full copytrace algorithm for increased capabilities
505 if yes let's use the full copytrace algorithm for increased capabilities
506 since it will be fast enough.
506 since it will be fast enough.
507
507
508 `experimental.copytrace.sourcecommitlimit` can be used to set a limit for
508 `experimental.copytrace.sourcecommitlimit` can be used to set a limit for
509 number of changesets from c1 to base such that if number of changesets are
509 number of changesets from c1 to base such that if number of changesets are
510 more than the limit, full copytracing algorithm won't be used.
510 more than the limit, full copytracing algorithm won't be used.
511 """
511 """
512 if c1.rev() is None:
512 if c1.rev() is None:
513 c1 = c1.p1()
513 c1 = c1.p1()
514 if c1.mutable() and base.mutable():
514 if c1.mutable() and base.mutable():
515 sourcecommitlimit = repo.ui.configint('experimental',
515 sourcecommitlimit = repo.ui.configint('experimental',
516 'copytrace.sourcecommitlimit')
516 'copytrace.sourcecommitlimit')
517 commits = len(repo.revs('%d::%d', base.rev(), c1.rev()))
517 commits = len(repo.revs('%d::%d', base.rev(), c1.rev()))
518 return commits < sourcecommitlimit
518 return commits < sourcecommitlimit
519 return False
519 return False
520
520
521 def _fullcopytracing(repo, c1, c2, base):
521 def _fullcopytracing(repo, c1, c2, base):
522 """ The full copytracing algorithm which finds all the new files that were
522 """ The full copytracing algorithm which finds all the new files that were
523 added from merge base up to the top commit and for each file it checks if
523 added from merge base up to the top commit and for each file it checks if
524 this file was copied from another file.
524 this file was copied from another file.
525
525
526 This is pretty slow when a lot of changesets are involved but will track all
526 This is pretty slow when a lot of changesets are involved but will track all
527 the copies.
527 the copies.
528 """
528 """
529 # In certain scenarios (e.g. graft, update or rebase), base can be
529 # In certain scenarios (e.g. graft, update or rebase), base can be
530 # overridden We still need to know a real common ancestor in this case We
530 # overridden We still need to know a real common ancestor in this case We
531 # can't just compute _c1.ancestor(_c2) and compare it to ca, because there
531 # can't just compute _c1.ancestor(_c2) and compare it to ca, because there
532 # can be multiple common ancestors, e.g. in case of bidmerge. Because our
532 # can be multiple common ancestors, e.g. in case of bidmerge. Because our
533 # caller may not know if the revision passed in lieu of the CA is a genuine
533 # caller may not know if the revision passed in lieu of the CA is a genuine
534 # common ancestor or not without explicitly checking it, it's better to
534 # common ancestor or not without explicitly checking it, it's better to
535 # determine that here.
535 # determine that here.
536 #
536 #
537 # base.isancestorof(wc) is False, work around that
537 # base.isancestorof(wc) is False, work around that
538 _c1 = c1.p1() if c1.rev() is None else c1
538 _c1 = c1.p1() if c1.rev() is None else c1
539 _c2 = c2.p1() if c2.rev() is None else c2
539 _c2 = c2.p1() if c2.rev() is None else c2
540 # an endpoint is "dirty" if it isn't a descendant of the merge base
540 # an endpoint is "dirty" if it isn't a descendant of the merge base
541 # if we have a dirty endpoint, we need to trigger graft logic, and also
541 # if we have a dirty endpoint, we need to trigger graft logic, and also
542 # keep track of which endpoint is dirty
542 # keep track of which endpoint is dirty
543 dirtyc1 = not base.isancestorof(_c1)
543 dirtyc1 = not base.isancestorof(_c1)
544 dirtyc2 = not base.isancestorof(_c2)
544 dirtyc2 = not base.isancestorof(_c2)
545 graft = dirtyc1 or dirtyc2
545 graft = dirtyc1 or dirtyc2
546 tca = base
546 tca = base
547 if graft:
547 if graft:
548 tca = _c1.ancestor(_c2)
548 tca = _c1.ancestor(_c2)
549
549
550 limit = _findlimit(repo, c1, c2)
550 limit = _findlimit(repo, c1, c2)
551
551
552 m1 = c1.manifest()
552 m1 = c1.manifest()
553 m2 = c2.manifest()
553 m2 = c2.manifest()
554 mb = base.manifest()
554 mb = base.manifest()
555
555
556 # gather data from _checkcopies:
556 # gather data from _checkcopies:
557 # - diverge = record all diverges in this dict
557 # - diverge = record all diverges in this dict
558 # - copy = record all non-divergent copies in this dict
558 # - copy = record all non-divergent copies in this dict
559 # - fullcopy = record all copies in this dict
559 # - fullcopy = record all copies in this dict
560 # - incomplete = record non-divergent partial copies here
560 # - incomplete = record non-divergent partial copies here
561 # - incompletediverge = record divergent partial copies here
561 # - incompletediverge = record divergent partial copies here
562 diverge = {} # divergence data is shared
562 diverge = {} # divergence data is shared
563 incompletediverge = {}
563 incompletediverge = {}
564 data1 = {'copy': {},
564 data1 = {'copy': {},
565 'fullcopy': {},
565 'fullcopy': {},
566 'incomplete': {},
566 'incomplete': {},
567 'diverge': diverge,
567 'diverge': diverge,
568 'incompletediverge': incompletediverge,
568 'incompletediverge': incompletediverge,
569 }
569 }
570 data2 = {'copy': {},
570 data2 = {'copy': {},
571 'fullcopy': {},
571 'fullcopy': {},
572 'incomplete': {},
572 'incomplete': {},
573 'diverge': diverge,
573 'diverge': diverge,
574 'incompletediverge': incompletediverge,
574 'incompletediverge': incompletediverge,
575 }
575 }
576
576
577 # find interesting file sets from manifests
577 # find interesting file sets from manifests
578 addedinm1 = m1.filesnotin(mb, repo.narrowmatch())
578 addedinm1 = m1.filesnotin(mb, repo.narrowmatch())
579 addedinm2 = m2.filesnotin(mb, repo.narrowmatch())
579 addedinm2 = m2.filesnotin(mb, repo.narrowmatch())
580 bothnew = sorted(addedinm1 & addedinm2)
580 bothnew = sorted(addedinm1 & addedinm2)
581 if tca == base:
581 if tca == base:
582 # unmatched file from base
582 # unmatched file from base
583 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
583 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
584 u1u, u2u = u1r, u2r
584 u1u, u2u = u1r, u2r
585 else:
585 else:
586 # unmatched file from base (DAG rotation in the graft case)
586 # unmatched file from base (DAG rotation in the graft case)
587 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
587 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
588 # unmatched file from topological common ancestors (no DAG rotation)
588 # unmatched file from topological common ancestors (no DAG rotation)
589 # need to recompute this for directory move handling when grafting
589 # need to recompute this for directory move handling when grafting
590 mta = tca.manifest()
590 mta = tca.manifest()
591 u1u, u2u = _computenonoverlap(repo, c1, c2,
591 u1u, u2u = _computenonoverlap(repo, c1, c2,
592 m1.filesnotin(mta, repo.narrowmatch()),
592 m1.filesnotin(mta, repo.narrowmatch()),
593 m2.filesnotin(mta, repo.narrowmatch()),
593 m2.filesnotin(mta, repo.narrowmatch()),
594 debug=False)
594 debug=False)
595
595
596 for f in u1u:
596 for f in u1u:
597 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, data1)
597 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, data1)
598
598
599 for f in u2u:
599 for f in u2u:
600 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, data2)
600 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, data2)
601
601
602 copy = dict(data1['copy'])
602 copy = dict(data1['copy'])
603 copy.update(data2['copy'])
603 copy.update(data2['copy'])
604 fullcopy = dict(data1['fullcopy'])
604 fullcopy = dict(data1['fullcopy'])
605 fullcopy.update(data2['fullcopy'])
605 fullcopy.update(data2['fullcopy'])
606
606
607 if dirtyc1:
607 if dirtyc1:
608 _combinecopies(data2['incomplete'], data1['incomplete'], copy, diverge,
608 _combinecopies(data2['incomplete'], data1['incomplete'], copy, diverge,
609 incompletediverge)
609 incompletediverge)
610 if dirtyc2:
610 if dirtyc2:
611 _combinecopies(data1['incomplete'], data2['incomplete'], copy, diverge,
611 _combinecopies(data1['incomplete'], data2['incomplete'], copy, diverge,
612 incompletediverge)
612 incompletediverge)
613
613
614 renamedelete = {}
614 renamedelete = {}
615 renamedeleteset = set()
615 renamedeleteset = set()
616 divergeset = set()
616 divergeset = set()
617 for of, fl in list(diverge.items()):
617 for of, fl in list(diverge.items()):
618 if len(fl) == 1 or of in c1 or of in c2:
618 if len(fl) == 1 or of in c1 or of in c2:
619 del diverge[of] # not actually divergent, or not a rename
619 del diverge[of] # not actually divergent, or not a rename
620 if of not in c1 and of not in c2:
620 if of not in c1 and of not in c2:
621 # renamed on one side, deleted on the other side, but filter
621 # renamed on one side, deleted on the other side, but filter
622 # out files that have been renamed and then deleted
622 # out files that have been renamed and then deleted
623 renamedelete[of] = [f for f in fl if f in c1 or f in c2]
623 renamedelete[of] = [f for f in fl if f in c1 or f in c2]
624 renamedeleteset.update(fl) # reverse map for below
624 renamedeleteset.update(fl) # reverse map for below
625 else:
625 else:
626 divergeset.update(fl) # reverse map for below
626 divergeset.update(fl) # reverse map for below
627
627
628 if bothnew:
629 repo.ui.debug(" unmatched files new in both:\n %s\n"
630 % "\n ".join(bothnew))
631 bothdiverge = {}
628 bothdiverge = {}
632 bothincompletediverge = {}
629 bothincompletediverge = {}
633 remainder = {}
630 remainder = {}
634 both1 = {'copy': {},
631 both1 = {'copy': {},
635 'fullcopy': {},
632 'fullcopy': {},
636 'incomplete': {},
633 'incomplete': {},
637 'diverge': bothdiverge,
634 'diverge': bothdiverge,
638 'incompletediverge': bothincompletediverge
635 'incompletediverge': bothincompletediverge
639 }
636 }
640 both2 = {'copy': {},
637 both2 = {'copy': {},
641 'fullcopy': {},
638 'fullcopy': {},
642 'incomplete': {},
639 'incomplete': {},
643 'diverge': bothdiverge,
640 'diverge': bothdiverge,
644 'incompletediverge': bothincompletediverge
641 'incompletediverge': bothincompletediverge
645 }
642 }
646 for f in bothnew:
643 for f in bothnew:
647 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, both1)
644 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, both1)
648 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, both2)
645 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, both2)
649 if dirtyc1 and dirtyc2:
646 if dirtyc1 and dirtyc2:
650 remainder = _combinecopies(both2['incomplete'], both1['incomplete'],
647 remainder = _combinecopies(both2['incomplete'], both1['incomplete'],
651 copy, bothdiverge, bothincompletediverge)
648 copy, bothdiverge, bothincompletediverge)
652 remainder1 = _combinecopies(both1['incomplete'], both2['incomplete'],
649 remainder1 = _combinecopies(both1['incomplete'], both2['incomplete'],
653 copy, bothdiverge, bothincompletediverge)
650 copy, bothdiverge, bothincompletediverge)
654 remainder.update(remainder1)
651 remainder.update(remainder1)
655 elif dirtyc1:
652 elif dirtyc1:
656 # incomplete copies may only be found on the "dirty" side for bothnew
653 # incomplete copies may only be found on the "dirty" side for bothnew
657 assert not both2['incomplete']
654 assert not both2['incomplete']
658 remainder = _combinecopies({}, both1['incomplete'], copy, bothdiverge,
655 remainder = _combinecopies({}, both1['incomplete'], copy, bothdiverge,
659 bothincompletediverge)
656 bothincompletediverge)
660 elif dirtyc2:
657 elif dirtyc2:
661 assert not both1['incomplete']
658 assert not both1['incomplete']
662 remainder = _combinecopies({}, both2['incomplete'], copy, bothdiverge,
659 remainder = _combinecopies({}, both2['incomplete'], copy, bothdiverge,
663 bothincompletediverge)
660 bothincompletediverge)
664 else:
661 else:
665 # incomplete copies and divergences can't happen outside grafts
662 # incomplete copies and divergences can't happen outside grafts
666 assert not both1['incomplete']
663 assert not both1['incomplete']
667 assert not both2['incomplete']
664 assert not both2['incomplete']
668 assert not bothincompletediverge
665 assert not bothincompletediverge
669 for f in remainder:
666 for f in remainder:
670 assert f not in bothdiverge
667 assert f not in bothdiverge
671 ic = remainder[f]
668 ic = remainder[f]
672 if ic[0] in (m1 if dirtyc1 else m2):
669 if ic[0] in (m1 if dirtyc1 else m2):
673 # backed-out rename on one side, but watch out for deleted files
670 # backed-out rename on one side, but watch out for deleted files
674 bothdiverge[f] = ic
671 bothdiverge[f] = ic
675 for of, fl in bothdiverge.items():
672 for of, fl in bothdiverge.items():
676 if len(fl) == 2 and fl[0] == fl[1]:
673 if len(fl) == 2 and fl[0] == fl[1]:
677 copy[fl[0]] = of # not actually divergent, just matching renames
674 copy[fl[0]] = of # not actually divergent, just matching renames
678
675
679 # Sometimes we get invalid copies here (the "and not remotebase" in
676 # Sometimes we get invalid copies here (the "and not remotebase" in
680 # _checkcopies() seems suspicious). Filter them out.
677 # _checkcopies() seems suspicious). Filter them out.
681 for dst, src in fullcopy.copy().items():
678 for dst, src in fullcopy.copy().items():
682 if src not in mb:
679 if src not in mb:
683 del fullcopy[dst]
680 del fullcopy[dst]
684 # Sometimes we forget to add entries from "copy" to "fullcopy", so fix
681 # Sometimes we forget to add entries from "copy" to "fullcopy", so fix
685 # that up here
682 # that up here
686 for dst, src in copy.items():
683 for dst, src in copy.items():
687 fullcopy[dst] = src
684 fullcopy[dst] = src
688 # Sometimes we forget to add entries from "diverge" to "fullcopy", so fix
685 # Sometimes we forget to add entries from "diverge" to "fullcopy", so fix
689 # that up here
686 # that up here
690 for src, dsts in diverge.items():
687 for src, dsts in diverge.items():
691 for dst in dsts:
688 for dst in dsts:
692 fullcopy[dst] = src
689 fullcopy[dst] = src
693
690
694 if not fullcopy:
691 if not fullcopy:
695 return copy, {}, diverge, renamedelete, {}
692 return copy, {}, diverge, renamedelete, {}
696
693
697 if repo.ui.debugflag:
694 if repo.ui.debugflag:
698 repo.ui.debug(" all copies found (* = to merge, ! = divergent, "
695 repo.ui.debug(" all copies found (* = to merge, ! = divergent, "
699 "% = renamed and deleted):\n")
696 "% = renamed and deleted):\n")
700 for f in sorted(fullcopy):
697 for f in sorted(fullcopy):
701 note = ""
698 note = ""
702 if f in copy:
699 if f in copy:
703 note += "*"
700 note += "*"
704 if f in divergeset:
701 if f in divergeset:
705 note += "!"
702 note += "!"
706 if f in renamedeleteset:
703 if f in renamedeleteset:
707 note += "%"
704 note += "%"
708 repo.ui.debug(" src: '%s' -> dst: '%s' %s\n" % (fullcopy[f], f,
705 repo.ui.debug(" src: '%s' -> dst: '%s' %s\n" % (fullcopy[f], f,
709 note))
706 note))
710 del divergeset
707 del divergeset
711
708
712 repo.ui.debug(" checking for directory renames\n")
709 repo.ui.debug(" checking for directory renames\n")
713
710
714 # generate a directory move map
711 # generate a directory move map
715 d1, d2 = c1.dirs(), c2.dirs()
712 d1, d2 = c1.dirs(), c2.dirs()
716 # Hack for adding '', which is not otherwise added, to d1 and d2
713 # Hack for adding '', which is not otherwise added, to d1 and d2
717 d1.addpath('/')
714 d1.addpath('/')
718 d2.addpath('/')
715 d2.addpath('/')
719 invalid = set()
716 invalid = set()
720 dirmove = {}
717 dirmove = {}
721
718
722 # examine each file copy for a potential directory move, which is
719 # examine each file copy for a potential directory move, which is
723 # when all the files in a directory are moved to a new directory
720 # when all the files in a directory are moved to a new directory
724 for dst, src in fullcopy.iteritems():
721 for dst, src in fullcopy.iteritems():
725 dsrc, ddst = pathutil.dirname(src), pathutil.dirname(dst)
722 dsrc, ddst = pathutil.dirname(src), pathutil.dirname(dst)
726 if dsrc in invalid:
723 if dsrc in invalid:
727 # already seen to be uninteresting
724 # already seen to be uninteresting
728 continue
725 continue
729 elif dsrc in d1 and ddst in d1:
726 elif dsrc in d1 and ddst in d1:
730 # directory wasn't entirely moved locally
727 # directory wasn't entirely moved locally
731 invalid.add(dsrc)
728 invalid.add(dsrc)
732 elif dsrc in d2 and ddst in d2:
729 elif dsrc in d2 and ddst in d2:
733 # directory wasn't entirely moved remotely
730 # directory wasn't entirely moved remotely
734 invalid.add(dsrc)
731 invalid.add(dsrc)
735 elif dsrc in dirmove and dirmove[dsrc] != ddst:
732 elif dsrc in dirmove and dirmove[dsrc] != ddst:
736 # files from the same directory moved to two different places
733 # files from the same directory moved to two different places
737 invalid.add(dsrc)
734 invalid.add(dsrc)
738 else:
735 else:
739 # looks good so far
736 # looks good so far
740 dirmove[dsrc] = ddst
737 dirmove[dsrc] = ddst
741
738
742 for i in invalid:
739 for i in invalid:
743 if i in dirmove:
740 if i in dirmove:
744 del dirmove[i]
741 del dirmove[i]
745 del d1, d2, invalid
742 del d1, d2, invalid
746
743
747 if not dirmove:
744 if not dirmove:
748 return copy, {}, diverge, renamedelete, {}
745 return copy, {}, diverge, renamedelete, {}
749
746
750 dirmove = {k + "/": v + "/" for k, v in dirmove.iteritems()}
747 dirmove = {k + "/": v + "/" for k, v in dirmove.iteritems()}
751
748
752 for d in dirmove:
749 for d in dirmove:
753 repo.ui.debug(" discovered dir src: '%s' -> dst: '%s'\n" %
750 repo.ui.debug(" discovered dir src: '%s' -> dst: '%s'\n" %
754 (d, dirmove[d]))
751 (d, dirmove[d]))
755
752
756 movewithdir = {}
753 movewithdir = {}
757 # check unaccounted nonoverlapping files against directory moves
754 # check unaccounted nonoverlapping files against directory moves
758 for f in u1r + u2r:
755 for f in u1r + u2r:
759 if f not in fullcopy:
756 if f not in fullcopy:
760 for d in dirmove:
757 for d in dirmove:
761 if f.startswith(d):
758 if f.startswith(d):
762 # new file added in a directory that was moved, move it
759 # new file added in a directory that was moved, move it
763 df = dirmove[d] + f[len(d):]
760 df = dirmove[d] + f[len(d):]
764 if df not in copy:
761 if df not in copy:
765 movewithdir[f] = df
762 movewithdir[f] = df
766 repo.ui.debug((" pending file src: '%s' -> "
763 repo.ui.debug((" pending file src: '%s' -> "
767 "dst: '%s'\n") % (f, df))
764 "dst: '%s'\n") % (f, df))
768 break
765 break
769
766
770 return copy, movewithdir, diverge, renamedelete, dirmove
767 return copy, movewithdir, diverge, renamedelete, dirmove
771
768
772 def _heuristicscopytracing(repo, c1, c2, base):
769 def _heuristicscopytracing(repo, c1, c2, base):
773 """ Fast copytracing using filename heuristics
770 """ Fast copytracing using filename heuristics
774
771
775 Assumes that moves or renames are of following two types:
772 Assumes that moves or renames are of following two types:
776
773
777 1) Inside a directory only (same directory name but different filenames)
774 1) Inside a directory only (same directory name but different filenames)
778 2) Move from one directory to another
775 2) Move from one directory to another
779 (same filenames but different directory names)
776 (same filenames but different directory names)
780
777
781 Works only when there are no merge commits in the "source branch".
778 Works only when there are no merge commits in the "source branch".
782 Source branch is commits from base up to c2 not including base.
779 Source branch is commits from base up to c2 not including base.
783
780
784 If merge is involved it fallbacks to _fullcopytracing().
781 If merge is involved it fallbacks to _fullcopytracing().
785
782
786 Can be used by setting the following config:
783 Can be used by setting the following config:
787
784
788 [experimental]
785 [experimental]
789 copytrace = heuristics
786 copytrace = heuristics
790
787
791 In some cases the copy/move candidates found by heuristics can be very large
788 In some cases the copy/move candidates found by heuristics can be very large
792 in number and that will make the algorithm slow. The number of possible
789 in number and that will make the algorithm slow. The number of possible
793 candidates to check can be limited by using the config
790 candidates to check can be limited by using the config
794 `experimental.copytrace.movecandidateslimit` which defaults to 100.
791 `experimental.copytrace.movecandidateslimit` which defaults to 100.
795 """
792 """
796
793
797 if c1.rev() is None:
794 if c1.rev() is None:
798 c1 = c1.p1()
795 c1 = c1.p1()
799 if c2.rev() is None:
796 if c2.rev() is None:
800 c2 = c2.p1()
797 c2 = c2.p1()
801
798
802 copies = {}
799 copies = {}
803
800
804 changedfiles = set()
801 changedfiles = set()
805 m1 = c1.manifest()
802 m1 = c1.manifest()
806 if not repo.revs('%d::%d', base.rev(), c2.rev()):
803 if not repo.revs('%d::%d', base.rev(), c2.rev()):
807 # If base is not in c2 branch, we switch to fullcopytracing
804 # If base is not in c2 branch, we switch to fullcopytracing
808 repo.ui.debug("switching to full copytracing as base is not "
805 repo.ui.debug("switching to full copytracing as base is not "
809 "an ancestor of c2\n")
806 "an ancestor of c2\n")
810 return _fullcopytracing(repo, c1, c2, base)
807 return _fullcopytracing(repo, c1, c2, base)
811
808
812 ctx = c2
809 ctx = c2
813 while ctx != base:
810 while ctx != base:
814 if len(ctx.parents()) == 2:
811 if len(ctx.parents()) == 2:
815 # To keep things simple let's not handle merges
812 # To keep things simple let's not handle merges
816 repo.ui.debug("switching to full copytracing because of merges\n")
813 repo.ui.debug("switching to full copytracing because of merges\n")
817 return _fullcopytracing(repo, c1, c2, base)
814 return _fullcopytracing(repo, c1, c2, base)
818 changedfiles.update(ctx.files())
815 changedfiles.update(ctx.files())
819 ctx = ctx.p1()
816 ctx = ctx.p1()
820
817
821 cp = _forwardcopies(base, c2)
818 cp = _forwardcopies(base, c2)
822 for dst, src in cp.iteritems():
819 for dst, src in cp.iteritems():
823 if src in m1:
820 if src in m1:
824 copies[dst] = src
821 copies[dst] = src
825
822
826 # file is missing if it isn't present in the destination, but is present in
823 # file is missing if it isn't present in the destination, but is present in
827 # the base and present in the source.
824 # the base and present in the source.
828 # Presence in the base is important to exclude added files, presence in the
825 # Presence in the base is important to exclude added files, presence in the
829 # source is important to exclude removed files.
826 # source is important to exclude removed files.
830 filt = lambda f: f not in m1 and f in base and f in c2
827 filt = lambda f: f not in m1 and f in base and f in c2
831 missingfiles = [f for f in changedfiles if filt(f)]
828 missingfiles = [f for f in changedfiles if filt(f)]
832
829
833 if missingfiles:
830 if missingfiles:
834 basenametofilename = collections.defaultdict(list)
831 basenametofilename = collections.defaultdict(list)
835 dirnametofilename = collections.defaultdict(list)
832 dirnametofilename = collections.defaultdict(list)
836
833
837 for f in m1.filesnotin(base.manifest()):
834 for f in m1.filesnotin(base.manifest()):
838 basename = os.path.basename(f)
835 basename = os.path.basename(f)
839 dirname = os.path.dirname(f)
836 dirname = os.path.dirname(f)
840 basenametofilename[basename].append(f)
837 basenametofilename[basename].append(f)
841 dirnametofilename[dirname].append(f)
838 dirnametofilename[dirname].append(f)
842
839
843 for f in missingfiles:
840 for f in missingfiles:
844 basename = os.path.basename(f)
841 basename = os.path.basename(f)
845 dirname = os.path.dirname(f)
842 dirname = os.path.dirname(f)
846 samebasename = basenametofilename[basename]
843 samebasename = basenametofilename[basename]
847 samedirname = dirnametofilename[dirname]
844 samedirname = dirnametofilename[dirname]
848 movecandidates = samebasename + samedirname
845 movecandidates = samebasename + samedirname
849 # f is guaranteed to be present in c2, that's why
846 # f is guaranteed to be present in c2, that's why
850 # c2.filectx(f) won't fail
847 # c2.filectx(f) won't fail
851 f2 = c2.filectx(f)
848 f2 = c2.filectx(f)
852 # we can have a lot of candidates which can slow down the heuristics
849 # we can have a lot of candidates which can slow down the heuristics
853 # config value to limit the number of candidates moves to check
850 # config value to limit the number of candidates moves to check
854 maxcandidates = repo.ui.configint('experimental',
851 maxcandidates = repo.ui.configint('experimental',
855 'copytrace.movecandidateslimit')
852 'copytrace.movecandidateslimit')
856
853
857 if len(movecandidates) > maxcandidates:
854 if len(movecandidates) > maxcandidates:
858 repo.ui.status(_("skipping copytracing for '%s', more "
855 repo.ui.status(_("skipping copytracing for '%s', more "
859 "candidates than the limit: %d\n")
856 "candidates than the limit: %d\n")
860 % (f, len(movecandidates)))
857 % (f, len(movecandidates)))
861 continue
858 continue
862
859
863 for candidate in movecandidates:
860 for candidate in movecandidates:
864 f1 = c1.filectx(candidate)
861 f1 = c1.filectx(candidate)
865 if _related(f1, f2):
862 if _related(f1, f2):
866 # if there are a few related copies then we'll merge
863 # if there are a few related copies then we'll merge
867 # changes into all of them. This matches the behaviour
864 # changes into all of them. This matches the behaviour
868 # of upstream copytracing
865 # of upstream copytracing
869 copies[candidate] = f
866 copies[candidate] = f
870
867
871 return copies, {}, {}, {}, {}
868 return copies, {}, {}, {}, {}
872
869
873 def _related(f1, f2):
870 def _related(f1, f2):
874 """return True if f1 and f2 filectx have a common ancestor
871 """return True if f1 and f2 filectx have a common ancestor
875
872
876 Walk back to common ancestor to see if the two files originate
873 Walk back to common ancestor to see if the two files originate
877 from the same file. Since workingfilectx's rev() is None it messes
874 from the same file. Since workingfilectx's rev() is None it messes
878 up the integer comparison logic, hence the pre-step check for
875 up the integer comparison logic, hence the pre-step check for
879 None (f1 and f2 can only be workingfilectx's initially).
876 None (f1 and f2 can only be workingfilectx's initially).
880 """
877 """
881
878
882 if f1 == f2:
879 if f1 == f2:
883 return True # a match
880 return True # a match
884
881
885 g1, g2 = f1.ancestors(), f2.ancestors()
882 g1, g2 = f1.ancestors(), f2.ancestors()
886 try:
883 try:
887 f1r, f2r = f1.linkrev(), f2.linkrev()
884 f1r, f2r = f1.linkrev(), f2.linkrev()
888
885
889 if f1r is None:
886 if f1r is None:
890 f1 = next(g1)
887 f1 = next(g1)
891 if f2r is None:
888 if f2r is None:
892 f2 = next(g2)
889 f2 = next(g2)
893
890
894 while True:
891 while True:
895 f1r, f2r = f1.linkrev(), f2.linkrev()
892 f1r, f2r = f1.linkrev(), f2.linkrev()
896 if f1r > f2r:
893 if f1r > f2r:
897 f1 = next(g1)
894 f1 = next(g1)
898 elif f2r > f1r:
895 elif f2r > f1r:
899 f2 = next(g2)
896 f2 = next(g2)
900 else: # f1 and f2 point to files in the same linkrev
897 else: # f1 and f2 point to files in the same linkrev
901 return f1 == f2 # true if they point to the same file
898 return f1 == f2 # true if they point to the same file
902 except StopIteration:
899 except StopIteration:
903 return False
900 return False
904
901
905 def _checkcopies(srcctx, dstctx, f, base, tca, remotebase, limit, data):
902 def _checkcopies(srcctx, dstctx, f, base, tca, remotebase, limit, data):
906 """
903 """
907 check possible copies of f from msrc to mdst
904 check possible copies of f from msrc to mdst
908
905
909 srcctx = starting context for f in msrc
906 srcctx = starting context for f in msrc
910 dstctx = destination context for f in mdst
907 dstctx = destination context for f in mdst
911 f = the filename to check (as in msrc)
908 f = the filename to check (as in msrc)
912 base = the changectx used as a merge base
909 base = the changectx used as a merge base
913 tca = topological common ancestor for graft-like scenarios
910 tca = topological common ancestor for graft-like scenarios
914 remotebase = True if base is outside tca::srcctx, False otherwise
911 remotebase = True if base is outside tca::srcctx, False otherwise
915 limit = the rev number to not search beyond
912 limit = the rev number to not search beyond
916 data = dictionary of dictionary to store copy data. (see mergecopies)
913 data = dictionary of dictionary to store copy data. (see mergecopies)
917
914
918 note: limit is only an optimization, and provides no guarantee that
915 note: limit is only an optimization, and provides no guarantee that
919 irrelevant revisions will not be visited
916 irrelevant revisions will not be visited
920 there is no easy way to make this algorithm stop in a guaranteed way
917 there is no easy way to make this algorithm stop in a guaranteed way
921 once it "goes behind a certain revision".
918 once it "goes behind a certain revision".
922 """
919 """
923
920
924 msrc = srcctx.manifest()
921 msrc = srcctx.manifest()
925 mdst = dstctx.manifest()
922 mdst = dstctx.manifest()
926 mb = base.manifest()
923 mb = base.manifest()
927 mta = tca.manifest()
924 mta = tca.manifest()
928 # Might be true if this call is about finding backward renames,
925 # Might be true if this call is about finding backward renames,
929 # This happens in the case of grafts because the DAG is then rotated.
926 # This happens in the case of grafts because the DAG is then rotated.
930 # If the file exists in both the base and the source, we are not looking
927 # If the file exists in both the base and the source, we are not looking
931 # for a rename on the source side, but on the part of the DAG that is
928 # for a rename on the source side, but on the part of the DAG that is
932 # traversed backwards.
929 # traversed backwards.
933 #
930 #
934 # In the case there is both backward and forward renames (before and after
931 # In the case there is both backward and forward renames (before and after
935 # the base) this is more complicated as we must detect a divergence.
932 # the base) this is more complicated as we must detect a divergence.
936 # We use 'backwards = False' in that case.
933 # We use 'backwards = False' in that case.
937 backwards = not remotebase and base != tca and f in mb
934 backwards = not remotebase and base != tca and f in mb
938 getsrcfctx = _makegetfctx(srcctx)
935 getsrcfctx = _makegetfctx(srcctx)
939 getdstfctx = _makegetfctx(dstctx)
936 getdstfctx = _makegetfctx(dstctx)
940
937
941 if msrc[f] == mb.get(f) and not remotebase:
938 if msrc[f] == mb.get(f) and not remotebase:
942 # Nothing to merge
939 # Nothing to merge
943 return
940 return
944
941
945 of = None
942 of = None
946 seen = {f}
943 seen = {f}
947 for oc in getsrcfctx(f, msrc[f]).ancestors():
944 for oc in getsrcfctx(f, msrc[f]).ancestors():
948 of = oc.path()
945 of = oc.path()
949 if of in seen:
946 if of in seen:
950 # check limit late - grab last rename before
947 # check limit late - grab last rename before
951 if oc.linkrev() < limit:
948 if oc.linkrev() < limit:
952 break
949 break
953 continue
950 continue
954 seen.add(of)
951 seen.add(of)
955
952
956 # remember for dir rename detection
953 # remember for dir rename detection
957 if backwards:
954 if backwards:
958 data['fullcopy'][of] = f # grafting backwards through renames
955 data['fullcopy'][of] = f # grafting backwards through renames
959 else:
956 else:
960 data['fullcopy'][f] = of
957 data['fullcopy'][f] = of
961 if of not in mdst:
958 if of not in mdst:
962 continue # no match, keep looking
959 continue # no match, keep looking
963 if mdst[of] == mb.get(of):
960 if mdst[of] == mb.get(of):
964 return # no merge needed, quit early
961 return # no merge needed, quit early
965 c2 = getdstfctx(of, mdst[of])
962 c2 = getdstfctx(of, mdst[of])
966 # c2 might be a plain new file on added on destination side that is
963 # c2 might be a plain new file on added on destination side that is
967 # unrelated to the droids we are looking for.
964 # unrelated to the droids we are looking for.
968 cr = _related(oc, c2)
965 cr = _related(oc, c2)
969 if cr and (of == f or of == c2.path()): # non-divergent
966 if cr and (of == f or of == c2.path()): # non-divergent
970 if backwards:
967 if backwards:
971 data['copy'][of] = f
968 data['copy'][of] = f
972 elif of in mb:
969 elif of in mb:
973 data['copy'][f] = of
970 data['copy'][f] = of
974 elif remotebase: # special case: a <- b <- a -> b "ping-pong" rename
971 elif remotebase: # special case: a <- b <- a -> b "ping-pong" rename
975 data['copy'][of] = f
972 data['copy'][of] = f
976 del data['fullcopy'][f]
973 del data['fullcopy'][f]
977 data['fullcopy'][of] = f
974 data['fullcopy'][of] = f
978 else: # divergence w.r.t. graft CA on one side of topological CA
975 else: # divergence w.r.t. graft CA on one side of topological CA
979 for sf in seen:
976 for sf in seen:
980 if sf in mb:
977 if sf in mb:
981 assert sf not in data['diverge']
978 assert sf not in data['diverge']
982 data['diverge'][sf] = [f, of]
979 data['diverge'][sf] = [f, of]
983 break
980 break
984 return
981 return
985
982
986 if of in mta:
983 if of in mta:
987 if backwards or remotebase:
984 if backwards or remotebase:
988 data['incomplete'][of] = f
985 data['incomplete'][of] = f
989 else:
986 else:
990 for sf in seen:
987 for sf in seen:
991 if sf in mb:
988 if sf in mb:
992 if tca == base:
989 if tca == base:
993 data['diverge'].setdefault(sf, []).append(f)
990 data['diverge'].setdefault(sf, []).append(f)
994 else:
991 else:
995 data['incompletediverge'][sf] = [of, f]
992 data['incompletediverge'][sf] = [of, f]
996 return
993 return
997
994
998 def duplicatecopies(repo, wctx, rev, fromrev, skiprev=None):
995 def duplicatecopies(repo, wctx, rev, fromrev, skiprev=None):
999 """reproduce copies from fromrev to rev in the dirstate
996 """reproduce copies from fromrev to rev in the dirstate
1000
997
1001 If skiprev is specified, it's a revision that should be used to
998 If skiprev is specified, it's a revision that should be used to
1002 filter copy records. Any copies that occur between fromrev and
999 filter copy records. Any copies that occur between fromrev and
1003 skiprev will not be duplicated, even if they appear in the set of
1000 skiprev will not be duplicated, even if they appear in the set of
1004 copies between fromrev and rev.
1001 copies between fromrev and rev.
1005 """
1002 """
1006 exclude = {}
1003 exclude = {}
1007 ctraceconfig = repo.ui.config('experimental', 'copytrace')
1004 ctraceconfig = repo.ui.config('experimental', 'copytrace')
1008 bctrace = stringutil.parsebool(ctraceconfig)
1005 bctrace = stringutil.parsebool(ctraceconfig)
1009 if (skiprev is not None and
1006 if (skiprev is not None and
1010 (ctraceconfig == 'heuristics' or bctrace or bctrace is None)):
1007 (ctraceconfig == 'heuristics' or bctrace or bctrace is None)):
1011 # copytrace='off' skips this line, but not the entire function because
1008 # copytrace='off' skips this line, but not the entire function because
1012 # the line below is O(size of the repo) during a rebase, while the rest
1009 # the line below is O(size of the repo) during a rebase, while the rest
1013 # of the function is much faster (and is required for carrying copy
1010 # of the function is much faster (and is required for carrying copy
1014 # metadata across the rebase anyway).
1011 # metadata across the rebase anyway).
1015 exclude = pathcopies(repo[fromrev], repo[skiprev])
1012 exclude = pathcopies(repo[fromrev], repo[skiprev])
1016 for dst, src in pathcopies(repo[fromrev], repo[rev]).iteritems():
1013 for dst, src in pathcopies(repo[fromrev], repo[rev]).iteritems():
1017 # copies.pathcopies returns backward renames, so dst might not
1014 # copies.pathcopies returns backward renames, so dst might not
1018 # actually be in the dirstate
1015 # actually be in the dirstate
1019 if dst in exclude:
1016 if dst in exclude:
1020 continue
1017 continue
1021 wctx[dst].markcopied(src)
1018 wctx[dst].markcopied(src)
@@ -1,2405 +1,2403 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 unmatched files in local:
202 unmatched files in local:
203 b
203 b
204 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
204 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
205 src: 'a' -> dst: 'b' *
205 src: 'a' -> dst: 'b' *
206 checking for directory renames
206 checking for directory renames
207 resolving manifests
207 resolving manifests
208 branchmerge: True, force: True, partial: False
208 branchmerge: True, force: True, partial: False
209 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
209 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
210 preserving b for resolve of b
210 preserving b for resolve of b
211 starting 4 threads for background file closing (?)
211 starting 4 threads for background file closing (?)
212 b: local copied/moved from a -> m (premerge)
212 b: local copied/moved from a -> m (premerge)
213 picked tool ':merge' for b (binary False symlink False changedelete False)
213 picked tool ':merge' for b (binary False symlink False changedelete False)
214 merging b and a to b
214 merging b and a to b
215 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
215 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
216 premerge successful
216 premerge successful
217 committing files:
217 committing files:
218 b
218 b
219 committing manifest
219 committing manifest
220 committing changelog
220 committing changelog
221 updating the branch cache
221 updating the branch cache
222 grafting 5:97f8bfe72746 "5"
222 grafting 5:97f8bfe72746 "5"
223 resolving manifests
223 resolving manifests
224 branchmerge: True, force: True, partial: False
224 branchmerge: True, force: True, partial: False
225 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
225 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
226 e: remote is newer -> g
226 e: remote is newer -> g
227 getting e
227 getting e
228 committing files:
228 committing files:
229 e
229 e
230 committing manifest
230 committing manifest
231 committing changelog
231 committing changelog
232 updating the branch cache
232 updating the branch cache
233 $ HGEDITOR=cat hg graft 4 3 --log --debug
233 $ HGEDITOR=cat hg graft 4 3 --log --debug
234 scanning for duplicate grafts
234 scanning for duplicate grafts
235 grafting 4:9c233e8e184d "4"
235 grafting 4:9c233e8e184d "4"
236 resolving manifests
236 resolving manifests
237 branchmerge: True, force: True, partial: False
237 branchmerge: True, force: True, partial: False
238 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
238 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
239 preserving e for resolve of e
239 preserving e for resolve of e
240 d: remote is newer -> g
240 d: remote is newer -> g
241 getting d
241 getting d
242 e: versions differ -> m (premerge)
242 e: versions differ -> m (premerge)
243 picked tool ':merge' for e (binary False symlink False changedelete False)
243 picked tool ':merge' for e (binary False symlink False changedelete False)
244 merging e
244 merging e
245 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
245 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
246 e: versions differ -> m (merge)
246 e: versions differ -> m (merge)
247 picked tool ':merge' for e (binary False symlink False changedelete False)
247 picked tool ':merge' for e (binary False symlink False changedelete False)
248 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
248 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
249 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
249 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
250 abort: unresolved conflicts, can't continue
250 abort: unresolved conflicts, can't continue
251 (use 'hg resolve' and 'hg graft --continue')
251 (use 'hg resolve' and 'hg graft --continue')
252 [255]
252 [255]
253
253
254 Summary should mention graft:
254 Summary should mention graft:
255
255
256 $ hg summary |grep graft
256 $ hg summary |grep graft
257 commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
257 commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
258
258
259 Using status to get more context
259 Using status to get more context
260
260
261 $ hg status --verbose
261 $ hg status --verbose
262 M d
262 M d
263 M e
263 M e
264 ? a.orig
264 ? a.orig
265 ? e.orig
265 ? e.orig
266 # The repository is in an unfinished *graft* state.
266 # The repository is in an unfinished *graft* state.
267
267
268 # Unresolved merge conflicts:
268 # Unresolved merge conflicts:
269 #
269 #
270 # e
270 # e
271 #
271 #
272 # To mark files as resolved: hg resolve --mark FILE
272 # To mark files as resolved: hg resolve --mark FILE
273
273
274 # To continue: hg graft --continue
274 # To continue: hg graft --continue
275 # To abort: hg graft --abort
275 # To abort: hg graft --abort
276
276
277
277
278 Commit while interrupted should fail:
278 Commit while interrupted should fail:
279
279
280 $ hg ci -m 'commit interrupted graft'
280 $ hg ci -m 'commit interrupted graft'
281 abort: graft in progress
281 abort: graft in progress
282 (use 'hg graft --continue' or 'hg graft --stop' to stop)
282 (use 'hg graft --continue' or 'hg graft --stop' to stop)
283 [255]
283 [255]
284
284
285 Abort the graft and try committing:
285 Abort the graft and try committing:
286
286
287 $ hg up -C .
287 $ hg up -C .
288 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
289 $ echo c >> e
289 $ echo c >> e
290 $ hg ci -mtest
290 $ hg ci -mtest
291
291
292 $ hg strip . --config extensions.strip=
292 $ hg strip . --config extensions.strip=
293 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
293 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
294 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
294 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
295
295
296 Graft again:
296 Graft again:
297
297
298 $ hg graft 1 5 4 3 'merge()' 2
298 $ hg graft 1 5 4 3 'merge()' 2
299 skipping ungraftable merge revision 6
299 skipping ungraftable merge revision 6
300 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
300 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
301 skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e)
301 skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e)
302 skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec)
302 skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec)
303 grafting 4:9c233e8e184d "4"
303 grafting 4:9c233e8e184d "4"
304 merging e
304 merging e
305 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
305 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
306 abort: unresolved conflicts, can't continue
306 abort: unresolved conflicts, can't continue
307 (use 'hg resolve' and 'hg graft --continue')
307 (use 'hg resolve' and 'hg graft --continue')
308 [255]
308 [255]
309
309
310 Continue without resolve should fail:
310 Continue without resolve should fail:
311
311
312 $ hg graft -c
312 $ hg graft -c
313 grafting 4:9c233e8e184d "4"
313 grafting 4:9c233e8e184d "4"
314 abort: unresolved merge conflicts (see 'hg help resolve')
314 abort: unresolved merge conflicts (see 'hg help resolve')
315 [255]
315 [255]
316
316
317 Fix up:
317 Fix up:
318
318
319 $ echo b > e
319 $ echo b > e
320 $ hg resolve -m e
320 $ hg resolve -m e
321 (no more unresolved files)
321 (no more unresolved files)
322 continue: hg graft --continue
322 continue: hg graft --continue
323
323
324 Continue with a revision should fail:
324 Continue with a revision should fail:
325
325
326 $ hg graft -c 6
326 $ hg graft -c 6
327 abort: can't specify --continue and revisions
327 abort: can't specify --continue and revisions
328 [255]
328 [255]
329
329
330 $ hg graft -c -r 6
330 $ hg graft -c -r 6
331 abort: can't specify --continue and revisions
331 abort: can't specify --continue and revisions
332 [255]
332 [255]
333
333
334 Continue for real, clobber usernames
334 Continue for real, clobber usernames
335
335
336 $ hg graft -c -U
336 $ hg graft -c -U
337 grafting 4:9c233e8e184d "4"
337 grafting 4:9c233e8e184d "4"
338 grafting 3:4c60f11aa304 "3"
338 grafting 3:4c60f11aa304 "3"
339
339
340 Compare with original:
340 Compare with original:
341
341
342 $ hg diff -r 6
342 $ hg diff -r 6
343 $ hg status --rev 0:. -C
343 $ hg status --rev 0:. -C
344 M d
344 M d
345 M e
345 M e
346 A b
346 A b
347 a
347 a
348 A c
348 A c
349 a
349 a
350 R a
350 R a
351
351
352 View graph:
352 View graph:
353
353
354 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
354 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
355 @ test@11.draft: 3
355 @ test@11.draft: 3
356 |
356 |
357 o test@10.draft: 4
357 o test@10.draft: 4
358 |
358 |
359 o test@9.draft: 5
359 o test@9.draft: 5
360 |
360 |
361 o bar@8.draft: 1
361 o bar@8.draft: 1
362 |
362 |
363 o foo@7.draft: 2
363 o foo@7.draft: 2
364 |
364 |
365 | o test@6.secret: 6
365 | o test@6.secret: 6
366 | |\
366 | |\
367 | | o test@5.draft: 5
367 | | o test@5.draft: 5
368 | | |
368 | | |
369 | o | test@4.draft: 4
369 | o | test@4.draft: 4
370 | |/
370 | |/
371 | o baz@3.public: 3
371 | o baz@3.public: 3
372 | |
372 | |
373 | o test@2.public: 2
373 | o test@2.public: 2
374 | |
374 | |
375 | o bar@1.public: 1
375 | o bar@1.public: 1
376 |/
376 |/
377 o test@0.public: 0
377 o test@0.public: 0
378
378
379 Graft again onto another branch should preserve the original source
379 Graft again onto another branch should preserve the original source
380 $ hg up -q 0
380 $ hg up -q 0
381 $ echo 'g'>g
381 $ echo 'g'>g
382 $ hg add g
382 $ hg add g
383 $ hg ci -m 7
383 $ hg ci -m 7
384 created new head
384 created new head
385 $ hg graft 7
385 $ hg graft 7
386 grafting 7:ef0ef43d49e7 "2"
386 grafting 7:ef0ef43d49e7 "2"
387
387
388 $ hg log -r 7 --template '{rev}:{node}\n'
388 $ hg log -r 7 --template '{rev}:{node}\n'
389 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
389 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
390 $ hg log -r 2 --template '{rev}:{node}\n'
390 $ hg log -r 2 --template '{rev}:{node}\n'
391 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
391 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
392
392
393 $ hg log --debug -r tip
393 $ hg log --debug -r tip
394 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
394 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
395 tag: tip
395 tag: tip
396 phase: draft
396 phase: draft
397 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
397 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
398 parent: -1:0000000000000000000000000000000000000000
398 parent: -1:0000000000000000000000000000000000000000
399 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
399 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
400 user: foo
400 user: foo
401 date: Thu Jan 01 00:00:00 1970 +0000
401 date: Thu Jan 01 00:00:00 1970 +0000
402 files+: b
402 files+: b
403 files-: a
403 files-: a
404 extra: branch=default
404 extra: branch=default
405 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
405 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
406 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
406 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
407 description:
407 description:
408 2
408 2
409
409
410
410
411 Disallow grafting an already grafted cset onto its original branch
411 Disallow grafting an already grafted cset onto its original branch
412 $ hg up -q 6
412 $ hg up -q 6
413 $ hg graft 7
413 $ hg graft 7
414 skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f)
414 skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f)
415 [255]
415 [255]
416
416
417 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13
417 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13
418 --- */hg-5c095ad7e90f.patch * (glob)
418 --- */hg-5c095ad7e90f.patch * (glob)
419 +++ */hg-7a4785234d87.patch * (glob)
419 +++ */hg-7a4785234d87.patch * (glob)
420 @@ -1,18 +1,18 @@
420 @@ -1,18 +1,18 @@
421 # HG changeset patch
421 # HG changeset patch
422 -# User test
422 -# User test
423 +# User foo
423 +# User foo
424 # Date 0 0
424 # Date 0 0
425 # Thu Jan 01 00:00:00 1970 +0000
425 # Thu Jan 01 00:00:00 1970 +0000
426 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
426 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
427 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
427 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
428 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
428 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
429 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
429 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
430 2
430 2
431
431
432 -diff -r 5d205f8b35b6 -r 5c095ad7e90f a
432 -diff -r 5d205f8b35b6 -r 5c095ad7e90f a
433 +diff -r b592ea63bb0c -r 7a4785234d87 a
433 +diff -r b592ea63bb0c -r 7a4785234d87 a
434 --- a/a Thu Jan 01 00:00:00 1970 +0000
434 --- a/a Thu Jan 01 00:00:00 1970 +0000
435 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
435 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
436 @@ -1,1 +0,0 @@
436 @@ -1,1 +0,0 @@
437 --b
437 --b
438 -diff -r 5d205f8b35b6 -r 5c095ad7e90f b
438 -diff -r 5d205f8b35b6 -r 5c095ad7e90f b
439 +-a
439 +-a
440 +diff -r b592ea63bb0c -r 7a4785234d87 b
440 +diff -r b592ea63bb0c -r 7a4785234d87 b
441 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
441 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
442 +++ b/b Thu Jan 01 00:00:00 1970 +0000
442 +++ b/b Thu Jan 01 00:00:00 1970 +0000
443 @@ -0,0 +1,1 @@
443 @@ -0,0 +1,1 @@
444 -+b
444 -+b
445 ++a
445 ++a
446 [1]
446 [1]
447
447
448 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X .
448 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X .
449 --- */hg-5c095ad7e90f.patch * (glob)
449 --- */hg-5c095ad7e90f.patch * (glob)
450 +++ */hg-7a4785234d87.patch * (glob)
450 +++ */hg-7a4785234d87.patch * (glob)
451 @@ -1,8 +1,8 @@
451 @@ -1,8 +1,8 @@
452 # HG changeset patch
452 # HG changeset patch
453 -# User test
453 -# User test
454 +# User foo
454 +# User foo
455 # Date 0 0
455 # Date 0 0
456 # Thu Jan 01 00:00:00 1970 +0000
456 # Thu Jan 01 00:00:00 1970 +0000
457 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
457 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
458 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
458 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
459 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
459 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
460 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
460 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
461 2
461 2
462
462
463 [1]
463 [1]
464
464
465 Disallow grafting already grafted csets with the same origin onto each other
465 Disallow grafting already grafted csets with the same origin onto each other
466 $ hg up -q 13
466 $ hg up -q 13
467 $ hg graft 2
467 $ hg graft 2
468 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
468 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
469 [255]
469 [255]
470 $ hg graft 7
470 $ hg graft 7
471 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
471 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
472 [255]
472 [255]
473
473
474 $ hg up -q 7
474 $ hg up -q 7
475 $ hg graft 2
475 $ hg graft 2
476 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
476 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
477 [255]
477 [255]
478 $ hg graft tip
478 $ hg graft tip
479 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
479 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
480 [255]
480 [255]
481
481
482 Graft with --log
482 Graft with --log
483
483
484 $ hg up -Cq 1
484 $ hg up -Cq 1
485 $ hg graft 3 --log -u foo
485 $ hg graft 3 --log -u foo
486 grafting 3:4c60f11aa304 "3"
486 grafting 3:4c60f11aa304 "3"
487 warning: can't find ancestor for 'c' copied from 'b'!
487 warning: can't find ancestor for 'c' copied from 'b'!
488 $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
488 $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
489 14:0c921c65ef1e 1:5d205f8b35b6 3
489 14:0c921c65ef1e 1:5d205f8b35b6 3
490 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
490 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
491
491
492 Resolve conflicted graft
492 Resolve conflicted graft
493 $ hg up -q 0
493 $ hg up -q 0
494 $ echo b > a
494 $ echo b > a
495 $ hg ci -m 8
495 $ hg ci -m 8
496 created new head
496 created new head
497 $ echo c > a
497 $ echo c > a
498 $ hg ci -m 9
498 $ hg ci -m 9
499 $ hg graft 1 --tool internal:fail
499 $ hg graft 1 --tool internal:fail
500 grafting 1:5d205f8b35b6 "1"
500 grafting 1:5d205f8b35b6 "1"
501 abort: unresolved conflicts, can't continue
501 abort: unresolved conflicts, can't continue
502 (use 'hg resolve' and 'hg graft --continue')
502 (use 'hg resolve' and 'hg graft --continue')
503 [255]
503 [255]
504 $ hg resolve --all
504 $ hg resolve --all
505 merging a
505 merging a
506 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
506 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
507 [1]
507 [1]
508 $ cat a
508 $ cat a
509 <<<<<<< local: aaa4406d4f0a - test: 9
509 <<<<<<< local: aaa4406d4f0a - test: 9
510 c
510 c
511 =======
511 =======
512 b
512 b
513 >>>>>>> graft: 5d205f8b35b6 - bar: 1
513 >>>>>>> graft: 5d205f8b35b6 - bar: 1
514 $ echo b > a
514 $ echo b > a
515 $ hg resolve -m a
515 $ hg resolve -m a
516 (no more unresolved files)
516 (no more unresolved files)
517 continue: hg graft --continue
517 continue: hg graft --continue
518 $ hg graft -c
518 $ hg graft -c
519 grafting 1:5d205f8b35b6 "1"
519 grafting 1:5d205f8b35b6 "1"
520 $ hg export tip --git
520 $ hg export tip --git
521 # HG changeset patch
521 # HG changeset patch
522 # User bar
522 # User bar
523 # Date 0 0
523 # Date 0 0
524 # Thu Jan 01 00:00:00 1970 +0000
524 # Thu Jan 01 00:00:00 1970 +0000
525 # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
525 # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
526 # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6
526 # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6
527 1
527 1
528
528
529 diff --git a/a b/a
529 diff --git a/a b/a
530 --- a/a
530 --- a/a
531 +++ b/a
531 +++ b/a
532 @@ -1,1 +1,1 @@
532 @@ -1,1 +1,1 @@
533 -c
533 -c
534 +b
534 +b
535
535
536 Resolve conflicted graft with rename
536 Resolve conflicted graft with rename
537 $ echo c > a
537 $ echo c > a
538 $ hg ci -m 10
538 $ hg ci -m 10
539 $ hg graft 2 --tool internal:fail
539 $ hg graft 2 --tool internal:fail
540 grafting 2:5c095ad7e90f "2"
540 grafting 2:5c095ad7e90f "2"
541 abort: unresolved conflicts, can't continue
541 abort: unresolved conflicts, can't continue
542 (use 'hg resolve' and 'hg graft --continue')
542 (use 'hg resolve' and 'hg graft --continue')
543 [255]
543 [255]
544 $ hg resolve --all
544 $ hg resolve --all
545 merging a and b to b
545 merging a and b to b
546 (no more unresolved files)
546 (no more unresolved files)
547 continue: hg graft --continue
547 continue: hg graft --continue
548 $ hg graft -c
548 $ hg graft -c
549 grafting 2:5c095ad7e90f "2"
549 grafting 2:5c095ad7e90f "2"
550 $ hg export tip --git
550 $ hg export tip --git
551 # HG changeset patch
551 # HG changeset patch
552 # User test
552 # User test
553 # Date 0 0
553 # Date 0 0
554 # Thu Jan 01 00:00:00 1970 +0000
554 # Thu Jan 01 00:00:00 1970 +0000
555 # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
555 # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
556 # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612
556 # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612
557 2
557 2
558
558
559 diff --git a/a b/b
559 diff --git a/a b/b
560 rename from a
560 rename from a
561 rename to b
561 rename to b
562
562
563 Test simple origin(), with and without args
563 Test simple origin(), with and without args
564 $ hg log -r 'origin()'
564 $ hg log -r 'origin()'
565 changeset: 1:5d205f8b35b6
565 changeset: 1:5d205f8b35b6
566 user: bar
566 user: bar
567 date: Thu Jan 01 00:00:00 1970 +0000
567 date: Thu Jan 01 00:00:00 1970 +0000
568 summary: 1
568 summary: 1
569
569
570 changeset: 2:5c095ad7e90f
570 changeset: 2:5c095ad7e90f
571 user: test
571 user: test
572 date: Thu Jan 01 00:00:00 1970 +0000
572 date: Thu Jan 01 00:00:00 1970 +0000
573 summary: 2
573 summary: 2
574
574
575 changeset: 3:4c60f11aa304
575 changeset: 3:4c60f11aa304
576 user: baz
576 user: baz
577 date: Thu Jan 01 00:00:00 1970 +0000
577 date: Thu Jan 01 00:00:00 1970 +0000
578 summary: 3
578 summary: 3
579
579
580 changeset: 4:9c233e8e184d
580 changeset: 4:9c233e8e184d
581 user: test
581 user: test
582 date: Thu Jan 01 00:00:00 1970 +0000
582 date: Thu Jan 01 00:00:00 1970 +0000
583 summary: 4
583 summary: 4
584
584
585 changeset: 5:97f8bfe72746
585 changeset: 5:97f8bfe72746
586 branch: stable
586 branch: stable
587 parent: 3:4c60f11aa304
587 parent: 3:4c60f11aa304
588 user: test
588 user: test
589 date: Thu Jan 01 00:00:00 1970 +0000
589 date: Thu Jan 01 00:00:00 1970 +0000
590 summary: 5
590 summary: 5
591
591
592 $ hg log -r 'origin(7)'
592 $ hg log -r 'origin(7)'
593 changeset: 2:5c095ad7e90f
593 changeset: 2:5c095ad7e90f
594 user: test
594 user: test
595 date: Thu Jan 01 00:00:00 1970 +0000
595 date: Thu Jan 01 00:00:00 1970 +0000
596 summary: 2
596 summary: 2
597
597
598 Now transplant a graft to test following through copies
598 Now transplant a graft to test following through copies
599 $ hg up -q 0
599 $ hg up -q 0
600 $ hg branch -q dev
600 $ hg branch -q dev
601 $ hg ci -qm "dev branch"
601 $ hg ci -qm "dev branch"
602 $ hg --config extensions.transplant= transplant -q 7
602 $ hg --config extensions.transplant= transplant -q 7
603 $ hg log -r 'origin(.)'
603 $ hg log -r 'origin(.)'
604 changeset: 2:5c095ad7e90f
604 changeset: 2:5c095ad7e90f
605 user: test
605 user: test
606 date: Thu Jan 01 00:00:00 1970 +0000
606 date: Thu Jan 01 00:00:00 1970 +0000
607 summary: 2
607 summary: 2
608
608
609 Test that the graft and transplant markers in extra are converted, allowing
609 Test that the graft and transplant markers in extra are converted, allowing
610 origin() to still work. Note that these recheck the immediately preceeding two
610 origin() to still work. Note that these recheck the immediately preceeding two
611 tests.
611 tests.
612 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
612 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
613
613
614 The graft case
614 The graft case
615 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
615 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
616 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
616 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
617 branch=default
617 branch=default
618 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
618 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
619 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
619 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
620 $ hg -R ../converted log -r 'origin(7)'
620 $ hg -R ../converted log -r 'origin(7)'
621 changeset: 2:e0213322b2c1
621 changeset: 2:e0213322b2c1
622 user: test
622 user: test
623 date: Thu Jan 01 00:00:00 1970 +0000
623 date: Thu Jan 01 00:00:00 1970 +0000
624 summary: 2
624 summary: 2
625
625
626 Test that template correctly expands more than one 'extra' (issue4362), and that
626 Test that template correctly expands more than one 'extra' (issue4362), and that
627 'intermediate-source' is converted.
627 'intermediate-source' is converted.
628 $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}"
628 $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}"
629 Extra: branch=default
629 Extra: branch=default
630 Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9
630 Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9
631 Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b
631 Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b
632 Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d
632 Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d
633
633
634 The transplant case
634 The transplant case
635 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
635 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
636 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
636 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
637 branch=dev
637 branch=dev
638 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
638 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
639 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b
639 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b
640 $ hg -R ../converted log -r 'origin(tip)'
640 $ hg -R ../converted log -r 'origin(tip)'
641 changeset: 2:e0213322b2c1
641 changeset: 2:e0213322b2c1
642 user: test
642 user: test
643 date: Thu Jan 01 00:00:00 1970 +0000
643 date: Thu Jan 01 00:00:00 1970 +0000
644 summary: 2
644 summary: 2
645
645
646
646
647 Test simple destination
647 Test simple destination
648 $ hg log -r 'destination()'
648 $ hg log -r 'destination()'
649 changeset: 7:ef0ef43d49e7
649 changeset: 7:ef0ef43d49e7
650 parent: 0:68795b066622
650 parent: 0:68795b066622
651 user: foo
651 user: foo
652 date: Thu Jan 01 00:00:00 1970 +0000
652 date: Thu Jan 01 00:00:00 1970 +0000
653 summary: 2
653 summary: 2
654
654
655 changeset: 8:6b9e5368ca4e
655 changeset: 8:6b9e5368ca4e
656 user: bar
656 user: bar
657 date: Thu Jan 01 00:00:00 1970 +0000
657 date: Thu Jan 01 00:00:00 1970 +0000
658 summary: 1
658 summary: 1
659
659
660 changeset: 9:1905859650ec
660 changeset: 9:1905859650ec
661 user: test
661 user: test
662 date: Thu Jan 01 00:00:00 1970 +0000
662 date: Thu Jan 01 00:00:00 1970 +0000
663 summary: 5
663 summary: 5
664
664
665 changeset: 10:52dc0b4c6907
665 changeset: 10:52dc0b4c6907
666 user: test
666 user: test
667 date: Thu Jan 01 00:00:00 1970 +0000
667 date: Thu Jan 01 00:00:00 1970 +0000
668 summary: 4
668 summary: 4
669
669
670 changeset: 11:882b35362a6b
670 changeset: 11:882b35362a6b
671 user: test
671 user: test
672 date: Thu Jan 01 00:00:00 1970 +0000
672 date: Thu Jan 01 00:00:00 1970 +0000
673 summary: 3
673 summary: 3
674
674
675 changeset: 13:7a4785234d87
675 changeset: 13:7a4785234d87
676 user: foo
676 user: foo
677 date: Thu Jan 01 00:00:00 1970 +0000
677 date: Thu Jan 01 00:00:00 1970 +0000
678 summary: 2
678 summary: 2
679
679
680 changeset: 14:0c921c65ef1e
680 changeset: 14:0c921c65ef1e
681 parent: 1:5d205f8b35b6
681 parent: 1:5d205f8b35b6
682 user: foo
682 user: foo
683 date: Thu Jan 01 00:00:00 1970 +0000
683 date: Thu Jan 01 00:00:00 1970 +0000
684 summary: 3
684 summary: 3
685
685
686 changeset: 17:f67661df0c48
686 changeset: 17:f67661df0c48
687 user: bar
687 user: bar
688 date: Thu Jan 01 00:00:00 1970 +0000
688 date: Thu Jan 01 00:00:00 1970 +0000
689 summary: 1
689 summary: 1
690
690
691 changeset: 19:9627f653b421
691 changeset: 19:9627f653b421
692 user: test
692 user: test
693 date: Thu Jan 01 00:00:00 1970 +0000
693 date: Thu Jan 01 00:00:00 1970 +0000
694 summary: 2
694 summary: 2
695
695
696 changeset: 21:7e61b508e709
696 changeset: 21:7e61b508e709
697 branch: dev
697 branch: dev
698 tag: tip
698 tag: tip
699 user: foo
699 user: foo
700 date: Thu Jan 01 00:00:00 1970 +0000
700 date: Thu Jan 01 00:00:00 1970 +0000
701 summary: 2
701 summary: 2
702
702
703 $ hg log -r 'destination(2)'
703 $ hg log -r 'destination(2)'
704 changeset: 7:ef0ef43d49e7
704 changeset: 7:ef0ef43d49e7
705 parent: 0:68795b066622
705 parent: 0:68795b066622
706 user: foo
706 user: foo
707 date: Thu Jan 01 00:00:00 1970 +0000
707 date: Thu Jan 01 00:00:00 1970 +0000
708 summary: 2
708 summary: 2
709
709
710 changeset: 13:7a4785234d87
710 changeset: 13:7a4785234d87
711 user: foo
711 user: foo
712 date: Thu Jan 01 00:00:00 1970 +0000
712 date: Thu Jan 01 00:00:00 1970 +0000
713 summary: 2
713 summary: 2
714
714
715 changeset: 19:9627f653b421
715 changeset: 19:9627f653b421
716 user: test
716 user: test
717 date: Thu Jan 01 00:00:00 1970 +0000
717 date: Thu Jan 01 00:00:00 1970 +0000
718 summary: 2
718 summary: 2
719
719
720 changeset: 21:7e61b508e709
720 changeset: 21:7e61b508e709
721 branch: dev
721 branch: dev
722 tag: tip
722 tag: tip
723 user: foo
723 user: foo
724 date: Thu Jan 01 00:00:00 1970 +0000
724 date: Thu Jan 01 00:00:00 1970 +0000
725 summary: 2
725 summary: 2
726
726
727 Transplants of grafts can find a destination...
727 Transplants of grafts can find a destination...
728 $ hg log -r 'destination(7)'
728 $ hg log -r 'destination(7)'
729 changeset: 21:7e61b508e709
729 changeset: 21:7e61b508e709
730 branch: dev
730 branch: dev
731 tag: tip
731 tag: tip
732 user: foo
732 user: foo
733 date: Thu Jan 01 00:00:00 1970 +0000
733 date: Thu Jan 01 00:00:00 1970 +0000
734 summary: 2
734 summary: 2
735
735
736 ... grafts of grafts unfortunately can't
736 ... grafts of grafts unfortunately can't
737 $ hg graft -q 13 --debug
737 $ hg graft -q 13 --debug
738 scanning for duplicate grafts
738 scanning for duplicate grafts
739 grafting 13:7a4785234d87 "2"
739 grafting 13:7a4785234d87 "2"
740 unmatched files new in both:
741 b
742 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
740 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
743 src: 'a' -> dst: 'b' *
741 src: 'a' -> dst: 'b' *
744 checking for directory renames
742 checking for directory renames
745 resolving manifests
743 resolving manifests
746 branchmerge: True, force: True, partial: False
744 branchmerge: True, force: True, partial: False
747 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
745 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
748 starting 4 threads for background file closing (?)
746 starting 4 threads for background file closing (?)
749 committing files:
747 committing files:
750 b
748 b
751 warning: can't find ancestor for 'b' copied from 'a'!
749 warning: can't find ancestor for 'b' copied from 'a'!
752 reusing manifest form p1 (listed files actually unchanged)
750 reusing manifest form p1 (listed files actually unchanged)
753 committing changelog
751 committing changelog
754 updating the branch cache
752 updating the branch cache
755 $ hg log -r 'destination(13)'
753 $ hg log -r 'destination(13)'
756 All copies of a cset
754 All copies of a cset
757 $ hg log -r 'origin(13) or destination(origin(13))'
755 $ hg log -r 'origin(13) or destination(origin(13))'
758 changeset: 2:5c095ad7e90f
756 changeset: 2:5c095ad7e90f
759 user: test
757 user: test
760 date: Thu Jan 01 00:00:00 1970 +0000
758 date: Thu Jan 01 00:00:00 1970 +0000
761 summary: 2
759 summary: 2
762
760
763 changeset: 7:ef0ef43d49e7
761 changeset: 7:ef0ef43d49e7
764 parent: 0:68795b066622
762 parent: 0:68795b066622
765 user: foo
763 user: foo
766 date: Thu Jan 01 00:00:00 1970 +0000
764 date: Thu Jan 01 00:00:00 1970 +0000
767 summary: 2
765 summary: 2
768
766
769 changeset: 13:7a4785234d87
767 changeset: 13:7a4785234d87
770 user: foo
768 user: foo
771 date: Thu Jan 01 00:00:00 1970 +0000
769 date: Thu Jan 01 00:00:00 1970 +0000
772 summary: 2
770 summary: 2
773
771
774 changeset: 19:9627f653b421
772 changeset: 19:9627f653b421
775 user: test
773 user: test
776 date: Thu Jan 01 00:00:00 1970 +0000
774 date: Thu Jan 01 00:00:00 1970 +0000
777 summary: 2
775 summary: 2
778
776
779 changeset: 21:7e61b508e709
777 changeset: 21:7e61b508e709
780 branch: dev
778 branch: dev
781 user: foo
779 user: foo
782 date: Thu Jan 01 00:00:00 1970 +0000
780 date: Thu Jan 01 00:00:00 1970 +0000
783 summary: 2
781 summary: 2
784
782
785 changeset: 22:3a4e92d81b97
783 changeset: 22:3a4e92d81b97
786 branch: dev
784 branch: dev
787 tag: tip
785 tag: tip
788 user: foo
786 user: foo
789 date: Thu Jan 01 00:00:00 1970 +0000
787 date: Thu Jan 01 00:00:00 1970 +0000
790 summary: 2
788 summary: 2
791
789
792
790
793 graft works on complex revset
791 graft works on complex revset
794
792
795 $ hg graft 'origin(13) or destination(origin(13))'
793 $ hg graft 'origin(13) or destination(origin(13))'
796 skipping ancestor revision 21:7e61b508e709
794 skipping ancestor revision 21:7e61b508e709
797 skipping ancestor revision 22:3a4e92d81b97
795 skipping ancestor revision 22:3a4e92d81b97
798 skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97)
796 skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97)
799 grafting 7:ef0ef43d49e7 "2"
797 grafting 7:ef0ef43d49e7 "2"
800 warning: can't find ancestor for 'b' copied from 'a'!
798 warning: can't find ancestor for 'b' copied from 'a'!
801 grafting 13:7a4785234d87 "2"
799 grafting 13:7a4785234d87 "2"
802 warning: can't find ancestor for 'b' copied from 'a'!
800 warning: can't find ancestor for 'b' copied from 'a'!
803 grafting 19:9627f653b421 "2"
801 grafting 19:9627f653b421 "2"
804 merging b
802 merging b
805 warning: can't find ancestor for 'b' copied from 'a'!
803 warning: can't find ancestor for 'b' copied from 'a'!
806
804
807 graft with --force (still doesn't graft merges)
805 graft with --force (still doesn't graft merges)
808
806
809 $ hg graft 19 0 6
807 $ hg graft 19 0 6
810 skipping ungraftable merge revision 6
808 skipping ungraftable merge revision 6
811 skipping ancestor revision 0:68795b066622
809 skipping ancestor revision 0:68795b066622
812 skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f)
810 skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f)
813 [255]
811 [255]
814 $ hg graft 19 0 6 --force
812 $ hg graft 19 0 6 --force
815 skipping ungraftable merge revision 6
813 skipping ungraftable merge revision 6
816 grafting 19:9627f653b421 "2"
814 grafting 19:9627f653b421 "2"
817 merging b
815 merging b
818 warning: can't find ancestor for 'b' copied from 'a'!
816 warning: can't find ancestor for 'b' copied from 'a'!
819 grafting 0:68795b066622 "0"
817 grafting 0:68795b066622 "0"
820
818
821 graft --force after backout
819 graft --force after backout
822
820
823 $ echo abc > a
821 $ echo abc > a
824 $ hg ci -m 28
822 $ hg ci -m 28
825 $ hg backout 28
823 $ hg backout 28
826 reverting a
824 reverting a
827 changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d
825 changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d
828 $ hg graft 28
826 $ hg graft 28
829 skipping ancestor revision 28:cc20d29aec8d
827 skipping ancestor revision 28:cc20d29aec8d
830 [255]
828 [255]
831 $ hg graft 28 --force
829 $ hg graft 28 --force
832 grafting 28:cc20d29aec8d "28"
830 grafting 28:cc20d29aec8d "28"
833 merging a
831 merging a
834 $ cat a
832 $ cat a
835 abc
833 abc
836
834
837 graft --continue after --force
835 graft --continue after --force
838
836
839 $ echo def > a
837 $ echo def > a
840 $ hg ci -m 31
838 $ hg ci -m 31
841 $ hg graft 28 --force --tool internal:fail
839 $ hg graft 28 --force --tool internal:fail
842 grafting 28:cc20d29aec8d "28"
840 grafting 28:cc20d29aec8d "28"
843 abort: unresolved conflicts, can't continue
841 abort: unresolved conflicts, can't continue
844 (use 'hg resolve' and 'hg graft --continue')
842 (use 'hg resolve' and 'hg graft --continue')
845 [255]
843 [255]
846 $ hg resolve --all
844 $ hg resolve --all
847 merging a
845 merging a
848 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
846 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
849 [1]
847 [1]
850 $ echo abc > a
848 $ echo abc > a
851 $ hg resolve -m a
849 $ hg resolve -m a
852 (no more unresolved files)
850 (no more unresolved files)
853 continue: hg graft --continue
851 continue: hg graft --continue
854 $ hg graft -c
852 $ hg graft -c
855 grafting 28:cc20d29aec8d "28"
853 grafting 28:cc20d29aec8d "28"
856 $ cat a
854 $ cat a
857 abc
855 abc
858
856
859 Continue testing same origin policy, using revision numbers from test above
857 Continue testing same origin policy, using revision numbers from test above
860 but do some destructive editing of the repo:
858 but do some destructive editing of the repo:
861
859
862 $ hg up -qC 7
860 $ hg up -qC 7
863 $ hg tag -l -r 13 tmp
861 $ hg tag -l -r 13 tmp
864 $ hg --config extensions.strip= strip 2
862 $ hg --config extensions.strip= strip 2
865 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg
863 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg
866 $ hg graft tmp
864 $ hg graft tmp
867 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
865 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
868 [255]
866 [255]
869
867
870 Empty graft
868 Empty graft
871
869
872 $ hg up -qr 26
870 $ hg up -qr 26
873 $ hg tag -f something
871 $ hg tag -f something
874 $ hg graft -qr 27
872 $ hg graft -qr 27
875 $ hg graft -f 27
873 $ hg graft -f 27
876 grafting 27:17d42b8f5d50 "28"
874 grafting 27:17d42b8f5d50 "28"
877 note: graft of 27:17d42b8f5d50 created no changes to commit
875 note: graft of 27:17d42b8f5d50 created no changes to commit
878
876
879 $ cd ..
877 $ cd ..
880
878
881 Graft to duplicate a commit
879 Graft to duplicate a commit
882
880
883 $ hg init graftsibling
881 $ hg init graftsibling
884 $ cd graftsibling
882 $ cd graftsibling
885 $ touch a
883 $ touch a
886 $ hg commit -qAm a
884 $ hg commit -qAm a
887 $ touch b
885 $ touch b
888 $ hg commit -qAm b
886 $ hg commit -qAm b
889 $ hg log -G -T '{rev}\n'
887 $ hg log -G -T '{rev}\n'
890 @ 1
888 @ 1
891 |
889 |
892 o 0
890 o 0
893
891
894 $ hg up -q 0
892 $ hg up -q 0
895 $ hg graft -r 1
893 $ hg graft -r 1
896 grafting 1:0e067c57feba "b" (tip)
894 grafting 1:0e067c57feba "b" (tip)
897 $ hg log -G -T '{rev}\n'
895 $ hg log -G -T '{rev}\n'
898 @ 2
896 @ 2
899 |
897 |
900 | o 1
898 | o 1
901 |/
899 |/
902 o 0
900 o 0
903
901
904 Graft to duplicate a commit twice
902 Graft to duplicate a commit twice
905
903
906 $ hg up -q 0
904 $ hg up -q 0
907 $ hg graft -r 2
905 $ hg graft -r 2
908 grafting 2:044ec77f6389 "b" (tip)
906 grafting 2:044ec77f6389 "b" (tip)
909 $ hg log -G -T '{rev}\n'
907 $ hg log -G -T '{rev}\n'
910 @ 3
908 @ 3
911 |
909 |
912 | o 2
910 | o 2
913 |/
911 |/
914 | o 1
912 | o 1
915 |/
913 |/
916 o 0
914 o 0
917
915
918 Graft from behind a move or rename
916 Graft from behind a move or rename
919 ==================================
917 ==================================
920
918
921 NOTE: This is affected by issue5343, and will need updating when it's fixed
919 NOTE: This is affected by issue5343, and will need updating when it's fixed
922
920
923 Consider this topology for a regular graft:
921 Consider this topology for a regular graft:
924
922
925 o c1
923 o c1
926 |
924 |
927 | o c2
925 | o c2
928 | |
926 | |
929 | o ca # stands for "common ancestor"
927 | o ca # stands for "common ancestor"
930 |/
928 |/
931 o cta # stands for "common topological ancestor"
929 o cta # stands for "common topological ancestor"
932
930
933 Note that in issue5343, ca==cta.
931 Note that in issue5343, ca==cta.
934
932
935 The following table shows the possible cases. Here, "x->y" and, equivalently,
933 The following table shows the possible cases. Here, "x->y" and, equivalently,
936 "y<-x", where x is an ancestor of y, means that some copy happened from x to y.
934 "y<-x", where x is an ancestor of y, means that some copy happened from x to y.
937
935
938 name | c1<-cta | cta<->ca | ca->c2
936 name | c1<-cta | cta<->ca | ca->c2
939 A.0 | | |
937 A.0 | | |
940 A.1 | X | |
938 A.1 | X | |
941 A.2 | | X |
939 A.2 | | X |
942 A.3 | | | X
940 A.3 | | | X
943 A.4 | X | X |
941 A.4 | X | X |
944 A.5 | X | | X
942 A.5 | X | | X
945 A.6 | | X | X
943 A.6 | | X | X
946 A.7 | X | X | X
944 A.7 | X | X | X
947
945
948 A.0 is trivial, and doesn't need copy tracking.
946 A.0 is trivial, and doesn't need copy tracking.
949 For A.1, a forward rename is recorded in the c1 pass, to be followed later.
947 For A.1, a forward rename is recorded in the c1 pass, to be followed later.
950 In A.2, the rename is recorded in the c2 pass and followed backwards.
948 In A.2, the rename is recorded in the c2 pass and followed backwards.
951 A.3 is recorded in the c2 pass as a forward rename to be duplicated on target.
949 A.3 is recorded in the c2 pass as a forward rename to be duplicated on target.
952 In A.4, both passes of checkcopies record incomplete renames, which are
950 In A.4, both passes of checkcopies record incomplete renames, which are
953 then joined in mergecopies to record a rename to be followed.
951 then joined in mergecopies to record a rename to be followed.
954 In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass
952 In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass
955 records an incomplete divergence. The incomplete rename is then joined to the
953 records an incomplete divergence. The incomplete rename is then joined to the
956 appropriate side of the incomplete divergence, and the result is recorded as a
954 appropriate side of the incomplete divergence, and the result is recorded as a
957 divergence. The code doesn't distinguish at all between these two cases, since
955 divergence. The code doesn't distinguish at all between these two cases, since
958 the end result of them is the same: an incomplete divergence joined with an
956 the end result of them is the same: an incomplete divergence joined with an
959 incomplete rename into a divergence.
957 incomplete rename into a divergence.
960 Finally, A.6 records a divergence entirely in the c2 pass.
958 Finally, A.6 records a divergence entirely in the c2 pass.
961
959
962 A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all.
960 A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all.
963 A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge.
961 A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge.
964 A.5 has issue5343 as a special case.
962 A.5 has issue5343 as a special case.
965 A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious
963 A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious
966 incomplete divergence, which is in fact complete. This is handled later in
964 incomplete divergence, which is in fact complete. This is handled later in
967 mergecopies.
965 mergecopies.
968 A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b,
966 A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b,
969 a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting,
967 a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting,
970 the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base
968 the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base
971 case, a<-b<-c->a is treated the same as a<-b<-b->a).
969 case, a<-b<-c->a is treated the same as a<-b<-b->a).
972
970
973 f5a therefore tests the "ping-pong" rename case, where a file is renamed to the
971 f5a therefore tests the "ping-pong" rename case, where a file is renamed to the
974 same name on both branches, then the rename is backed out on one branch, and
972 same name on both branches, then the rename is backed out on one branch, and
975 the backout is grafted to the other branch. This creates a challenging rename
973 the backout is grafted to the other branch. This creates a challenging rename
976 sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft
974 sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft
977 source, respectively. Since rename detection will run on the c1 side for such a
975 source, respectively. Since rename detection will run on the c1 side for such a
978 sequence (as for technical reasons, we split the c1 and c2 sides not at the
976 sequence (as for technical reasons, we split the c1 and c2 sides not at the
979 graft CA, but rather at the topological CA), it will pick up a false rename,
977 graft CA, but rather at the topological CA), it will pick up a false rename,
980 and cause a spurious merge conflict. This false rename is always exactly the
978 and cause a spurious merge conflict. This false rename is always exactly the
981 reverse of the true rename that would be detected on the c2 side, so we can
979 reverse of the true rename that would be detected on the c2 side, so we can
982 correct for it by detecting this condition and reversing as necessary.
980 correct for it by detecting this condition and reversing as necessary.
983
981
984 First, set up the repository with commits to be grafted
982 First, set up the repository with commits to be grafted
985
983
986 $ hg init ../graftmove
984 $ hg init ../graftmove
987 $ cd ../graftmove
985 $ cd ../graftmove
988 $ echo c1a > f1a
986 $ echo c1a > f1a
989 $ echo c2a > f2a
987 $ echo c2a > f2a
990 $ echo c3a > f3a
988 $ echo c3a > f3a
991 $ echo c4a > f4a
989 $ echo c4a > f4a
992 $ echo c5a > f5a
990 $ echo c5a > f5a
993 $ hg ci -qAm A0
991 $ hg ci -qAm A0
994 $ hg mv f1a f1b
992 $ hg mv f1a f1b
995 $ hg mv f3a f3b
993 $ hg mv f3a f3b
996 $ hg mv f5a f5b
994 $ hg mv f5a f5b
997 $ hg ci -qAm B0
995 $ hg ci -qAm B0
998 $ echo c1c > f1b
996 $ echo c1c > f1b
999 $ hg mv f2a f2c
997 $ hg mv f2a f2c
1000 $ hg mv f5b f5a
998 $ hg mv f5b f5a
1001 $ echo c5c > f5a
999 $ echo c5c > f5a
1002 $ hg ci -qAm C0
1000 $ hg ci -qAm C0
1003 $ hg mv f3b f3d
1001 $ hg mv f3b f3d
1004 $ echo c4d > f4a
1002 $ echo c4d > f4a
1005 $ hg ci -qAm D0
1003 $ hg ci -qAm D0
1006 $ hg log -G
1004 $ hg log -G
1007 @ changeset: 3:b69f5839d2d9
1005 @ changeset: 3:b69f5839d2d9
1008 | tag: tip
1006 | tag: tip
1009 | user: test
1007 | user: test
1010 | date: Thu Jan 01 00:00:00 1970 +0000
1008 | date: Thu Jan 01 00:00:00 1970 +0000
1011 | summary: D0
1009 | summary: D0
1012 |
1010 |
1013 o changeset: 2:f58c7e2b28fa
1011 o changeset: 2:f58c7e2b28fa
1014 | user: test
1012 | user: test
1015 | date: Thu Jan 01 00:00:00 1970 +0000
1013 | date: Thu Jan 01 00:00:00 1970 +0000
1016 | summary: C0
1014 | summary: C0
1017 |
1015 |
1018 o changeset: 1:3d7bba921b5d
1016 o changeset: 1:3d7bba921b5d
1019 | user: test
1017 | user: test
1020 | date: Thu Jan 01 00:00:00 1970 +0000
1018 | date: Thu Jan 01 00:00:00 1970 +0000
1021 | summary: B0
1019 | summary: B0
1022 |
1020 |
1023 o changeset: 0:11f7a1b56675
1021 o changeset: 0:11f7a1b56675
1024 user: test
1022 user: test
1025 date: Thu Jan 01 00:00:00 1970 +0000
1023 date: Thu Jan 01 00:00:00 1970 +0000
1026 summary: A0
1024 summary: A0
1027
1025
1028
1026
1029 Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the
1027 Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the
1030 two renames actually converge to the same name (thus no actual divergence).
1028 two renames actually converge to the same name (thus no actual divergence).
1031
1029
1032 $ hg up -q 'desc("A0")'
1030 $ hg up -q 'desc("A0")'
1033 $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit
1031 $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit
1034 grafting 2:f58c7e2b28fa "C0"
1032 grafting 2:f58c7e2b28fa "C0"
1035 merging f1a and f1b to f1a
1033 merging f1a and f1b to f1a
1036 merging f5a
1034 merging f5a
1037 warning: can't find ancestor for 'f5a' copied from 'f5b'!
1035 warning: can't find ancestor for 'f5a' copied from 'f5b'!
1038 $ hg status --change .
1036 $ hg status --change .
1039 M f1a
1037 M f1a
1040 M f5a
1038 M f5a
1041 A f2c
1039 A f2c
1042 R f2a
1040 R f2a
1043 $ hg cat f1a
1041 $ hg cat f1a
1044 c1c
1042 c1c
1045 $ hg cat f1b
1043 $ hg cat f1b
1046 f1b: no such file in rev c9763722f9bd
1044 f1b: no such file in rev c9763722f9bd
1047 [1]
1045 [1]
1048
1046
1049 Test the cases A.0 (f4x) and A.6 (f3x)
1047 Test the cases A.0 (f4x) and A.6 (f3x)
1050
1048
1051 $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit
1049 $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit
1052 grafting 3:b69f5839d2d9 "D0"
1050 grafting 3:b69f5839d2d9 "D0"
1053 note: possible conflict - f3b was renamed multiple times to:
1051 note: possible conflict - f3b was renamed multiple times to:
1054 f3a
1052 f3a
1055 f3d
1053 f3d
1056 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1054 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1057
1055
1058 Set up the repository for some further tests
1056 Set up the repository for some further tests
1059
1057
1060 $ hg up -q "min(desc("A0"))"
1058 $ hg up -q "min(desc("A0"))"
1061 $ hg mv f1a f1e
1059 $ hg mv f1a f1e
1062 $ echo c2e > f2a
1060 $ echo c2e > f2a
1063 $ hg mv f3a f3e
1061 $ hg mv f3a f3e
1064 $ hg mv f4a f4e
1062 $ hg mv f4a f4e
1065 $ hg mv f5a f5b
1063 $ hg mv f5a f5b
1066 $ hg ci -qAm "E0"
1064 $ hg ci -qAm "E0"
1067 $ hg up -q "min(desc("A0"))"
1065 $ hg up -q "min(desc("A0"))"
1068 $ hg cp f1a f1f
1066 $ hg cp f1a f1f
1069 $ hg ci -qAm "F0"
1067 $ hg ci -qAm "F0"
1070 $ hg up -q "min(desc("A0"))"
1068 $ hg up -q "min(desc("A0"))"
1071 $ hg cp f1a f1g
1069 $ hg cp f1a f1g
1072 $ echo c1g > f1g
1070 $ echo c1g > f1g
1073 $ hg ci -qAm "G0"
1071 $ hg ci -qAm "G0"
1074 $ hg log -G
1072 $ hg log -G
1075 @ changeset: 8:ba67f08fb15a
1073 @ changeset: 8:ba67f08fb15a
1076 | tag: tip
1074 | tag: tip
1077 | parent: 0:11f7a1b56675
1075 | parent: 0:11f7a1b56675
1078 | user: test
1076 | user: test
1079 | date: Thu Jan 01 00:00:00 1970 +0000
1077 | date: Thu Jan 01 00:00:00 1970 +0000
1080 | summary: G0
1078 | summary: G0
1081 |
1079 |
1082 | o changeset: 7:d376ab0d7fda
1080 | o changeset: 7:d376ab0d7fda
1083 |/ parent: 0:11f7a1b56675
1081 |/ parent: 0:11f7a1b56675
1084 | user: test
1082 | user: test
1085 | date: Thu Jan 01 00:00:00 1970 +0000
1083 | date: Thu Jan 01 00:00:00 1970 +0000
1086 | summary: F0
1084 | summary: F0
1087 |
1085 |
1088 | o changeset: 6:6bd1736cab86
1086 | o changeset: 6:6bd1736cab86
1089 |/ parent: 0:11f7a1b56675
1087 |/ parent: 0:11f7a1b56675
1090 | user: test
1088 | user: test
1091 | date: Thu Jan 01 00:00:00 1970 +0000
1089 | date: Thu Jan 01 00:00:00 1970 +0000
1092 | summary: E0
1090 | summary: E0
1093 |
1091 |
1094 | o changeset: 5:560daee679da
1092 | o changeset: 5:560daee679da
1095 | | user: test
1093 | | user: test
1096 | | date: Thu Jan 01 00:00:00 1970 +0000
1094 | | date: Thu Jan 01 00:00:00 1970 +0000
1097 | | summary: D1
1095 | | summary: D1
1098 | |
1096 | |
1099 | o changeset: 4:c9763722f9bd
1097 | o changeset: 4:c9763722f9bd
1100 |/ parent: 0:11f7a1b56675
1098 |/ parent: 0:11f7a1b56675
1101 | user: test
1099 | user: test
1102 | date: Thu Jan 01 00:00:00 1970 +0000
1100 | date: Thu Jan 01 00:00:00 1970 +0000
1103 | summary: C1
1101 | summary: C1
1104 |
1102 |
1105 | o changeset: 3:b69f5839d2d9
1103 | o changeset: 3:b69f5839d2d9
1106 | | user: test
1104 | | user: test
1107 | | date: Thu Jan 01 00:00:00 1970 +0000
1105 | | date: Thu Jan 01 00:00:00 1970 +0000
1108 | | summary: D0
1106 | | summary: D0
1109 | |
1107 | |
1110 | o changeset: 2:f58c7e2b28fa
1108 | o changeset: 2:f58c7e2b28fa
1111 | | user: test
1109 | | user: test
1112 | | date: Thu Jan 01 00:00:00 1970 +0000
1110 | | date: Thu Jan 01 00:00:00 1970 +0000
1113 | | summary: C0
1111 | | summary: C0
1114 | |
1112 | |
1115 | o changeset: 1:3d7bba921b5d
1113 | o changeset: 1:3d7bba921b5d
1116 |/ user: test
1114 |/ user: test
1117 | date: Thu Jan 01 00:00:00 1970 +0000
1115 | date: Thu Jan 01 00:00:00 1970 +0000
1118 | summary: B0
1116 | summary: B0
1119 |
1117 |
1120 o changeset: 0:11f7a1b56675
1118 o changeset: 0:11f7a1b56675
1121 user: test
1119 user: test
1122 date: Thu Jan 01 00:00:00 1970 +0000
1120 date: Thu Jan 01 00:00:00 1970 +0000
1123 summary: A0
1121 summary: A0
1124
1122
1125
1123
1126 Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x),
1124 Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x),
1127 and A.3 with a local content change to be preserved (f2x).
1125 and A.3 with a local content change to be preserved (f2x).
1128
1126
1129 $ hg up -q "desc("E0")"
1127 $ hg up -q "desc("E0")"
1130 $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
1128 $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
1131 grafting 2:f58c7e2b28fa "C0"
1129 grafting 2:f58c7e2b28fa "C0"
1132 merging f1e and f1b to f1e
1130 merging f1e and f1b to f1e
1133 merging f2a and f2c to f2c
1131 merging f2a and f2c to f2c
1134 merging f5b and f5a to f5a
1132 merging f5b and f5a to f5a
1135
1133
1136 Test the cases A.1 (f4x) and A.7 (f3x).
1134 Test the cases A.1 (f4x) and A.7 (f3x).
1137
1135
1138 $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit
1136 $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit
1139 grafting 3:b69f5839d2d9 "D0"
1137 grafting 3:b69f5839d2d9 "D0"
1140 note: possible conflict - f3b was renamed multiple times to:
1138 note: possible conflict - f3b was renamed multiple times to:
1141 f3d
1139 f3d
1142 f3e
1140 f3e
1143 merging f4e and f4a to f4e
1141 merging f4e and f4a to f4e
1144 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1142 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1145
1143
1146 $ hg cat f2c
1144 $ hg cat f2c
1147 c2e
1145 c2e
1148
1146
1149 Test the case A.5 (move case, f1x).
1147 Test the case A.5 (move case, f1x).
1150
1148
1151 $ hg up -q "desc("C0")"
1149 $ hg up -q "desc("C0")"
1152 BROKEN: Shouldn't get the warning about missing ancestor
1150 BROKEN: Shouldn't get the warning about missing ancestor
1153 $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit
1151 $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit
1154 grafting 6:6bd1736cab86 "E0"
1152 grafting 6:6bd1736cab86 "E0"
1155 note: possible conflict - f1a was renamed multiple times to:
1153 note: possible conflict - f1a was renamed multiple times to:
1156 f1b
1154 f1b
1157 f1e
1155 f1e
1158 note: possible conflict - f3a was renamed multiple times to:
1156 note: possible conflict - f3a was renamed multiple times to:
1159 f3b
1157 f3b
1160 f3e
1158 f3e
1161 merging f2c and f2a to f2c
1159 merging f2c and f2a to f2c
1162 merging f5a and f5b to f5b
1160 merging f5a and f5b to f5b
1163 warning: can't find ancestor for 'f1e' copied from 'f1a'!
1161 warning: can't find ancestor for 'f1e' copied from 'f1a'!
1164 warning: can't find ancestor for 'f3e' copied from 'f3a'!
1162 warning: can't find ancestor for 'f3e' copied from 'f3a'!
1165 $ cat f1e
1163 $ cat f1e
1166 c1a
1164 c1a
1167
1165
1168 Test the case A.5 (copy case, f1x).
1166 Test the case A.5 (copy case, f1x).
1169
1167
1170 $ hg up -q "desc("C0")"
1168 $ hg up -q "desc("C0")"
1171 BROKEN: Shouldn't get the warning about missing ancestor
1169 BROKEN: Shouldn't get the warning about missing ancestor
1172 $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit
1170 $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit
1173 grafting 7:d376ab0d7fda "F0"
1171 grafting 7:d376ab0d7fda "F0"
1174 warning: can't find ancestor for 'f1f' copied from 'f1a'!
1172 warning: can't find ancestor for 'f1f' copied from 'f1a'!
1175 BROKEN: f1f should be marked a copy from f1b
1173 BROKEN: f1f should be marked a copy from f1b
1176 $ hg st --copies --change .
1174 $ hg st --copies --change .
1177 A f1f
1175 A f1f
1178 BROKEN: f1f should have the new content from f1b (i.e. "c1c")
1176 BROKEN: f1f should have the new content from f1b (i.e. "c1c")
1179 $ cat f1f
1177 $ cat f1f
1180 c1a
1178 c1a
1181
1179
1182 Test the case A.5 (copy+modify case, f1x).
1180 Test the case A.5 (copy+modify case, f1x).
1183
1181
1184 $ hg up -q "desc("C0")"
1182 $ hg up -q "desc("C0")"
1185 BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0
1183 BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0
1186 (content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content
1184 (content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content
1187 "c1a")
1185 "c1a")
1188 $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit
1186 $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit
1189 grafting 8:ba67f08fb15a "G0"
1187 grafting 8:ba67f08fb15a "G0"
1190 warning: can't find ancestor for 'f1g' copied from 'f1a'!
1188 warning: can't find ancestor for 'f1g' copied from 'f1a'!
1191
1189
1192 Check the results of the grafts tested
1190 Check the results of the grafts tested
1193
1191
1194 $ hg log -CGv --patch --git
1192 $ hg log -CGv --patch --git
1195 @ changeset: 13:ef3adf6c20a4
1193 @ changeset: 13:ef3adf6c20a4
1196 | tag: tip
1194 | tag: tip
1197 | parent: 2:f58c7e2b28fa
1195 | parent: 2:f58c7e2b28fa
1198 | user: test
1196 | user: test
1199 | date: Thu Jan 01 00:00:00 1970 +0000
1197 | date: Thu Jan 01 00:00:00 1970 +0000
1200 | files: f1g
1198 | files: f1g
1201 | description:
1199 | description:
1202 | G1
1200 | G1
1203 |
1201 |
1204 |
1202 |
1205 | diff --git a/f1g b/f1g
1203 | diff --git a/f1g b/f1g
1206 | new file mode 100644
1204 | new file mode 100644
1207 | --- /dev/null
1205 | --- /dev/null
1208 | +++ b/f1g
1206 | +++ b/f1g
1209 | @@ -0,0 +1,1 @@
1207 | @@ -0,0 +1,1 @@
1210 | +c1g
1208 | +c1g
1211 |
1209 |
1212 | o changeset: 12:b5542d755b54
1210 | o changeset: 12:b5542d755b54
1213 |/ parent: 2:f58c7e2b28fa
1211 |/ parent: 2:f58c7e2b28fa
1214 | user: test
1212 | user: test
1215 | date: Thu Jan 01 00:00:00 1970 +0000
1213 | date: Thu Jan 01 00:00:00 1970 +0000
1216 | files: f1f
1214 | files: f1f
1217 | description:
1215 | description:
1218 | F1
1216 | F1
1219 |
1217 |
1220 |
1218 |
1221 | diff --git a/f1f b/f1f
1219 | diff --git a/f1f b/f1f
1222 | new file mode 100644
1220 | new file mode 100644
1223 | --- /dev/null
1221 | --- /dev/null
1224 | +++ b/f1f
1222 | +++ b/f1f
1225 | @@ -0,0 +1,1 @@
1223 | @@ -0,0 +1,1 @@
1226 | +c1a
1224 | +c1a
1227 |
1225 |
1228 | o changeset: 11:f8a162271246
1226 | o changeset: 11:f8a162271246
1229 |/ parent: 2:f58c7e2b28fa
1227 |/ parent: 2:f58c7e2b28fa
1230 | user: test
1228 | user: test
1231 | date: Thu Jan 01 00:00:00 1970 +0000
1229 | date: Thu Jan 01 00:00:00 1970 +0000
1232 | files: f1e f2c f3e f4a f4e f5a f5b
1230 | files: f1e f2c f3e f4a f4e f5a f5b
1233 | copies: f4e (f4a) f5b (f5a)
1231 | copies: f4e (f4a) f5b (f5a)
1234 | description:
1232 | description:
1235 | E1
1233 | E1
1236 |
1234 |
1237 |
1235 |
1238 | diff --git a/f1e b/f1e
1236 | diff --git a/f1e b/f1e
1239 | new file mode 100644
1237 | new file mode 100644
1240 | --- /dev/null
1238 | --- /dev/null
1241 | +++ b/f1e
1239 | +++ b/f1e
1242 | @@ -0,0 +1,1 @@
1240 | @@ -0,0 +1,1 @@
1243 | +c1a
1241 | +c1a
1244 | diff --git a/f2c b/f2c
1242 | diff --git a/f2c b/f2c
1245 | --- a/f2c
1243 | --- a/f2c
1246 | +++ b/f2c
1244 | +++ b/f2c
1247 | @@ -1,1 +1,1 @@
1245 | @@ -1,1 +1,1 @@
1248 | -c2a
1246 | -c2a
1249 | +c2e
1247 | +c2e
1250 | diff --git a/f3e b/f3e
1248 | diff --git a/f3e b/f3e
1251 | new file mode 100644
1249 | new file mode 100644
1252 | --- /dev/null
1250 | --- /dev/null
1253 | +++ b/f3e
1251 | +++ b/f3e
1254 | @@ -0,0 +1,1 @@
1252 | @@ -0,0 +1,1 @@
1255 | +c3a
1253 | +c3a
1256 | diff --git a/f4a b/f4e
1254 | diff --git a/f4a b/f4e
1257 | rename from f4a
1255 | rename from f4a
1258 | rename to f4e
1256 | rename to f4e
1259 | diff --git a/f5a b/f5b
1257 | diff --git a/f5a b/f5b
1260 | rename from f5a
1258 | rename from f5a
1261 | rename to f5b
1259 | rename to f5b
1262 |
1260 |
1263 | o changeset: 10:93ee502e8b0a
1261 | o changeset: 10:93ee502e8b0a
1264 | | user: test
1262 | | user: test
1265 | | date: Thu Jan 01 00:00:00 1970 +0000
1263 | | date: Thu Jan 01 00:00:00 1970 +0000
1266 | | files: f3d f4e
1264 | | files: f3d f4e
1267 | | description:
1265 | | description:
1268 | | D2
1266 | | D2
1269 | |
1267 | |
1270 | |
1268 | |
1271 | | diff --git a/f3d b/f3d
1269 | | diff --git a/f3d b/f3d
1272 | | new file mode 100644
1270 | | new file mode 100644
1273 | | --- /dev/null
1271 | | --- /dev/null
1274 | | +++ b/f3d
1272 | | +++ b/f3d
1275 | | @@ -0,0 +1,1 @@
1273 | | @@ -0,0 +1,1 @@
1276 | | +c3a
1274 | | +c3a
1277 | | diff --git a/f4e b/f4e
1275 | | diff --git a/f4e b/f4e
1278 | | --- a/f4e
1276 | | --- a/f4e
1279 | | +++ b/f4e
1277 | | +++ b/f4e
1280 | | @@ -1,1 +1,1 @@
1278 | | @@ -1,1 +1,1 @@
1281 | | -c4a
1279 | | -c4a
1282 | | +c4d
1280 | | +c4d
1283 | |
1281 | |
1284 | o changeset: 9:539cf145f496
1282 | o changeset: 9:539cf145f496
1285 | | parent: 6:6bd1736cab86
1283 | | parent: 6:6bd1736cab86
1286 | | user: test
1284 | | user: test
1287 | | date: Thu Jan 01 00:00:00 1970 +0000
1285 | | date: Thu Jan 01 00:00:00 1970 +0000
1288 | | files: f1e f2a f2c f5a f5b
1286 | | files: f1e f2a f2c f5a f5b
1289 | | copies: f2c (f2a) f5a (f5b)
1287 | | copies: f2c (f2a) f5a (f5b)
1290 | | description:
1288 | | description:
1291 | | C2
1289 | | C2
1292 | |
1290 | |
1293 | |
1291 | |
1294 | | diff --git a/f1e b/f1e
1292 | | diff --git a/f1e b/f1e
1295 | | --- a/f1e
1293 | | --- a/f1e
1296 | | +++ b/f1e
1294 | | +++ b/f1e
1297 | | @@ -1,1 +1,1 @@
1295 | | @@ -1,1 +1,1 @@
1298 | | -c1a
1296 | | -c1a
1299 | | +c1c
1297 | | +c1c
1300 | | diff --git a/f2a b/f2c
1298 | | diff --git a/f2a b/f2c
1301 | | rename from f2a
1299 | | rename from f2a
1302 | | rename to f2c
1300 | | rename to f2c
1303 | | diff --git a/f5b b/f5a
1301 | | diff --git a/f5b b/f5a
1304 | | rename from f5b
1302 | | rename from f5b
1305 | | rename to f5a
1303 | | rename to f5a
1306 | | --- a/f5b
1304 | | --- a/f5b
1307 | | +++ b/f5a
1305 | | +++ b/f5a
1308 | | @@ -1,1 +1,1 @@
1306 | | @@ -1,1 +1,1 @@
1309 | | -c5a
1307 | | -c5a
1310 | | +c5c
1308 | | +c5c
1311 | |
1309 | |
1312 | | o changeset: 8:ba67f08fb15a
1310 | | o changeset: 8:ba67f08fb15a
1313 | | | parent: 0:11f7a1b56675
1311 | | | parent: 0:11f7a1b56675
1314 | | | user: test
1312 | | | user: test
1315 | | | date: Thu Jan 01 00:00:00 1970 +0000
1313 | | | date: Thu Jan 01 00:00:00 1970 +0000
1316 | | | files: f1g
1314 | | | files: f1g
1317 | | | copies: f1g (f1a)
1315 | | | copies: f1g (f1a)
1318 | | | description:
1316 | | | description:
1319 | | | G0
1317 | | | G0
1320 | | |
1318 | | |
1321 | | |
1319 | | |
1322 | | | diff --git a/f1a b/f1g
1320 | | | diff --git a/f1a b/f1g
1323 | | | copy from f1a
1321 | | | copy from f1a
1324 | | | copy to f1g
1322 | | | copy to f1g
1325 | | | --- a/f1a
1323 | | | --- a/f1a
1326 | | | +++ b/f1g
1324 | | | +++ b/f1g
1327 | | | @@ -1,1 +1,1 @@
1325 | | | @@ -1,1 +1,1 @@
1328 | | | -c1a
1326 | | | -c1a
1329 | | | +c1g
1327 | | | +c1g
1330 | | |
1328 | | |
1331 | | | o changeset: 7:d376ab0d7fda
1329 | | | o changeset: 7:d376ab0d7fda
1332 | | |/ parent: 0:11f7a1b56675
1330 | | |/ parent: 0:11f7a1b56675
1333 | | | user: test
1331 | | | user: test
1334 | | | date: Thu Jan 01 00:00:00 1970 +0000
1332 | | | date: Thu Jan 01 00:00:00 1970 +0000
1335 | | | files: f1f
1333 | | | files: f1f
1336 | | | copies: f1f (f1a)
1334 | | | copies: f1f (f1a)
1337 | | | description:
1335 | | | description:
1338 | | | F0
1336 | | | F0
1339 | | |
1337 | | |
1340 | | |
1338 | | |
1341 | | | diff --git a/f1a b/f1f
1339 | | | diff --git a/f1a b/f1f
1342 | | | copy from f1a
1340 | | | copy from f1a
1343 | | | copy to f1f
1341 | | | copy to f1f
1344 | | |
1342 | | |
1345 | o | changeset: 6:6bd1736cab86
1343 | o | changeset: 6:6bd1736cab86
1346 | |/ parent: 0:11f7a1b56675
1344 | |/ parent: 0:11f7a1b56675
1347 | | user: test
1345 | | user: test
1348 | | date: Thu Jan 01 00:00:00 1970 +0000
1346 | | date: Thu Jan 01 00:00:00 1970 +0000
1349 | | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b
1347 | | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b
1350 | | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a)
1348 | | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a)
1351 | | description:
1349 | | description:
1352 | | E0
1350 | | E0
1353 | |
1351 | |
1354 | |
1352 | |
1355 | | diff --git a/f1a b/f1e
1353 | | diff --git a/f1a b/f1e
1356 | | rename from f1a
1354 | | rename from f1a
1357 | | rename to f1e
1355 | | rename to f1e
1358 | | diff --git a/f2a b/f2a
1356 | | diff --git a/f2a b/f2a
1359 | | --- a/f2a
1357 | | --- a/f2a
1360 | | +++ b/f2a
1358 | | +++ b/f2a
1361 | | @@ -1,1 +1,1 @@
1359 | | @@ -1,1 +1,1 @@
1362 | | -c2a
1360 | | -c2a
1363 | | +c2e
1361 | | +c2e
1364 | | diff --git a/f3a b/f3e
1362 | | diff --git a/f3a b/f3e
1365 | | rename from f3a
1363 | | rename from f3a
1366 | | rename to f3e
1364 | | rename to f3e
1367 | | diff --git a/f4a b/f4e
1365 | | diff --git a/f4a b/f4e
1368 | | rename from f4a
1366 | | rename from f4a
1369 | | rename to f4e
1367 | | rename to f4e
1370 | | diff --git a/f5a b/f5b
1368 | | diff --git a/f5a b/f5b
1371 | | rename from f5a
1369 | | rename from f5a
1372 | | rename to f5b
1370 | | rename to f5b
1373 | |
1371 | |
1374 | | o changeset: 5:560daee679da
1372 | | o changeset: 5:560daee679da
1375 | | | user: test
1373 | | | user: test
1376 | | | date: Thu Jan 01 00:00:00 1970 +0000
1374 | | | date: Thu Jan 01 00:00:00 1970 +0000
1377 | | | files: f3d f4a
1375 | | | files: f3d f4a
1378 | | | description:
1376 | | | description:
1379 | | | D1
1377 | | | D1
1380 | | |
1378 | | |
1381 | | |
1379 | | |
1382 | | | diff --git a/f3d b/f3d
1380 | | | diff --git a/f3d b/f3d
1383 | | | new file mode 100644
1381 | | | new file mode 100644
1384 | | | --- /dev/null
1382 | | | --- /dev/null
1385 | | | +++ b/f3d
1383 | | | +++ b/f3d
1386 | | | @@ -0,0 +1,1 @@
1384 | | | @@ -0,0 +1,1 @@
1387 | | | +c3a
1385 | | | +c3a
1388 | | | diff --git a/f4a b/f4a
1386 | | | diff --git a/f4a b/f4a
1389 | | | --- a/f4a
1387 | | | --- a/f4a
1390 | | | +++ b/f4a
1388 | | | +++ b/f4a
1391 | | | @@ -1,1 +1,1 @@
1389 | | | @@ -1,1 +1,1 @@
1392 | | | -c4a
1390 | | | -c4a
1393 | | | +c4d
1391 | | | +c4d
1394 | | |
1392 | | |
1395 | | o changeset: 4:c9763722f9bd
1393 | | o changeset: 4:c9763722f9bd
1396 | |/ parent: 0:11f7a1b56675
1394 | |/ parent: 0:11f7a1b56675
1397 | | user: test
1395 | | user: test
1398 | | date: Thu Jan 01 00:00:00 1970 +0000
1396 | | date: Thu Jan 01 00:00:00 1970 +0000
1399 | | files: f1a f2a f2c f5a
1397 | | files: f1a f2a f2c f5a
1400 | | copies: f2c (f2a)
1398 | | copies: f2c (f2a)
1401 | | description:
1399 | | description:
1402 | | C1
1400 | | C1
1403 | |
1401 | |
1404 | |
1402 | |
1405 | | diff --git a/f1a b/f1a
1403 | | diff --git a/f1a b/f1a
1406 | | --- a/f1a
1404 | | --- a/f1a
1407 | | +++ b/f1a
1405 | | +++ b/f1a
1408 | | @@ -1,1 +1,1 @@
1406 | | @@ -1,1 +1,1 @@
1409 | | -c1a
1407 | | -c1a
1410 | | +c1c
1408 | | +c1c
1411 | | diff --git a/f2a b/f2c
1409 | | diff --git a/f2a b/f2c
1412 | | rename from f2a
1410 | | rename from f2a
1413 | | rename to f2c
1411 | | rename to f2c
1414 | | diff --git a/f5a b/f5a
1412 | | diff --git a/f5a b/f5a
1415 | | --- a/f5a
1413 | | --- a/f5a
1416 | | +++ b/f5a
1414 | | +++ b/f5a
1417 | | @@ -1,1 +1,1 @@
1415 | | @@ -1,1 +1,1 @@
1418 | | -c5a
1416 | | -c5a
1419 | | +c5c
1417 | | +c5c
1420 | |
1418 | |
1421 +---o changeset: 3:b69f5839d2d9
1419 +---o changeset: 3:b69f5839d2d9
1422 | | user: test
1420 | | user: test
1423 | | date: Thu Jan 01 00:00:00 1970 +0000
1421 | | date: Thu Jan 01 00:00:00 1970 +0000
1424 | | files: f3b f3d f4a
1422 | | files: f3b f3d f4a
1425 | | copies: f3d (f3b)
1423 | | copies: f3d (f3b)
1426 | | description:
1424 | | description:
1427 | | D0
1425 | | D0
1428 | |
1426 | |
1429 | |
1427 | |
1430 | | diff --git a/f3b b/f3d
1428 | | diff --git a/f3b b/f3d
1431 | | rename from f3b
1429 | | rename from f3b
1432 | | rename to f3d
1430 | | rename to f3d
1433 | | diff --git a/f4a b/f4a
1431 | | diff --git a/f4a b/f4a
1434 | | --- a/f4a
1432 | | --- a/f4a
1435 | | +++ b/f4a
1433 | | +++ b/f4a
1436 | | @@ -1,1 +1,1 @@
1434 | | @@ -1,1 +1,1 @@
1437 | | -c4a
1435 | | -c4a
1438 | | +c4d
1436 | | +c4d
1439 | |
1437 | |
1440 o | changeset: 2:f58c7e2b28fa
1438 o | changeset: 2:f58c7e2b28fa
1441 | | user: test
1439 | | user: test
1442 | | date: Thu Jan 01 00:00:00 1970 +0000
1440 | | date: Thu Jan 01 00:00:00 1970 +0000
1443 | | files: f1b f2a f2c f5a f5b
1441 | | files: f1b f2a f2c f5a f5b
1444 | | copies: f2c (f2a) f5a (f5b)
1442 | | copies: f2c (f2a) f5a (f5b)
1445 | | description:
1443 | | description:
1446 | | C0
1444 | | C0
1447 | |
1445 | |
1448 | |
1446 | |
1449 | | diff --git a/f1b b/f1b
1447 | | diff --git a/f1b b/f1b
1450 | | --- a/f1b
1448 | | --- a/f1b
1451 | | +++ b/f1b
1449 | | +++ b/f1b
1452 | | @@ -1,1 +1,1 @@
1450 | | @@ -1,1 +1,1 @@
1453 | | -c1a
1451 | | -c1a
1454 | | +c1c
1452 | | +c1c
1455 | | diff --git a/f2a b/f2c
1453 | | diff --git a/f2a b/f2c
1456 | | rename from f2a
1454 | | rename from f2a
1457 | | rename to f2c
1455 | | rename to f2c
1458 | | diff --git a/f5b b/f5a
1456 | | diff --git a/f5b b/f5a
1459 | | rename from f5b
1457 | | rename from f5b
1460 | | rename to f5a
1458 | | rename to f5a
1461 | | --- a/f5b
1459 | | --- a/f5b
1462 | | +++ b/f5a
1460 | | +++ b/f5a
1463 | | @@ -1,1 +1,1 @@
1461 | | @@ -1,1 +1,1 @@
1464 | | -c5a
1462 | | -c5a
1465 | | +c5c
1463 | | +c5c
1466 | |
1464 | |
1467 o | changeset: 1:3d7bba921b5d
1465 o | changeset: 1:3d7bba921b5d
1468 |/ user: test
1466 |/ user: test
1469 | date: Thu Jan 01 00:00:00 1970 +0000
1467 | date: Thu Jan 01 00:00:00 1970 +0000
1470 | files: f1a f1b f3a f3b f5a f5b
1468 | files: f1a f1b f3a f3b f5a f5b
1471 | copies: f1b (f1a) f3b (f3a) f5b (f5a)
1469 | copies: f1b (f1a) f3b (f3a) f5b (f5a)
1472 | description:
1470 | description:
1473 | B0
1471 | B0
1474 |
1472 |
1475 |
1473 |
1476 | diff --git a/f1a b/f1b
1474 | diff --git a/f1a b/f1b
1477 | rename from f1a
1475 | rename from f1a
1478 | rename to f1b
1476 | rename to f1b
1479 | diff --git a/f3a b/f3b
1477 | diff --git a/f3a b/f3b
1480 | rename from f3a
1478 | rename from f3a
1481 | rename to f3b
1479 | rename to f3b
1482 | diff --git a/f5a b/f5b
1480 | diff --git a/f5a b/f5b
1483 | rename from f5a
1481 | rename from f5a
1484 | rename to f5b
1482 | rename to f5b
1485 |
1483 |
1486 o changeset: 0:11f7a1b56675
1484 o changeset: 0:11f7a1b56675
1487 user: test
1485 user: test
1488 date: Thu Jan 01 00:00:00 1970 +0000
1486 date: Thu Jan 01 00:00:00 1970 +0000
1489 files: f1a f2a f3a f4a f5a
1487 files: f1a f2a f3a f4a f5a
1490 description:
1488 description:
1491 A0
1489 A0
1492
1490
1493
1491
1494 diff --git a/f1a b/f1a
1492 diff --git a/f1a b/f1a
1495 new file mode 100644
1493 new file mode 100644
1496 --- /dev/null
1494 --- /dev/null
1497 +++ b/f1a
1495 +++ b/f1a
1498 @@ -0,0 +1,1 @@
1496 @@ -0,0 +1,1 @@
1499 +c1a
1497 +c1a
1500 diff --git a/f2a b/f2a
1498 diff --git a/f2a b/f2a
1501 new file mode 100644
1499 new file mode 100644
1502 --- /dev/null
1500 --- /dev/null
1503 +++ b/f2a
1501 +++ b/f2a
1504 @@ -0,0 +1,1 @@
1502 @@ -0,0 +1,1 @@
1505 +c2a
1503 +c2a
1506 diff --git a/f3a b/f3a
1504 diff --git a/f3a b/f3a
1507 new file mode 100644
1505 new file mode 100644
1508 --- /dev/null
1506 --- /dev/null
1509 +++ b/f3a
1507 +++ b/f3a
1510 @@ -0,0 +1,1 @@
1508 @@ -0,0 +1,1 @@
1511 +c3a
1509 +c3a
1512 diff --git a/f4a b/f4a
1510 diff --git a/f4a b/f4a
1513 new file mode 100644
1511 new file mode 100644
1514 --- /dev/null
1512 --- /dev/null
1515 +++ b/f4a
1513 +++ b/f4a
1516 @@ -0,0 +1,1 @@
1514 @@ -0,0 +1,1 @@
1517 +c4a
1515 +c4a
1518 diff --git a/f5a b/f5a
1516 diff --git a/f5a b/f5a
1519 new file mode 100644
1517 new file mode 100644
1520 --- /dev/null
1518 --- /dev/null
1521 +++ b/f5a
1519 +++ b/f5a
1522 @@ -0,0 +1,1 @@
1520 @@ -0,0 +1,1 @@
1523 +c5a
1521 +c5a
1524
1522
1525 Check superfluous filemerge of files renamed in the past but untouched by graft
1523 Check superfluous filemerge of files renamed in the past but untouched by graft
1526
1524
1527 $ echo a > a
1525 $ echo a > a
1528 $ hg ci -qAma
1526 $ hg ci -qAma
1529 $ hg mv a b
1527 $ hg mv a b
1530 $ echo b > b
1528 $ echo b > b
1531 $ hg ci -qAmb
1529 $ hg ci -qAmb
1532 $ echo c > c
1530 $ echo c > c
1533 $ hg ci -qAmc
1531 $ hg ci -qAmc
1534 $ hg up -q .~2
1532 $ hg up -q .~2
1535 $ hg graft tip -qt:fail
1533 $ hg graft tip -qt:fail
1536
1534
1537 $ cd ..
1535 $ cd ..
1538
1536
1539 Graft a change into a new file previously grafted into a renamed directory
1537 Graft a change into a new file previously grafted into a renamed directory
1540
1538
1541 $ hg init dirmovenewfile
1539 $ hg init dirmovenewfile
1542 $ cd dirmovenewfile
1540 $ cd dirmovenewfile
1543 $ mkdir a
1541 $ mkdir a
1544 $ echo a > a/a
1542 $ echo a > a/a
1545 $ hg ci -qAma
1543 $ hg ci -qAma
1546 $ echo x > a/x
1544 $ echo x > a/x
1547 $ hg ci -qAmx
1545 $ hg ci -qAmx
1548 $ hg up -q 0
1546 $ hg up -q 0
1549 $ hg mv -q a b
1547 $ hg mv -q a b
1550 $ hg ci -qAmb
1548 $ hg ci -qAmb
1551 $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded
1549 $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded
1552 $ hg up -q 1
1550 $ hg up -q 1
1553 $ echo y > a/x
1551 $ echo y > a/x
1554 $ hg ci -qAmy
1552 $ hg ci -qAmy
1555 $ hg up -q 3
1553 $ hg up -q 3
1556 $ hg graft -q 4
1554 $ hg graft -q 4
1557 $ hg status --change .
1555 $ hg status --change .
1558 M b/x
1556 M b/x
1559
1557
1560 Prepare for test of skipped changesets and how merges can influence it:
1558 Prepare for test of skipped changesets and how merges can influence it:
1561
1559
1562 $ hg merge -q -r 1 --tool :local
1560 $ hg merge -q -r 1 --tool :local
1563 $ hg ci -m m
1561 $ hg ci -m m
1564 $ echo xx >> b/x
1562 $ echo xx >> b/x
1565 $ hg ci -m xx
1563 $ hg ci -m xx
1566
1564
1567 $ hg log -G -T '{rev} {desc|firstline}'
1565 $ hg log -G -T '{rev} {desc|firstline}'
1568 @ 7 xx
1566 @ 7 xx
1569 |
1567 |
1570 o 6 m
1568 o 6 m
1571 |\
1569 |\
1572 | o 5 y
1570 | o 5 y
1573 | |
1571 | |
1574 +---o 4 y
1572 +---o 4 y
1575 | |
1573 | |
1576 | o 3 x
1574 | o 3 x
1577 | |
1575 | |
1578 | o 2 b
1576 | o 2 b
1579 | |
1577 | |
1580 o | 1 x
1578 o | 1 x
1581 |/
1579 |/
1582 o 0 a
1580 o 0 a
1583
1581
1584 Grafting of plain changes correctly detects that 3 and 5 should be skipped:
1582 Grafting of plain changes correctly detects that 3 and 5 should be skipped:
1585
1583
1586 $ hg up -qCr 4
1584 $ hg up -qCr 4
1587 $ hg graft --tool :local -r 2::5
1585 $ hg graft --tool :local -r 2::5
1588 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1586 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1589 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1587 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1590 grafting 2:42127f193bcd "b"
1588 grafting 2:42127f193bcd "b"
1591
1589
1592 Extending the graft range to include a (skipped) merge of 3 will not prevent us from
1590 Extending the graft range to include a (skipped) merge of 3 will not prevent us from
1593 also detecting that both 3 and 5 should be skipped:
1591 also detecting that both 3 and 5 should be skipped:
1594
1592
1595 $ hg up -qCr 4
1593 $ hg up -qCr 4
1596 $ hg graft --tool :local -r 2::7
1594 $ hg graft --tool :local -r 2::7
1597 skipping ungraftable merge revision 6
1595 skipping ungraftable merge revision 6
1598 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1596 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1599 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1597 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1600 grafting 2:42127f193bcd "b"
1598 grafting 2:42127f193bcd "b"
1601 grafting 7:d3c3f2b38ecc "xx"
1599 grafting 7:d3c3f2b38ecc "xx"
1602 note: graft of 7:d3c3f2b38ecc created no changes to commit
1600 note: graft of 7:d3c3f2b38ecc created no changes to commit
1603
1601
1604 $ cd ..
1602 $ cd ..
1605
1603
1606 Grafted revision should be warned and skipped only once. (issue6024)
1604 Grafted revision should be warned and skipped only once. (issue6024)
1607
1605
1608 $ mkdir issue6024
1606 $ mkdir issue6024
1609 $ cd issue6024
1607 $ cd issue6024
1610
1608
1611 $ hg init base
1609 $ hg init base
1612 $ cd base
1610 $ cd base
1613 $ touch x
1611 $ touch x
1614 $ hg commit -qAminit
1612 $ hg commit -qAminit
1615 $ echo a > x
1613 $ echo a > x
1616 $ hg commit -mchange
1614 $ hg commit -mchange
1617 $ hg update -q 0
1615 $ hg update -q 0
1618 $ hg graft -r 1
1616 $ hg graft -r 1
1619 grafting 1:a0b923c546aa "change" (tip)
1617 grafting 1:a0b923c546aa "change" (tip)
1620 $ cd ..
1618 $ cd ..
1621
1619
1622 $ hg clone -qr 2 base clone
1620 $ hg clone -qr 2 base clone
1623 $ cd clone
1621 $ cd clone
1624 $ hg pull -q
1622 $ hg pull -q
1625 $ hg merge -q 2
1623 $ hg merge -q 2
1626 $ hg commit -mmerge
1624 $ hg commit -mmerge
1627 $ hg update -q 0
1625 $ hg update -q 0
1628 $ hg graft -r 1
1626 $ hg graft -r 1
1629 grafting 1:04fc6d444368 "change"
1627 grafting 1:04fc6d444368 "change"
1630 $ hg update -q 3
1628 $ hg update -q 3
1631 $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n'
1629 $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n'
1632 o 4:4e16 <- a0b9
1630 o 4:4e16 <- a0b9
1633 |
1631 |
1634 | @ 3:f0ac <-
1632 | @ 3:f0ac <-
1635 | |\
1633 | |\
1636 +---o 2:a0b9 <-
1634 +---o 2:a0b9 <-
1637 | |
1635 | |
1638 | o 1:04fc <- a0b9
1636 | o 1:04fc <- a0b9
1639 |/
1637 |/
1640 o 0:7848 <-
1638 o 0:7848 <-
1641
1639
1642
1640
1643 the source of rev 4 is an ancestor of the working parent, and was also
1641 the source of rev 4 is an ancestor of the working parent, and was also
1644 grafted as rev 1. it should be stripped from the target revisions only once.
1642 grafted as rev 1. it should be stripped from the target revisions only once.
1645
1643
1646 $ hg graft -r 4
1644 $ hg graft -r 4
1647 skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa)
1645 skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa)
1648 [255]
1646 [255]
1649
1647
1650 $ cd ../..
1648 $ cd ../..
1651
1649
1652 Testing the reading of old format graftstate file with newer mercurial
1650 Testing the reading of old format graftstate file with newer mercurial
1653
1651
1654 $ hg init oldgraft
1652 $ hg init oldgraft
1655 $ cd oldgraft
1653 $ cd oldgraft
1656 $ for ch in a b c; do echo foo > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1654 $ for ch in a b c; do echo foo > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1657 $ hg log -GT "{rev}:{node|short} {desc}\n"
1655 $ hg log -GT "{rev}:{node|short} {desc}\n"
1658 @ 2:8be98ac1a569 added c
1656 @ 2:8be98ac1a569 added c
1659 |
1657 |
1660 o 1:80e6d2c47cfe added b
1658 o 1:80e6d2c47cfe added b
1661 |
1659 |
1662 o 0:f7ad41964313 added a
1660 o 0:f7ad41964313 added a
1663
1661
1664 $ hg up 0
1662 $ hg up 0
1665 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1663 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1666 $ echo bar > b
1664 $ echo bar > b
1667 $ hg add b
1665 $ hg add b
1668 $ hg ci -m "bar to b"
1666 $ hg ci -m "bar to b"
1669 created new head
1667 created new head
1670 $ hg graft -r 1 -r 2
1668 $ hg graft -r 1 -r 2
1671 grafting 1:80e6d2c47cfe "added b"
1669 grafting 1:80e6d2c47cfe "added b"
1672 merging b
1670 merging b
1673 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1671 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1674 abort: unresolved conflicts, can't continue
1672 abort: unresolved conflicts, can't continue
1675 (use 'hg resolve' and 'hg graft --continue')
1673 (use 'hg resolve' and 'hg graft --continue')
1676 [255]
1674 [255]
1677
1675
1678 Writing the nodes in old format to graftstate
1676 Writing the nodes in old format to graftstate
1679
1677
1680 $ hg log -r 1 -r 2 -T '{node}\n' > .hg/graftstate
1678 $ hg log -r 1 -r 2 -T '{node}\n' > .hg/graftstate
1681 $ echo foo > b
1679 $ echo foo > b
1682 $ hg resolve -m
1680 $ hg resolve -m
1683 (no more unresolved files)
1681 (no more unresolved files)
1684 continue: hg graft --continue
1682 continue: hg graft --continue
1685 $ hg graft --continue
1683 $ hg graft --continue
1686 grafting 1:80e6d2c47cfe "added b"
1684 grafting 1:80e6d2c47cfe "added b"
1687 grafting 2:8be98ac1a569 "added c"
1685 grafting 2:8be98ac1a569 "added c"
1688
1686
1689 Testing that --user is preserved during conflicts and value is reused while
1687 Testing that --user is preserved during conflicts and value is reused while
1690 running `hg graft --continue`
1688 running `hg graft --continue`
1691
1689
1692 $ hg log -G
1690 $ hg log -G
1693 @ changeset: 5:711e9fa999f1
1691 @ changeset: 5:711e9fa999f1
1694 | tag: tip
1692 | tag: tip
1695 | user: test
1693 | user: test
1696 | date: Thu Jan 01 00:00:00 1970 +0000
1694 | date: Thu Jan 01 00:00:00 1970 +0000
1697 | summary: added c
1695 | summary: added c
1698 |
1696 |
1699 o changeset: 4:e5ad7353b408
1697 o changeset: 4:e5ad7353b408
1700 | user: test
1698 | user: test
1701 | date: Thu Jan 01 00:00:00 1970 +0000
1699 | date: Thu Jan 01 00:00:00 1970 +0000
1702 | summary: added b
1700 | summary: added b
1703 |
1701 |
1704 o changeset: 3:9e887f7a939c
1702 o changeset: 3:9e887f7a939c
1705 | parent: 0:f7ad41964313
1703 | parent: 0:f7ad41964313
1706 | user: test
1704 | user: test
1707 | date: Thu Jan 01 00:00:00 1970 +0000
1705 | date: Thu Jan 01 00:00:00 1970 +0000
1708 | summary: bar to b
1706 | summary: bar to b
1709 |
1707 |
1710 | o changeset: 2:8be98ac1a569
1708 | o changeset: 2:8be98ac1a569
1711 | | user: test
1709 | | user: test
1712 | | date: Thu Jan 01 00:00:00 1970 +0000
1710 | | date: Thu Jan 01 00:00:00 1970 +0000
1713 | | summary: added c
1711 | | summary: added c
1714 | |
1712 | |
1715 | o changeset: 1:80e6d2c47cfe
1713 | o changeset: 1:80e6d2c47cfe
1716 |/ user: test
1714 |/ user: test
1717 | date: Thu Jan 01 00:00:00 1970 +0000
1715 | date: Thu Jan 01 00:00:00 1970 +0000
1718 | summary: added b
1716 | summary: added b
1719 |
1717 |
1720 o changeset: 0:f7ad41964313
1718 o changeset: 0:f7ad41964313
1721 user: test
1719 user: test
1722 date: Thu Jan 01 00:00:00 1970 +0000
1720 date: Thu Jan 01 00:00:00 1970 +0000
1723 summary: added a
1721 summary: added a
1724
1722
1725
1723
1726 $ hg up '.^^'
1724 $ hg up '.^^'
1727 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1725 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1728
1726
1729 $ hg graft -r 1 -r 2 --user batman
1727 $ hg graft -r 1 -r 2 --user batman
1730 grafting 1:80e6d2c47cfe "added b"
1728 grafting 1:80e6d2c47cfe "added b"
1731 merging b
1729 merging b
1732 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1730 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1733 abort: unresolved conflicts, can't continue
1731 abort: unresolved conflicts, can't continue
1734 (use 'hg resolve' and 'hg graft --continue')
1732 (use 'hg resolve' and 'hg graft --continue')
1735 [255]
1733 [255]
1736
1734
1737 $ echo wat > b
1735 $ echo wat > b
1738 $ hg resolve -m
1736 $ hg resolve -m
1739 (no more unresolved files)
1737 (no more unresolved files)
1740 continue: hg graft --continue
1738 continue: hg graft --continue
1741
1739
1742 $ hg graft --continue
1740 $ hg graft --continue
1743 grafting 1:80e6d2c47cfe "added b"
1741 grafting 1:80e6d2c47cfe "added b"
1744 grafting 2:8be98ac1a569 "added c"
1742 grafting 2:8be98ac1a569 "added c"
1745
1743
1746 $ hg log -Gr 3::
1744 $ hg log -Gr 3::
1747 @ changeset: 7:11a36ffaacf2
1745 @ changeset: 7:11a36ffaacf2
1748 | tag: tip
1746 | tag: tip
1749 | user: batman
1747 | user: batman
1750 | date: Thu Jan 01 00:00:00 1970 +0000
1748 | date: Thu Jan 01 00:00:00 1970 +0000
1751 | summary: added c
1749 | summary: added c
1752 |
1750 |
1753 o changeset: 6:76803afc6511
1751 o changeset: 6:76803afc6511
1754 | parent: 3:9e887f7a939c
1752 | parent: 3:9e887f7a939c
1755 | user: batman
1753 | user: batman
1756 | date: Thu Jan 01 00:00:00 1970 +0000
1754 | date: Thu Jan 01 00:00:00 1970 +0000
1757 | summary: added b
1755 | summary: added b
1758 |
1756 |
1759 | o changeset: 5:711e9fa999f1
1757 | o changeset: 5:711e9fa999f1
1760 | | user: test
1758 | | user: test
1761 | | date: Thu Jan 01 00:00:00 1970 +0000
1759 | | date: Thu Jan 01 00:00:00 1970 +0000
1762 | | summary: added c
1760 | | summary: added c
1763 | |
1761 | |
1764 | o changeset: 4:e5ad7353b408
1762 | o changeset: 4:e5ad7353b408
1765 |/ user: test
1763 |/ user: test
1766 | date: Thu Jan 01 00:00:00 1970 +0000
1764 | date: Thu Jan 01 00:00:00 1970 +0000
1767 | summary: added b
1765 | summary: added b
1768 |
1766 |
1769 o changeset: 3:9e887f7a939c
1767 o changeset: 3:9e887f7a939c
1770 | parent: 0:f7ad41964313
1768 | parent: 0:f7ad41964313
1771 ~ user: test
1769 ~ user: test
1772 date: Thu Jan 01 00:00:00 1970 +0000
1770 date: Thu Jan 01 00:00:00 1970 +0000
1773 summary: bar to b
1771 summary: bar to b
1774
1772
1775 Test that --date is preserved and reused in `hg graft --continue`
1773 Test that --date is preserved and reused in `hg graft --continue`
1776
1774
1777 $ hg up '.^^'
1775 $ hg up '.^^'
1778 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1776 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1779 $ hg graft -r 1 -r 2 --date '1234560000 120'
1777 $ hg graft -r 1 -r 2 --date '1234560000 120'
1780 grafting 1:80e6d2c47cfe "added b"
1778 grafting 1:80e6d2c47cfe "added b"
1781 merging b
1779 merging b
1782 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1780 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1783 abort: unresolved conflicts, can't continue
1781 abort: unresolved conflicts, can't continue
1784 (use 'hg resolve' and 'hg graft --continue')
1782 (use 'hg resolve' and 'hg graft --continue')
1785 [255]
1783 [255]
1786
1784
1787 $ echo foobar > b
1785 $ echo foobar > b
1788 $ hg resolve -m
1786 $ hg resolve -m
1789 (no more unresolved files)
1787 (no more unresolved files)
1790 continue: hg graft --continue
1788 continue: hg graft --continue
1791 $ hg graft --continue
1789 $ hg graft --continue
1792 grafting 1:80e6d2c47cfe "added b"
1790 grafting 1:80e6d2c47cfe "added b"
1793 grafting 2:8be98ac1a569 "added c"
1791 grafting 2:8be98ac1a569 "added c"
1794
1792
1795 $ hg log -Gr '.^^::.'
1793 $ hg log -Gr '.^^::.'
1796 @ changeset: 9:1896b76e007a
1794 @ changeset: 9:1896b76e007a
1797 | tag: tip
1795 | tag: tip
1798 | user: test
1796 | user: test
1799 | date: Fri Feb 13 21:18:00 2009 -0002
1797 | date: Fri Feb 13 21:18:00 2009 -0002
1800 | summary: added c
1798 | summary: added c
1801 |
1799 |
1802 o changeset: 8:ce2b4f1632af
1800 o changeset: 8:ce2b4f1632af
1803 | parent: 3:9e887f7a939c
1801 | parent: 3:9e887f7a939c
1804 | user: test
1802 | user: test
1805 | date: Fri Feb 13 21:18:00 2009 -0002
1803 | date: Fri Feb 13 21:18:00 2009 -0002
1806 | summary: added b
1804 | summary: added b
1807 |
1805 |
1808 o changeset: 3:9e887f7a939c
1806 o changeset: 3:9e887f7a939c
1809 | parent: 0:f7ad41964313
1807 | parent: 0:f7ad41964313
1810 ~ user: test
1808 ~ user: test
1811 date: Thu Jan 01 00:00:00 1970 +0000
1809 date: Thu Jan 01 00:00:00 1970 +0000
1812 summary: bar to b
1810 summary: bar to b
1813
1811
1814 Test that --log is preserved and reused in `hg graft --continue`
1812 Test that --log is preserved and reused in `hg graft --continue`
1815
1813
1816 $ hg up '.^^'
1814 $ hg up '.^^'
1817 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1815 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1818 $ hg graft -r 1 -r 2 --log
1816 $ hg graft -r 1 -r 2 --log
1819 grafting 1:80e6d2c47cfe "added b"
1817 grafting 1:80e6d2c47cfe "added b"
1820 merging b
1818 merging b
1821 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1819 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1822 abort: unresolved conflicts, can't continue
1820 abort: unresolved conflicts, can't continue
1823 (use 'hg resolve' and 'hg graft --continue')
1821 (use 'hg resolve' and 'hg graft --continue')
1824 [255]
1822 [255]
1825
1823
1826 $ echo foobar > b
1824 $ echo foobar > b
1827 $ hg resolve -m
1825 $ hg resolve -m
1828 (no more unresolved files)
1826 (no more unresolved files)
1829 continue: hg graft --continue
1827 continue: hg graft --continue
1830
1828
1831 $ hg graft --continue
1829 $ hg graft --continue
1832 grafting 1:80e6d2c47cfe "added b"
1830 grafting 1:80e6d2c47cfe "added b"
1833 grafting 2:8be98ac1a569 "added c"
1831 grafting 2:8be98ac1a569 "added c"
1834
1832
1835 $ hg log -GT "{rev}:{node|short} {desc}" -r '.^^::.'
1833 $ hg log -GT "{rev}:{node|short} {desc}" -r '.^^::.'
1836 @ 11:30c1050a58b2 added c
1834 @ 11:30c1050a58b2 added c
1837 | (grafted from 8be98ac1a56990c2d9ca6861041b8390af7bd6f3)
1835 | (grafted from 8be98ac1a56990c2d9ca6861041b8390af7bd6f3)
1838 o 10:ec7eda2313e2 added b
1836 o 10:ec7eda2313e2 added b
1839 | (grafted from 80e6d2c47cfe5b3185519568327a17a061c7efb6)
1837 | (grafted from 80e6d2c47cfe5b3185519568327a17a061c7efb6)
1840 o 3:9e887f7a939c bar to b
1838 o 3:9e887f7a939c bar to b
1841 |
1839 |
1842 ~
1840 ~
1843
1841
1844 $ cd ..
1842 $ cd ..
1845
1843
1846 Testing the --stop flag of `hg graft` which stops the interrupted graft
1844 Testing the --stop flag of `hg graft` which stops the interrupted graft
1847
1845
1848 $ hg init stopgraft
1846 $ hg init stopgraft
1849 $ cd stopgraft
1847 $ cd stopgraft
1850 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1848 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1851
1849
1852 $ hg log -G
1850 $ hg log -G
1853 @ changeset: 3:9150fe93bec6
1851 @ changeset: 3:9150fe93bec6
1854 | tag: tip
1852 | tag: tip
1855 | user: test
1853 | user: test
1856 | date: Thu Jan 01 00:00:00 1970 +0000
1854 | date: Thu Jan 01 00:00:00 1970 +0000
1857 | summary: added d
1855 | summary: added d
1858 |
1856 |
1859 o changeset: 2:155349b645be
1857 o changeset: 2:155349b645be
1860 | user: test
1858 | user: test
1861 | date: Thu Jan 01 00:00:00 1970 +0000
1859 | date: Thu Jan 01 00:00:00 1970 +0000
1862 | summary: added c
1860 | summary: added c
1863 |
1861 |
1864 o changeset: 1:5f6d8a4bf34a
1862 o changeset: 1:5f6d8a4bf34a
1865 | user: test
1863 | user: test
1866 | date: Thu Jan 01 00:00:00 1970 +0000
1864 | date: Thu Jan 01 00:00:00 1970 +0000
1867 | summary: added b
1865 | summary: added b
1868 |
1866 |
1869 o changeset: 0:9092f1db7931
1867 o changeset: 0:9092f1db7931
1870 user: test
1868 user: test
1871 date: Thu Jan 01 00:00:00 1970 +0000
1869 date: Thu Jan 01 00:00:00 1970 +0000
1872 summary: added a
1870 summary: added a
1873
1871
1874 $ hg up '.^^'
1872 $ hg up '.^^'
1875 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1873 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1876
1874
1877 $ echo foo > d
1875 $ echo foo > d
1878 $ hg ci -Aqm "added foo to d"
1876 $ hg ci -Aqm "added foo to d"
1879
1877
1880 $ hg graft --stop
1878 $ hg graft --stop
1881 abort: no interrupted graft found
1879 abort: no interrupted graft found
1882 [255]
1880 [255]
1883
1881
1884 $ hg graft -r 3
1882 $ hg graft -r 3
1885 grafting 3:9150fe93bec6 "added d"
1883 grafting 3:9150fe93bec6 "added d"
1886 merging d
1884 merging d
1887 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1885 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1888 abort: unresolved conflicts, can't continue
1886 abort: unresolved conflicts, can't continue
1889 (use 'hg resolve' and 'hg graft --continue')
1887 (use 'hg resolve' and 'hg graft --continue')
1890 [255]
1888 [255]
1891
1889
1892 $ hg graft --stop --continue
1890 $ hg graft --stop --continue
1893 abort: cannot use '--continue' and '--stop' together
1891 abort: cannot use '--continue' and '--stop' together
1894 [255]
1892 [255]
1895
1893
1896 $ hg graft --stop -U
1894 $ hg graft --stop -U
1897 abort: cannot specify any other flag with '--stop'
1895 abort: cannot specify any other flag with '--stop'
1898 [255]
1896 [255]
1899 $ hg graft --stop --rev 4
1897 $ hg graft --stop --rev 4
1900 abort: cannot specify any other flag with '--stop'
1898 abort: cannot specify any other flag with '--stop'
1901 [255]
1899 [255]
1902 $ hg graft --stop --log
1900 $ hg graft --stop --log
1903 abort: cannot specify any other flag with '--stop'
1901 abort: cannot specify any other flag with '--stop'
1904 [255]
1902 [255]
1905
1903
1906 $ hg graft --stop
1904 $ hg graft --stop
1907 stopped the interrupted graft
1905 stopped the interrupted graft
1908 working directory is now at a0deacecd59d
1906 working directory is now at a0deacecd59d
1909
1907
1910 $ hg diff
1908 $ hg diff
1911
1909
1912 $ hg log -Gr '.'
1910 $ hg log -Gr '.'
1913 @ changeset: 4:a0deacecd59d
1911 @ changeset: 4:a0deacecd59d
1914 | tag: tip
1912 | tag: tip
1915 ~ parent: 1:5f6d8a4bf34a
1913 ~ parent: 1:5f6d8a4bf34a
1916 user: test
1914 user: test
1917 date: Thu Jan 01 00:00:00 1970 +0000
1915 date: Thu Jan 01 00:00:00 1970 +0000
1918 summary: added foo to d
1916 summary: added foo to d
1919
1917
1920 $ hg graft -r 2 -r 3
1918 $ hg graft -r 2 -r 3
1921 grafting 2:155349b645be "added c"
1919 grafting 2:155349b645be "added c"
1922 grafting 3:9150fe93bec6 "added d"
1920 grafting 3:9150fe93bec6 "added d"
1923 merging d
1921 merging d
1924 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1922 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1925 abort: unresolved conflicts, can't continue
1923 abort: unresolved conflicts, can't continue
1926 (use 'hg resolve' and 'hg graft --continue')
1924 (use 'hg resolve' and 'hg graft --continue')
1927 [255]
1925 [255]
1928
1926
1929 $ hg graft --stop
1927 $ hg graft --stop
1930 stopped the interrupted graft
1928 stopped the interrupted graft
1931 working directory is now at 75b447541a9e
1929 working directory is now at 75b447541a9e
1932
1930
1933 $ hg diff
1931 $ hg diff
1934
1932
1935 $ hg log -G -T "{rev}:{node|short} {desc}"
1933 $ hg log -G -T "{rev}:{node|short} {desc}"
1936 @ 5:75b447541a9e added c
1934 @ 5:75b447541a9e added c
1937 |
1935 |
1938 o 4:a0deacecd59d added foo to d
1936 o 4:a0deacecd59d added foo to d
1939 |
1937 |
1940 | o 3:9150fe93bec6 added d
1938 | o 3:9150fe93bec6 added d
1941 | |
1939 | |
1942 | o 2:155349b645be added c
1940 | o 2:155349b645be added c
1943 |/
1941 |/
1944 o 1:5f6d8a4bf34a added b
1942 o 1:5f6d8a4bf34a added b
1945 |
1943 |
1946 o 0:9092f1db7931 added a
1944 o 0:9092f1db7931 added a
1947
1945
1948 $ cd ..
1946 $ cd ..
1949
1947
1950 Testing the --abort flag for `hg graft` which aborts and rollback to state
1948 Testing the --abort flag for `hg graft` which aborts and rollback to state
1951 before the graft
1949 before the graft
1952
1950
1953 $ hg init abortgraft
1951 $ hg init abortgraft
1954 $ cd abortgraft
1952 $ cd abortgraft
1955 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1953 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1956
1954
1957 $ hg up '.^^'
1955 $ hg up '.^^'
1958 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1956 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1959
1957
1960 $ echo x > x
1958 $ echo x > x
1961 $ hg ci -Aqm "added x"
1959 $ hg ci -Aqm "added x"
1962 $ hg up '.^'
1960 $ hg up '.^'
1963 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1961 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1964 $ echo foo > c
1962 $ echo foo > c
1965 $ hg ci -Aqm "added foo to c"
1963 $ hg ci -Aqm "added foo to c"
1966
1964
1967 $ hg log -GT "{rev}:{node|short} {desc}"
1965 $ hg log -GT "{rev}:{node|short} {desc}"
1968 @ 5:36b793615f78 added foo to c
1966 @ 5:36b793615f78 added foo to c
1969 |
1967 |
1970 | o 4:863a25e1a9ea added x
1968 | o 4:863a25e1a9ea added x
1971 |/
1969 |/
1972 | o 3:9150fe93bec6 added d
1970 | o 3:9150fe93bec6 added d
1973 | |
1971 | |
1974 | o 2:155349b645be added c
1972 | o 2:155349b645be added c
1975 |/
1973 |/
1976 o 1:5f6d8a4bf34a added b
1974 o 1:5f6d8a4bf34a added b
1977 |
1975 |
1978 o 0:9092f1db7931 added a
1976 o 0:9092f1db7931 added a
1979
1977
1980 $ hg up 9150fe93bec6
1978 $ hg up 9150fe93bec6
1981 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1979 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1982
1980
1983 $ hg graft --abort
1981 $ hg graft --abort
1984 abort: no interrupted graft to abort
1982 abort: no interrupted graft to abort
1985 [255]
1983 [255]
1986
1984
1987 when stripping is required
1985 when stripping is required
1988 $ hg graft -r 4 -r 5
1986 $ hg graft -r 4 -r 5
1989 grafting 4:863a25e1a9ea "added x"
1987 grafting 4:863a25e1a9ea "added x"
1990 grafting 5:36b793615f78 "added foo to c" (tip)
1988 grafting 5:36b793615f78 "added foo to c" (tip)
1991 merging c
1989 merging c
1992 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
1990 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
1993 abort: unresolved conflicts, can't continue
1991 abort: unresolved conflicts, can't continue
1994 (use 'hg resolve' and 'hg graft --continue')
1992 (use 'hg resolve' and 'hg graft --continue')
1995 [255]
1993 [255]
1996
1994
1997 $ hg graft --continue --abort
1995 $ hg graft --continue --abort
1998 abort: cannot use '--continue' and '--abort' together
1996 abort: cannot use '--continue' and '--abort' together
1999 [255]
1997 [255]
2000
1998
2001 $ hg graft --abort --stop
1999 $ hg graft --abort --stop
2002 abort: cannot use '--abort' and '--stop' together
2000 abort: cannot use '--abort' and '--stop' together
2003 [255]
2001 [255]
2004
2002
2005 $ hg graft --abort --currentuser
2003 $ hg graft --abort --currentuser
2006 abort: cannot specify any other flag with '--abort'
2004 abort: cannot specify any other flag with '--abort'
2007 [255]
2005 [255]
2008
2006
2009 $ hg graft --abort --edit
2007 $ hg graft --abort --edit
2010 abort: cannot specify any other flag with '--abort'
2008 abort: cannot specify any other flag with '--abort'
2011 [255]
2009 [255]
2012
2010
2013 $ hg graft --abort
2011 $ hg graft --abort
2014 graft aborted
2012 graft aborted
2015 working directory is now at 9150fe93bec6
2013 working directory is now at 9150fe93bec6
2016 $ hg log -GT "{rev}:{node|short} {desc}"
2014 $ hg log -GT "{rev}:{node|short} {desc}"
2017 o 5:36b793615f78 added foo to c
2015 o 5:36b793615f78 added foo to c
2018 |
2016 |
2019 | o 4:863a25e1a9ea added x
2017 | o 4:863a25e1a9ea added x
2020 |/
2018 |/
2021 | @ 3:9150fe93bec6 added d
2019 | @ 3:9150fe93bec6 added d
2022 | |
2020 | |
2023 | o 2:155349b645be added c
2021 | o 2:155349b645be added c
2024 |/
2022 |/
2025 o 1:5f6d8a4bf34a added b
2023 o 1:5f6d8a4bf34a added b
2026 |
2024 |
2027 o 0:9092f1db7931 added a
2025 o 0:9092f1db7931 added a
2028
2026
2029 when stripping is not required
2027 when stripping is not required
2030 $ hg graft -r 5
2028 $ hg graft -r 5
2031 grafting 5:36b793615f78 "added foo to c" (tip)
2029 grafting 5:36b793615f78 "added foo to c" (tip)
2032 merging c
2030 merging c
2033 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2031 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2034 abort: unresolved conflicts, can't continue
2032 abort: unresolved conflicts, can't continue
2035 (use 'hg resolve' and 'hg graft --continue')
2033 (use 'hg resolve' and 'hg graft --continue')
2036 [255]
2034 [255]
2037
2035
2038 $ hg graft --abort
2036 $ hg graft --abort
2039 graft aborted
2037 graft aborted
2040 working directory is now at 9150fe93bec6
2038 working directory is now at 9150fe93bec6
2041 $ hg log -GT "{rev}:{node|short} {desc}"
2039 $ hg log -GT "{rev}:{node|short} {desc}"
2042 o 5:36b793615f78 added foo to c
2040 o 5:36b793615f78 added foo to c
2043 |
2041 |
2044 | o 4:863a25e1a9ea added x
2042 | o 4:863a25e1a9ea added x
2045 |/
2043 |/
2046 | @ 3:9150fe93bec6 added d
2044 | @ 3:9150fe93bec6 added d
2047 | |
2045 | |
2048 | o 2:155349b645be added c
2046 | o 2:155349b645be added c
2049 |/
2047 |/
2050 o 1:5f6d8a4bf34a added b
2048 o 1:5f6d8a4bf34a added b
2051 |
2049 |
2052 o 0:9092f1db7931 added a
2050 o 0:9092f1db7931 added a
2053
2051
2054 when some of the changesets became public
2052 when some of the changesets became public
2055
2053
2056 $ hg graft -r 4 -r 5
2054 $ hg graft -r 4 -r 5
2057 grafting 4:863a25e1a9ea "added x"
2055 grafting 4:863a25e1a9ea "added x"
2058 grafting 5:36b793615f78 "added foo to c" (tip)
2056 grafting 5:36b793615f78 "added foo to c" (tip)
2059 merging c
2057 merging c
2060 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2058 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2061 abort: unresolved conflicts, can't continue
2059 abort: unresolved conflicts, can't continue
2062 (use 'hg resolve' and 'hg graft --continue')
2060 (use 'hg resolve' and 'hg graft --continue')
2063 [255]
2061 [255]
2064
2062
2065 $ hg log -GT "{rev}:{node|short} {desc}"
2063 $ hg log -GT "{rev}:{node|short} {desc}"
2066 @ 6:6ec71c037d94 added x
2064 @ 6:6ec71c037d94 added x
2067 |
2065 |
2068 | o 5:36b793615f78 added foo to c
2066 | o 5:36b793615f78 added foo to c
2069 | |
2067 | |
2070 | | o 4:863a25e1a9ea added x
2068 | | o 4:863a25e1a9ea added x
2071 | |/
2069 | |/
2072 o | 3:9150fe93bec6 added d
2070 o | 3:9150fe93bec6 added d
2073 | |
2071 | |
2074 o | 2:155349b645be added c
2072 o | 2:155349b645be added c
2075 |/
2073 |/
2076 o 1:5f6d8a4bf34a added b
2074 o 1:5f6d8a4bf34a added b
2077 |
2075 |
2078 o 0:9092f1db7931 added a
2076 o 0:9092f1db7931 added a
2079
2077
2080 $ hg phase -r 6 --public
2078 $ hg phase -r 6 --public
2081
2079
2082 $ hg graft --abort
2080 $ hg graft --abort
2083 cannot clean up public changesets 6ec71c037d94
2081 cannot clean up public changesets 6ec71c037d94
2084 graft aborted
2082 graft aborted
2085 working directory is now at 6ec71c037d94
2083 working directory is now at 6ec71c037d94
2086
2084
2087 when we created new changesets on top of existing one
2085 when we created new changesets on top of existing one
2088
2086
2089 $ hg up '.^^'
2087 $ hg up '.^^'
2090 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2088 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2091 $ echo y > y
2089 $ echo y > y
2092 $ hg ci -Aqm "added y"
2090 $ hg ci -Aqm "added y"
2093 $ echo z > z
2091 $ echo z > z
2094 $ hg ci -Aqm "added z"
2092 $ hg ci -Aqm "added z"
2095
2093
2096 $ hg up 3
2094 $ hg up 3
2097 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
2095 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
2098 $ hg log -GT "{rev}:{node|short} {desc}"
2096 $ hg log -GT "{rev}:{node|short} {desc}"
2099 o 8:637f9e9bbfd4 added z
2097 o 8:637f9e9bbfd4 added z
2100 |
2098 |
2101 o 7:123221671fd4 added y
2099 o 7:123221671fd4 added y
2102 |
2100 |
2103 | o 6:6ec71c037d94 added x
2101 | o 6:6ec71c037d94 added x
2104 | |
2102 | |
2105 | | o 5:36b793615f78 added foo to c
2103 | | o 5:36b793615f78 added foo to c
2106 | | |
2104 | | |
2107 | | | o 4:863a25e1a9ea added x
2105 | | | o 4:863a25e1a9ea added x
2108 | | |/
2106 | | |/
2109 | @ | 3:9150fe93bec6 added d
2107 | @ | 3:9150fe93bec6 added d
2110 |/ /
2108 |/ /
2111 o / 2:155349b645be added c
2109 o / 2:155349b645be added c
2112 |/
2110 |/
2113 o 1:5f6d8a4bf34a added b
2111 o 1:5f6d8a4bf34a added b
2114 |
2112 |
2115 o 0:9092f1db7931 added a
2113 o 0:9092f1db7931 added a
2116
2114
2117 $ hg graft -r 8 -r 7 -r 5
2115 $ hg graft -r 8 -r 7 -r 5
2118 grafting 8:637f9e9bbfd4 "added z" (tip)
2116 grafting 8:637f9e9bbfd4 "added z" (tip)
2119 grafting 7:123221671fd4 "added y"
2117 grafting 7:123221671fd4 "added y"
2120 grafting 5:36b793615f78 "added foo to c"
2118 grafting 5:36b793615f78 "added foo to c"
2121 merging c
2119 merging c
2122 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2120 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
2123 abort: unresolved conflicts, can't continue
2121 abort: unresolved conflicts, can't continue
2124 (use 'hg resolve' and 'hg graft --continue')
2122 (use 'hg resolve' and 'hg graft --continue')
2125 [255]
2123 [255]
2126
2124
2127 $ cd ..
2125 $ cd ..
2128 $ hg init pullrepo
2126 $ hg init pullrepo
2129 $ cd pullrepo
2127 $ cd pullrepo
2130 $ cat >> .hg/hgrc <<EOF
2128 $ cat >> .hg/hgrc <<EOF
2131 > [phases]
2129 > [phases]
2132 > publish=False
2130 > publish=False
2133 > EOF
2131 > EOF
2134 $ hg pull ../abortgraft --config phases.publish=False
2132 $ hg pull ../abortgraft --config phases.publish=False
2135 pulling from ../abortgraft
2133 pulling from ../abortgraft
2136 requesting all changes
2134 requesting all changes
2137 adding changesets
2135 adding changesets
2138 adding manifests
2136 adding manifests
2139 adding file changes
2137 adding file changes
2140 added 11 changesets with 9 changes to 8 files (+4 heads)
2138 added 11 changesets with 9 changes to 8 files (+4 heads)
2141 new changesets 9092f1db7931:6b98ff0062dd (6 drafts)
2139 new changesets 9092f1db7931:6b98ff0062dd (6 drafts)
2142 (run 'hg heads' to see heads, 'hg merge' to merge)
2140 (run 'hg heads' to see heads, 'hg merge' to merge)
2143 $ hg up 9
2141 $ hg up 9
2144 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
2142 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
2145 $ echo w > w
2143 $ echo w > w
2146 $ hg ci -Aqm "added w" --config phases.publish=False
2144 $ hg ci -Aqm "added w" --config phases.publish=False
2147
2145
2148 $ cd ../abortgraft
2146 $ cd ../abortgraft
2149 $ hg pull ../pullrepo
2147 $ hg pull ../pullrepo
2150 pulling from ../pullrepo
2148 pulling from ../pullrepo
2151 searching for changes
2149 searching for changes
2152 adding changesets
2150 adding changesets
2153 adding manifests
2151 adding manifests
2154 adding file changes
2152 adding file changes
2155 added 1 changesets with 1 changes to 1 files (+1 heads)
2153 added 1 changesets with 1 changes to 1 files (+1 heads)
2156 new changesets 311dfc6cf3bf (1 drafts)
2154 new changesets 311dfc6cf3bf (1 drafts)
2157 (run 'hg heads .' to see heads, 'hg merge' to merge)
2155 (run 'hg heads .' to see heads, 'hg merge' to merge)
2158
2156
2159 $ hg graft --abort
2157 $ hg graft --abort
2160 new changesets detected on destination branch, can't strip
2158 new changesets detected on destination branch, can't strip
2161 graft aborted
2159 graft aborted
2162 working directory is now at 6b98ff0062dd
2160 working directory is now at 6b98ff0062dd
2163
2161
2164 $ cd ..
2162 $ cd ..
2165
2163
2166 ============================
2164 ============================
2167 Testing --no-commit option:|
2165 Testing --no-commit option:|
2168 ============================
2166 ============================
2169
2167
2170 $ hg init nocommit
2168 $ hg init nocommit
2171 $ cd nocommit
2169 $ cd nocommit
2172 $ echo a > a
2170 $ echo a > a
2173 $ hg ci -qAma
2171 $ hg ci -qAma
2174 $ echo b > b
2172 $ echo b > b
2175 $ hg ci -qAmb
2173 $ hg ci -qAmb
2176 $ hg up -q 0
2174 $ hg up -q 0
2177 $ echo c > c
2175 $ echo c > c
2178 $ hg ci -qAmc
2176 $ hg ci -qAmc
2179 $ hg log -GT "{rev}:{node|short} {desc}\n"
2177 $ hg log -GT "{rev}:{node|short} {desc}\n"
2180 @ 2:d36c0562f908 c
2178 @ 2:d36c0562f908 c
2181 |
2179 |
2182 | o 1:d2ae7f538514 b
2180 | o 1:d2ae7f538514 b
2183 |/
2181 |/
2184 o 0:cb9a9f314b8b a
2182 o 0:cb9a9f314b8b a
2185
2183
2186
2184
2187 Check reporting when --no-commit used with non-applicable options:
2185 Check reporting when --no-commit used with non-applicable options:
2188
2186
2189 $ hg graft 1 --no-commit -e
2187 $ hg graft 1 --no-commit -e
2190 abort: cannot specify --no-commit and --edit together
2188 abort: cannot specify --no-commit and --edit together
2191 [255]
2189 [255]
2192
2190
2193 $ hg graft 1 --no-commit --log
2191 $ hg graft 1 --no-commit --log
2194 abort: cannot specify --no-commit and --log together
2192 abort: cannot specify --no-commit and --log together
2195 [255]
2193 [255]
2196
2194
2197 $ hg graft 1 --no-commit -D
2195 $ hg graft 1 --no-commit -D
2198 abort: cannot specify --no-commit and --currentdate together
2196 abort: cannot specify --no-commit and --currentdate together
2199 [255]
2197 [255]
2200
2198
2201 Test --no-commit is working:
2199 Test --no-commit is working:
2202 $ hg graft 1 --no-commit
2200 $ hg graft 1 --no-commit
2203 grafting 1:d2ae7f538514 "b"
2201 grafting 1:d2ae7f538514 "b"
2204
2202
2205 $ hg log -GT "{rev}:{node|short} {desc}\n"
2203 $ hg log -GT "{rev}:{node|short} {desc}\n"
2206 @ 2:d36c0562f908 c
2204 @ 2:d36c0562f908 c
2207 |
2205 |
2208 | o 1:d2ae7f538514 b
2206 | o 1:d2ae7f538514 b
2209 |/
2207 |/
2210 o 0:cb9a9f314b8b a
2208 o 0:cb9a9f314b8b a
2211
2209
2212
2210
2213 $ hg diff
2211 $ hg diff
2214 diff -r d36c0562f908 b
2212 diff -r d36c0562f908 b
2215 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2213 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2216 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2214 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2217 @@ -0,0 +1,1 @@
2215 @@ -0,0 +1,1 @@
2218 +b
2216 +b
2219
2217
2220 Prepare wrdir to check --no-commit is resepected after --continue:
2218 Prepare wrdir to check --no-commit is resepected after --continue:
2221
2219
2222 $ hg up -qC
2220 $ hg up -qC
2223 $ echo A>a
2221 $ echo A>a
2224 $ hg ci -qm "A in file a"
2222 $ hg ci -qm "A in file a"
2225 $ hg up -q 1
2223 $ hg up -q 1
2226 $ echo B>a
2224 $ echo B>a
2227 $ hg ci -qm "B in file a"
2225 $ hg ci -qm "B in file a"
2228 $ hg log -GT "{rev}:{node|short} {desc}\n"
2226 $ hg log -GT "{rev}:{node|short} {desc}\n"
2229 @ 4:2aa9ad1006ff B in file a
2227 @ 4:2aa9ad1006ff B in file a
2230 |
2228 |
2231 | o 3:09e253b87e17 A in file a
2229 | o 3:09e253b87e17 A in file a
2232 | |
2230 | |
2233 | o 2:d36c0562f908 c
2231 | o 2:d36c0562f908 c
2234 | |
2232 | |
2235 o | 1:d2ae7f538514 b
2233 o | 1:d2ae7f538514 b
2236 |/
2234 |/
2237 o 0:cb9a9f314b8b a
2235 o 0:cb9a9f314b8b a
2238
2236
2239
2237
2240 $ hg graft 3 --no-commit
2238 $ hg graft 3 --no-commit
2241 grafting 3:09e253b87e17 "A in file a"
2239 grafting 3:09e253b87e17 "A in file a"
2242 merging a
2240 merging a
2243 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2241 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2244 abort: unresolved conflicts, can't continue
2242 abort: unresolved conflicts, can't continue
2245 (use 'hg resolve' and 'hg graft --continue')
2243 (use 'hg resolve' and 'hg graft --continue')
2246 [255]
2244 [255]
2247
2245
2248 Resolve conflict:
2246 Resolve conflict:
2249 $ echo A>a
2247 $ echo A>a
2250 $ hg resolve --mark
2248 $ hg resolve --mark
2251 (no more unresolved files)
2249 (no more unresolved files)
2252 continue: hg graft --continue
2250 continue: hg graft --continue
2253
2251
2254 $ hg graft --continue
2252 $ hg graft --continue
2255 grafting 3:09e253b87e17 "A in file a"
2253 grafting 3:09e253b87e17 "A in file a"
2256 $ hg log -GT "{rev}:{node|short} {desc}\n"
2254 $ hg log -GT "{rev}:{node|short} {desc}\n"
2257 @ 4:2aa9ad1006ff B in file a
2255 @ 4:2aa9ad1006ff B in file a
2258 |
2256 |
2259 | o 3:09e253b87e17 A in file a
2257 | o 3:09e253b87e17 A in file a
2260 | |
2258 | |
2261 | o 2:d36c0562f908 c
2259 | o 2:d36c0562f908 c
2262 | |
2260 | |
2263 o | 1:d2ae7f538514 b
2261 o | 1:d2ae7f538514 b
2264 |/
2262 |/
2265 o 0:cb9a9f314b8b a
2263 o 0:cb9a9f314b8b a
2266
2264
2267 $ hg diff
2265 $ hg diff
2268 diff -r 2aa9ad1006ff a
2266 diff -r 2aa9ad1006ff a
2269 --- a/a Thu Jan 01 00:00:00 1970 +0000
2267 --- a/a Thu Jan 01 00:00:00 1970 +0000
2270 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2268 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2271 @@ -1,1 +1,1 @@
2269 @@ -1,1 +1,1 @@
2272 -B
2270 -B
2273 +A
2271 +A
2274
2272
2275 $ hg up -qC
2273 $ hg up -qC
2276
2274
2277 Check --no-commit is resepected when passed with --continue:
2275 Check --no-commit is resepected when passed with --continue:
2278
2276
2279 $ hg graft 3
2277 $ hg graft 3
2280 grafting 3:09e253b87e17 "A in file a"
2278 grafting 3:09e253b87e17 "A in file a"
2281 merging a
2279 merging a
2282 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2280 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2283 abort: unresolved conflicts, can't continue
2281 abort: unresolved conflicts, can't continue
2284 (use 'hg resolve' and 'hg graft --continue')
2282 (use 'hg resolve' and 'hg graft --continue')
2285 [255]
2283 [255]
2286
2284
2287 Resolve conflict:
2285 Resolve conflict:
2288 $ echo A>a
2286 $ echo A>a
2289 $ hg resolve --mark
2287 $ hg resolve --mark
2290 (no more unresolved files)
2288 (no more unresolved files)
2291 continue: hg graft --continue
2289 continue: hg graft --continue
2292
2290
2293 $ hg graft --continue --no-commit
2291 $ hg graft --continue --no-commit
2294 grafting 3:09e253b87e17 "A in file a"
2292 grafting 3:09e253b87e17 "A in file a"
2295 $ hg diff
2293 $ hg diff
2296 diff -r 2aa9ad1006ff a
2294 diff -r 2aa9ad1006ff a
2297 --- a/a Thu Jan 01 00:00:00 1970 +0000
2295 --- a/a Thu Jan 01 00:00:00 1970 +0000
2298 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2296 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2299 @@ -1,1 +1,1 @@
2297 @@ -1,1 +1,1 @@
2300 -B
2298 -B
2301 +A
2299 +A
2302
2300
2303 $ hg log -GT "{rev}:{node|short} {desc}\n"
2301 $ hg log -GT "{rev}:{node|short} {desc}\n"
2304 @ 4:2aa9ad1006ff B in file a
2302 @ 4:2aa9ad1006ff B in file a
2305 |
2303 |
2306 | o 3:09e253b87e17 A in file a
2304 | o 3:09e253b87e17 A in file a
2307 | |
2305 | |
2308 | o 2:d36c0562f908 c
2306 | o 2:d36c0562f908 c
2309 | |
2307 | |
2310 o | 1:d2ae7f538514 b
2308 o | 1:d2ae7f538514 b
2311 |/
2309 |/
2312 o 0:cb9a9f314b8b a
2310 o 0:cb9a9f314b8b a
2313
2311
2314 $ hg up -qC
2312 $ hg up -qC
2315
2313
2316 Test --no-commit when graft multiple revisions:
2314 Test --no-commit when graft multiple revisions:
2317 When there is conflict:
2315 When there is conflict:
2318 $ hg graft -r "2::3" --no-commit
2316 $ hg graft -r "2::3" --no-commit
2319 grafting 2:d36c0562f908 "c"
2317 grafting 2:d36c0562f908 "c"
2320 grafting 3:09e253b87e17 "A in file a"
2318 grafting 3:09e253b87e17 "A in file a"
2321 merging a
2319 merging a
2322 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2320 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2323 abort: unresolved conflicts, can't continue
2321 abort: unresolved conflicts, can't continue
2324 (use 'hg resolve' and 'hg graft --continue')
2322 (use 'hg resolve' and 'hg graft --continue')
2325 [255]
2323 [255]
2326
2324
2327 $ echo A>a
2325 $ echo A>a
2328 $ hg resolve --mark
2326 $ hg resolve --mark
2329 (no more unresolved files)
2327 (no more unresolved files)
2330 continue: hg graft --continue
2328 continue: hg graft --continue
2331 $ hg graft --continue
2329 $ hg graft --continue
2332 grafting 3:09e253b87e17 "A in file a"
2330 grafting 3:09e253b87e17 "A in file a"
2333 $ hg diff
2331 $ hg diff
2334 diff -r 2aa9ad1006ff a
2332 diff -r 2aa9ad1006ff a
2335 --- a/a Thu Jan 01 00:00:00 1970 +0000
2333 --- a/a Thu Jan 01 00:00:00 1970 +0000
2336 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2334 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2337 @@ -1,1 +1,1 @@
2335 @@ -1,1 +1,1 @@
2338 -B
2336 -B
2339 +A
2337 +A
2340 diff -r 2aa9ad1006ff c
2338 diff -r 2aa9ad1006ff c
2341 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2339 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2342 +++ b/c Thu Jan 01 00:00:00 1970 +0000
2340 +++ b/c Thu Jan 01 00:00:00 1970 +0000
2343 @@ -0,0 +1,1 @@
2341 @@ -0,0 +1,1 @@
2344 +c
2342 +c
2345
2343
2346 $ hg log -GT "{rev}:{node|short} {desc}\n"
2344 $ hg log -GT "{rev}:{node|short} {desc}\n"
2347 @ 4:2aa9ad1006ff B in file a
2345 @ 4:2aa9ad1006ff B in file a
2348 |
2346 |
2349 | o 3:09e253b87e17 A in file a
2347 | o 3:09e253b87e17 A in file a
2350 | |
2348 | |
2351 | o 2:d36c0562f908 c
2349 | o 2:d36c0562f908 c
2352 | |
2350 | |
2353 o | 1:d2ae7f538514 b
2351 o | 1:d2ae7f538514 b
2354 |/
2352 |/
2355 o 0:cb9a9f314b8b a
2353 o 0:cb9a9f314b8b a
2356
2354
2357 $ hg up -qC
2355 $ hg up -qC
2358
2356
2359 When there is no conflict:
2357 When there is no conflict:
2360 $ echo d>d
2358 $ echo d>d
2361 $ hg add d -q
2359 $ hg add d -q
2362 $ hg ci -qmd
2360 $ hg ci -qmd
2363 $ hg up 3 -q
2361 $ hg up 3 -q
2364 $ hg log -GT "{rev}:{node|short} {desc}\n"
2362 $ hg log -GT "{rev}:{node|short} {desc}\n"
2365 o 5:baefa8927fc0 d
2363 o 5:baefa8927fc0 d
2366 |
2364 |
2367 o 4:2aa9ad1006ff B in file a
2365 o 4:2aa9ad1006ff B in file a
2368 |
2366 |
2369 | @ 3:09e253b87e17 A in file a
2367 | @ 3:09e253b87e17 A in file a
2370 | |
2368 | |
2371 | o 2:d36c0562f908 c
2369 | o 2:d36c0562f908 c
2372 | |
2370 | |
2373 o | 1:d2ae7f538514 b
2371 o | 1:d2ae7f538514 b
2374 |/
2372 |/
2375 o 0:cb9a9f314b8b a
2373 o 0:cb9a9f314b8b a
2376
2374
2377
2375
2378 $ hg graft -r 1 -r 5 --no-commit
2376 $ hg graft -r 1 -r 5 --no-commit
2379 grafting 1:d2ae7f538514 "b"
2377 grafting 1:d2ae7f538514 "b"
2380 grafting 5:baefa8927fc0 "d" (tip)
2378 grafting 5:baefa8927fc0 "d" (tip)
2381 $ hg diff
2379 $ hg diff
2382 diff -r 09e253b87e17 b
2380 diff -r 09e253b87e17 b
2383 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2381 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2384 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2382 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2385 @@ -0,0 +1,1 @@
2383 @@ -0,0 +1,1 @@
2386 +b
2384 +b
2387 diff -r 09e253b87e17 d
2385 diff -r 09e253b87e17 d
2388 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2386 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2389 +++ b/d Thu Jan 01 00:00:00 1970 +0000
2387 +++ b/d Thu Jan 01 00:00:00 1970 +0000
2390 @@ -0,0 +1,1 @@
2388 @@ -0,0 +1,1 @@
2391 +d
2389 +d
2392 $ hg log -GT "{rev}:{node|short} {desc}\n"
2390 $ hg log -GT "{rev}:{node|short} {desc}\n"
2393 o 5:baefa8927fc0 d
2391 o 5:baefa8927fc0 d
2394 |
2392 |
2395 o 4:2aa9ad1006ff B in file a
2393 o 4:2aa9ad1006ff B in file a
2396 |
2394 |
2397 | @ 3:09e253b87e17 A in file a
2395 | @ 3:09e253b87e17 A in file a
2398 | |
2396 | |
2399 | o 2:d36c0562f908 c
2397 | o 2:d36c0562f908 c
2400 | |
2398 | |
2401 o | 1:d2ae7f538514 b
2399 o | 1:d2ae7f538514 b
2402 |/
2400 |/
2403 o 0:cb9a9f314b8b a
2401 o 0:cb9a9f314b8b a
2404
2402
2405 $ cd ..
2403 $ cd ..
@@ -1,1052 +1,1031 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 unmatched files in other:
79 unmatched files in other:
80 b
80 b
81 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
81 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
82 src: 'a' -> dst: 'b' *
82 src: 'a' -> dst: 'b' *
83 checking for directory renames
83 checking for directory renames
84 resolving manifests
84 resolving manifests
85 branchmerge: True, force: False, partial: False
85 branchmerge: True, force: False, partial: False
86 ancestor: 924404dff337, local: e300d1c794ec+, remote: 4ce40f5aca24
86 ancestor: 924404dff337, local: e300d1c794ec+, remote: 4ce40f5aca24
87 preserving a for resolve of b
87 preserving a for resolve of b
88 preserving rev for resolve of rev
88 preserving rev for resolve of rev
89 starting 4 threads for background file closing (?)
89 starting 4 threads for background file closing (?)
90 b: remote copied from a -> m (premerge)
90 b: remote copied from a -> m (premerge)
91 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)
92 merging a and b to b
92 merging a and b to b
93 my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337
93 my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337
94 premerge successful
94 premerge successful
95 rev: versions differ -> m (premerge)
95 rev: versions differ -> m (premerge)
96 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)
97 merging rev
97 merging rev
98 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
98 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
99 rev: versions differ -> m (merge)
99 rev: versions differ -> m (merge)
100 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)
101 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
101 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
102 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
102 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
103 merge tool returned: 0
103 merge tool returned: 0
104 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
105 (branch merge, don't forget to commit)
105 (branch merge, don't forget to commit)
106 --------------
106 --------------
107 M b
107 M b
108 a
108 a
109 C a
109 C a
110 --------------
110 --------------
111
111
112 $ 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"
113 created new head
113 created new head
114 --------------
114 --------------
115 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
116 --------------
116 --------------
117 unmatched files in local:
117 unmatched files in local:
118 b
118 b
119 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
119 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
120 src: 'a' -> dst: 'b' *
120 src: 'a' -> dst: 'b' *
121 checking for directory renames
121 checking for directory renames
122 resolving manifests
122 resolving manifests
123 branchmerge: True, force: False, partial: False
123 branchmerge: True, force: False, partial: False
124 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: f4db7e329e71
124 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: f4db7e329e71
125 preserving b for resolve of b
125 preserving b for resolve of b
126 preserving rev for resolve of rev
126 preserving rev for resolve of rev
127 a: remote is newer -> g
127 a: remote is newer -> g
128 getting a
128 getting a
129 b: local copied/moved from a -> m (premerge)
129 b: local copied/moved from a -> m (premerge)
130 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)
131 merging b and a to b
131 merging b and a to b
132 my b@86a2aa42fc76+ other a@f4db7e329e71 ancestor a@924404dff337
132 my b@86a2aa42fc76+ other a@f4db7e329e71 ancestor a@924404dff337
133 premerge successful
133 premerge successful
134 rev: versions differ -> m (premerge)
134 rev: versions differ -> m (premerge)
135 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)
136 merging rev
136 merging rev
137 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
137 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
138 rev: versions differ -> m (merge)
138 rev: versions differ -> m (merge)
139 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)
140 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
140 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
141 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
141 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
142 merge tool returned: 0
142 merge tool returned: 0
143 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
144 (branch merge, don't forget to commit)
144 (branch merge, don't forget to commit)
145 --------------
145 --------------
146 M a
146 M a
147 M b
147 M b
148 a
148 a
149 --------------
149 --------------
150
150
151 $ 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"
152 created new head
152 created new head
153 --------------
153 --------------
154 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
155 --------------
155 --------------
156 unmatched files in other:
156 unmatched files in other:
157 b
157 b
158 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
158 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
159 src: 'a' -> dst: 'b' *
159 src: 'a' -> dst: 'b' *
160 checking for directory renames
160 checking for directory renames
161 resolving manifests
161 resolving manifests
162 branchmerge: True, force: False, partial: False
162 branchmerge: True, force: False, partial: False
163 ancestor: 924404dff337, local: e300d1c794ec+, remote: bdb19105162a
163 ancestor: 924404dff337, local: e300d1c794ec+, remote: bdb19105162a
164 preserving a for resolve of b
164 preserving a for resolve of b
165 preserving rev for resolve of rev
165 preserving rev for resolve of rev
166 removing a
166 removing a
167 starting 4 threads for background file closing (?)
167 starting 4 threads for background file closing (?)
168 b: remote moved from a -> m (premerge)
168 b: remote moved from a -> m (premerge)
169 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)
170 merging a and b to b
170 merging a and b to b
171 my b@e300d1c794ec+ other b@bdb19105162a ancestor a@924404dff337
171 my b@e300d1c794ec+ other b@bdb19105162a ancestor a@924404dff337
172 premerge successful
172 premerge successful
173 rev: versions differ -> m (premerge)
173 rev: versions differ -> m (premerge)
174 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)
175 merging rev
175 merging rev
176 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
176 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
177 rev: versions differ -> m (merge)
177 rev: versions differ -> m (merge)
178 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)
179 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
179 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
180 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
180 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
181 merge tool returned: 0
181 merge tool returned: 0
182 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
183 (branch merge, don't forget to commit)
183 (branch merge, don't forget to commit)
184 --------------
184 --------------
185 M b
185 M b
186 a
186 a
187 --------------
187 --------------
188
188
189 $ 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"
190 created new head
190 created new head
191 --------------
191 --------------
192 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
193 --------------
193 --------------
194 unmatched files in local:
194 unmatched files in local:
195 b
195 b
196 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
196 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
197 src: 'a' -> dst: 'b' *
197 src: 'a' -> dst: 'b' *
198 checking for directory renames
198 checking for directory renames
199 resolving manifests
199 resolving manifests
200 branchmerge: True, force: False, partial: False
200 branchmerge: True, force: False, partial: False
201 ancestor: 924404dff337, local: 02963e448370+, remote: f4db7e329e71
201 ancestor: 924404dff337, local: 02963e448370+, remote: f4db7e329e71
202 preserving b for resolve of b
202 preserving b for resolve of b
203 preserving rev for resolve of rev
203 preserving rev for resolve of rev
204 starting 4 threads for background file closing (?)
204 starting 4 threads for background file closing (?)
205 b: local copied/moved from a -> m (premerge)
205 b: local copied/moved from a -> m (premerge)
206 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)
207 merging b and a to b
207 merging b and a to b
208 my b@02963e448370+ other a@f4db7e329e71 ancestor a@924404dff337
208 my b@02963e448370+ other a@f4db7e329e71 ancestor a@924404dff337
209 premerge successful
209 premerge successful
210 rev: versions differ -> m (premerge)
210 rev: versions differ -> m (premerge)
211 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)
212 merging rev
212 merging rev
213 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
213 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
214 rev: versions differ -> m (merge)
214 rev: versions differ -> m (merge)
215 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)
216 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
216 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
217 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
217 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
218 merge tool returned: 0
218 merge tool returned: 0
219 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
220 (branch merge, don't forget to commit)
220 (branch merge, don't forget to commit)
221 --------------
221 --------------
222 M b
222 M b
223 a
223 a
224 --------------
224 --------------
225
225
226 $ tm " " "nc a b" " " "5 get b"
226 $ tm " " "nc a b" " " "5 get b"
227 created new head
227 created new head
228 --------------
228 --------------
229 test L: R:nc a b W: - 5 get b
229 test L: R:nc a b W: - 5 get b
230 --------------
230 --------------
231 unmatched files in other:
231 unmatched files in other:
232 b
232 b
233 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
233 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
234 src: 'a' -> dst: 'b'
234 src: 'a' -> dst: 'b'
235 checking for directory renames
235 checking for directory renames
236 resolving manifests
236 resolving manifests
237 branchmerge: True, force: False, partial: False
237 branchmerge: True, force: False, partial: False
238 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: 4ce40f5aca24
238 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: 4ce40f5aca24
239 preserving rev for resolve of rev
239 preserving rev for resolve of rev
240 b: remote created -> g
240 b: remote created -> g
241 getting b
241 getting b
242 rev: versions differ -> m (premerge)
242 rev: versions differ -> m (premerge)
243 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)
244 merging rev
244 merging rev
245 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
245 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
246 rev: versions differ -> m (merge)
246 rev: versions differ -> m (merge)
247 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)
248 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
248 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
249 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
249 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
250 merge tool returned: 0
250 merge tool returned: 0
251 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
252 (branch merge, don't forget to commit)
252 (branch merge, don't forget to commit)
253 --------------
253 --------------
254 M b
254 M b
255 C a
255 C a
256 --------------
256 --------------
257
257
258 $ tm "nc a b" " " " " "6 nothing"
258 $ tm "nc a b" " " " " "6 nothing"
259 created new head
259 created new head
260 --------------
260 --------------
261 test L:nc a b R: W: - 6 nothing
261 test L:nc a b R: W: - 6 nothing
262 --------------
262 --------------
263 unmatched files in local:
263 unmatched files in local:
264 b
264 b
265 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
265 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
266 src: 'a' -> dst: 'b'
266 src: 'a' -> dst: 'b'
267 checking for directory renames
267 checking for directory renames
268 resolving manifests
268 resolving manifests
269 branchmerge: True, force: False, partial: False
269 branchmerge: True, force: False, partial: False
270 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 97c705ade336
270 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 97c705ade336
271 preserving rev for resolve of rev
271 preserving rev for resolve of rev
272 starting 4 threads for background file closing (?)
272 starting 4 threads for background file closing (?)
273 rev: versions differ -> m (premerge)
273 rev: versions differ -> m (premerge)
274 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)
275 merging rev
275 merging rev
276 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
276 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
277 rev: versions differ -> m (merge)
277 rev: versions differ -> m (merge)
278 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)
279 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
279 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
280 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
280 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
281 merge tool returned: 0
281 merge tool returned: 0
282 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
283 (branch merge, don't forget to commit)
283 (branch merge, don't forget to commit)
284 --------------
284 --------------
285 C a
285 C a
286 C b
286 C b
287 --------------
287 --------------
288
288
289 $ tm " " "nm a b" " " "7 get b"
289 $ tm " " "nm a b" " " "7 get b"
290 created new head
290 created new head
291 --------------
291 --------------
292 test L: R:nm a b W: - 7 get b
292 test L: R:nm a b W: - 7 get b
293 --------------
293 --------------
294 unmatched files in other:
294 unmatched files in other:
295 b
295 b
296 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
296 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
297 src: 'a' -> dst: 'b'
297 src: 'a' -> dst: 'b'
298 checking for directory renames
298 checking for directory renames
299 resolving manifests
299 resolving manifests
300 branchmerge: True, force: False, partial: False
300 branchmerge: True, force: False, partial: False
301 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: bdb19105162a
301 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: bdb19105162a
302 preserving rev for resolve of rev
302 preserving rev for resolve of rev
303 a: other deleted -> r
303 a: other deleted -> r
304 removing a
304 removing a
305 b: remote created -> g
305 b: remote created -> g
306 getting b
306 getting b
307 rev: versions differ -> m (premerge)
307 rev: versions differ -> m (premerge)
308 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)
309 merging rev
309 merging rev
310 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
310 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
311 rev: versions differ -> m (merge)
311 rev: versions differ -> m (merge)
312 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)
313 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
313 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
314 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
314 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
315 merge tool returned: 0
315 merge tool returned: 0
316 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
317 (branch merge, don't forget to commit)
317 (branch merge, don't forget to commit)
318 --------------
318 --------------
319 M b
319 M b
320 --------------
320 --------------
321
321
322 $ tm "nm a b" " " " " "8 nothing"
322 $ tm "nm a b" " " " " "8 nothing"
323 created new head
323 created new head
324 --------------
324 --------------
325 test L:nm a b R: W: - 8 nothing
325 test L:nm a b R: W: - 8 nothing
326 --------------
326 --------------
327 unmatched files in local:
327 unmatched files in local:
328 b
328 b
329 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
329 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
330 src: 'a' -> dst: 'b'
330 src: 'a' -> dst: 'b'
331 checking for directory renames
331 checking for directory renames
332 resolving manifests
332 resolving manifests
333 branchmerge: True, force: False, partial: False
333 branchmerge: True, force: False, partial: False
334 ancestor: 924404dff337, local: 02963e448370+, remote: 97c705ade336
334 ancestor: 924404dff337, local: 02963e448370+, remote: 97c705ade336
335 preserving rev for resolve of rev
335 preserving rev for resolve of rev
336 starting 4 threads for background file closing (?)
336 starting 4 threads for background file closing (?)
337 rev: versions differ -> m (premerge)
337 rev: versions differ -> m (premerge)
338 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)
339 merging rev
339 merging rev
340 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
340 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
341 rev: versions differ -> m (merge)
341 rev: versions differ -> m (merge)
342 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)
343 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
343 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
344 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
344 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
345 merge tool returned: 0
345 merge tool returned: 0
346 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
347 (branch merge, don't forget to commit)
347 (branch merge, don't forget to commit)
348 --------------
348 --------------
349 C b
349 C b
350 --------------
350 --------------
351
351
352 $ 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"
353 created new head
353 created new head
354 --------------
354 --------------
355 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
356 --------------
356 --------------
357 unmatched files new in both:
358 b
359 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
357 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
360 src: 'a' -> dst: 'b' *
358 src: 'a' -> dst: 'b' *
361 checking for directory renames
359 checking for directory renames
362 resolving manifests
360 resolving manifests
363 branchmerge: True, force: False, partial: False
361 branchmerge: True, force: False, partial: False
364 ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493
362 ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493
365 preserving b for resolve of b
363 preserving b for resolve of b
366 preserving rev for resolve of rev
364 preserving rev for resolve of rev
367 starting 4 threads for background file closing (?)
365 starting 4 threads for background file closing (?)
368 b: both renamed from a -> m (premerge)
366 b: both renamed from a -> m (premerge)
369 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
367 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
370 merging b
368 merging b
371 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
369 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
372 rev: versions differ -> m (premerge)
370 rev: versions differ -> m (premerge)
373 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
371 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
374 merging rev
372 merging rev
375 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
373 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
376 b: both renamed from a -> m (merge)
374 b: both renamed from a -> m (merge)
377 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
375 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
378 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
376 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
379 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
377 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
380 merge tool returned: 0
378 merge tool returned: 0
381 rev: versions differ -> m (merge)
379 rev: versions differ -> m (merge)
382 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
380 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
383 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
381 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
384 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
382 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
385 merge tool returned: 0
383 merge tool returned: 0
386 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
384 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
387 (branch merge, don't forget to commit)
385 (branch merge, don't forget to commit)
388 --------------
386 --------------
389 M b
387 M b
390 --------------
388 --------------
391
389
392
390
393 m "um a c" "um x c" " " "10 do merge with no ancestor"
391 m "um a c" "um x c" " " "10 do merge with no ancestor"
394
392
395 $ tm "nm a b" "nm a c" " " "11 get c, keep b"
393 $ tm "nm a b" "nm a c" " " "11 get c, keep b"
396 created new head
394 created new head
397 --------------
395 --------------
398 test L:nm a b R:nm a c W: - 11 get c, keep b
396 test L:nm a b R:nm a c W: - 11 get c, keep b
399 --------------
397 --------------
400 unmatched files in local:
398 unmatched files in local:
401 b
399 b
402 unmatched files in other:
400 unmatched files in other:
403 c
401 c
404 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
402 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
405 src: 'a' -> dst: 'b' !
403 src: 'a' -> dst: 'b' !
406 src: 'a' -> dst: 'c' !
404 src: 'a' -> dst: 'c' !
407 checking for directory renames
405 checking for directory renames
408 resolving manifests
406 resolving manifests
409 branchmerge: True, force: False, partial: False
407 branchmerge: True, force: False, partial: False
410 ancestor: 924404dff337, local: 02963e448370+, remote: fe905ef2c33e
408 ancestor: 924404dff337, local: 02963e448370+, remote: fe905ef2c33e
411 note: possible conflict - a was renamed multiple times to:
409 note: possible conflict - a was renamed multiple times to:
412 b
410 b
413 c
411 c
414 preserving rev for resolve of rev
412 preserving rev for resolve of rev
415 c: remote created -> g
413 c: remote created -> g
416 getting c
414 getting c
417 rev: versions differ -> m (premerge)
415 rev: versions differ -> m (premerge)
418 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
416 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
419 merging rev
417 merging rev
420 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
418 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
421 rev: versions differ -> m (merge)
419 rev: versions differ -> m (merge)
422 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
420 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
423 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
421 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
424 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
422 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
425 merge tool returned: 0
423 merge tool returned: 0
426 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
424 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
427 (branch merge, don't forget to commit)
425 (branch merge, don't forget to commit)
428 --------------
426 --------------
429 M c
427 M c
430 C b
428 C b
431 --------------
429 --------------
432
430
433 $ tm "nc a b" "up b " " " "12 merge b no ancestor"
431 $ tm "nc a b" "up b " " " "12 merge b no ancestor"
434 created new head
432 created new head
435 --------------
433 --------------
436 test L:nc a b R:up b W: - 12 merge b no ancestor
434 test L:nc a b R:up b W: - 12 merge b no ancestor
437 --------------
435 --------------
438 unmatched files new in both:
439 b
440 resolving manifests
436 resolving manifests
441 branchmerge: True, force: False, partial: False
437 branchmerge: True, force: False, partial: False
442 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7
438 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7
443 preserving b for resolve of b
439 preserving b for resolve of b
444 preserving rev for resolve of rev
440 preserving rev for resolve of rev
445 starting 4 threads for background file closing (?)
441 starting 4 threads for background file closing (?)
446 b: both created -> m (premerge)
442 b: both created -> m (premerge)
447 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
443 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
448 merging b
444 merging b
449 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
445 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
450 rev: versions differ -> m (premerge)
446 rev: versions differ -> m (premerge)
451 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
447 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
452 merging rev
448 merging rev
453 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
449 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
454 b: both created -> m (merge)
450 b: both created -> m (merge)
455 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
451 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
456 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
452 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
457 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
453 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
458 merge tool returned: 0
454 merge tool returned: 0
459 rev: versions differ -> m (merge)
455 rev: versions differ -> m (merge)
460 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
456 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
461 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
457 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
462 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
458 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
463 merge tool returned: 0
459 merge tool returned: 0
464 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
460 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
465 (branch merge, don't forget to commit)
461 (branch merge, don't forget to commit)
466 --------------
462 --------------
467 M b
463 M b
468 C a
464 C a
469 --------------
465 --------------
470
466
471 $ tm "up b " "nm a b" " " "13 merge b no ancestor"
467 $ tm "up b " "nm a b" " " "13 merge b no ancestor"
472 created new head
468 created new head
473 --------------
469 --------------
474 test L:up b R:nm a b W: - 13 merge b no ancestor
470 test L:up b R:nm a b W: - 13 merge b no ancestor
475 --------------
471 --------------
476 unmatched files new in both:
477 b
478 resolving manifests
472 resolving manifests
479 branchmerge: True, force: False, partial: False
473 branchmerge: True, force: False, partial: False
480 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
474 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
481 preserving b for resolve of b
475 preserving b for resolve of b
482 preserving rev for resolve of rev
476 preserving rev for resolve of rev
483 a: other deleted -> r
477 a: other deleted -> r
484 removing a
478 removing a
485 starting 4 threads for background file closing (?)
479 starting 4 threads for background file closing (?)
486 b: both created -> m (premerge)
480 b: both created -> m (premerge)
487 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
481 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
488 merging b
482 merging b
489 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
483 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
490 rev: versions differ -> m (premerge)
484 rev: versions differ -> m (premerge)
491 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
485 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
492 merging rev
486 merging rev
493 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
487 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
494 b: both created -> m (merge)
488 b: both created -> m (merge)
495 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
489 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
496 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
490 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
497 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
491 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
498 merge tool returned: 0
492 merge tool returned: 0
499 rev: versions differ -> m (merge)
493 rev: versions differ -> m (merge)
500 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
494 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
501 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
495 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
502 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
496 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
503 merge tool returned: 0
497 merge tool returned: 0
504 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
498 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
505 (branch merge, don't forget to commit)
499 (branch merge, don't forget to commit)
506 --------------
500 --------------
507 M b
501 M b
508 --------------
502 --------------
509
503
510 $ tm "nc a b" "up a b" " " "14 merge b no ancestor"
504 $ tm "nc a b" "up a b" " " "14 merge b no ancestor"
511 created new head
505 created new head
512 --------------
506 --------------
513 test L:nc a b R:up a b W: - 14 merge b no ancestor
507 test L:nc a b R:up a b W: - 14 merge b no ancestor
514 --------------
508 --------------
515 unmatched files new in both:
516 b
517 resolving manifests
509 resolving manifests
518 branchmerge: True, force: False, partial: False
510 branchmerge: True, force: False, partial: False
519 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
511 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
520 preserving b for resolve of b
512 preserving b for resolve of b
521 preserving rev for resolve of rev
513 preserving rev for resolve of rev
522 a: remote is newer -> g
514 a: remote is newer -> g
523 getting a
515 getting a
524 b: both created -> m (premerge)
516 b: both created -> m (premerge)
525 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
517 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
526 merging b
518 merging b
527 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
519 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
528 rev: versions differ -> m (premerge)
520 rev: versions differ -> m (premerge)
529 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
521 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
530 merging rev
522 merging rev
531 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
523 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
532 b: both created -> m (merge)
524 b: both created -> m (merge)
533 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)
534 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
526 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
535 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
527 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
536 merge tool returned: 0
528 merge tool returned: 0
537 rev: versions differ -> m (merge)
529 rev: versions differ -> m (merge)
538 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
530 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
539 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
531 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
540 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
532 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
541 merge tool returned: 0
533 merge tool returned: 0
542 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
534 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
543 (branch merge, don't forget to commit)
535 (branch merge, don't forget to commit)
544 --------------
536 --------------
545 M a
537 M a
546 M b
538 M b
547 --------------
539 --------------
548
540
549 $ tm "up b " "nm a b" " " "15 merge b no ancestor, remove a"
541 $ tm "up b " "nm a b" " " "15 merge b no ancestor, remove a"
550 created new head
542 created new head
551 --------------
543 --------------
552 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
544 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
553 --------------
545 --------------
554 unmatched files new in both:
555 b
556 resolving manifests
546 resolving manifests
557 branchmerge: True, force: False, partial: False
547 branchmerge: True, force: False, partial: False
558 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
548 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
559 preserving b for resolve of b
549 preserving b for resolve of b
560 preserving rev for resolve of rev
550 preserving rev for resolve of rev
561 a: other deleted -> r
551 a: other deleted -> r
562 removing a
552 removing a
563 starting 4 threads for background file closing (?)
553 starting 4 threads for background file closing (?)
564 b: both created -> m (premerge)
554 b: both created -> m (premerge)
565 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
555 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
566 merging b
556 merging b
567 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
557 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
568 rev: versions differ -> m (premerge)
558 rev: versions differ -> m (premerge)
569 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
559 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
570 merging rev
560 merging rev
571 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
561 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
572 b: both created -> m (merge)
562 b: both created -> m (merge)
573 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
563 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
574 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
564 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
575 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
565 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
576 merge tool returned: 0
566 merge tool returned: 0
577 rev: versions differ -> m (merge)
567 rev: versions differ -> m (merge)
578 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
568 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
579 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
569 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
580 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
570 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
581 merge tool returned: 0
571 merge tool returned: 0
582 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
572 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
583 (branch merge, don't forget to commit)
573 (branch merge, don't forget to commit)
584 --------------
574 --------------
585 M b
575 M b
586 --------------
576 --------------
587
577
588 $ tm "nc a b" "up a b" " " "16 get a, merge b no ancestor"
578 $ tm "nc a b" "up a b" " " "16 get a, merge b no ancestor"
589 created new head
579 created new head
590 --------------
580 --------------
591 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
581 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
592 --------------
582 --------------
593 unmatched files new in both:
594 b
595 resolving manifests
583 resolving manifests
596 branchmerge: True, force: False, partial: False
584 branchmerge: True, force: False, partial: False
597 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
585 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
598 preserving b for resolve of b
586 preserving b for resolve of b
599 preserving rev for resolve of rev
587 preserving rev for resolve of rev
600 a: remote is newer -> g
588 a: remote is newer -> g
601 getting a
589 getting a
602 b: both created -> m (premerge)
590 b: both created -> m (premerge)
603 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
591 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
604 merging b
592 merging b
605 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
593 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
606 rev: versions differ -> m (premerge)
594 rev: versions differ -> m (premerge)
607 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
595 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
608 merging rev
596 merging rev
609 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
597 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
610 b: both created -> m (merge)
598 b: both created -> m (merge)
611 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
599 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
612 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
600 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
613 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
601 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
614 merge tool returned: 0
602 merge tool returned: 0
615 rev: versions differ -> m (merge)
603 rev: versions differ -> m (merge)
616 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
604 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
617 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
605 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
618 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
606 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
619 merge tool returned: 0
607 merge tool returned: 0
620 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
608 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
621 (branch merge, don't forget to commit)
609 (branch merge, don't forget to commit)
622 --------------
610 --------------
623 M a
611 M a
624 M b
612 M b
625 --------------
613 --------------
626
614
627 $ tm "up a b" "nc a b" " " "17 keep a, merge b no ancestor"
615 $ tm "up a b" "nc a b" " " "17 keep a, merge b no ancestor"
628 created new head
616 created new head
629 --------------
617 --------------
630 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
618 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
631 --------------
619 --------------
632 unmatched files new in both:
633 b
634 resolving manifests
620 resolving manifests
635 branchmerge: True, force: False, partial: False
621 branchmerge: True, force: False, partial: False
636 ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
622 ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
637 preserving b for resolve of b
623 preserving b for resolve of b
638 preserving rev for resolve of rev
624 preserving rev for resolve of rev
639 starting 4 threads for background file closing (?)
625 starting 4 threads for background file closing (?)
640 b: both created -> m (premerge)
626 b: both created -> m (premerge)
641 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
627 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
642 merging b
628 merging b
643 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
629 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
644 rev: versions differ -> m (premerge)
630 rev: versions differ -> m (premerge)
645 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
631 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
646 merging rev
632 merging rev
647 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
633 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
648 b: both created -> m (merge)
634 b: both created -> m (merge)
649 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
635 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
650 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
636 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
651 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
637 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
652 merge tool returned: 0
638 merge tool returned: 0
653 rev: versions differ -> m (merge)
639 rev: versions differ -> m (merge)
654 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
640 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
655 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
641 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
656 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
642 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
657 merge tool returned: 0
643 merge tool returned: 0
658 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
644 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
659 (branch merge, don't forget to commit)
645 (branch merge, don't forget to commit)
660 --------------
646 --------------
661 M b
647 M b
662 C a
648 C a
663 --------------
649 --------------
664
650
665 $ tm "nm a b" "up a b" " " "18 merge b no ancestor"
651 $ tm "nm a b" "up a b" " " "18 merge b no ancestor"
666 created new head
652 created new head
667 --------------
653 --------------
668 test L:nm a b R:up a b W: - 18 merge b no ancestor
654 test L:nm a b R:up a b W: - 18 merge b no ancestor
669 --------------
655 --------------
670 unmatched files new in both:
671 b
672 resolving manifests
656 resolving manifests
673 branchmerge: True, force: False, partial: False
657 branchmerge: True, force: False, partial: False
674 ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a
658 ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a
675 preserving b for resolve of b
659 preserving b for resolve of b
676 preserving rev for resolve of rev
660 preserving rev for resolve of rev
677 starting 4 threads for background file closing (?)
661 starting 4 threads for background file closing (?)
678 a: prompt deleted/changed -> m (premerge)
662 a: prompt deleted/changed -> m (premerge)
679 picked tool ':prompt' for a (binary False symlink False changedelete True)
663 picked tool ':prompt' for a (binary False symlink False changedelete True)
680 file 'a' was deleted in local [working copy] but was modified in other [merge rev].
664 file 'a' was deleted in local [working copy] but was modified in other [merge rev].
681 What do you want to do?
665 What do you want to do?
682 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
666 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
683 b: both created -> m (premerge)
667 b: both created -> m (premerge)
684 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
668 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
685 merging b
669 merging b
686 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
670 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
687 rev: versions differ -> m (premerge)
671 rev: versions differ -> m (premerge)
688 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
672 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
689 merging rev
673 merging rev
690 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
674 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
691 b: both created -> m (merge)
675 b: both created -> m (merge)
692 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
676 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
693 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
677 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
694 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
678 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
695 merge tool returned: 0
679 merge tool returned: 0
696 rev: versions differ -> m (merge)
680 rev: versions differ -> m (merge)
697 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
681 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
698 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
682 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
699 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
683 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
700 merge tool returned: 0
684 merge tool returned: 0
701 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
685 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
702 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
686 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
703 --------------
687 --------------
704 M a
688 M a
705 M b
689 M b
706 abort: unresolved merge conflicts (see 'hg help resolve')
690 abort: unresolved merge conflicts (see 'hg help resolve')
707 --------------
691 --------------
708
692
709 $ tm "up a b" "nm a b" " " "19 merge b no ancestor, prompt remove a"
693 $ tm "up a b" "nm a b" " " "19 merge b no ancestor, prompt remove a"
710 created new head
694 created new head
711 --------------
695 --------------
712 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
696 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
713 --------------
697 --------------
714 unmatched files new in both:
715 b
716 resolving manifests
698 resolving manifests
717 branchmerge: True, force: False, partial: False
699 branchmerge: True, force: False, partial: False
718 ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a
700 ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a
719 preserving a for resolve of a
701 preserving a for resolve of a
720 preserving b for resolve of b
702 preserving b for resolve of b
721 preserving rev for resolve of rev
703 preserving rev for resolve of rev
722 starting 4 threads for background file closing (?)
704 starting 4 threads for background file closing (?)
723 a: prompt changed/deleted -> m (premerge)
705 a: prompt changed/deleted -> m (premerge)
724 picked tool ':prompt' for a (binary False symlink False changedelete True)
706 picked tool ':prompt' for a (binary False symlink False changedelete True)
725 file 'a' was deleted in other [merge rev] but was modified in local [working copy].
707 file 'a' was deleted in other [merge rev] but was modified in local [working copy].
726 What do you want to do?
708 What do you want to do?
727 use (c)hanged version, (d)elete, or leave (u)nresolved? u
709 use (c)hanged version, (d)elete, or leave (u)nresolved? u
728 b: both created -> m (premerge)
710 b: both created -> m (premerge)
729 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
711 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
730 merging b
712 merging b
731 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
713 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
732 rev: versions differ -> m (premerge)
714 rev: versions differ -> m (premerge)
733 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
715 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
734 merging rev
716 merging rev
735 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
717 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
736 b: both created -> m (merge)
718 b: both created -> m (merge)
737 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
719 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
738 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
720 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
739 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
721 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
740 merge tool returned: 0
722 merge tool returned: 0
741 rev: versions differ -> m (merge)
723 rev: versions differ -> m (merge)
742 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
724 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
743 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
725 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
744 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
726 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
745 merge tool returned: 0
727 merge tool returned: 0
746 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
728 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
747 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
729 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
748 --------------
730 --------------
749 M b
731 M b
750 C a
732 C a
751 abort: unresolved merge conflicts (see 'hg help resolve')
733 abort: unresolved merge conflicts (see 'hg help resolve')
752 --------------
734 --------------
753
735
754 $ tm "up a " "um a b" " " "20 merge a and b to b, remove a"
736 $ tm "up a " "um a b" " " "20 merge a and b to b, remove a"
755 created new head
737 created new head
756 --------------
738 --------------
757 test L:up a R:um a b W: - 20 merge a and b to b, remove a
739 test L:up a R:um a b W: - 20 merge a and b to b, remove a
758 --------------
740 --------------
759 unmatched files in other:
741 unmatched files in other:
760 b
742 b
761 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
743 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
762 src: 'a' -> dst: 'b' *
744 src: 'a' -> dst: 'b' *
763 checking for directory renames
745 checking for directory renames
764 resolving manifests
746 resolving manifests
765 branchmerge: True, force: False, partial: False
747 branchmerge: True, force: False, partial: False
766 ancestor: 924404dff337, local: e300d1c794ec+, remote: 49b6d8032493
748 ancestor: 924404dff337, local: e300d1c794ec+, remote: 49b6d8032493
767 preserving a for resolve of b
749 preserving a for resolve of b
768 preserving rev for resolve of rev
750 preserving rev for resolve of rev
769 removing a
751 removing a
770 starting 4 threads for background file closing (?)
752 starting 4 threads for background file closing (?)
771 b: remote moved from a -> m (premerge)
753 b: remote moved from a -> m (premerge)
772 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
754 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
773 merging a and b to b
755 merging a and b to b
774 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
756 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
775 rev: versions differ -> m (premerge)
757 rev: versions differ -> m (premerge)
776 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
758 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
777 merging rev
759 merging rev
778 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
760 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
779 b: remote moved from a -> m (merge)
761 b: remote moved from a -> m (merge)
780 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
762 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
781 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
763 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
782 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
764 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
783 merge tool returned: 0
765 merge tool returned: 0
784 rev: versions differ -> m (merge)
766 rev: versions differ -> m (merge)
785 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
767 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
786 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
768 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
787 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
769 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
788 merge tool returned: 0
770 merge tool returned: 0
789 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
771 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
790 (branch merge, don't forget to commit)
772 (branch merge, don't forget to commit)
791 --------------
773 --------------
792 M b
774 M b
793 a
775 a
794 --------------
776 --------------
795
777
796 $ tm "um a b" "up a " " " "21 merge a and b to b"
778 $ tm "um a b" "up a " " " "21 merge a and b to b"
797 created new head
779 created new head
798 --------------
780 --------------
799 test L:um a b R:up a W: - 21 merge a and b to b
781 test L:um a b R:up a W: - 21 merge a and b to b
800 --------------
782 --------------
801 unmatched files in local:
783 unmatched files in local:
802 b
784 b
803 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
785 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
804 src: 'a' -> dst: 'b' *
786 src: 'a' -> dst: 'b' *
805 checking for directory renames
787 checking for directory renames
806 resolving manifests
788 resolving manifests
807 branchmerge: True, force: False, partial: False
789 branchmerge: True, force: False, partial: False
808 ancestor: 924404dff337, local: 62e7bf090eba+, remote: f4db7e329e71
790 ancestor: 924404dff337, local: 62e7bf090eba+, remote: f4db7e329e71
809 preserving b for resolve of b
791 preserving b for resolve of b
810 preserving rev for resolve of rev
792 preserving rev for resolve of rev
811 starting 4 threads for background file closing (?)
793 starting 4 threads for background file closing (?)
812 b: local copied/moved from a -> m (premerge)
794 b: local copied/moved from a -> m (premerge)
813 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
795 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
814 merging b and a to b
796 merging b and a to b
815 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
797 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
816 rev: versions differ -> m (premerge)
798 rev: versions differ -> m (premerge)
817 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
799 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
818 merging rev
800 merging rev
819 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
801 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
820 b: local copied/moved from a -> m (merge)
802 b: local copied/moved from a -> m (merge)
821 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
803 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
822 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
804 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
823 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
805 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
824 merge tool returned: 0
806 merge tool returned: 0
825 rev: versions differ -> m (merge)
807 rev: versions differ -> m (merge)
826 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
808 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
827 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
809 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
828 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
810 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
829 merge tool returned: 0
811 merge tool returned: 0
830 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
812 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
831 (branch merge, don't forget to commit)
813 (branch merge, don't forget to commit)
832 --------------
814 --------------
833 M b
815 M b
834 a
816 a
835 --------------
817 --------------
836
818
837
819
838 m "nm a b" "um x a" " " "22 get a, keep b"
820 m "nm a b" "um x a" " " "22 get a, keep b"
839
821
840 $ tm "nm a b" "up a c" " " "23 get c, keep b"
822 $ tm "nm a b" "up a c" " " "23 get c, keep b"
841 created new head
823 created new head
842 --------------
824 --------------
843 test L:nm a b R:up a c W: - 23 get c, keep b
825 test L:nm a b R:up a c W: - 23 get c, keep b
844 --------------
826 --------------
845 unmatched files in local:
827 unmatched files in local:
846 b
828 b
847 unmatched files in other:
829 unmatched files in other:
848 c
830 c
849 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
831 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
850 src: 'a' -> dst: 'b' *
832 src: 'a' -> dst: 'b' *
851 checking for directory renames
833 checking for directory renames
852 resolving manifests
834 resolving manifests
853 branchmerge: True, force: False, partial: False
835 branchmerge: True, force: False, partial: False
854 ancestor: 924404dff337, local: 02963e448370+, remote: 2b958612230f
836 ancestor: 924404dff337, local: 02963e448370+, remote: 2b958612230f
855 preserving b for resolve of b
837 preserving b for resolve of b
856 preserving rev for resolve of rev
838 preserving rev for resolve of rev
857 c: remote created -> g
839 c: remote created -> g
858 getting c
840 getting c
859 b: local copied/moved from a -> m (premerge)
841 b: local copied/moved from a -> m (premerge)
860 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
842 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
861 merging b and a to b
843 merging b and a to b
862 my b@02963e448370+ other a@2b958612230f ancestor a@924404dff337
844 my b@02963e448370+ other a@2b958612230f ancestor a@924404dff337
863 premerge successful
845 premerge successful
864 rev: versions differ -> m (premerge)
846 rev: versions differ -> m (premerge)
865 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
847 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
866 merging rev
848 merging rev
867 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
849 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
868 rev: versions differ -> m (merge)
850 rev: versions differ -> m (merge)
869 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
851 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
870 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
852 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
871 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
853 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
872 merge tool returned: 0
854 merge tool returned: 0
873 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
855 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
874 (branch merge, don't forget to commit)
856 (branch merge, don't forget to commit)
875 --------------
857 --------------
876 M b
858 M b
877 a
859 a
878 M c
860 M c
879 --------------
861 --------------
880
862
881
863
882 $ cd ..
864 $ cd ..
883
865
884
866
885 Systematic and terse testing of merge merges and ancestor calculation:
867 Systematic and terse testing of merge merges and ancestor calculation:
886
868
887 Expected result:
869 Expected result:
888
870
889 \ a m1 m2 dst
871 \ a m1 m2 dst
890 0 - f f f "versions differ"
872 0 - f f f "versions differ"
891 1 f g g g "versions differ"
873 1 f g g g "versions differ"
892 2 f f f f "versions differ"
874 2 f f f f "versions differ"
893 3 f f g f+g "remote copied to " + f
875 3 f f g f+g "remote copied to " + f
894 4 f f g g "remote moved to " + f
876 4 f f g g "remote moved to " + f
895 5 f g f f+g "local copied to " + f2
877 5 f g f f+g "local copied to " + f2
896 6 f g f g "local moved to " + f2
878 6 f g f g "local moved to " + f2
897 7 - (f) f f "remote differs from untracked local"
879 7 - (f) f f "remote differs from untracked local"
898 8 f (f) f f "remote differs from untracked local"
880 8 f (f) f f "remote differs from untracked local"
899
881
900 $ hg init ancestortest
882 $ hg init ancestortest
901 $ cd ancestortest
883 $ cd ancestortest
902 $ for x in 1 2 3 4 5 6 8; do mkdir $x; echo a > $x/f; done
884 $ for x in 1 2 3 4 5 6 8; do mkdir $x; echo a > $x/f; done
903 $ hg ci -Aqm "a"
885 $ hg ci -Aqm "a"
904 $ mkdir 0
886 $ mkdir 0
905 $ touch 0/f
887 $ touch 0/f
906 $ hg mv 1/f 1/g
888 $ hg mv 1/f 1/g
907 $ hg cp 5/f 5/g
889 $ hg cp 5/f 5/g
908 $ hg mv 6/f 6/g
890 $ hg mv 6/f 6/g
909 $ hg rm 8/f
891 $ hg rm 8/f
910 $ for x in */*; do echo m1 > $x; done
892 $ for x in */*; do echo m1 > $x; done
911 $ hg ci -Aqm "m1"
893 $ hg ci -Aqm "m1"
912 $ hg up -qr0
894 $ hg up -qr0
913 $ mkdir 0 7
895 $ mkdir 0 7
914 $ touch 0/f 7/f
896 $ touch 0/f 7/f
915 $ hg mv 1/f 1/g
897 $ hg mv 1/f 1/g
916 $ hg cp 3/f 3/g
898 $ hg cp 3/f 3/g
917 $ hg mv 4/f 4/g
899 $ hg mv 4/f 4/g
918 $ for x in */*; do echo m2 > $x; done
900 $ for x in */*; do echo m2 > $x; done
919 $ hg ci -Aqm "m2"
901 $ hg ci -Aqm "m2"
920 $ hg up -qr1
902 $ hg up -qr1
921 $ mkdir 7 8
903 $ mkdir 7 8
922 $ echo m > 7/f
904 $ echo m > 7/f
923 $ echo m > 8/f
905 $ echo m > 8/f
924 $ hg merge -f --tool internal:dump -v --debug -r2 | sed '/^resolving manifests/,$d' 2> /dev/null
906 $ hg merge -f --tool internal:dump -v --debug -r2 | sed '/^resolving manifests/,$d' 2> /dev/null
925 unmatched files in local:
907 unmatched files in local:
926 5/g
908 5/g
927 6/g
909 6/g
928 unmatched files in other:
910 unmatched files in other:
929 3/g
911 3/g
930 4/g
912 4/g
931 7/f
913 7/f
932 unmatched files new in both:
933 0/f
934 1/g
935 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
914 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
936 src: '1/f' -> dst: '1/g' *
915 src: '1/f' -> dst: '1/g' *
937 src: '3/f' -> dst: '3/g' *
916 src: '3/f' -> dst: '3/g' *
938 src: '4/f' -> dst: '4/g' *
917 src: '4/f' -> dst: '4/g' *
939 src: '5/f' -> dst: '5/g' *
918 src: '5/f' -> dst: '5/g' *
940 src: '6/f' -> dst: '6/g' *
919 src: '6/f' -> dst: '6/g' *
941 checking for directory renames
920 checking for directory renames
942 $ hg mani
921 $ hg mani
943 0/f
922 0/f
944 1/g
923 1/g
945 2/f
924 2/f
946 3/f
925 3/f
947 4/f
926 4/f
948 5/f
927 5/f
949 5/g
928 5/g
950 6/g
929 6/g
951 $ for f in */*; do echo $f:; cat $f; done
930 $ for f in */*; do echo $f:; cat $f; done
952 0/f:
931 0/f:
953 m1
932 m1
954 0/f.base:
933 0/f.base:
955 0/f.local:
934 0/f.local:
956 m1
935 m1
957 0/f.orig:
936 0/f.orig:
958 m1
937 m1
959 0/f.other:
938 0/f.other:
960 m2
939 m2
961 1/g:
940 1/g:
962 m1
941 m1
963 1/g.base:
942 1/g.base:
964 a
943 a
965 1/g.local:
944 1/g.local:
966 m1
945 m1
967 1/g.orig:
946 1/g.orig:
968 m1
947 m1
969 1/g.other:
948 1/g.other:
970 m2
949 m2
971 2/f:
950 2/f:
972 m1
951 m1
973 2/f.base:
952 2/f.base:
974 a
953 a
975 2/f.local:
954 2/f.local:
976 m1
955 m1
977 2/f.orig:
956 2/f.orig:
978 m1
957 m1
979 2/f.other:
958 2/f.other:
980 m2
959 m2
981 3/f:
960 3/f:
982 m1
961 m1
983 3/f.base:
962 3/f.base:
984 a
963 a
985 3/f.local:
964 3/f.local:
986 m1
965 m1
987 3/f.orig:
966 3/f.orig:
988 m1
967 m1
989 3/f.other:
968 3/f.other:
990 m2
969 m2
991 3/g:
970 3/g:
992 m1
971 m1
993 3/g.base:
972 3/g.base:
994 a
973 a
995 3/g.local:
974 3/g.local:
996 m1
975 m1
997 3/g.orig:
976 3/g.orig:
998 m1
977 m1
999 3/g.other:
978 3/g.other:
1000 m2
979 m2
1001 4/g:
980 4/g:
1002 m1
981 m1
1003 4/g.base:
982 4/g.base:
1004 a
983 a
1005 4/g.local:
984 4/g.local:
1006 m1
985 m1
1007 4/g.orig:
986 4/g.orig:
1008 m1
987 m1
1009 4/g.other:
988 4/g.other:
1010 m2
989 m2
1011 5/f:
990 5/f:
1012 m1
991 m1
1013 5/f.base:
992 5/f.base:
1014 a
993 a
1015 5/f.local:
994 5/f.local:
1016 m1
995 m1
1017 5/f.orig:
996 5/f.orig:
1018 m1
997 m1
1019 5/f.other:
998 5/f.other:
1020 m2
999 m2
1021 5/g:
1000 5/g:
1022 m1
1001 m1
1023 5/g.base:
1002 5/g.base:
1024 a
1003 a
1025 5/g.local:
1004 5/g.local:
1026 m1
1005 m1
1027 5/g.orig:
1006 5/g.orig:
1028 m1
1007 m1
1029 5/g.other:
1008 5/g.other:
1030 m2
1009 m2
1031 6/g:
1010 6/g:
1032 m1
1011 m1
1033 6/g.base:
1012 6/g.base:
1034 a
1013 a
1035 6/g.local:
1014 6/g.local:
1036 m1
1015 m1
1037 6/g.orig:
1016 6/g.orig:
1038 m1
1017 m1
1039 6/g.other:
1018 6/g.other:
1040 m2
1019 m2
1041 7/f:
1020 7/f:
1042 m
1021 m
1043 7/f.base:
1022 7/f.base:
1044 7/f.local:
1023 7/f.local:
1045 m
1024 m
1046 7/f.orig:
1025 7/f.orig:
1047 m
1026 m
1048 7/f.other:
1027 7/f.other:
1049 m2
1028 m2
1050 8/f:
1029 8/f:
1051 m2
1030 m2
1052 $ cd ..
1031 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now