aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAnand Kumria <wildfire@progsoc.org>2008-08-10 19:26:28 +0100
committerJunio C Hamano <gitster@pobox.com>2008-08-11 18:57:04 -0700
commit21a50753852cb51b120ec9933416daa6cea6d184 (patch)
tree925d4ad97bc1dbc7cb26581e5b475e2cd0682792 /contrib
parent87b611d5fd518e4754e599bc2f348f83db410c56 (diff)
downloadgit-21a50753852cb51b120ec9933416daa6cea6d184.tar.gz
git-21a50753852cb51b120ec9933416daa6cea6d184.tar.xz
Add a single command that will be used to construct the 'p4' command
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>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p411
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 2ed36ecd6..b4acf7689 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -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)