Skip to content

Commit

Permalink
Add a single command that will be used to construct the 'p4' command
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Anand Kumria authored and Junio C Hamano committed Aug 12, 2008
1 parent 87b611d commit 21a5075
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions contrib/fast-import/git-p4
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 21a5075

Please sign in to comment.