##// END OF EJS Templates
filemerge: return whether the file was deleted...
Siddharth Agarwal -
r27034:86ede9ed default
parent child Browse files
Show More
@@ -561,7 +561,7 b' def overridefilemerge(origfn, premerge, '
561 561 (lfutil.splitstandin(orig), ahash, dhash, ohash),
562 562 0) == 1)):
563 563 repo.wwrite(fcd.path(), fco.data(), fco.flags())
564 return True, 0
564 return True, 0, False
565 565
566 566 def copiespathcopies(orig, ctx1, ctx2, match=None):
567 567 copies = orig(ctx1, ctx2, match=match)
@@ -497,8 +497,8 b' def _filemerge(premerge, repo, mynode, o'
497 497 fca = ancestor file context
498 498 fcd = local file context for current/destination file
499 499
500 Returns whether the merge is complete, and the return value of the merge.
501 """
500 Returns whether the merge is complete, the return value of the merge, and
501 a boolean indicating whether the file was deleted from disk."""
502 502
503 503 def temp(prefix, ctx):
504 504 pre = "%s~%s." % (os.path.basename(ctx.path()), prefix)
@@ -510,7 +510,7 b' def _filemerge(premerge, repo, mynode, o'
510 510 return name
511 511
512 512 if not fco.cmp(fcd): # files identical?
513 return True, None
513 return True, None, False
514 514
515 515 ui = repo.ui
516 516 fd = fcd.path()
@@ -538,7 +538,7 b' def _filemerge(premerge, repo, mynode, o'
538 538
539 539 if mergetype == nomerge:
540 540 r, deleted = func(repo, mynode, orig, fcd, fco, fca, toolconf)
541 return True, r
541 return True, r, deleted
542 542
543 543 if premerge:
544 544 if orig != fco.path():
@@ -552,7 +552,7 b' def _filemerge(premerge, repo, mynode, o'
552 552 toolconf):
553 553 if onfailure:
554 554 ui.warn(onfailure % fd)
555 return True, 1
555 return True, 1, False
556 556
557 557 a = repo.wjoin(fd)
558 558 b = temp("base", fca)
@@ -573,7 +573,7 b' def _filemerge(premerge, repo, mynode, o'
573 573 if premerge and mergetype == fullmerge:
574 574 r = _premerge(repo, toolconf, files, labels=labels)
575 575 # complete if premerge successful (r is 0)
576 return not r, r
576 return not r, r, False
577 577
578 578 needcheck, r, deleted = func(repo, mynode, orig, fcd, fco, fca,
579 579 toolconf, files, labels=labels)
@@ -585,7 +585,7 b' def _filemerge(premerge, repo, mynode, o'
585 585 if onfailure:
586 586 ui.warn(onfailure % fd)
587 587
588 return True, r
588 return True, r, deleted
589 589 finally:
590 590 if not r:
591 591 util.unlink(back)
@@ -432,11 +432,13 b' class mergestate(object):'
432 432 f = self._repo.vfs('merge/' + hash)
433 433 self._repo.wwrite(dfile, f.read(), flags)
434 434 f.close()
435 complete, r = filemerge.premerge(self._repo, self._local, lfile,
436 fcd, fco, fca, labels=labels)
435 complete, r, deleted = filemerge.premerge(self._repo, self._local,
436 lfile, fcd, fco, fca,
437 labels=labels)
437 438 else:
438 complete, r = filemerge.filemerge(self._repo, self._local, lfile,
439 fcd, fco, fca, labels=labels)
439 complete, r, deleted = filemerge.filemerge(self._repo, self._local,
440 lfile, fcd, fco, fca,
441 labels=labels)
440 442 if r is None:
441 443 # no real conflict
442 444 del self._state[dfile]
General Comments 0
You need to be logged in to leave comments. Login now