Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/filemerge.py @ 48763:93d6f0e7ba2f
filemerge: move check for identical sides out of filemerge()
`filemerge.filemerge()` returns `None` if no merge was necessary
because the two sides were identical. I don't think it should be that
function's responsibility to handle that case; we should ideally not
even call `filemerge.filemerge()` if the two inputs identical. This
patch therefore moves the check out to the caller (`mergestate.py`).
The largefiles test changed because we now notice that the two sides
made the same change, so we don't consider it a merge. Also note that
the new message better matches the line above it in the test output.
Differential Revision: https://phab.mercurial-scm.org/D12154
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 07 Feb 2022 22:54:38 -0800 |
parents | 7dad4665d223 |
children | b70c9697ab41 |
comparison
equal
deleted
inserted
replaced
48762:d169e651066b | 48763:93d6f0e7ba2f |
---|---|
987 fca = ancestor file context | 987 fca = ancestor file context |
988 fcd = local file context for current/destination file | 988 fcd = local file context for current/destination file |
989 | 989 |
990 Returns whether the merge is complete, the return value of the merge, and | 990 Returns whether the merge is complete, the return value of the merge, and |
991 a boolean indicating whether the file was deleted from disk.""" | 991 a boolean indicating whether the file was deleted from disk.""" |
992 | |
993 if not fco.cmp(fcd): # files identical? | |
994 return None, False | |
995 | |
996 ui = repo.ui | 992 ui = repo.ui |
997 fd = fcd.path() | 993 fd = fcd.path() |
998 uipathfn = scmutil.getuipathfn(repo) | 994 uipathfn = scmutil.getuipathfn(repo) |
999 fduipath = uipathfn(fd) | 995 fduipath = uipathfn(fd) |
1000 binary = fcd.isbinary() or fco.isbinary() or fca.isbinary() | 996 binary = fcd.isbinary() or fco.isbinary() or fca.isbinary() |