# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 2014-09-12 06:35:19
# Node ID 333d654783adfcc2606e01b4897a88e97c7945cc
# Parent  e1b68c0a936388c7ffbf10d3fd9530c69722614e

convert: for git's getchanges, use explicit index for iteration

Upcoming patches will add support for copies and renames, for which we'll need
to access multiple lines of the difftree output at once.

diff --git a/hgext/convert/git.py b/hgext/convert/git.py
--- a/hgext/convert/git.py
+++ b/hgext/convert/git.py
@@ -190,7 +190,12 @@ class convert_git(converter_source):
         entry = None
         subexists = False
         subdeleted = False
-        for l in fh.read().split('\x00'):
+        difftree = fh.read().split('\x00')
+        lcount = len(difftree)
+        i = 0
+        while i < lcount:
+            l = difftree[i]
+            i += 1
             if not entry:
                 if not l.startswith(':'):
                     continue