summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1cd5738)
raw | patch | inline | side by side (parent: 1cd5738)
author | Simon Hausmann <hausmann@kde.org> | |
Wed, 7 Feb 2007 22:37:54 +0000 (23:37 +0100) | ||
committer | Simon Hausmann <hausmann@kde.org> | |
Wed, 7 Feb 2007 22:37:54 +0000 (23:37 +0100) |
Added support for @all as revision range specifier to import all changes to a given depot path.
Also default to an import of #head if no revrange is specified.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
Also default to an import of #head if no revrange is specified.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
contrib/fast-import/p4-fast-export.py | patch | blob | history |
index be4fd36c361e263ff4d7bddc3df0ba29a5b92e8e..16e3d8d42acd297a295c38b31753eee32f1b4a48 100755 (executable)
import marshal, popen2
branch = "refs/heads/p4"
-prefix = os.popen("git-repo-config --get p4.depotpath").read()
+prefix = previousDepotPath = os.popen("git-repo-config --get p4.depotpath").read()
if len(prefix) != 0:
prefix = prefix[:-1]
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 " %s //depot/my/project/ -- to import the current head"
+ print " %s //depot/my/project/@all -- to import everything"
print " %s //depot/my/project/@1,6 -- to import only from revision 1 to 6"
print ""
print " (a ... is not needed in the path p4 specification, it's added implicitly)"
if prefix.find("@") != -1:
atIdx = prefix.index("@")
changeRange = prefix[atIdx:]
- if changeRange.find(",") == -1:
+ if changeRange == "@all":
+ changeRange = ""
+ elif changeRange.find(",") == -1:
revision = changeRange
changeRange = ""
prefix = prefix[0:atIdx]
hashIdx = prefix.index("#")
revision = prefix[hashIdx:]
prefix = prefix[0:hashIdx]
+elif len(previousDepotPath) == 0:
+ revision = "#head"
if prefix.endswith("..."):
prefix = prefix[:-3]