mercurial/changegroup.py
changeset 26694 c2e6e3cc7cb4
parent 26595 be0489770925
child 26695 1121fced5b20
--- 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)]))