changeset 26694:c2e6e3cc7cb4

changegroup: move source check to top of addchangegroup This is preparation for some refactoring.
author Augie Fackler <augie@google.com>
date Tue, 13 Oct 2015 15:54:05 -0400
parents 338af85109dd
children 1121fced5b20
files mercurial/changegroup.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changegroup.py	Thu Oct 15 09:52:32 2015 -0400
+++ b/mercurial/changegroup.py	Tue Oct 13 15:54:05 2015 -0400
@@ -730,6 +730,9 @@
     - fewer heads than before: -1-removed heads (-2..-n)
     - number of heads stays the same: 1
     """
+    if not source:
+        return 0
+
     repo = repo.unfiltered()
     def csmap(x):
         repo.ui.debug("add changeset %s\n" % short(x))
@@ -738,9 +741,6 @@
     def revmap(x):
         return cl.rev(x)
 
-    if not source:
-        return 0
-
     changesets = files = revisions = 0
 
     tr = repo.transaction("\n".join([srctype, util.hidepassword(url)]))