##// END OF EJS Templates
merge: unify merge and copy actions
Matt Mackall -
r3308:ecc1bf27 default
parent child Browse files
Show More
@@ -1,463 +1,443 b''
1 # merge.py - directory-level update/merge handling for Mercurial
1 # merge.py - directory-level update/merge handling for Mercurial
2 #
2 #
3 # Copyright 2006 Matt Mackall <mpm@selenic.com>
3 # Copyright 2006 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms
5 # This software may be used and distributed according to the terms
6 # of the GNU General Public License, incorporated herein by reference.
6 # of the GNU General Public License, incorporated herein by reference.
7
7
8 from node import *
8 from node import *
9 from i18n import gettext as _
9 from i18n import gettext as _
10 from demandload import *
10 from demandload import *
11 demandload(globals(), "errno util os tempfile")
11 demandload(globals(), "errno util os tempfile")
12
12
13 def filemerge(repo, fw, fo, fd, wctx, mctx, move):
13 def filemerge(repo, fw, fo, fd, wctx, mctx, move):
14 """perform a 3-way merge in the working directory
14 """perform a 3-way merge in the working directory
15
15
16 fw = filename in the working directory and first parent
16 fw = filename in the working directory and first parent
17 fo = filename in other parent
17 fo = filename in other parent
18 fd = destination filename
18 fd = destination filename
19 wctx, mctx = working and merge changecontexts
19 wctx, mctx = working and merge changecontexts
20 move = whether to move or copy the file to the destination
20 move = whether to move or copy the file to the destination
21
21
22 TODO:
22 TODO:
23 if fw is copied in the working directory, we get confused
23 if fw is copied in the working directory, we get confused
24 implement move and fd
24 implement move and fd
25 """
25 """
26
26
27 def temp(prefix, ctx):
27 def temp(prefix, ctx):
28 pre = "%s~%s." % (os.path.basename(ctx.path()), prefix)
28 pre = "%s~%s." % (os.path.basename(ctx.path()), prefix)
29 (fd, name) = tempfile.mkstemp(prefix=pre)
29 (fd, name) = tempfile.mkstemp(prefix=pre)
30 f = os.fdopen(fd, "wb")
30 f = os.fdopen(fd, "wb")
31 repo.wwrite(ctx.path(), ctx.data(), f)
31 repo.wwrite(ctx.path(), ctx.data(), f)
32 f.close()
32 f.close()
33 return name
33 return name
34
34
35 fcm = wctx.filectx(fw)
35 fcm = wctx.filectx(fw)
36 fco = mctx.filectx(fo)
36 fco = mctx.filectx(fo)
37 fca = fcm.ancestor(fco)
37 fca = fcm.ancestor(fco)
38 if not fca:
38 if not fca:
39 fca = repo.filectx(fw, fileid=-1)
39 fca = repo.filectx(fw, fileid=-1)
40 a = repo.wjoin(fw)
40 a = repo.wjoin(fw)
41 b = temp("base", fca)
41 b = temp("base", fca)
42 c = temp("other", fco)
42 c = temp("other", fco)
43
43
44 repo.ui.note(_("resolving %s\n") % fw)
44 repo.ui.note(_("resolving %s\n") % fw)
45 repo.ui.debug(_("my %s other %s ancestor %s\n") % (fcm, fco, fca))
45 repo.ui.debug(_("my %s other %s ancestor %s\n") % (fcm, fco, fca))
46
46
47 cmd = (os.environ.get("HGMERGE") or repo.ui.config("ui", "merge")
47 cmd = (os.environ.get("HGMERGE") or repo.ui.config("ui", "merge")
48 or "hgmerge")
48 or "hgmerge")
49 r = util.system('%s "%s" "%s" "%s"' % (cmd, a, b, c), cwd=repo.root,
49 r = util.system('%s "%s" "%s" "%s"' % (cmd, a, b, c), cwd=repo.root,
50 environ={'HG_FILE': fw,
50 environ={'HG_FILE': fw,
51 'HG_MY_NODE': str(wctx.parents()[0]),
51 'HG_MY_NODE': str(wctx.parents()[0]),
52 'HG_OTHER_NODE': str(mctx)})
52 'HG_OTHER_NODE': str(mctx)})
53 if r:
53 if r:
54 repo.ui.warn(_("merging %s failed!\n") % fw)
54 repo.ui.warn(_("merging %s failed!\n") % fw)
55 else:
55 else:
56 if fd != fw:
56 if fd != fw:
57 repo.ui.debug(_("copying %s to %s\n") % (fw, fd))
57 repo.ui.debug(_("copying %s to %s\n") % (fw, fd))
58 repo.wwrite(fd, repo.wread(fw))
58 repo.wwrite(fd, repo.wread(fw))
59 if move:
59 if move:
60 repo.ui.debug(_("removing %s\n") % fw)
60 repo.ui.debug(_("removing %s\n") % fw)
61 os.unlink(a)
61 os.unlink(a)
62
62
63 os.unlink(b)
63 os.unlink(b)
64 os.unlink(c)
64 os.unlink(c)
65 return r
65 return r
66
66
67 def checkunknown(repo, m2, wctx):
67 def checkunknown(repo, m2, wctx):
68 """
68 """
69 check for collisions between unknown files and files in m2
69 check for collisions between unknown files and files in m2
70 """
70 """
71 for f in wctx.unknown():
71 for f in wctx.unknown():
72 if f in m2:
72 if f in m2:
73 if repo.file(f).cmp(m2[f], repo.wread(f)):
73 if repo.file(f).cmp(m2[f], repo.wread(f)):
74 raise util.Abort(_("'%s' already exists in the working"
74 raise util.Abort(_("'%s' already exists in the working"
75 " dir and differs from remote") % f)
75 " dir and differs from remote") % f)
76
76
77 def forgetremoved(m2, wctx):
77 def forgetremoved(m2, wctx):
78 """
78 """
79 Forget removed files
79 Forget removed files
80
80
81 If we're jumping between revisions (as opposed to merging), and if
81 If we're jumping between revisions (as opposed to merging), and if
82 neither the working directory nor the target rev has the file,
82 neither the working directory nor the target rev has the file,
83 then we need to remove it from the dirstate, to prevent the
83 then we need to remove it from the dirstate, to prevent the
84 dirstate from listing the file when it is no longer in the
84 dirstate from listing the file when it is no longer in the
85 manifest.
85 manifest.
86 """
86 """
87
87
88 action = []
88 action = []
89
89
90 for f in wctx.deleted() + wctx.removed():
90 for f in wctx.deleted() + wctx.removed():
91 if f not in m2:
91 if f not in m2:
92 action.append((f, "f"))
92 action.append((f, "f"))
93
93
94 return action
94 return action
95
95
96 def nonoverlap(d1, d2):
96 def nonoverlap(d1, d2):
97 """
97 """
98 Return list of elements in d1 not in d2
98 Return list of elements in d1 not in d2
99 """
99 """
100
100
101 l = []
101 l = []
102 for d in d1:
102 for d in d1:
103 if d not in d2:
103 if d not in d2:
104 l.append(d)
104 l.append(d)
105
105
106 l.sort()
106 l.sort()
107 return l
107 return l
108
108
109 def findold(fctx, limit):
109 def findold(fctx, limit):
110 """
110 """
111 find files that path was copied from, back to linkrev limit
111 find files that path was copied from, back to linkrev limit
112 """
112 """
113
113
114 old = {}
114 old = {}
115 orig = fctx.path()
115 orig = fctx.path()
116 visit = [fctx]
116 visit = [fctx]
117 while visit:
117 while visit:
118 fc = visit.pop()
118 fc = visit.pop()
119 if fc.rev() < limit:
119 if fc.rev() < limit:
120 continue
120 continue
121 if fc.path() != orig and fc.path() not in old:
121 if fc.path() != orig and fc.path() not in old:
122 old[fc.path()] = 1
122 old[fc.path()] = 1
123 visit += fc.parents()
123 visit += fc.parents()
124
124
125 old = old.keys()
125 old = old.keys()
126 old.sort()
126 old.sort()
127 return old
127 return old
128
128
129 def findcopies(repo, m1, m2, limit):
129 def findcopies(repo, m1, m2, limit):
130 """
130 """
131 Find moves and copies between m1 and m2 back to limit linkrev
131 Find moves and copies between m1 and m2 back to limit linkrev
132 """
132 """
133
133
134 if not repo.ui.config("merge", "followcopies"):
134 if not repo.ui.config("merge", "followcopies"):
135 return {}
135 return {}
136
136
137 # avoid silly behavior for update from empty dir
137 # avoid silly behavior for update from empty dir
138 if not m1:
138 if not m1:
139 return {}
139 return {}
140
140
141 dcopies = repo.dirstate.copies()
141 dcopies = repo.dirstate.copies()
142 copy = {}
142 copy = {}
143 match = {}
143 match = {}
144 u1 = nonoverlap(m1, m2)
144 u1 = nonoverlap(m1, m2)
145 u2 = nonoverlap(m2, m1)
145 u2 = nonoverlap(m2, m1)
146 ctx = util.cachefunc(lambda f,n: repo.filectx(f, fileid=n[:20]))
146 ctx = util.cachefunc(lambda f,n: repo.filectx(f, fileid=n[:20]))
147
147
148 def checkpair(c, f2, man):
148 def checkpair(c, f2, man):
149 ''' check if an apparent pair actually matches '''
149 ''' check if an apparent pair actually matches '''
150 c2 = ctx(f2, man[f2])
150 c2 = ctx(f2, man[f2])
151 ca = c.ancestor(c2)
151 ca = c.ancestor(c2)
152 if ca and ca.path() == c.path() or ca.path() == c2.path():
152 if ca and ca.path() == c.path() or ca.path() == c2.path():
153 copy[c.path()] = f2
153 copy[c.path()] = f2
154 copy[f2] = c.path()
154 copy[f2] = c.path()
155
155
156 for f in u1:
156 for f in u1:
157 c = ctx(dcopies.get(f, f), m1[f])
157 c = ctx(dcopies.get(f, f), m1[f])
158 for of in findold(c, limit):
158 for of in findold(c, limit):
159 if of in m2:
159 if of in m2:
160 checkpair(c, of, m2)
160 checkpair(c, of, m2)
161 else:
161 else:
162 match.setdefault(of, []).append(f)
162 match.setdefault(of, []).append(f)
163
163
164 for f in u2:
164 for f in u2:
165 c = ctx(f, m2[f])
165 c = ctx(f, m2[f])
166 for of in findold(c, limit):
166 for of in findold(c, limit):
167 if of in m1:
167 if of in m1:
168 checkpair(c, of, m1)
168 checkpair(c, of, m1)
169 elif of in match:
169 elif of in match:
170 for mf in match[of]:
170 for mf in match[of]:
171 checkpair(c, mf, m1)
171 checkpair(c, mf, m1)
172
172
173 return copy
173 return copy
174
174
175 def manifestmerge(repo, p1, p2, pa, overwrite, partial):
175 def manifestmerge(repo, p1, p2, pa, overwrite, partial):
176 """
176 """
177 Merge manifest m1 with m2 using ancestor ma and generate merge action list
177 Merge manifest m1 with m2 using ancestor ma and generate merge action list
178 """
178 """
179
179
180 m1 = p1.manifest()
180 m1 = p1.manifest()
181 m2 = p2.manifest()
181 m2 = p2.manifest()
182 ma = pa.manifest()
182 ma = pa.manifest()
183 backwards = (pa == p2)
183 backwards = (pa == p2)
184
184
185 def fmerge(f, f2=None, fa=None):
185 def fmerge(f, f2=None, fa=None):
186 """merge executable flags"""
186 """merge executable flags"""
187 if not f2:
187 if not f2:
188 f2 = f
188 f2 = f
189 fa = f
189 fa = f
190 a, b, c = ma.execf(fa), m1.execf(f), m2.execf(f2)
190 a, b, c = ma.execf(fa), m1.execf(f), m2.execf(f2)
191 return ((a^b) | (a^c)) ^ a
191 return ((a^b) | (a^c)) ^ a
192
192
193 action = []
193 action = []
194
194
195 def act(msg, m, f, *args):
195 def act(msg, m, f, *args):
196 repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m))
196 repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m))
197 action.append((f, m) + args)
197 action.append((f, m) + args)
198
198
199 copy = {}
199 copy = {}
200 if not (backwards or overwrite):
200 if not (backwards or overwrite):
201 copy = findcopies(repo, m1, m2, pa.rev())
201 copy = findcopies(repo, m1, m2, pa.rev())
202
202
203 # Compare manifests
203 # Compare manifests
204 for f, n in m1.iteritems():
204 for f, n in m1.iteritems():
205 if partial and not partial(f):
205 if partial and not partial(f):
206 continue
206 continue
207 if f in m2:
207 if f in m2:
208 # are files different?
208 # are files different?
209 if n != m2[f]:
209 if n != m2[f]:
210 a = ma.get(f, nullid)
210 a = ma.get(f, nullid)
211 # are both different from the ancestor?
211 # are both different from the ancestor?
212 if not overwrite and n != a and m2[f] != a:
212 if not overwrite and n != a and m2[f] != a:
213 act("versions differ", "m", f, fmerge(f))
213 act("versions differ", "m", f, f, f, fmerge(f), False)
214 # are we clobbering?
214 # are we clobbering?
215 # is remote's version newer?
215 # is remote's version newer?
216 # or are we going back in time and clean?
216 # or are we going back in time and clean?
217 elif overwrite or m2[f] != a or (backwards and not n[20:]):
217 elif overwrite or m2[f] != a or (backwards and not n[20:]):
218 act("remote is newer", "g", f, m2.execf(f))
218 act("remote is newer", "g", f, m2.execf(f))
219 # local is newer, not overwrite, check mode bits
219 # local is newer, not overwrite, check mode bits
220 elif fmerge(f) != m1.execf(f):
220 elif fmerge(f) != m1.execf(f):
221 act("update permissions", "e", f, m2.execf(f))
221 act("update permissions", "e", f, m2.execf(f))
222 # contents same, check mode bits
222 # contents same, check mode bits
223 elif m1.execf(f) != m2.execf(f):
223 elif m1.execf(f) != m2.execf(f):
224 if overwrite or fmerge(f) != m1.execf(f):
224 if overwrite or fmerge(f) != m1.execf(f):
225 act("update permissions", "e", f, m2.execf(f))
225 act("update permissions", "e", f, m2.execf(f))
226 elif f in copy:
226 elif f in copy:
227 f2 = copy[f]
227 f2 = copy[f]
228 if f in ma: # case 3,20 A/B/A
228 if f in ma: # case 3,20 A/B/A
229 act("remote moved", "c",
229 act("remote moved", "m", f, f2, f2, fmerge(f, f2, f), True)
230 f, f2, f2, fmerge(f, f2, f), True)
231 else:
230 else:
232 if f2 in m1: # case 2 A,B/B/B
231 if f2 in m1: # case 2 A,B/B/B
233 act("local copied", "c",
232 act("local copied", "m",
234 f, f2, f, fmerge(f, f2, f2), False)
233 f, f2, f, fmerge(f, f2, f2), False)
235 else: # case 4,21 A/B/B
234 else: # case 4,21 A/B/B
236 act("local moved", "c",
235 act("local moved", "m",
237 f, f2, f, fmerge(f, f2, f2), False)
236 f, f2, f, fmerge(f, f2, f2), False)
238 elif f in ma:
237 elif f in ma:
239 if n != ma[f] and not overwrite:
238 if n != ma[f] and not overwrite:
240 if repo.ui.prompt(
239 if repo.ui.prompt(
241 (_(" local changed %s which remote deleted\n") % f) +
240 (_(" local changed %s which remote deleted\n") % f) +
242 _("(k)eep or (d)elete?"), _("[kd]"), _("k")) == _("d"):
241 _("(k)eep or (d)elete?"), _("[kd]"), _("k")) == _("d"):
243 act("prompt delete", "r", f)
242 act("prompt delete", "r", f)
244 else:
243 else:
245 act("other deleted", "r", f)
244 act("other deleted", "r", f)
246 else:
245 else:
247 # file is created on branch or in working directory
246 # file is created on branch or in working directory
248 if (overwrite and n[20:] != "u") or (backwards and not n[20:]):
247 if (overwrite and n[20:] != "u") or (backwards and not n[20:]):
249 act("remote deleted", "r", f)
248 act("remote deleted", "r", f)
250
249
251 for f, n in m2.iteritems():
250 for f, n in m2.iteritems():
252 if partial and not partial(f):
251 if partial and not partial(f):
253 continue
252 continue
254 if f in m1:
253 if f in m1:
255 continue
254 continue
256 if f in copy:
255 if f in copy:
257 f2 = copy[f]
256 f2 = copy[f]
258 if f2 not in m2: # already seen
257 if f2 not in m2: # already seen
259 continue
258 continue
260 # rename case 1, A/A,B/A
259 # rename case 1, A/A,B/A
261 act("remote copied", "c", f2, f, f, fmerge(f2, f, f2), False)
260 act("remote copied", "m", f2, f, f, fmerge(f2, f, f2), False)
262 elif f in ma:
261 elif f in ma:
263 if overwrite or backwards:
262 if overwrite or backwards:
264 act("recreating", "g", f, m2.execf(f))
263 act("recreating", "g", f, m2.execf(f))
265 elif n != ma[f]:
264 elif n != ma[f]:
266 if repo.ui.prompt(
265 if repo.ui.prompt(
267 (_("remote changed %s which local deleted\n") % f) +
266 (_("remote changed %s which local deleted\n") % f) +
268 _("(k)eep or (d)elete?"), _("[kd]"), _("k")) == _("k"):
267 _("(k)eep or (d)elete?"), _("[kd]"), _("k")) == _("k"):
269 act("prompt recreating", "g", f, m2.execf(f))
268 act("prompt recreating", "g", f, m2.execf(f))
270 else:
269 else:
271 act("remote created", "g", f, m2.execf(f))
270 act("remote created", "g", f, m2.execf(f))
272
271
273 return action
272 return action
274
273
275 def applyupdates(repo, action, wctx, mctx):
274 def applyupdates(repo, action, wctx, mctx):
276 updated, merged, removed, unresolved = 0, 0, 0, 0
275 updated, merged, removed, unresolved = 0, 0, 0, 0
277 action.sort()
276 action.sort()
278 for a in action:
277 for a in action:
279 f, m = a[:2]
278 f, m = a[:2]
280 if f[0] == "/":
279 if f[0] == "/":
281 continue
280 continue
282 if m == "r": # remove
281 if m == "r": # remove
283 repo.ui.note(_("removing %s\n") % f)
282 repo.ui.note(_("removing %s\n") % f)
284 util.audit_path(f)
283 util.audit_path(f)
285 try:
284 try:
286 util.unlink(repo.wjoin(f))
285 util.unlink(repo.wjoin(f))
287 except OSError, inst:
286 except OSError, inst:
288 if inst.errno != errno.ENOENT:
287 if inst.errno != errno.ENOENT:
289 repo.ui.warn(_("update failed to remove %s: %s!\n") %
288 repo.ui.warn(_("update failed to remove %s: %s!\n") %
290 (f, inst.strerror))
289 (f, inst.strerror))
291 removed +=1
290 removed +=1
292 elif m == "c": # copy
291 elif m == "m": # merge
293 f2, fd, flag, move = a[2:]
292 f2, fd, flag, move = a[2:]
294 repo.ui.status(_("merging %s and %s to %s\n") % (f, f2, fd))
293 if f != f2:
294 repo.ui.status(_("merging %s and %s to %s\n") % (f, f2, fd))
295 else:
296 repo.ui.status(_("merging %s\n") % f)
295 if filemerge(repo, f, f2, fd, wctx, mctx, move):
297 if filemerge(repo, f, f2, fd, wctx, mctx, move):
296 unresolved += 1
298 unresolved += 1
297 util.set_exec(repo.wjoin(fd), flag)
299 util.set_exec(repo.wjoin(fd), flag)
298 merged += 1
300 merged += 1
299 elif m == "m": # merge
300 flag = a[2]
301 repo.ui.status(_("merging %s\n") % f)
302 if filemerge(repo, f, f, f, wctx, mctx, False):
303 unresolved += 1
304 util.set_exec(repo.wjoin(f), flag)
305 merged += 1
306 elif m == "g": # get
301 elif m == "g": # get
307 flag = a[2]
302 flag = a[2]
308 repo.ui.note(_("getting %s\n") % f)
303 repo.ui.note(_("getting %s\n") % f)
309 t = mctx.filectx(f).data()
304 t = mctx.filectx(f).data()
310 repo.wwrite(f, t)
305 repo.wwrite(f, t)
311 util.set_exec(repo.wjoin(f), flag)
306 util.set_exec(repo.wjoin(f), flag)
312 updated += 1
307 updated += 1
313 elif m == "e": # exec
308 elif m == "e": # exec
314 flag = a[2]
309 flag = a[2]
315 util.set_exec(repo.wjoin(f), flag)
310 util.set_exec(repo.wjoin(f), flag)
316
311
317 return updated, merged, removed, unresolved
312 return updated, merged, removed, unresolved
318
313
319 def recordupdates(repo, action, branchmerge, mctx):
314 def recordupdates(repo, action, branchmerge, mctx):
320 for a in action:
315 for a in action:
321 f, m = a[:2]
316 f, m = a[:2]
322 if m == "r": # remove
317 if m == "r": # remove
323 if branchmerge:
318 if branchmerge:
324 repo.dirstate.update([f], 'r')
319 repo.dirstate.update([f], 'r')
325 else:
320 else:
326 repo.dirstate.forget([f])
321 repo.dirstate.forget([f])
327 elif m == "f": # forget
322 elif m == "f": # forget
328 repo.dirstate.forget([f])
323 repo.dirstate.forget([f])
329 elif m == "g": # get
324 elif m == "g": # get
330 if branchmerge:
325 if branchmerge:
331 repo.dirstate.update([f], 'n', st_mtime=-1)
326 repo.dirstate.update([f], 'n', st_mtime=-1)
332 else:
327 else:
333 repo.dirstate.update([f], 'n')
328 repo.dirstate.update([f], 'n')
334 elif m == "m": # merge
329 elif m == "m": # merge
335 flag = a[2]
336 if branchmerge:
337 # We've done a branch merge, mark this file as merged
338 # so that we properly record the merger later
339 repo.dirstate.update([f], 'm')
340 else:
341 # We've update-merged a locally modified file, so
342 # we set the dirstate to emulate a normal checkout
343 # of that file some time in the past. Thus our
344 # merge will appear as a normal local file
345 # modification.
346 fl = repo.file(f)
347 f_len = mctx.filectx(f).size()
348 repo.dirstate.update([f], 'n', st_size=f_len, st_mtime=-1)
349 elif m == "c": # copy
350 f2, fd, flag, move = a[2:]
330 f2, fd, flag, move = a[2:]
351 if branchmerge:
331 if branchmerge:
352 # We've done a branch merge, mark this file as merged
332 # We've done a branch merge, mark this file as merged
353 # so that we properly record the merger later
333 # so that we properly record the merger later
354 repo.dirstate.update([fd], 'm')
334 repo.dirstate.update([fd], 'm')
355 else:
335 else:
356 # We've update-merged a locally modified file, so
336 # We've update-merged a locally modified file, so
357 # we set the dirstate to emulate a normal checkout
337 # we set the dirstate to emulate a normal checkout
358 # of that file some time in the past. Thus our
338 # of that file some time in the past. Thus our
359 # merge will appear as a normal local file
339 # merge will appear as a normal local file
360 # modification.
340 # modification.
361 fl = repo.file(f)
362 f_len = mctx.filectx(f).size()
341 f_len = mctx.filectx(f).size()
363 repo.dirstate.update([fd], 'n', st_size=f_len, st_mtime=-1)
342 repo.dirstate.update([fd], 'n', st_size=f_len, st_mtime=-1)
364 if move:
343 if f != f2: # copy/rename
365 repo.dirstate.update([f], 'r')
344 if move:
366 if f != fd:
345 repo.dirstate.update([f], 'r')
367 repo.dirstate.copy(f, fd)
346 if f != fd:
368 else:
347 repo.dirstate.copy(f, fd)
369 repo.dirstate.copy(f2, fd)
348 else:
349 repo.dirstate.copy(f2, fd)
370
350
371 def update(repo, node, branchmerge=False, force=False, partial=None,
351 def update(repo, node, branchmerge=False, force=False, partial=None,
372 wlock=None, show_stats=True, remind=True):
352 wlock=None, show_stats=True, remind=True):
373
353
374 overwrite = force and not branchmerge
354 overwrite = force and not branchmerge
375 forcemerge = force and branchmerge
355 forcemerge = force and branchmerge
376
356
377 if not wlock:
357 if not wlock:
378 wlock = repo.wlock()
358 wlock = repo.wlock()
379
359
380 ### check phase
360 ### check phase
381
361
382 wc = repo.workingctx()
362 wc = repo.workingctx()
383 pl = wc.parents()
363 pl = wc.parents()
384 if not overwrite and len(pl) > 1:
364 if not overwrite and len(pl) > 1:
385 raise util.Abort(_("outstanding uncommitted merges"))
365 raise util.Abort(_("outstanding uncommitted merges"))
386
366
387 p1, p2 = pl[0], repo.changectx(node)
367 p1, p2 = pl[0], repo.changectx(node)
388 pa = p1.ancestor(p2)
368 pa = p1.ancestor(p2)
389
369
390 # is there a linear path from p1 to p2?
370 # is there a linear path from p1 to p2?
391 if pa == p1 or pa == p2:
371 if pa == p1 or pa == p2:
392 if branchmerge:
372 if branchmerge:
393 raise util.Abort(_("there is nothing to merge, just use "
373 raise util.Abort(_("there is nothing to merge, just use "
394 "'hg update' or look at 'hg heads'"))
374 "'hg update' or look at 'hg heads'"))
395 elif not (overwrite or branchmerge):
375 elif not (overwrite or branchmerge):
396 raise util.Abort(_("update spans branches, use 'hg merge' "
376 raise util.Abort(_("update spans branches, use 'hg merge' "
397 "or 'hg update -C' to lose changes"))
377 "or 'hg update -C' to lose changes"))
398
378
399 if branchmerge and not forcemerge:
379 if branchmerge and not forcemerge:
400 if wc.modified() or wc.added() or wc.removed():
380 if wc.modified() or wc.added() or wc.removed():
401 raise util.Abort(_("outstanding uncommitted changes"))
381 raise util.Abort(_("outstanding uncommitted changes"))
402
382
403 m1 = wc.manifest()
383 m1 = wc.manifest()
404 m2 = p2.manifest()
384 m2 = p2.manifest()
405
385
406 # resolve the manifest to determine which files
386 # resolve the manifest to determine which files
407 # we care about merging
387 # we care about merging
408 repo.ui.note(_("resolving manifests\n"))
388 repo.ui.note(_("resolving manifests\n"))
409 repo.ui.debug(_(" overwrite %s branchmerge %s partial %s\n") %
389 repo.ui.debug(_(" overwrite %s branchmerge %s partial %s\n") %
410 (overwrite, branchmerge, bool(partial)))
390 (overwrite, branchmerge, bool(partial)))
411 repo.ui.debug(_(" ancestor %s local %s remote %s\n") % (p1, p2, pa))
391 repo.ui.debug(_(" ancestor %s local %s remote %s\n") % (p1, p2, pa))
412
392
413 action = []
393 action = []
414
394
415 if not force:
395 if not force:
416 checkunknown(repo, m2, wc)
396 checkunknown(repo, m2, wc)
417 if not branchmerge:
397 if not branchmerge:
418 action += forgetremoved(m2, wc)
398 action += forgetremoved(m2, wc)
419
399
420 action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
400 action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
421
401
422 ### apply phase
402 ### apply phase
423
403
424 if not branchmerge:
404 if not branchmerge:
425 # just jump to the new rev
405 # just jump to the new rev
426 fp1, fp2, xp1, xp2 = p2.node(), nullid, str(p2), ''
406 fp1, fp2, xp1, xp2 = p2.node(), nullid, str(p2), ''
427 else:
407 else:
428 fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
408 fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
429
409
430 if not partial:
410 if not partial:
431 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
411 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
432
412
433 updated, merged, removed, unresolved = applyupdates(repo, action, wc, p2)
413 updated, merged, removed, unresolved = applyupdates(repo, action, wc, p2)
434
414
435 # update dirstate
415 # update dirstate
436 if not partial:
416 if not partial:
437 recordupdates(repo, action, branchmerge, p2)
417 recordupdates(repo, action, branchmerge, p2)
438 repo.dirstate.setparents(fp1, fp2)
418 repo.dirstate.setparents(fp1, fp2)
439 repo.hook('update', parent1=xp1, parent2=xp2, error=unresolved)
419 repo.hook('update', parent1=xp1, parent2=xp2, error=unresolved)
440
420
441 if show_stats:
421 if show_stats:
442 stats = ((updated, _("updated")),
422 stats = ((updated, _("updated")),
443 (merged - unresolved, _("merged")),
423 (merged - unresolved, _("merged")),
444 (removed, _("removed")),
424 (removed, _("removed")),
445 (unresolved, _("unresolved")))
425 (unresolved, _("unresolved")))
446 note = ", ".join([_("%d files %s") % s for s in stats])
426 note = ", ".join([_("%d files %s") % s for s in stats])
447 repo.ui.status("%s\n" % note)
427 repo.ui.status("%s\n" % note)
448 if not partial:
428 if not partial:
449 if branchmerge:
429 if branchmerge:
450 if unresolved:
430 if unresolved:
451 repo.ui.status(_("There are unresolved merges,"
431 repo.ui.status(_("There are unresolved merges,"
452 " you can redo the full merge using:\n"
432 " you can redo the full merge using:\n"
453 " hg update -C %s\n"
433 " hg update -C %s\n"
454 " hg merge %s\n"
434 " hg merge %s\n"
455 % (p1.rev(), p2.rev())))
435 % (p1.rev(), p2.rev())))
456 elif remind:
436 elif remind:
457 repo.ui.status(_("(branch merge, don't forget to commit)\n"))
437 repo.ui.status(_("(branch merge, don't forget to commit)\n"))
458 elif unresolved:
438 elif unresolved:
459 repo.ui.status(_("There are unresolved merges with"
439 repo.ui.status(_("There are unresolved merges with"
460 " locally modified files.\n"))
440 " locally modified files.\n"))
461
441
462 return unresolved
442 return unresolved
463
443
@@ -1,26 +1,26 b''
1 checkout
1 checkout
2 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
2 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
3 merge
3 merge
4 resolving manifests
4 resolving manifests
5 overwrite None branchmerge True partial False
5 overwrite None branchmerge True partial False
6 ancestor f26ec4fc3fa3 local 8e765a822af2 remote af1939970a1c
6 ancestor f26ec4fc3fa3 local 8e765a822af2 remote af1939970a1c
7 a: remote moved -> c
7 a: remote moved -> m
8 b2: remote created -> g
8 b2: remote created -> g
9 merging a and b to b
9 merging a and b to b
10 resolving a
10 resolving a
11 my a@. other b@8e765a822af2 ancestor a@af1939970a1c
11 my a@. other b@8e765a822af2 ancestor a@af1939970a1c
12 copying a to b
12 copying a to b
13 removing a
13 removing a
14 getting b2
14 getting b2
15 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
15 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
16 (branch merge, don't forget to commit)
16 (branch merge, don't forget to commit)
17 M b
17 M b
18 a
18 a
19 M b2
19 M b2
20 R a
20 R a
21 C c2
21 C c2
22 blahblah
22 blahblah
23 rev offset length base linkrev nodeid p1 p2
23 rev offset length base linkrev nodeid p1 p2
24 0 0 67 0 1 dc51707dfc98 000000000000 000000000000
24 0 0 67 0 1 dc51707dfc98 000000000000 000000000000
25 1 67 72 1 3 b2494a44f0a9 000000000000 dc51707dfc98
25 1 67 72 1 3 b2494a44f0a9 000000000000 dc51707dfc98
26 renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
26 renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
@@ -1,463 +1,463 b''
1 --------------
1 --------------
2 test L:up a R:nc a b W: - 1 get local a to b
2 test L:up a R:nc a b W: - 1 get local a to b
3 --------------
3 --------------
4 resolving manifests
4 resolving manifests
5 overwrite None branchmerge True partial False
5 overwrite None branchmerge True partial False
6 ancestor e300d1c794ec local 735846fee2d7 remote 924404dff337
6 ancestor e300d1c794ec local 735846fee2d7 remote 924404dff337
7 rev: versions differ -> m
7 rev: versions differ -> m
8 a: remote copied -> c
8 a: remote copied -> m
9 merging a and b to b
9 merging a and b to b
10 resolving a
10 resolving a
11 my a@. other b@735846fee2d7 ancestor a@924404dff337
11 my a@. other b@735846fee2d7 ancestor a@924404dff337
12 copying a to b
12 copying a to b
13 merging rev
13 merging rev
14 resolving rev
14 resolving rev
15 my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
15 my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
16 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
16 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
17 (branch merge, don't forget to commit)
17 (branch merge, don't forget to commit)
18 --------------
18 --------------
19 M a
19 M a
20 M b
20 M b
21 a
21 a
22 --------------
22 --------------
23
23
24 --------------
24 --------------
25 test L:nc a b R:up a W: - 2 get rem change to a and b
25 test L:nc a b R:up a W: - 2 get rem change to a and b
26 --------------
26 --------------
27 resolving manifests
27 resolving manifests
28 overwrite None branchmerge True partial False
28 overwrite None branchmerge True partial False
29 ancestor ac809aeed39a local f4db7e329e71 remote 924404dff337
29 ancestor ac809aeed39a local f4db7e329e71 remote 924404dff337
30 a: remote is newer -> g
30 a: remote is newer -> g
31 b: local copied -> c
31 b: local copied -> m
32 rev: versions differ -> m
32 rev: versions differ -> m
33 getting a
33 getting a
34 merging b and a to b
34 merging b and a to b
35 resolving b
35 resolving b
36 my b@. other a@f4db7e329e71 ancestor a@924404dff337
36 my b@. other a@f4db7e329e71 ancestor a@924404dff337
37 merging rev
37 merging rev
38 resolving rev
38 resolving rev
39 my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
39 my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
40 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
40 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
41 (branch merge, don't forget to commit)
41 (branch merge, don't forget to commit)
42 --------------
42 --------------
43 M a
43 M a
44 M b
44 M b
45 a
45 a
46 --------------
46 --------------
47
47
48 --------------
48 --------------
49 test L:up a R:nm a b W: - 3 get local a change to b, remove a
49 test L:up a R:nm a b W: - 3 get local a change to b, remove a
50 --------------
50 --------------
51 resolving manifests
51 resolving manifests
52 overwrite None branchmerge True partial False
52 overwrite None branchmerge True partial False
53 ancestor e300d1c794ec local e03727d2d66b remote 924404dff337
53 ancestor e300d1c794ec local e03727d2d66b remote 924404dff337
54 a: remote moved -> c
54 a: remote moved -> m
55 rev: versions differ -> m
55 rev: versions differ -> m
56 merging a and b to b
56 merging a and b to b
57 resolving a
57 resolving a
58 my a@. other b@e03727d2d66b ancestor a@924404dff337
58 my a@. other b@e03727d2d66b ancestor a@924404dff337
59 copying a to b
59 copying a to b
60 removing a
60 removing a
61 merging rev
61 merging rev
62 resolving rev
62 resolving rev
63 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
63 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
64 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
64 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
65 (branch merge, don't forget to commit)
65 (branch merge, don't forget to commit)
66 --------------
66 --------------
67 M b
67 M b
68 a
68 a
69 --------------
69 --------------
70
70
71 --------------
71 --------------
72 test L:nm a b R:up a W: - 4 get remote change to b
72 test L:nm a b R:up a W: - 4 get remote change to b
73 --------------
73 --------------
74 resolving manifests
74 resolving manifests
75 overwrite None branchmerge True partial False
75 overwrite None branchmerge True partial False
76 ancestor ecf3cb2a4219 local f4db7e329e71 remote 924404dff337
76 ancestor ecf3cb2a4219 local f4db7e329e71 remote 924404dff337
77 b: local moved -> c
77 b: local moved -> m
78 rev: versions differ -> m
78 rev: versions differ -> m
79 merging b and a to b
79 merging b and a to b
80 resolving b
80 resolving b
81 my b@. other a@f4db7e329e71 ancestor a@924404dff337
81 my b@. other a@f4db7e329e71 ancestor a@924404dff337
82 merging rev
82 merging rev
83 resolving rev
83 resolving rev
84 my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
84 my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
85 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
85 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
86 (branch merge, don't forget to commit)
86 (branch merge, don't forget to commit)
87 --------------
87 --------------
88 M b
88 M b
89 a
89 a
90 --------------
90 --------------
91
91
92 --------------
92 --------------
93 test L: R:nc a b W: - 5 get b
93 test L: R:nc a b W: - 5 get b
94 --------------
94 --------------
95 resolving manifests
95 resolving manifests
96 overwrite None branchmerge True partial False
96 overwrite None branchmerge True partial False
97 ancestor 94b33a1b7f2d local 735846fee2d7 remote 924404dff337
97 ancestor 94b33a1b7f2d local 735846fee2d7 remote 924404dff337
98 rev: versions differ -> m
98 rev: versions differ -> m
99 a: remote copied -> c
99 a: remote copied -> m
100 merging a and b to b
100 merging a and b to b
101 resolving a
101 resolving a
102 my a@. other b@735846fee2d7 ancestor a@924404dff337
102 my a@. other b@735846fee2d7 ancestor a@924404dff337
103 copying a to b
103 copying a to b
104 merging rev
104 merging rev
105 resolving rev
105 resolving rev
106 my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
106 my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
107 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
107 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
108 (branch merge, don't forget to commit)
108 (branch merge, don't forget to commit)
109 --------------
109 --------------
110 M a
110 M a
111 M b
111 M b
112 a
112 a
113 --------------
113 --------------
114
114
115 --------------
115 --------------
116 test L:nc a b R: W: - 6 nothing
116 test L:nc a b R: W: - 6 nothing
117 --------------
117 --------------
118 resolving manifests
118 resolving manifests
119 overwrite None branchmerge True partial False
119 overwrite None branchmerge True partial False
120 ancestor ac809aeed39a local 97c705ade336 remote 924404dff337
120 ancestor ac809aeed39a local 97c705ade336 remote 924404dff337
121 b: local copied -> c
121 b: local copied -> m
122 rev: versions differ -> m
122 rev: versions differ -> m
123 merging b and a to b
123 merging b and a to b
124 resolving b
124 resolving b
125 my b@. other a@97c705ade336 ancestor a@924404dff337
125 my b@. other a@97c705ade336 ancestor a@924404dff337
126 merging rev
126 merging rev
127 resolving rev
127 resolving rev
128 my rev@. other rev@97c705ade336 ancestor rev@924404dff337
128 my rev@. other rev@97c705ade336 ancestor rev@924404dff337
129 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
129 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
130 (branch merge, don't forget to commit)
130 (branch merge, don't forget to commit)
131 --------------
131 --------------
132 M b
132 M b
133 a
133 a
134 C a
134 C a
135 --------------
135 --------------
136
136
137 --------------
137 --------------
138 test L: R:nm a b W: - 7 get b
138 test L: R:nm a b W: - 7 get b
139 --------------
139 --------------
140 resolving manifests
140 resolving manifests
141 overwrite None branchmerge True partial False
141 overwrite None branchmerge True partial False
142 ancestor 94b33a1b7f2d local e03727d2d66b remote 924404dff337
142 ancestor 94b33a1b7f2d local e03727d2d66b remote 924404dff337
143 a: remote moved -> c
143 a: remote moved -> m
144 rev: versions differ -> m
144 rev: versions differ -> m
145 merging a and b to b
145 merging a and b to b
146 resolving a
146 resolving a
147 my a@. other b@e03727d2d66b ancestor a@924404dff337
147 my a@. other b@e03727d2d66b ancestor a@924404dff337
148 copying a to b
148 copying a to b
149 removing a
149 removing a
150 merging rev
150 merging rev
151 resolving rev
151 resolving rev
152 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
152 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
153 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
153 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
154 (branch merge, don't forget to commit)
154 (branch merge, don't forget to commit)
155 --------------
155 --------------
156 M b
156 M b
157 a
157 a
158 --------------
158 --------------
159
159
160 --------------
160 --------------
161 test L:nm a b R: W: - 8 nothing
161 test L:nm a b R: W: - 8 nothing
162 --------------
162 --------------
163 resolving manifests
163 resolving manifests
164 overwrite None branchmerge True partial False
164 overwrite None branchmerge True partial False
165 ancestor ecf3cb2a4219 local 97c705ade336 remote 924404dff337
165 ancestor ecf3cb2a4219 local 97c705ade336 remote 924404dff337
166 b: local moved -> c
166 b: local moved -> m
167 rev: versions differ -> m
167 rev: versions differ -> m
168 merging b and a to b
168 merging b and a to b
169 resolving b
169 resolving b
170 my b@. other a@97c705ade336 ancestor a@924404dff337
170 my b@. other a@97c705ade336 ancestor a@924404dff337
171 merging rev
171 merging rev
172 resolving rev
172 resolving rev
173 my rev@. other rev@97c705ade336 ancestor rev@924404dff337
173 my rev@. other rev@97c705ade336 ancestor rev@924404dff337
174 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
174 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
175 (branch merge, don't forget to commit)
175 (branch merge, don't forget to commit)
176 --------------
176 --------------
177 M b
177 M b
178 a
178 a
179 --------------
179 --------------
180
180
181 --------------
181 --------------
182 test L:um a b R:um a b W: - 9 do merge with ancestor in a
182 test L:um a b R:um a b W: - 9 do merge with ancestor in a
183 --------------
183 --------------
184 resolving manifests
184 resolving manifests
185 overwrite None branchmerge True partial False
185 overwrite None branchmerge True partial False
186 ancestor ec03c2ca8642 local 79cc6877a3b7 remote 924404dff337
186 ancestor ec03c2ca8642 local 79cc6877a3b7 remote 924404dff337
187 b: versions differ -> m
187 b: versions differ -> m
188 rev: versions differ -> m
188 rev: versions differ -> m
189 merging b
189 merging b
190 resolving b
190 resolving b
191 my b@. other b@79cc6877a3b7 ancestor a@924404dff337
191 my b@. other b@79cc6877a3b7 ancestor a@924404dff337
192 merging rev
192 merging rev
193 resolving rev
193 resolving rev
194 my rev@. other rev@79cc6877a3b7 ancestor rev@924404dff337
194 my rev@. other rev@79cc6877a3b7 ancestor rev@924404dff337
195 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
195 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
196 (branch merge, don't forget to commit)
196 (branch merge, don't forget to commit)
197 --------------
197 --------------
198 M b
198 M b
199 --------------
199 --------------
200
200
201 --------------
201 --------------
202 test L:nm a b R:nm a c W: - 11 get c, keep b
202 test L:nm a b R:nm a c W: - 11 get c, keep b
203 --------------
203 --------------
204 resolving manifests
204 resolving manifests
205 overwrite None branchmerge True partial False
205 overwrite None branchmerge True partial False
206 ancestor ecf3cb2a4219 local e6abcc1a30c2 remote 924404dff337
206 ancestor ecf3cb2a4219 local e6abcc1a30c2 remote 924404dff337
207 rev: versions differ -> m
207 rev: versions differ -> m
208 c: remote created -> g
208 c: remote created -> g
209 getting c
209 getting c
210 merging rev
210 merging rev
211 resolving rev
211 resolving rev
212 my rev@. other rev@e6abcc1a30c2 ancestor rev@924404dff337
212 my rev@. other rev@e6abcc1a30c2 ancestor rev@924404dff337
213 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
213 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
214 (branch merge, don't forget to commit)
214 (branch merge, don't forget to commit)
215 --------------
215 --------------
216 M c
216 M c
217 C b
217 C b
218 --------------
218 --------------
219
219
220 --------------
220 --------------
221 test L:nc a b R:up b W: - 12 merge b no ancestor
221 test L:nc a b R:up b W: - 12 merge b no ancestor
222 --------------
222 --------------
223 resolving manifests
223 resolving manifests
224 overwrite None branchmerge True partial False
224 overwrite None branchmerge True partial False
225 ancestor ac809aeed39a local af30c7647fc7 remote 924404dff337
225 ancestor ac809aeed39a local af30c7647fc7 remote 924404dff337
226 b: versions differ -> m
226 b: versions differ -> m
227 rev: versions differ -> m
227 rev: versions differ -> m
228 merging b
228 merging b
229 resolving b
229 resolving b
230 my b@. other b@af30c7647fc7 ancestor b@000000000000
230 my b@. other b@af30c7647fc7 ancestor b@000000000000
231 merging rev
231 merging rev
232 resolving rev
232 resolving rev
233 my rev@. other rev@af30c7647fc7 ancestor rev@924404dff337
233 my rev@. other rev@af30c7647fc7 ancestor rev@924404dff337
234 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
234 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
235 (branch merge, don't forget to commit)
235 (branch merge, don't forget to commit)
236 --------------
236 --------------
237 M b
237 M b
238 C a
238 C a
239 --------------
239 --------------
240
240
241 --------------
241 --------------
242 test L:up b R:nm a b W: - 13 merge b no ancestor
242 test L:up b R:nm a b W: - 13 merge b no ancestor
243 --------------
243 --------------
244 resolving manifests
244 resolving manifests
245 overwrite None branchmerge True partial False
245 overwrite None branchmerge True partial False
246 ancestor 59318016310c local e03727d2d66b remote 924404dff337
246 ancestor 59318016310c local e03727d2d66b remote 924404dff337
247 a: other deleted -> r
247 a: other deleted -> r
248 b: versions differ -> m
248 b: versions differ -> m
249 rev: versions differ -> m
249 rev: versions differ -> m
250 removing a
250 removing a
251 merging b
251 merging b
252 resolving b
252 resolving b
253 my b@. other b@e03727d2d66b ancestor b@000000000000
253 my b@. other b@e03727d2d66b ancestor b@000000000000
254 merging rev
254 merging rev
255 resolving rev
255 resolving rev
256 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
256 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
257 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
257 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
258 (branch merge, don't forget to commit)
258 (branch merge, don't forget to commit)
259 --------------
259 --------------
260 M b
260 M b
261 --------------
261 --------------
262
262
263 --------------
263 --------------
264 test L:nc a b R:up a b W: - 14 merge b no ancestor
264 test L:nc a b R:up a b W: - 14 merge b no ancestor
265 --------------
265 --------------
266 resolving manifests
266 resolving manifests
267 overwrite None branchmerge True partial False
267 overwrite None branchmerge True partial False
268 ancestor ac809aeed39a local 8dbce441892a remote 924404dff337
268 ancestor ac809aeed39a local 8dbce441892a remote 924404dff337
269 a: remote is newer -> g
269 a: remote is newer -> g
270 b: versions differ -> m
270 b: versions differ -> m
271 rev: versions differ -> m
271 rev: versions differ -> m
272 getting a
272 getting a
273 merging b
273 merging b
274 resolving b
274 resolving b
275 my b@. other b@8dbce441892a ancestor b@000000000000
275 my b@. other b@8dbce441892a ancestor b@000000000000
276 merging rev
276 merging rev
277 resolving rev
277 resolving rev
278 my rev@. other rev@8dbce441892a ancestor rev@924404dff337
278 my rev@. other rev@8dbce441892a ancestor rev@924404dff337
279 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
279 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
280 (branch merge, don't forget to commit)
280 (branch merge, don't forget to commit)
281 --------------
281 --------------
282 M a
282 M a
283 M b
283 M b
284 --------------
284 --------------
285
285
286 --------------
286 --------------
287 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
287 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
288 --------------
288 --------------
289 resolving manifests
289 resolving manifests
290 overwrite None branchmerge True partial False
290 overwrite None branchmerge True partial False
291 ancestor 59318016310c local e03727d2d66b remote 924404dff337
291 ancestor 59318016310c local e03727d2d66b remote 924404dff337
292 a: other deleted -> r
292 a: other deleted -> r
293 b: versions differ -> m
293 b: versions differ -> m
294 rev: versions differ -> m
294 rev: versions differ -> m
295 removing a
295 removing a
296 merging b
296 merging b
297 resolving b
297 resolving b
298 my b@. other b@e03727d2d66b ancestor b@000000000000
298 my b@. other b@e03727d2d66b ancestor b@000000000000
299 merging rev
299 merging rev
300 resolving rev
300 resolving rev
301 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
301 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
302 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
302 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
303 (branch merge, don't forget to commit)
303 (branch merge, don't forget to commit)
304 --------------
304 --------------
305 M b
305 M b
306 --------------
306 --------------
307
307
308 --------------
308 --------------
309 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
309 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
310 --------------
310 --------------
311 resolving manifests
311 resolving manifests
312 overwrite None branchmerge True partial False
312 overwrite None branchmerge True partial False
313 ancestor ac809aeed39a local 8dbce441892a remote 924404dff337
313 ancestor ac809aeed39a local 8dbce441892a remote 924404dff337
314 a: remote is newer -> g
314 a: remote is newer -> g
315 b: versions differ -> m
315 b: versions differ -> m
316 rev: versions differ -> m
316 rev: versions differ -> m
317 getting a
317 getting a
318 merging b
318 merging b
319 resolving b
319 resolving b
320 my b@. other b@8dbce441892a ancestor b@000000000000
320 my b@. other b@8dbce441892a ancestor b@000000000000
321 merging rev
321 merging rev
322 resolving rev
322 resolving rev
323 my rev@. other rev@8dbce441892a ancestor rev@924404dff337
323 my rev@. other rev@8dbce441892a ancestor rev@924404dff337
324 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
324 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
325 (branch merge, don't forget to commit)
325 (branch merge, don't forget to commit)
326 --------------
326 --------------
327 M a
327 M a
328 M b
328 M b
329 --------------
329 --------------
330
330
331 --------------
331 --------------
332 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
332 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
333 --------------
333 --------------
334 resolving manifests
334 resolving manifests
335 overwrite None branchmerge True partial False
335 overwrite None branchmerge True partial False
336 ancestor 0b76e65c8289 local 735846fee2d7 remote 924404dff337
336 ancestor 0b76e65c8289 local 735846fee2d7 remote 924404dff337
337 b: versions differ -> m
337 b: versions differ -> m
338 rev: versions differ -> m
338 rev: versions differ -> m
339 merging b
339 merging b
340 resolving b
340 resolving b
341 my b@. other b@735846fee2d7 ancestor b@000000000000
341 my b@. other b@735846fee2d7 ancestor b@000000000000
342 merging rev
342 merging rev
343 resolving rev
343 resolving rev
344 my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
344 my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
345 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
345 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
346 (branch merge, don't forget to commit)
346 (branch merge, don't forget to commit)
347 --------------
347 --------------
348 M b
348 M b
349 C a
349 C a
350 --------------
350 --------------
351
351
352 --------------
352 --------------
353 test L:nm a b R:up a b W: - 18 merge b no ancestor
353 test L:nm a b R:up a b W: - 18 merge b no ancestor
354 --------------
354 --------------
355 resolving manifests
355 resolving manifests
356 overwrite None branchmerge True partial False
356 overwrite None branchmerge True partial False
357 ancestor ecf3cb2a4219 local 8dbce441892a remote 924404dff337
357 ancestor ecf3cb2a4219 local 8dbce441892a remote 924404dff337
358 b: versions differ -> m
358 b: versions differ -> m
359 rev: versions differ -> m
359 rev: versions differ -> m
360 a: prompt recreating -> g
360 a: prompt recreating -> g
361 getting a
361 getting a
362 merging b
362 merging b
363 resolving b
363 resolving b
364 my b@. other b@8dbce441892a ancestor b@000000000000
364 my b@. other b@8dbce441892a ancestor b@000000000000
365 merging rev
365 merging rev
366 resolving rev
366 resolving rev
367 my rev@. other rev@8dbce441892a ancestor rev@924404dff337
367 my rev@. other rev@8dbce441892a ancestor rev@924404dff337
368 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
368 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
369 (branch merge, don't forget to commit)
369 (branch merge, don't forget to commit)
370 --------------
370 --------------
371 M a
371 M a
372 M b
372 M b
373 --------------
373 --------------
374
374
375 --------------
375 --------------
376 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
376 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
377 --------------
377 --------------
378 resolving manifests
378 resolving manifests
379 overwrite None branchmerge True partial False
379 overwrite None branchmerge True partial False
380 ancestor 0b76e65c8289 local e03727d2d66b remote 924404dff337
380 ancestor 0b76e65c8289 local e03727d2d66b remote 924404dff337
381 b: versions differ -> m
381 b: versions differ -> m
382 rev: versions differ -> m
382 rev: versions differ -> m
383 merging b
383 merging b
384 resolving b
384 resolving b
385 my b@. other b@e03727d2d66b ancestor b@000000000000
385 my b@. other b@e03727d2d66b ancestor b@000000000000
386 merging rev
386 merging rev
387 resolving rev
387 resolving rev
388 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
388 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
389 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
389 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
390 (branch merge, don't forget to commit)
390 (branch merge, don't forget to commit)
391 --------------
391 --------------
392 M b
392 M b
393 C a
393 C a
394 --------------
394 --------------
395
395
396 --------------
396 --------------
397 test L:up a R:um a b W: - 20 merge a and b to b, remove a
397 test L:up a R:um a b W: - 20 merge a and b to b, remove a
398 --------------
398 --------------
399 resolving manifests
399 resolving manifests
400 overwrite None branchmerge True partial False
400 overwrite None branchmerge True partial False
401 ancestor e300d1c794ec local 79cc6877a3b7 remote 924404dff337
401 ancestor e300d1c794ec local 79cc6877a3b7 remote 924404dff337
402 a: remote moved -> c
402 a: remote moved -> m
403 rev: versions differ -> m
403 rev: versions differ -> m
404 merging a and b to b
404 merging a and b to b
405 resolving a
405 resolving a
406 my a@. other b@79cc6877a3b7 ancestor a@924404dff337
406 my a@. other b@79cc6877a3b7 ancestor a@924404dff337
407 copying a to b
407 copying a to b
408 removing a
408 removing a
409 merging rev
409 merging rev
410 resolving rev
410 resolving rev
411 my rev@. other rev@79cc6877a3b7 ancestor rev@924404dff337
411 my rev@. other rev@79cc6877a3b7 ancestor rev@924404dff337
412 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
412 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
413 (branch merge, don't forget to commit)
413 (branch merge, don't forget to commit)
414 --------------
414 --------------
415 M b
415 M b
416 a
416 a
417 --------------
417 --------------
418
418
419 --------------
419 --------------
420 test L:um a b R:up a W: - 21 merge a and b to b
420 test L:um a b R:up a W: - 21 merge a and b to b
421 --------------
421 --------------
422 resolving manifests
422 resolving manifests
423 overwrite None branchmerge True partial False
423 overwrite None branchmerge True partial False
424 ancestor ec03c2ca8642 local f4db7e329e71 remote 924404dff337
424 ancestor ec03c2ca8642 local f4db7e329e71 remote 924404dff337
425 b: local moved -> c
425 b: local moved -> m
426 rev: versions differ -> m
426 rev: versions differ -> m
427 merging b and a to b
427 merging b and a to b
428 resolving b
428 resolving b
429 my b@. other a@f4db7e329e71 ancestor a@924404dff337
429 my b@. other a@f4db7e329e71 ancestor a@924404dff337
430 merging rev
430 merging rev
431 resolving rev
431 resolving rev
432 my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
432 my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
433 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
433 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
434 (branch merge, don't forget to commit)
434 (branch merge, don't forget to commit)
435 --------------
435 --------------
436 M b
436 M b
437 a
437 a
438 --------------
438 --------------
439
439
440 --------------
440 --------------
441 test L:nm a b R:up a c W: - 23 get c, keep b
441 test L:nm a b R:up a c W: - 23 get c, keep b
442 --------------
442 --------------
443 resolving manifests
443 resolving manifests
444 overwrite None branchmerge True partial False
444 overwrite None branchmerge True partial False
445 ancestor ecf3cb2a4219 local 2b958612230f remote 924404dff337
445 ancestor ecf3cb2a4219 local 2b958612230f remote 924404dff337
446 b: local moved -> c
446 b: local moved -> m
447 rev: versions differ -> m
447 rev: versions differ -> m
448 c: remote created -> g
448 c: remote created -> g
449 merging b and a to b
449 merging b and a to b
450 resolving b
450 resolving b
451 my b@. other a@2b958612230f ancestor a@924404dff337
451 my b@. other a@2b958612230f ancestor a@924404dff337
452 getting c
452 getting c
453 merging rev
453 merging rev
454 resolving rev
454 resolving rev
455 my rev@. other rev@2b958612230f ancestor rev@924404dff337
455 my rev@. other rev@2b958612230f ancestor rev@924404dff337
456 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
456 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
457 (branch merge, don't forget to commit)
457 (branch merge, don't forget to commit)
458 --------------
458 --------------
459 M b
459 M b
460 a
460 a
461 M c
461 M c
462 --------------
462 --------------
463
463
General Comments 0
You need to be logged in to leave comments. Login now