@matheusbsbs / matheus-bagliano / commits / 21a5075385
Fork 0

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>

Anand Kumria committed Aug 10, 2008 at 19:26 UTC 21a50753852cb51b120ec9933416daa6cea6d184
1 file changed +11
contrib/fast-import/git-p4
+11
@@ -16,6 +16,17 @@ from sets import Set;
16
17 verbose = False
18
19 +
20 +def p4_build_cmd(cmd):
21 + """Build a suitable p4 command line.
22 +
23 + This consolidates building and returning a p4 command line into one
24 + location. It means that hooking into the environment, or other configuration
25 + can be done more easily.
26 + """
27 + real_cmd = "%s %s" % ("p4", cmd)
28 + return real_cmd
29 +
30 def die(msg):
31 if verbose:
32 raise Exception(msg)