diff options
author | Simon Hausmann <hausmann@kde.org> | 2007-02-07 22:57:01 +0100 |
---|---|---|
committer | Simon Hausmann <hausmann@kde.org> | 2007-02-07 22:57:01 +0100 |
commit | c4cf2d4f8793ea8f889052391d72dd4066e88155 (patch) | |
tree | ec375b864933b766c91922eb0a3111f82a3e3cac /contrib | |
parent | Initial support for importing a directory from Perforce at a specified revision. (diff) | |
download | tgif-c4cf2d4f8793ea8f889052391d72dd4066e88155.tar.xz |
Minor cleanups and print an error message of git fast-import if it fails.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/fast-import/p4-fast-export.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/contrib/fast-import/p4-fast-export.py b/contrib/fast-import/p4-fast-export.py index 19f5f03476..06de0eae6d 100755 --- a/contrib/fast-import/p4-fast-export.py +++ b/contrib/fast-import/p4-fast-export.py @@ -154,6 +154,9 @@ if len(changeRange) == 0: sys.stderr.write("\n") tz = - time.timezone / 36 +tzsign = ("%s" % tz)[0] +if tzsign != '+' and tzsign != '-': + tz = "+" + ("%s" % tz) if len(revision) > 0: print "Doing initial import of %s from revision %s" % (prefix, revision) @@ -165,21 +168,25 @@ if len(revision) > 0: fileCnt = 0 for info in p4CmdList("files %s...%s" % (prefix, revision)): + change = info["change"] + if change > newestRevision: + newestRevision = change + if info["action"] == "delete": continue + for prop in [ "depotFile", "rev", "action", "type" ]: details["%s%s" % (prop, fileCnt)] = info[prop] - change = info["change"] - if change > newestRevision: - newestRevision = change - fileCnt = fileCnt + 1 details["change"] = newestRevision gitOutput, gitStream, gitError = popen2.popen3("git-fast-import") - commit(details) + try: + commit(details) + except: + print gitError.read() gitStream.close() gitOutput.close() |