changeset 2002:4aab906517c6

Calling revlog.addgroup with an empty changegroup now raises RevlogError. The empty changegroup can be caused by remote servers dying soon after findincoming, and further code in pull assumes (correctly) that there are new changesets.
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 24 Mar 2006 19:51:05 +0100
parents a439b7b51530
children 62647394e368
files mercurial/revlog.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Fri Mar 24 10:33:18 2006 -0800
+++ b/mercurial/revlog.py	Fri Mar 24 19:51:05 2006 +0100
@@ -743,7 +743,7 @@
         #track the base of the current delta log
         r = self.count()
         t = r - 1
-        node = nullid
+        node = None
 
         base = prev = -1
         start = end = measure = 0
@@ -816,6 +816,8 @@
 
         dfh.close()
         ifh.close()
+        if node is None:
+            raise RevlogError(_("group to be added is empty"))
         return node
 
     def strip(self, rev, minlink):