Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Made the name of the git branch used for the perforce import configurable through a new --branch=<name> commandline option.
author
Simon Hausmann
<hausmann@kde.org>
Thu, 8 Feb 2007 14:53:11 +0000
(15:53 +0100)
committer
Simon Hausmann
<hausmann@kde.org>
Thu, 8 Feb 2007 14:53:11 +0000
(15: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:
7315866
)
diff --git
a/contrib/fast-import/p4-fast-export.py
b/contrib/fast-import/p4-fast-export.py
index 9f4b16a974d55a2fd5ee5586d079be1fc0b20042..c44292473a82fd349b69176038eafdf8c177f4f6 100755
(executable)
--- a/
contrib/fast-import/p4-fast-export.py
+++ b/
contrib/fast-import/p4-fast-export.py
@@
-10,16
+10,26
@@
# - support p4 submit (hah!)
#
import os, string, sys, time
# - support p4 submit (hah!)
#
import os, string, sys, time
-import marshal, popen2
+import marshal, popen2
, getopt
branch = "refs/heads/p4"
prefix = previousDepotPath = os.popen("git-repo-config --get p4.depotpath").read()
if len(prefix) != 0:
prefix = prefix[:-1]
branch = "refs/heads/p4"
prefix = previousDepotPath = os.popen("git-repo-config --get p4.depotpath").read()
if len(prefix) != 0:
prefix = prefix[:-1]
-if len(sys.argv) == 1 and len(prefix) != 0:
+try:
+ opts, args = getopt.getopt(sys.argv[1:], "", [ "branch=" ])
+except getopt.GetoptError:
+ print "fixme, syntax error"
+ sys.exit(1)
+
+for o, a in opts:
+ if o == "--branch":
+ branch = "refs/heads/" + a
+
+if len(args) == 0 and len(prefix) != 0:
print "[using previously specified depot path %s]" % prefix
print "[using previously specified depot path %s]" % prefix
-elif len(
sys.argv) != 2
:
+elif len(
args) != 1
:
print "usage: %s //depot/path[@revRange]" % sys.argv[0]
print "\n example:"
print " %s //depot/my/project/ -- to import the current head"
print "usage: %s //depot/path[@revRange]" % sys.argv[0]
print "\n example:"
print " %s //depot/my/project/ -- to import the current head"
@@
-30,10
+40,10
@@
print ""
sys.exit(1)
else:
print ""
sys.exit(1)
else:
- if len(prefix) != 0 and prefix !=
sys.argv[1
]:
- print "previous import used depot path %s and now %s was specified. this doesn't work!" % (prefix,
sys.argv[1
])
+ if len(prefix) != 0 and prefix !=
args[0
]:
+ print "previous import used depot path %s and now %s was specified. this doesn't work!" % (prefix,
args[0
])
sys.exit(1)
sys.exit(1)
- prefix =
sys.argv[1
]
+ prefix =
args[0
]
changeRange = ""
revision = ""
changeRange = ""
revision = ""