Show More
@@ -16,8 +16,6 b' def filemerge(repo, fw, fo, fd, wctx, mc' | |||
|
16 | 16 | fw = filename in the working directory and first parent |
|
17 | 17 | fo = filename in other parent |
|
18 | 18 | fd = destination filename |
|
19 | my = fileid in first parent | |
|
20 | other = fileid in second parent | |
|
21 | 19 | wctx, mctx = working and merge changecontexts |
|
22 | 20 | move = whether to move or copy the file to the destination |
|
23 | 21 | |
@@ -212,7 +210,7 b' def manifestmerge(repo, p1, p2, pa, over' | |||
|
212 | 210 | a = ma.get(f, nullid) |
|
213 | 211 | # are both different from the ancestor? |
|
214 | 212 | if not overwrite and n != a and m2[f] != a: |
|
215 |
act("versions differ", f, "m", fmerge(f) |
|
|
213 | act("versions differ", f, "m", fmerge(f)) | |
|
216 | 214 | # are we clobbering? |
|
217 | 215 | # is remote's version newer? |
|
218 | 216 | # or are we going back in time and clean? |
@@ -229,14 +227,14 b' def manifestmerge(repo, p1, p2, pa, over' | |||
|
229 | 227 | f2 = copy[f] |
|
230 | 228 | if f in ma: # case 3,20 A/B/A |
|
231 | 229 | act("remote moved", |
|
232 |
f, "c", f2, f2 |
|
|
230 | f, "c", f2, f2, fmerge(f, f2, f), True) | |
|
233 | 231 | else: |
|
234 | 232 | if f2 in m1: # case 2 A,B/B/B |
|
235 | 233 | act("local copied", |
|
236 |
f, "c", f2, f |
|
|
234 | f, "c", f2, f, fmerge(f, f2, f2), False) | |
|
237 | 235 | else: # case 4,21 A/B/B |
|
238 | 236 | act("local moved", |
|
239 |
f, "c", f2, f |
|
|
237 | f, "c", f2, f, fmerge(f, f2, f2), False) | |
|
240 | 238 | elif f in ma: |
|
241 | 239 | if n != ma[f] and not overwrite: |
|
242 | 240 | if repo.ui.prompt( |
@@ -260,8 +258,7 b' def manifestmerge(repo, p1, p2, pa, over' | |||
|
260 | 258 | if f2 not in m2: # already seen |
|
261 | 259 | continue |
|
262 | 260 | # rename case 1, A/A,B/A |
|
263 | act("remote copied", | |
|
264 | f2, "c", f, f, m1[f2], m2[f], fmerge(f2, f, f2), False) | |
|
261 | act("remote copied", f2, "c", f, f, fmerge(f2, f, f2), False) | |
|
265 | 262 | elif f in ma: |
|
266 | 263 | if overwrite or backwards: |
|
267 | 264 | act("recreating", f, "g", m2.execf(f), n) |
@@ -293,14 +290,14 b' def applyupdates(repo, action, wctx, mct' | |||
|
293 | 290 | (f, inst.strerror)) |
|
294 | 291 | removed +=1 |
|
295 | 292 | elif m == "c": # copy |
|
296 |
f2, fd |
|
|
293 | f2, fd, flag, move = a[2:] | |
|
297 | 294 | repo.ui.status(_("merging %s and %s to %s\n") % (f, f2, fd)) |
|
298 | 295 | if filemerge(repo, f, f2, fd, wctx, mctx, move): |
|
299 | 296 | unresolved += 1 |
|
300 | 297 | util.set_exec(repo.wjoin(fd), flag) |
|
301 | 298 | merged += 1 |
|
302 | 299 | elif m == "m": # merge |
|
303 |
flag |
|
|
300 | flag = a[2] | |
|
304 | 301 | repo.ui.status(_("merging %s\n") % f) |
|
305 | 302 | if filemerge(repo, f, f, f, wctx, mctx, False): |
|
306 | 303 | unresolved += 1 |
@@ -309,17 +306,17 b' def applyupdates(repo, action, wctx, mct' | |||
|
309 | 306 | elif m == "g": # get |
|
310 | 307 | flag, node = a[2:] |
|
311 | 308 | repo.ui.note(_("getting %s\n") % f) |
|
312 |
t = |
|
|
309 | t = mctx.filectx(f).data() | |
|
313 | 310 | repo.wwrite(f, t) |
|
314 | 311 | util.set_exec(repo.wjoin(f), flag) |
|
315 | 312 | updated += 1 |
|
316 | 313 | elif m == "e": # exec |
|
317 |
flag = a[2 |
|
|
314 | flag = a[2] | |
|
318 | 315 | util.set_exec(repo.wjoin(f), flag) |
|
319 | 316 | |
|
320 | 317 | return updated, merged, removed, unresolved |
|
321 | 318 | |
|
322 | def recordupdates(repo, action, branchmerge): | |
|
319 | def recordupdates(repo, action, branchmerge, mctx): | |
|
323 | 320 | for a in action: |
|
324 | 321 | f, m = a[:2] |
|
325 | 322 | if m == "r": # remove |
@@ -335,7 +332,7 b' def recordupdates(repo, action, branchme' | |||
|
335 | 332 | else: |
|
336 | 333 | repo.dirstate.update([f], 'n') |
|
337 | 334 | elif m == "m": # merge |
|
338 |
flag |
|
|
335 | flag = a[2] | |
|
339 | 336 | if branchmerge: |
|
340 | 337 | # We've done a branch merge, mark this file as merged |
|
341 | 338 | # so that we properly record the merger later |
@@ -347,10 +344,10 b' def recordupdates(repo, action, branchme' | |||
|
347 | 344 | # merge will appear as a normal local file |
|
348 | 345 | # modification. |
|
349 | 346 | fl = repo.file(f) |
|
350 |
f_len = fl.size( |
|
|
347 | f_len = mctx.filectx(f).size() | |
|
351 | 348 | repo.dirstate.update([f], 'n', st_size=f_len, st_mtime=-1) |
|
352 | 349 | elif m == "c": # copy |
|
353 |
f2, fd |
|
|
350 | f2, fd, flag, move = a[2:] | |
|
354 | 351 | if branchmerge: |
|
355 | 352 | # We've done a branch merge, mark this file as merged |
|
356 | 353 | # so that we properly record the merger later |
@@ -362,7 +359,7 b' def recordupdates(repo, action, branchme' | |||
|
362 | 359 | # merge will appear as a normal local file |
|
363 | 360 | # modification. |
|
364 | 361 | fl = repo.file(f) |
|
365 |
f_len = fl.size( |
|
|
362 | f_len = mctx.filectx(f).size() | |
|
366 | 363 | repo.dirstate.update([fd], 'n', st_size=f_len, st_mtime=-1) |
|
367 | 364 | if move: |
|
368 | 365 | repo.dirstate.update([f], 'r') |
@@ -437,7 +434,7 b' def update(repo, node, branchmerge=False' | |||
|
437 | 434 | |
|
438 | 435 | # update dirstate |
|
439 | 436 | if not partial: |
|
440 | recordupdates(repo, action, branchmerge) | |
|
437 | recordupdates(repo, action, branchmerge, p2) | |
|
441 | 438 | repo.dirstate.setparents(fp1, fp2) |
|
442 | 439 | repo.hook('update', parent1=xp1, parent2=xp2, error=unresolved) |
|
443 | 440 |
General Comments 0
You need to be logged in to leave comments.
Login now