Skip to content

Commit 1c49fc1

Browse files
committed
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>
1 parent e87f37a commit 1c49fc1

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

contrib/fast-import/git-p4

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ class P4Sync(Command):
12851285

12861286
self.depotPaths = sorted(args)
12871287

1288-
self.revision = ""
1288+
revision = ""
12891289
self.users = {}
12901290

12911291
newPaths = []
@@ -1296,15 +1296,15 @@ class P4Sync(Command):
12961296
if self.changeRange == "@all":
12971297
self.changeRange = ""
12981298
elif ',' not in self.changeRange:
1299-
self.revision = self.changeRange
1299+
revision = self.changeRange
13001300
self.changeRange = ""
13011301
p = p[:atIdx]
13021302
elif p.find("#") != -1:
13031303
hashIdx = p.index("#")
1304-
self.revision = p[hashIdx:]
1304+
revision = p[hashIdx:]
13051305
p = p[:hashIdx]
13061306
elif self.previousDepotPaths == []:
1307-
self.revision = "#head"
1307+
revision = "#head"
13081308

13091309
p = re.sub ("\.\.\.$", "", p)
13101310
if not p.endswith("/"):
@@ -1345,19 +1345,19 @@ class P4Sync(Command):
13451345
self.gitStream = importProcess.stdin
13461346
self.gitError = importProcess.stderr
13471347

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)
13501350

13511351
details = { "user" : "git perforce import user", "time" : int(time.time()) }
13521352
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
13551355
newestRevision = 0
13561356

13571357
fileCnt = 0
13581358
for info in p4CmdList("files "
13591359
+ ' '.join(["%s...%s"
1360-
% (p, self.revision)
1360+
% (p, revision)
13611361
for p in self.depotPaths])):
13621362

13631363
if info['code'] == 'error':

0 commit comments

Comments
 (0)