push/pull: abort if we try to visit a missing or empty revlog
authorMatt Mackall <mpm@selenic.com>
Wed, 21 Nov 2007 13:26:18 -0600
changeset 5543 a3df02cd4a35
parent 5542 253736bb0dc9
child 5544 686899a7de5b
push/pull: abort if we try to visit a missing or empty revlog
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Tue Nov 20 15:54:25 2007 -0600
+++ b/mercurial/localrepo.py	Wed Nov 21 13:26:18 2007 -0600
@@ -1710,6 +1710,8 @@
             # Go through all our files in order sorted by name.
             for fname in changedfiles:
                 filerevlog = self.file(fname)
+                if filerevlog.count() == 0:
+                    raise util.abort(_("empty or missing revlog for %s") % fname)
                 # Toss out the filenodes that the recipient isn't really
                 # missing.
                 if msng_filenode_set.has_key(fname):
@@ -1794,6 +1796,8 @@
 
             for fname in changedfiles:
                 filerevlog = self.file(fname)
+                if filerevlog.count() == 0:
+                    raise util.abort(_("empty or missing revlog for %s") % fname)
                 nodeiter = gennodelst(filerevlog)
                 nodeiter = list(nodeiter)
                 if nodeiter: