equal
deleted
inserted
replaced
743 return False, 1, None |
743 return False, 1, None |
744 localpath = _workingpath(repo, fcd) |
744 localpath = _workingpath(repo, fcd) |
745 args = _toolstr(repo.ui, tool, b"args") |
745 args = _toolstr(repo.ui, tool, b"args") |
746 |
746 |
747 with _maketempfiles( |
747 with _maketempfiles( |
748 repo, fco, fca, repo.wvfs.join(backup.path()), b"$output" in args |
748 fco, fca, repo.wvfs.join(backup.path()), b"$output" in args |
749 ) as temppaths: |
749 ) as temppaths: |
750 basepath, otherpath, localoutputpath = temppaths |
750 basepath, otherpath, localoutputpath = temppaths |
751 outpath = b"" |
751 outpath = b"" |
752 |
752 |
753 def format_label(input): |
753 def format_label(input): |
919 # the backup context regardless of where it lives. |
919 # the backup context regardless of where it lives. |
920 return context.arbitraryfilectx(backup, repo=repo) |
920 return context.arbitraryfilectx(backup, repo=repo) |
921 |
921 |
922 |
922 |
923 @contextlib.contextmanager |
923 @contextlib.contextmanager |
924 def _maketempfiles(repo, fco, fca, localpath, uselocalpath): |
924 def _maketempfiles(fco, fca, localpath, uselocalpath): |
925 """Writes out `fco` and `fca` as temporary files, and (if uselocalpath) |
925 """Writes out `fco` and `fca` as temporary files, and (if uselocalpath) |
926 copies `localpath` to another temporary file, so an external merge tool may |
926 copies `localpath` to another temporary file, so an external merge tool may |
927 use them. |
927 use them. |
928 """ |
928 """ |
929 tmproot = pycompat.mkdtemp(prefix=b'hgmerge-') |
929 tmproot = pycompat.mkdtemp(prefix=b'hgmerge-') |