Slightly improved help usage output and made specifying the trailing slash for the depot path optional.
authorSimon Hausmann <shausman@trolltech.com>
Wed, 31 Jan 2007 08:49:41 +0000 (09:49 +0100)
committerSimon Hausmann <shausman@trolltech.com>
Wed, 31 Jan 2007 08:49:41 +0000 (09:49 +0100)
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
contrib/fast-import/p4-fast-export.py
index abd6da4668f465f042b04d9bac146c6157f3a5ae..8df3d733929746672ffaaf22836e3cc80a743b2e 100644 (file)
 if len(sys.argv) != 2:
     sys.stderr.write("usage: %s //depot/path[@revRange]\n" % sys.argv[0]);
     sys.stderr.write("\n    example:\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/ -- 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("\n");
+    sys.stderr.write("    (a ... is not needed in the path p4 specification, it's added implicitly)\n");
     sys.stderr.write("\n");
     sys.exit(1)
 
@@ -34,6 +36,9 @@
 except ValueError:
     changeRange = ""
 
+if not prefix.endswith("/"):
+    prefix += "/"
+
 def describe(change):
     output = os.popen("p4 describe %s" % change).readlines()