Fix git-dir option and allow reading log substitutions from a file
Signed-off-by: Simon Hausmann <hausmann@kde.org>
Simon Hausmann committed
Mar 13, 2007 at 09:14 UTC
5aba82fd5056fa57f467f3c5fe81fe71ee0e8b99
1 file changed
+6
-2
contrib/fast-import/p4-git-sync.py
+6
-2
@@ -32,8 +32,8 @@ def p4Cmd(cmd):
32
return result;
33
34
try:
35
- opts, args = getopt.getopt(sys.argv[1:], "", [ "continue", "--git-dir=", "origin=", "reset", "master=",
36
- "submit-log-subst=" ])
35
+ opts, args = getopt.getopt(sys.argv[1:], "", [ "continue", "git-dir=", "origin=", "reset", "master=",
36
+ "submit-log-subst=", "log-substitutions=" ])
37
except getopt.GetoptError:
38
print "fixme, syntax error"
39
sys.exit(1)
@@ -63,6 +63,10 @@ for o, a in opts:
63
key = a.split("%")[0]
64
value = a.split("%")[1]
65
logSubstitutions[key] = value
66
+ elif o == "--log-substitutions":
67
+ for line in open(a, "r").readlines():
68
+ tokens = line[:-1].split("=")
69
+ logSubstitutions[tokens[0]] = tokens[1]
70
71
if len(gitdir) == 0:
72
gitdir = ".git"