changeset 42166:85f5934016f9

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
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 15 Apr 2019 22:58:10 -0700
parents 22c9ffdf8ef6
children 91a0bc50b288
files mercurial/copies.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Mon Apr 15 16:46:41 2019 -0700
+++ b/mercurial/copies.py	Mon Apr 15 22:58:10 2019 -0700
@@ -696,7 +696,11 @@
     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 @@
                                                               note))
     del divergeset
 
-    if not fullcopy:
-        return copy, {}, diverge, renamedelete, {}
-
     repo.ui.debug("  checking for directory renames\n")
 
     # generate a directory move map