changeset 22467:333d654783ad

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.
author Siddharth Agarwal <sid0@fb.com>
date Thu, 11 Sep 2014 23:35:19 -0700
parents e1b68c0a9363
children 5910184f1f7b
files hgext/convert/git.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/git.py	Fri Sep 12 10:17:56 2014 -0700
+++ b/hgext/convert/git.py	Thu Sep 11 23:35:19 2014 -0700
@@ -190,7 +190,12 @@
         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