copies: move early return for "no copies" case a little earlier
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 15 Apr 2019 22:58:10 -0700
changeset 42166 85f5934016f9
parent 42165 22c9ffdf8ef6
child 42167 91a0bc50b288
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
mercurial/copies.py
--- 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