changegroup: move source check to top of addchangegroup
This is preparation for some refactoring.
--- 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)]))