pure: fix index parsing on empty repositories stable
authorWagner Bruna <wbruna@softwareexpress.com.br>
Thu, 17 Feb 2011 13:37:52 -0200
branchstable
changeset 13435 90d7ce986565
parent 13434 b5cc838dd999
child 13436 b391c0c9be61
pure: fix index parsing on empty repositories
mercurial/pure/parsers.py
--- 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))