diff mercurial/pure/parsers.py @ 13435:90d7ce986565 stable

pure: fix index parsing on empty repositories
author Wagner Bruna <wbruna@softwareexpress.com.br>
date Thu, 17 Feb 2011 13:37:52 -0200
parents 20a54bdf2328
children e4bfb9c337f3
line wrap: on
line diff
--- a/mercurial/pure/parsers.py	Thu Feb 17 17:15:32 2011 -0500
+++ b/mercurial/pure/parsers.py	Thu Feb 17 13:37:52 2011 -0200
@@ -56,10 +56,11 @@
             n += 1
             off += s
 
-    e = list(index[0])
-    type = gettype(e[0])
-    e[0] = offset_type(0, type)
-    index[0] = tuple(e)
+    if index:
+        e = list(index[0])
+        type = gettype(e[0])
+        e[0] = offset_type(0, type)
+        index[0] = tuple(e)
 
     # add the magic null revision at -1
     index.append((0, 0, 0, -1, -1, -1, -1, nullid))