Class GraphReceivePackOptions
java.lang.Object
com.perforce.p4java.option.Options
com.perforce.p4java.option.server.GraphReceivePackOptions
Options required by the graph receve-pack command
Usage: receive-pack -n repo [-u user -v] -i files... [ -r refs... | -F refs... | -p packed-refs ]
- option -i refer to the .pack file it self e.g ./p4 graph receive-pack -n //graph/scm-plugin -i scm-api-plugin.git/objects/pack/pack-156db553fe00511509f8395aaeb0eed2f0871e9c.pack
- option -r refer to the SHA value of the master commit e.g ./p4 graph receive-pack -n //graph/scm-plugin -r master=5631932f5cdf6c3b829911b6fe5ab42d436d74da
- option -p refer to the packed-refs
-
Field Summary
FieldsFields inherited from class com.perforce.p4java.option.Options
immutable, optionList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFile()getRef()The SHA reference to the master commitgetRepo()getUser()booleanprocessOptions(IServer server) Turn this (specific) options object into a list of strings to be sent to the Perforce server as options for a specific command.voidSets the path to the pack filevoidsetForcePackedRef(String forcePackedRef) Sets the SHA for -p optionvoidsetForceRef(String forceRef) Sets the SHA for -F optionvoidsetPackedRef(String packedRef) Sets the SHA representing the master packvoidvoidSets the repository that must exist or will be created by the receive-pack commandvoidThe user who owns the pack filevoidsetVerbose(boolean verbose) Sets the verbosity, option -v, of the commandMethods inherited from class com.perforce.p4java.option.Options
getOptions, isImmutable, processFields, setImmutable, setOptions
-
Field Details
-
GRAPH_RECEIVE_PACK_COMMAND_PART
- See Also:
-
OPTIONS_SPECS
- See Also:
-
-
Constructor Details
-
GraphReceivePackOptions
public GraphReceivePackOptions(String repo, String user, String file, String ref, String forceRef, String packedRef, String forcePackedRef, boolean verbose) Constructs receive pack option with the given arguments- Parameters:
repo- Graph repo (-n repo)user- Owner (-u user)file- Pack file (-i file)ref- SHA reference (-r refs...)forceRef- Import at reference (-F refs...)packedRef- Packed Reference (-p packed-refs)forcePackedRef- Force option (-P)verbose- Verbose output (-v)- Since:
- 2017.1
-
GraphReceivePackOptions
public GraphReceivePackOptions()Default constructor
-
-
Method Details
-
processOptions
Description copied from class:OptionsTurn this (specific) options object into a list of strings to be sent to the Perforce server as options for a specific command. As a side effect, set the option list associated with this Option to the result.The method is used by the server object to generate the string-based arguments expected by the Perforce server corresponding to the state of this method-specific options object. Will return an empty list if there are no "interesting" options set or available. May simply return the superclass options string list if is non-null, but that behaviour is neither guaranteed nor required.
Note that this method is not intended to be called directly by users but by the underlying P4Java plumbing; odd results may occur if this method is called in other contexts.
- Specified by:
processOptionsin classOptions- Parameters:
server- possibly-null IServer representing the Perforce server the options are to be used against. If this parameter is null, it is acceptable to throw an OptionsException, but it is also possible to ignore it and do the best you can with what you've got...- Returns:
- non-null (but possibly empty) string list representing the normalized Perforce server arguments corresponding to the state of this specific options object.
- Throws:
OptionsException- if an error occurs in options processing that is not some species of ConnectionException, RequestException, AccessException, etc.
-
setRepo
Sets the repository that must exist or will be created by the receive-pack command- Parameters:
repo- - the repo containing the extracted pack content
-
getRepo
- Returns:
- the repo containing the extracted pack content
-
setUser
The user who owns the pack file- Parameters:
user- - the user who owns the pack file
-
getUser
- Returns:
- the user who owns the pack file
-
setFile
Sets the path to the pack file- Parameters:
file- - The path to the pack file itself
-
getFile
- Returns:
- - The path to the pack file itself
-
getRef
The SHA reference to the master commit- Returns:
- Sets the -r option value
-
setRef
- Parameters:
ref- - Sets the -r option value
-
setVerbose
public void setVerbose(boolean verbose) Sets the verbosity, option -v, of the command- Parameters:
verbose- - true or false
-
isVerbose
public boolean isVerbose()- Returns:
- verbosity is set to true or false
-
getPackedRef
- Returns:
- Returns the SHA reference to the commit to receive
-
setPackedRef
Sets the SHA representing the master pack- Parameters:
packedRef- - the SHA reference to the commit to receive
-
getForceRef
- Returns:
- the SHA set for the -F option
-
setForceRef
Sets the SHA for -F option- Parameters:
forceRef- - the SHA set for the -F option
-
getForcePackedRef
- Returns:
- the SHA for -p option
-
setForcePackedRef
Sets the SHA for -p option- Parameters:
forcePackedRef- - the SHA for -p option
-