diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2928,7 +2928,7 @@ files = [ f for f in files - if (f not in filestoamend or not samefile(f, wctx, base)) + if not (f in filestoamend and samefile(f, wctx, base)) ] def filectxfn(repo, ctx_, path):