OSDN Git Service

git-p4: Fix the sorting of changelists when cloning a Perforce repository.
authorReece H. Dunn <msclrhd@gmail.com>
Mon, 13 Aug 2007 18:40:50 +0000 (19:40 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Aug 2007 22:23:14 +0000 (15:23 -0700)
When performing a git-p4 clone operation on a Perforce repository,
where the changelists change in order of magnitude (e.g. 100 to 1000),
the set of changes to import from is not sorted properly. This is
because the data in the list is strings not integers. The other place
where this is done already converts the value to an integer, so it is
not affected.

Acked-by: Simon Hausmann <simon@lst.de>
contrib/fast-import/git-p4

index 805d632..6d01062 100755 (executable)
@@ -1322,7 +1322,7 @@ class P4Sync(Command):
 
                 for line in output:
                     changeNum = line.split(" ")[1]
-                    changes.append(changeNum)
+                    changes.append(int(changeNum))
 
                 changes.sort()