Mercurial > hg
diff mercurial/copies.py @ 44163:782e0d9c3b74
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 22 Jan 2020 15:23:30 -0800 |
parents | baf3fe2977cc |
children | 45192589555c |
line wrap: on
line diff
--- 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")