Skip to content

Commit 21a5075

Browse files
Anand Kumriagitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 87b611d commit 21a5075

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

contrib/fast-import/git-p4

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ from sets import Set;
1616

1717
verbose = False
1818

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+
1930
def die(msg):
2031
if verbose:
2132
raise Exception(msg)

0 commit comments

Comments
 (0)