diff options
author | Simon Hausmann <hausmann@kde.org> | 2007-03-10 10:53:07 +0100 |
---|---|---|
committer | Simon Hausmann <hausmann@kde.org> | 2007-03-10 10:53:07 +0100 |
commit | 478764bc8261857e7eca2deac409e34c2778347a (patch) | |
tree | 6dfb35222d89fdcb5d98e1a7cb4743888f53974f /contrib/fast-import | |
parent | Make the p4 data/command cache configurable through the --cache-debug command... (diff) | |
download | tgif-478764bc8261857e7eca2deac409e34c2778347a.tar.xz |
Minor code cleanups.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
Diffstat (limited to 'contrib/fast-import')
-rwxr-xr-x | contrib/fast-import/p4-fast-export.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/contrib/fast-import/p4-fast-export.py b/contrib/fast-import/p4-fast-export.py index 3d2b42b636..bd2f03064b 100755 --- a/contrib/fast-import/p4-fast-export.py +++ b/contrib/fast-import/p4-fast-export.py @@ -340,6 +340,16 @@ def commit(details, files, branch, branchPrefix, parent): 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(): users = {} @@ -448,6 +458,8 @@ else: knownBranches.add(branch) branchPrefix = globalPrefix + branch + "/" + filesForCommit = extractFilesInCommitToBranch(files, branchPrefix) + parent = "" ########### remove cnt!!! if branch not in createdBranches and cnt > 2: @@ -458,10 +470,11 @@ else: # elif len(parent) > 0: # print "%s branched off of %s" % (branch, parent) + branch = "refs/heads/" + branch commit(description, files, branch, branchPrefix, parent) else: - commit(description, files, branch, globalPrefix, initialParent) + commit(description, filesForCommit, branch, globalPrefix, initialParent) initialParent = "" # except: # print gitError.read() |