# HG changeset patch # User Martin von Zweigbergk # Date 2019-04-16 05:58:10 # Node ID 85f5934016f97c8647dec74e45b4e63c809e12e3 # Parent 22c9ffdf8ef68d6026ee2ddc3ef95fc726b22c60 copies: move early return for "no copies" case a little earlier We can return before the block that prints debug messages. That block will not be run anyway when there are no copies. Differential Revision: https://phab.mercurial-scm.org/D6248 diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -696,7 +696,11 @@ def _fullcopytracing(repo, c1, c2, base) for src, dsts in diverge.items(): for dst in dsts: fullcopy[dst] = src - if fullcopy and repo.ui.debugflag: + + if not fullcopy: + return copy, {}, diverge, renamedelete, {} + + if repo.ui.debugflag: repo.ui.debug(" all copies found (* = to merge, ! = divergent, " "% = renamed and deleted):\n") for f in sorted(fullcopy): @@ -711,9 +715,6 @@ def _fullcopytracing(repo, c1, c2, base) note)) del divergeset - if not fullcopy: - return copy, {}, diverge, renamedelete, {} - repo.ui.debug(" checking for directory renames\n") # generate a directory move map