Patchwork D12577: amend: small refactor of logic for clarity

login
register
mail settings
Submitter phabricator
Date April 19, 2022, 7:21 p.m.
Message ID <differential-rev-PHID-DREV-cmkd7aiuefch2y3np6yh-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50925/
State New
Headers show

Comments

phabricator - April 19, 2022, 7:21 p.m.
spectral created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12577

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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):