Patchwork D9794: copies: clarify which case some conditional are handling

login
register
mail settings
Submitter phabricator
Date Jan. 15, 2021, 11:09 p.m.
Message ID <differential-rev-PHID-DREV-xotf3xctvdp6ayvgddah-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48105/
State Superseded
Headers show

Comments

phabricator - Jan. 15, 2021, 11:09 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This make the function a bit clearer. The middle conditional get no label
  because we about about to remove it. See next changeset for details.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -60,13 +60,13 @@ 
 
     for k, v in list(t.items()):
         # remove copies from files that didn't exist
-        if v not in src:
+        if v not in src:  # case 5
             del t[k]
         # remove criss-crossed copies
         elif k in src and v in dst:
             del t[k]
         # remove copies to files that were then removed
-        elif k not in dst:
+        elif k not in dst:  # case 1
             del t[k]