Merge branch 'maint'
[gitweb.git] / contrib / fast-import / git-p4
index 1f5a56ee7ffcedb854d84023fdf61570dcffe67e..41e86e76cb9e4718c87185fc0b25e630ad091939 100755 (executable)
@@ -1181,11 +1181,11 @@ class P4Sync(Command):
                 elif ',' not in self.changeRange:
                     self.revision = self.changeRange
                     self.changeRange = ""
-                p = p[0:atIdx]
+                p = p[:atIdx]
             elif p.find("#") != -1:
                 hashIdx = p.index("#")
                 self.revision = p[hashIdx:]
-                p = p[0:hashIdx]
+                p = p[:hashIdx]
             elif self.previousDepotPaths == []:
                 self.revision = "#head"
 
@@ -1296,10 +1296,10 @@ class P4Sync(Command):
                     changeNum = line.split(" ")[1]
                     changes.append(changeNum)
 
-                changes.reverse()
+                changes.sort()
 
                 if len(self.maxChanges) > 0:
-                    changes = changes[0:min(int(self.maxChanges), len(changes))]
+                    changes = changes[:min(int(self.maxChanges), len(changes))]
 
             if len(changes) == 0:
                 if not self.silent: