Mercurial > hg-stable
changeset 27123:4dc5951df1e4
filemerge: in ':fail' tool, write out other side if local side is deleted
We do this because we don't want to modify the dirstate for failures, and don't
just want to leave the file missing from disk. Plus it's more useful for the
user if the changed side is written out -- it is easier to delete a file than
to get it back via hg revert.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 24 Nov 2015 10:57:01 -0800 |
parents | 77d760ba8dcd |
children | 9c870e3efab7 |
files | mercurial/filemerge.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/filemerge.py Mon Nov 23 18:03:25 2015 -0800 +++ b/mercurial/filemerge.py Tue Nov 24 10:57:01 2015 -0800 @@ -285,6 +285,9 @@ Rather than attempting to merge files that were modified on both branches, it marks them as unresolved. The resolve command must be used to resolve these conflicts.""" + # for change/delete conflicts write out the changed version, then fail + if fcd.isabsent(): + repo.wwrite(fcd.path(), fco.data(), fco.flags()) return 1, False def _premerge(repo, fcd, fco, fca, toolconf, files, labels=None):