Minor code cleanups.

Signed-off-by: Simon Hausmann <hausmann@kde.org>
This commit is contained in:
Simon Hausmann
2007-03-10 10:53:07 +01:00
parent 59f1d2b52d
commit 478764bc82

View File

@ -340,6 +340,16 @@ def commit(details, files, branch, branchPrefix, parent):
lastChange = int(details["change"]) lastChange = int(details["change"])
def extractFilesInCommitToBranch(files, branchPrefix):
newFiles = []
for file in files:
path = file["path"]
if path.startswith(branchPrefix):
newFiles.append(file)
return newFiles
def getUserMap(): def getUserMap():
users = {} users = {}
@ -448,6 +458,8 @@ else:
knownBranches.add(branch) knownBranches.add(branch)
branchPrefix = globalPrefix + branch + "/" branchPrefix = globalPrefix + branch + "/"
filesForCommit = extractFilesInCommitToBranch(files, branchPrefix)
parent = "" parent = ""
########### remove cnt!!! ########### remove cnt!!!
if branch not in createdBranches and cnt > 2: if branch not in createdBranches and cnt > 2:
@ -458,10 +470,11 @@ else:
# elif len(parent) > 0: # elif len(parent) > 0:
# print "%s branched off of %s" % (branch, parent) # print "%s branched off of %s" % (branch, parent)
branch = "refs/heads/" + branch branch = "refs/heads/" + branch
commit(description, files, branch, branchPrefix, parent) commit(description, files, branch, branchPrefix, parent)
else: else:
commit(description, files, branch, globalPrefix, initialParent) commit(description, filesForCommit, branch, globalPrefix, initialParent)
initialParent = "" initialParent = ""
# except: # except:
# print gitError.read() # print gitError.read()