Fix style nit in Python slicing.

Python slices start at 0 by default.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
This commit is contained in:
Han-Wen Nienhuys 2007-07-23 15:56:37 -07:00 committed by Simon Hausmann
parent a4eba020f9
commit 7fcff9def5

View File

@ -1181,11 +1181,11 @@ class P4Sync(Command):
elif ',' not in self.changeRange: elif ',' not in self.changeRange:
self.revision = self.changeRange self.revision = self.changeRange
self.changeRange = "" self.changeRange = ""
p = p[0:atIdx] p = p[:atIdx]
elif p.find("#") != -1: elif p.find("#") != -1:
hashIdx = p.index("#") hashIdx = p.index("#")
self.revision = p[hashIdx:] self.revision = p[hashIdx:]
p = p[0:hashIdx] p = p[:hashIdx]
elif self.previousDepotPaths == []: elif self.previousDepotPaths == []:
self.revision = "#head" self.revision = "#head"
@ -1299,7 +1299,7 @@ class P4Sync(Command):
changes.sort() changes.sort()
if len(self.maxChanges) > 0: 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 len(changes) == 0:
if not self.silent: if not self.silent: