hgext/convert/p4.py
changeset 30597 fa2d2c8ac398
parent 29205 a0939666b836
child 30598 364e14885cea
--- a/hgext/convert/p4.py	Thu Dec 15 11:00:18 2016 -0800
+++ b/hgext/convert/p4.py	Tue Dec 13 21:49:58 2016 -0800
@@ -126,14 +126,16 @@
 
         # handle revision limiting
         startrev = self.ui.config('convert', 'p4.startrev', default=0)
-        self.p4changes = [x for x in self.p4changes
-                          if ((not startrev or int(x) >= int(startrev)) and
-                              (not self.revs or int(x) <= int(self.revs[0])))]
 
         # now read the full changelists to get the list of file revisions
         ui.status(_('collecting p4 changelists\n'))
         lastid = None
         for change in self.p4changes:
+            if startrev and int(change) < int(startrev):
+                continue
+            if self.revs and int(change) > int(self.revs[0]):
+                continue
+
             cmd = "p4 -G describe -s %s" % change
             stdout = util.popen(cmd, mode='rb')
             d = marshal.load(stdout)