Slightly improved help usage output and made specifying the trailing slash for the depot path optional.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
This commit is contained in:
Simon Hausmann 2007-01-31 09:49:41 +01:00
parent da96cd9e24
commit 06bb04454f

View File

@ -20,8 +20,10 @@ import os, string, sys
if len(sys.argv) != 2: if len(sys.argv) != 2:
sys.stderr.write("usage: %s //depot/path[@revRange]\n" % sys.argv[0]); sys.stderr.write("usage: %s //depot/path[@revRange]\n" % sys.argv[0]);
sys.stderr.write("\n example:\n"); sys.stderr.write("\n example:\n");
sys.stderr.write(" %s //depot/my/project -- to import everything\n"); sys.stderr.write(" %s //depot/my/project/ -- to import everything\n");
sys.stderr.write(" %s //depot/my/project@1,6 -- to import only from revision 1 to 6\n"); sys.stderr.write(" %s //depot/my/project/@1,6 -- to import only from revision 1 to 6\n");
sys.stderr.write("\n");
sys.stderr.write(" (a ... is not needed in the path p4 specification, it's added implicitly)\n");
sys.stderr.write("\n"); sys.stderr.write("\n");
sys.exit(1) sys.exit(1)
@ -34,6 +36,9 @@ try:
except ValueError: except ValueError:
changeRange = "" changeRange = ""
if not prefix.endswith("/"):
prefix += "/"
def describe(change): def describe(change):
output = os.popen("p4 describe %s" % change).readlines() output = os.popen("p4 describe %s" % change).readlines()