Burgerlib Python
|
Package that contains functions to help perforce. More...
Functions | |
def | where_is_p4 (verbose=False, refresh=False, path=None) |
Return the location of the p4 executable. More... | |
def | is_under_p4_control (working_directory) |
Test if the directory is under Perforce source control. More... | |
def | perforce_command (files, command, verbose=False) |
Given a list of files, send a command to execute on them in perforce. More... | |
def | perforce_edit (files, verbose=False) |
Given a list of files, checkout (Edit) them in perforce. More... | |
def | perforce_add (files, verbose=False) |
Given a list of files, add them in perforce. More... | |
def | perforce_opened (files=None, verbose=False) |
Get the list of opened files in Perforce. More... | |
def | make_version_header (working_dir, outputfilename, verbose=False) |
Create a C header with the perforce version. More... | |
Variables | |
_PERFORCE_PATH | |
Cached location of p4 from Perforce. | |
Package that contains functions to help perforce.
def burger.perforce.is_under_p4_control | ( | working_directory | ) |
Test if the directory is under Perforce source control.
First test if p4 is installed by calling where_is_p4(). Then use the p4 tool to query if the working directory is under Perforce source control.
working_directory | Directory to test. |
def burger.perforce.make_version_header | ( | working_dir, | |
outputfilename, | |||
verbose = False |
|||
) |
Create a C header with the perforce version.
This function assumes version control is with perforce!
Get the last change list and create a header with this information (Only modify the output file if the contents have changed)
C++ defines are declared for P4_CHANGELIST, P4_CHANGEDATE, P4_CHANGETIME, P4_CLIENT P4_USER
working_dir | string with the path of the folder to obtain the perforce version for |
outputfilename | string with the path of the generated header |
verbose | Print perforce commands and other informational messages |
def burger.perforce.perforce_add | ( | files, | |
verbose = False |
|||
) |
Given a list of files, add them in perforce.
Pass either a single string or a string list of pathnames of files to checkout in perforce using the "p4 add" command
files | list or string object of file(s) to add |
verbose | If True, print the command line and warnings |
def burger.perforce.perforce_command | ( | files, | |
command, | |||
verbose = False |
|||
) |
Given a list of files, send a command to execute on them in perforce.
Pass either a single string or a string list of pathnames of files to checkout in perforce using the "p4" command with the command name
files | list or string object of file(s) to checkout |
command | string to pass to p4 such as "edit" or "add" |
verbose | If True, print the command line and warnings |
def burger.perforce.perforce_edit | ( | files, | |
verbose = False |
|||
) |
Given a list of files, checkout (Edit) them in perforce.
Pass either a single string or a string list of pathnames of files to checkout in perforce using the "p4 edit" command
files | list or string object of file(s) to checkout |
verbose | If True, print the command line and warnings |
def burger.perforce.perforce_opened | ( | files = None , |
|
verbose = False |
|||
) |
Get the list of opened files in Perforce.
Check perforce if any files are opened and if so, return the list of files in Perforce format that are currently opened.
files | List of files or directories to check, None for all. |
verbose | If True, print the command line and warnings. |
def burger.perforce.where_is_p4 | ( | verbose = False , |
|
refresh = False , |
|||
path = None |
|||
) |
Return the location of the p4 executable.
Look for an environment variable PERFORCE and determine if the executable resides there, if so, return the string to the path.
PATH is then searched for p4, and if it's not found, None is returned.
verbose | If True, print a message if Perforce was not found |
refresh | If True, reset the cache and force a reload. |
path | Path to Perforce to place in the cache |