Patchwork D7976: copies: avoid calculating debug-only stuff without --debug

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2020, 11:26 p.m.
Message ID <a51530797a6b8b76aa9b9c47526135bd@localhost.localdomain>
Download mbox | patch
Permalink /patch/44630/
State Not Applicable
Headers show

Comments

phabricator - Jan. 24, 2020, 11:26 p.m.
Closed by commit rHG782e0d9c3b74: copies: avoid calculating debug-only stuff without --debug (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7976?vs=19561&id=19574

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7976/new/

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

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -614,13 +614,6 @@ 
                 src, dsts2, m2, m1, mb, c1, base, copy, renamedelete
             )
 
-    renamedeleteset = set()
-    divergeset = set()
-    for dsts in diverge.values():
-        divergeset.update(dsts)
-    for dsts in renamedelete.values():
-        renamedeleteset.update(dsts)
-
     # find interesting file sets from manifests
     addedinm1 = m1.filesnotin(mb, repo.narrowmatch())
     addedinm2 = m2.filesnotin(mb, repo.narrowmatch())
@@ -637,6 +630,13 @@ 
     fullcopy.update(copies2)
 
     if repo.ui.debugflag:
+        renamedeleteset = set()
+        divergeset = set()
+        for dsts in diverge.values():
+            divergeset.update(dsts)
+        for dsts in renamedelete.values():
+            renamedeleteset.update(dsts)
+
         repo.ui.debug(
             b"  all copies found (* = to merge, ! = divergent, "
             b"% = renamed and deleted):\n"
@@ -652,7 +652,8 @@ 
             repo.ui.debug(
                 b"   src: '%s' -> dst: '%s' %s\n" % (fullcopy[f], f, note)
             )
-    del divergeset
+        del renamedeleteset
+        del divergeset
 
     repo.ui.debug(b"  checking for directory renames\n")