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