Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 34975:5f40efa472db stable
amend: do not drop missing files (issue5732)
samefile() can be wrong since wctx.manifest() does not include missing files,
whereas missing files should be preserved on commit.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 04 Nov 2017 23:48:19 +0900 |
parents | 0ba3b928f9a9 |
children | 691524f0bbf6 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sat Nov 04 23:45:59 2017 +0900 +++ b/mercurial/cmdutil.py Sat Nov 04 23:48:19 2017 +0900 @@ -3166,9 +3166,11 @@ # introduced file X and the file was renamed in the working # copy, then those two files are the same and # we can discard X from our list of files. Likewise if X - # was deleted, it's no longer relevant + # was removed, it's no longer relevant. If X is missing (aka + # deleted), old X must be preserved. files.update(filestoamend) - files = [f for f in files if not samefile(f, wctx, base)] + files = [f for f in files if (not samefile(f, wctx, base) + or f in wctx.deleted())] def filectxfn(repo, ctx_, path): try: