# HG changeset patch # User Kyle Lippincott # Date 2022-04-19 19:17:23 # Node ID f45e1618cbf68aca4e72b6fed8dd2acef6f39a10 # Parent e55ce61891e3a2c65844cebb645973a48bf6933a amend: move "return None for removed files" into block handling filestoamend This is just a small logic cleanup from D12573, no change in behavior. Differential Revision: https://phab.mercurial-scm.org/D12576 diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2933,16 +2933,15 @@ def amend(ui, repo, old, extra, pats, op def filectxfn(repo, ctx_, path): try: - # Return None for removed files. - if path in wctx.removed() and path in filestoamend: - return None - # If the file being considered is not amongst the files # to be amended, we should use the file context from the # old changeset. This avoids issues when only some files in # the working copy are being amended but there are also # changes to other files from the old changeset. if path in filestoamend: + # Return None for removed files. + if path in wctx.removed(): + return None fctx = wctx[path] else: fctx = old.filectx(path)