revlog: bail out earlier in group when we have no chunks
authorSune Foldager <cryo@cyanite.org>
Fri, 03 Jun 2011 20:32:54 +0200
changeset 14523 b4175b72bbd8
parent 14522 5ca61ef6ff00
child 14524 97d2259af787
revlog: bail out earlier in group when we have no chunks
mercurial/revlog.py
--- a/mercurial/revlog.py	Fri Jun 03 20:23:32 2011 +0200
+++ b/mercurial/revlog.py	Fri Jun 03 20:32:54 2011 +0200
@@ -1096,6 +1096,11 @@
         changegroup starts with a full revision.
         """
 
+        # if we don't have any revisions touched by these changesets, bail
+        if len(nodelist) == 0:
+            yield bundler.close()
+            return
+
         # for generaldelta revlogs, we linearize the revs; this will both be
         # much quicker and generate a much smaller bundle
         if (self._generaldelta and reorder is not False) or reorder:
@@ -1105,11 +1110,6 @@
         else:
             revs = sorted([self.rev(n) for n in nodelist])
 
-        # if we don't have any revisions touched by these changesets, bail
-        if not revs:
-            yield bundler.close()
-            return
-
         # add the parent of the first rev
         p = self.parentrevs(revs[0])[0]
         revs.insert(0, p)