Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Minor code cleanups.
author
Simon Hausmann
<hausmann@kde.org>
Sat, 10 Mar 2007 09:53:07 +0000
(10:53 +0100)
committer
Simon Hausmann
<hausmann@kde.org>
Sat, 10 Mar 2007 09:53:07 +0000
(10:53 +0100)
Signed-off-by: Simon Hausmann <hausmann@kde.org>
contrib/fast-import/p4-fast-export.py
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
59f1d2b
)
diff --git
a/contrib/fast-import/p4-fast-export.py
b/contrib/fast-import/p4-fast-export.py
index 3d2b42b63603c952b2b433240da1d7d532c5beb3..bd2f03064b0e67ea4a8ce53326087f3fee1de376 100755
(executable)
--- 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"])
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 = {}
def getUserMap():
users = {}
@@
-448,6
+458,8
@@
def getUserMap():
knownBranches.add(branch)
branchPrefix = globalPrefix + branch + "/"
knownBranches.add(branch)
branchPrefix = globalPrefix + branch + "/"
+ filesForCommit = extractFilesInCommitToBranch(files, branchPrefix)
+
parent = ""
########### remove cnt!!!
if branch not in createdBranches and cnt > 2:
parent = ""
########### remove cnt!!!
if branch not in createdBranches and cnt > 2:
@@
-458,10
+470,11
@@
def getUserMap():
# elif len(parent) > 0:
# print "%s branched off of %s" % (branch, parent)
# elif len(parent) > 0:
# print "%s branched off of %s" % (branch, parent)
+
branch = "refs/heads/" + branch
commit(description, files, branch, branchPrefix, parent)
else:
branch = "refs/heads/" + branch
commit(description, files, branch, branchPrefix, parent)
else:
- commit(description, files, branch, globalPrefix, initialParent)
+ commit(description, files
ForCommit
, branch, globalPrefix, initialParent)
initialParent = ""
# except:
# print gitError.read()
initialParent = ""
# except:
# print gitError.read()