Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Make incremental imports easier to use by storing the p4 depot path after an import in .git/config and re-using it when we're invoked again later.
author
Simon Hausmann
<hausmann@kde.org>
Wed, 7 Feb 2007 22:25:56 +0000
(23:25 +0100)
committer
Simon Hausmann
<hausmann@kde.org>
Wed, 7 Feb 2007 22:25:56 +0000
(23:25 +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:
e3d37cf
)
diff --git
a/contrib/fast-import/p4-fast-export.py
b/contrib/fast-import/p4-fast-export.py
index 3e573cd7863a8b3dff67d3d3ae08b71e5ffb7eb1..be4fd36c361e263ff4d7bddc3df0ba29a5b92e8e 100755
(executable)
--- a/
contrib/fast-import/p4-fast-export.py
+++ b/
contrib/fast-import/p4-fast-export.py
@@
-12,7
+12,14
@@
import os, string, sys, time
import marshal, popen2
import os, string, sys, time
import marshal, popen2
-if len(sys.argv) != 2:
+branch = "refs/heads/p4"
+prefix = 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:
+ print "[using previously specified depot path %s]" % prefix
+elif len(sys.argv) != 2:
print "usage: %s //depot/path[@revRange]" % sys.argv[0]
print "\n example:"
print " %s //depot/my/project/ -- to import everything"
print "usage: %s //depot/path[@revRange]" % sys.argv[0]
print "\n example:"
print " %s //depot/my/project/ -- to import everything"
@@
-21,9
+28,12
@@
print " (a ... is not needed in the path p4 specification, it's added implicitly)"
print ""
sys.exit(1)
print " (a ... is not needed in the path p4 specification, it's added implicitly)"
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])
+ sys.exit(1)
+ prefix = sys.argv[1]
-branch = "refs/heads/p4"
-prefix = sys.argv[1]
changeRange = ""
revision = ""
users = {}
changeRange = ""
revision = ""
users = {}
@@
-222,3
+232,6
@@
def getUserMap():
gitError.close()
print ""
gitError.close()
print ""
+
+os.popen("git-repo-config p4.depotpath %s" % prefix).read()
+