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>
This commit is contained in:
parent
e87f37ae42
commit
1c49fc197b
@ -1285,7 +1285,7 @@ class P4Sync(Command):
|
|||||||
|
|
||||||
self.depotPaths = sorted(args)
|
self.depotPaths = sorted(args)
|
||||||
|
|
||||||
self.revision = ""
|
revision = ""
|
||||||
self.users = {}
|
self.users = {}
|
||||||
|
|
||||||
newPaths = []
|
newPaths = []
|
||||||
@ -1296,15 +1296,15 @@ class P4Sync(Command):
|
|||||||
if self.changeRange == "@all":
|
if self.changeRange == "@all":
|
||||||
self.changeRange = ""
|
self.changeRange = ""
|
||||||
elif ',' not in self.changeRange:
|
elif ',' not in self.changeRange:
|
||||||
self.revision = self.changeRange
|
revision = self.changeRange
|
||||||
self.changeRange = ""
|
self.changeRange = ""
|
||||||
p = p[:atIdx]
|
p = p[:atIdx]
|
||||||
elif p.find("#") != -1:
|
elif p.find("#") != -1:
|
||||||
hashIdx = p.index("#")
|
hashIdx = p.index("#")
|
||||||
self.revision = p[hashIdx:]
|
revision = p[hashIdx:]
|
||||||
p = p[:hashIdx]
|
p = p[:hashIdx]
|
||||||
elif self.previousDepotPaths == []:
|
elif self.previousDepotPaths == []:
|
||||||
self.revision = "#head"
|
revision = "#head"
|
||||||
|
|
||||||
p = re.sub ("\.\.\.$", "", p)
|
p = re.sub ("\.\.\.$", "", p)
|
||||||
if not p.endswith("/"):
|
if not p.endswith("/"):
|
||||||
@ -1345,19 +1345,19 @@ class P4Sync(Command):
|
|||||||
self.gitStream = importProcess.stdin
|
self.gitStream = importProcess.stdin
|
||||||
self.gitError = importProcess.stderr
|
self.gitError = importProcess.stderr
|
||||||
|
|
||||||
if self.revision:
|
if revision:
|
||||||
print "Doing initial import of %s from revision %s into %s" % (' '.join(self.depotPaths), self.revision, self.branch)
|
print "Doing initial import of %s from revision %s into %s" % (' '.join(self.depotPaths), revision, self.branch)
|
||||||
|
|
||||||
details = { "user" : "git perforce import user", "time" : int(time.time()) }
|
details = { "user" : "git perforce import user", "time" : int(time.time()) }
|
||||||
details["desc"] = ("Initial import of %s from the state at revision %s"
|
details["desc"] = ("Initial import of %s from the state at revision %s"
|
||||||
% (' '.join(self.depotPaths), self.revision))
|
% (' '.join(self.depotPaths), revision))
|
||||||
details["change"] = self.revision
|
details["change"] = revision
|
||||||
newestRevision = 0
|
newestRevision = 0
|
||||||
|
|
||||||
fileCnt = 0
|
fileCnt = 0
|
||||||
for info in p4CmdList("files "
|
for info in p4CmdList("files "
|
||||||
+ ' '.join(["%s...%s"
|
+ ' '.join(["%s...%s"
|
||||||
% (p, self.revision)
|
% (p, revision)
|
||||||
for p in self.depotPaths])):
|
for p in self.depotPaths])):
|
||||||
|
|
||||||
if info['code'] == 'error':
|
if info['code'] == 'error':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user