]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Add a single command that will be used to construct the 'p4' command
authorAnand Kumria <wildfire@progsoc.org>
Sun, 10 Aug 2008 18:26:28 +0000 (19:26 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Aug 2008 01:57:04 +0000 (18:57 -0700)
Rather than having three locations where the 'p4' command is built up,
 refactor this into the one place. This will, eventually, allow us to
 have one place where we modify the evironment or pass extra
 command-line options to the 'p4' binary.

Signed-off-by: Anand Kumria <wildfire@progsoc.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/fast-import/git-p4

index 2ed36ecd6be505d5607fccd062f5234728f46102..b4acf7689d769f6bf1b12b0089c6d58786aa74d7 100755 (executable)
@@ -16,6 +16,17 @@ from sets import Set;
 
 verbose = False
 
+
+def p4_build_cmd(cmd):
+    """Build a suitable p4 command line.
+
+    This consolidates building and returning a p4 command line into one
+    location. It means that hooking into the environment, or other configuration
+    can be done more easily.
+    """
+    real_cmd = "%s %s" % ("p4", cmd)
+    return real_cmd
+
 def die(msg):
     if verbose:
         raise Exception(msg)