@matheusbsbs / matheus-bagliano / commits / 1c49fc197b
Fork 0

git-p4: Cleanup; Turn self.revision into a function local variable (it's not used anywhere outside the function).

Signed-off-by: Simon Hausmann <simon@lst.de>

Simon Hausmann committed Aug 26, 2007 at 16:04 UTC 1c49fc197bd05a4c2ed602efcdbe277ef798813a
1 file changed +9 -9
contrib/fast-import/git-p4
+9 -9
@@ -1285,7 +1285,7 @@ class P4Sync(Command):
1285
1286 self.depotPaths = sorted(args)
1287
1288 - self.revision = ""
1288 + revision = ""
1289 self.users = {}
1290
1291 newPaths = []
@@ -1296,15 +1296,15 @@ class P4Sync(Command):
1296 if self.changeRange == "@all":
1297 self.changeRange = ""
1298 elif ',' not in self.changeRange:
1299 - self.revision = self.changeRange
1299 + revision = self.changeRange
1300 self.changeRange = ""
1301 p = p[:atIdx]
1302 elif p.find("#") != -1:
1303 hashIdx = p.index("#")
1304 - self.revision = p[hashIdx:]
1304 + revision = p[hashIdx:]
1305 p = p[:hashIdx]
1306 elif self.previousDepotPaths == []:
1307 - self.revision = "#head"
1307 + revision = "#head"
1308
1309 p = re.sub ("\.\.\.$", "", p)
1310 if not p.endswith("/"):
@@ -1345,19 +1345,19 @@ class P4Sync(Command):
1345 self.gitStream = importProcess.stdin
1346 self.gitError = importProcess.stderr
1347
1348 - if self.revision:
1349 - print "Doing initial import of %s from revision %s into %s" % (' '.join(self.depotPaths), self.revision, self.branch)
1348 + if revision:
1349 + print "Doing initial import of %s from revision %s into %s" % (' '.join(self.depotPaths), revision, self.branch)
1350
1351 details = { "user" : "git perforce import user", "time" : int(time.time()) }
1352 details["desc"] = ("Initial import of %s from the state at revision %s"
1353 - % (' '.join(self.depotPaths), self.revision))
1354 - details["change"] = self.revision
1353 + % (' '.join(self.depotPaths), revision))
1354 + details["change"] = revision
1355 newestRevision = 0
1356
1357 fileCnt = 0
1358 for info in p4CmdList("files "
1359 + ' '.join(["%s...%s"
1360 - % (p, self.revision)
1360 + % (p, revision)
1361 for p in self.depotPaths])):
1362
1363 if info['code'] == 'error':