# HG changeset patch # User Wagner Bruna # Date 2011-02-17 15:37:52 # Node ID 90d7ce986565cc4eacd5ad15420a979994d837ac # Parent b5cc838dd999da5dd262536475a336a7e1ab5c53 pure: fix index parsing on empty repositories diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py --- a/mercurial/pure/parsers.py +++ b/mercurial/pure/parsers.py @@ -56,10 +56,11 @@ def parse_index2(data, inline): 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))