# HG changeset patch # User Martin von Zweigbergk # Date 1579735410 28800 # Node ID 782e0d9c3b7467d18838580b0670d44f2bd29259 # Parent baf3fe2977cc082d458a8c68ade7861f92c78151 copies: avoid calculating debug-only stuff without --debug `renamedeleteset` and `divergeset` is only used with `repo.ui.debugflag`, so let's avoid calculating them otherwise. While at it, I also added a `del renamedeleteset` for consistency. Differential Revision: https://phab.mercurial-scm.org/D7976 diff -r baf3fe2977cc -r 782e0d9c3b74 mercurial/copies.py --- a/mercurial/copies.py Wed Jan 22 15:20:12 2020 -0800 +++ b/mercurial/copies.py Wed Jan 22 15:23:30 2020 -0800 @@ -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")