summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 29bdbac)
raw | patch | inline | side by side (parent: 29bdbac)
author | Simon Hausmann <shausman@trolltech.com> | |
Sat, 19 May 2007 09:07:32 +0000 (11:07 +0200) | ||
committer | Simon Hausmann <shausman@trolltech.com> | |
Sat, 19 May 2007 09:07:32 +0000 (11:07 +0200) |
for debugging (oops).
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
contrib/fast-import/git-p4 | patch | blob | history |
index 2c1dc9e2b3431a8f0bfa3e20d0f5672c049f763e..35c5f9c696507e2f9892740b556d20dfb9a43b05 100755 (executable)
fnum = fnum + 1
return files
- def branchesForCommit(self, files):
- branches = Set()
+ def splitFilesIntoBranches(self, files):
+ branches = {}
for file in files:
path = file["path"][len(self.depotPath):]
for branch in self.knownBranches.keys():
if path.startswith(branch):
- branches.add(branch)
+ if branch not in branches:
+ branches[branch] = []
+ branches[branch].append(file["path"])
return branches
if not self.silent:
print "Tag %s does not match with change %s: file count is different." % (labelDetails["label"], change)
- def extractFilesInCommitToBranch(self, files, branchPrefix):
- newFiles = []
-
- for file in files:
- path = file["path"]
- if path.startswith(branchPrefix):
- newFiles.append(file)
-
- return newFiles
-
def getUserMap(self):
self.users = {}
if p4Change > 0:
self.depotPath = self.previousDepotPath
- #self.changeRange = "@%s,#head" % p4Change
- self.changeRange = "@%s,%s" % (p4Change, p4Change + 10)
+ self.changeRange = "@%s,#head" % p4Change
self.initialParent = parseRevision(self.branch)
if not self.silent:
print "Performing incremental import into %s git branch" % self.branch
try:
files = self.extractFilesFromCommit(description)
if self.detectBranches:
- for branch in self.branchesForCommit(files):
+ branches = self.splitFilesIntoBranches(files)
+ for branch in branches.keys():
branchPrefix = self.depotPath + branch + "/"
parent = ""
- filesForCommit = self.extractFilesInCommitToBranch(files, branch)
+ filesForCommit = branches[branch]
if self.verbose:
print "branch is %s" % branch