pub struct Copy<M = Unselected> { /* private fields */ }Expand description
Type-safe builder for p4 copy.
Copy files and/or the stream spec from one location in the depot to another.
§Syntax
p4 [g-opts] copy [-c change] [-n -f -K -v -q] [-m max] fromFile[rev] toFile
p4 [g-opts] copy [-c change] [-n -f -K -v -q] [-m max] -b branch [-r] [toFile[rev] ...]
p4 [g-opts] copy [-c change] [-n -f -K -v -q] [-m max] -b branch -s fromFile[rev] [toFile ...]
p4 [g-opts] copy [-c change] [-n -f -K -v -q] [-m max] -S stream [-P parent] [-F] [-r] [toFile[rev] ...]
p4 [g-opts] copy [options] -S stream [-Af | -As] [-P parent] [-F] [-r] [toFile[rev] ...]The M type parameter tracks the command form at compile time, starting
as Unselected from Copy::new. The Unselected state is the
direct form p4 copy fromFile[rev] toFile: spawn it with the two file
arguments to copy without a branch or stream mapping. Enter a branch or
stream form with one of Self::branch or Self::stream:
Branch(entered viaSelf::branch): use a branch view;Copy::reversesupplies-rand transitions to theBranchReversestate;Copy::sourcesupplies-s fromFile[rev]and transitions to theBranchOverridestate.Stream(entered viaSelf::stream): use a stream’s generated branch view;Copy::files_onlysupplies-AfandCopy::stream_spec_onlysupplies-As, each transitioning to the corresponding state.
Implementations§
Source§impl Copy<Unselected>
impl Copy<Unselected>
Sourcepub fn new(bin: impl Into<PathBuf>, global_opts: GlobalOpts) -> Self
pub fn new(bin: impl Into<PathBuf>, global_opts: GlobalOpts) -> Self
Creates a new p4 copy command in the direct form
p4 copy fromFile[rev] toFile.
bin is the path to the Perforce command-line executable. In this
state, spawn with the fromFile[rev] and toFile arguments via
ParameterizedSpawn::spawn_with; use Self::branch or
Self::stream to enter a branch or stream form.
Sourcepub fn branch(self, v: impl Into<String>) -> Copy<Branch<Unselected>>
pub fn branch(self, v: impl Into<String>) -> Copy<Branch<Unselected>>
Enters the branch form: p4 copy -b branch [-r] [toFile[rev] ...].
Uses the named branch view to determine source and target files. Use
Copy::reverse to supply -r, or Copy::source to supply -s fromFile[rev] (which transitions to the BranchOverride form).
Sourcepub fn stream(self, v: impl Into<String>) -> Copy<Stream<Unselected>>
pub fn stream(self, v: impl Into<String>) -> Copy<Stream<Unselected>>
Enters the stream form: p4 copy -S stream [-P parent] [-F] [-r] [toFile[rev] ...].
Uses a generated branch view that maps the stream to its parent. Use Copy::files_only (-Af) or Copy::stream_spec_only (-As) to restrict what is copied.
Source§impl<M> Copy<M>
impl<M> Copy<M>
Sourcepub fn get_global_opts(&self) -> &GlobalOpts
pub fn get_global_opts(&self) -> &GlobalOpts
Sourcepub fn set_global_opts(&mut self, v: GlobalOpts) -> &mut Self
pub fn set_global_opts(&mut self, v: GlobalOpts) -> &mut Self
Sourcepub fn global_opts(self, v: GlobalOpts) -> Self
pub fn global_opts(self, v: GlobalOpts) -> Self
Sourcepub fn get_changelist(&self) -> Option<&String>
pub fn get_changelist(&self) -> Option<&String>
§Description
-c change
Open the files in the specified pending changelist rather than in the default changelist.
Sourcepub fn set_changelist(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_changelist(&mut self, v: impl Into<String>) -> &mut Self
§Description
-c change
Open the files in the specified pending changelist rather than in the default changelist.
Sourcepub fn changelist(self, v: impl Into<String>) -> Self
pub fn changelist(self, v: impl Into<String>) -> Self
§Description
-c change
Open the files in the specified pending changelist rather than in the default changelist.
Sourcepub fn get_limit(&self) -> Option<u64>
pub fn get_limit(&self) -> Option<u64>
§Description
-m max
Specify the maximum number of files to copy, to limit the size of the operation.
Sourcepub fn set_limit(&mut self, v: u64) -> &mut Self
pub fn set_limit(&mut self, v: u64) -> &mut Self
§Description
-m max
Specify the maximum number of files to copy, to limit the size of the operation.
Sourcepub fn limit(self, v: u64) -> Self
pub fn limit(self, v: u64) -> Self
§Description
-m max
Specify the maximum number of files to copy, to limit the size of the operation.
Sourcepub fn get_preview(&self) -> bool
pub fn get_preview(&self) -> bool
Sourcepub fn set_preview(&mut self, v: bool) -> &mut Self
pub fn set_preview(&mut self, v: bool) -> &mut Self
Sourcepub fn get_force(&self) -> bool
pub fn get_force(&self) -> bool
§Description
-f
Force the creation of extra revisions in order to explicitly record that files have been copied. Deleted source files are copied if they do not exist in the target, and files that are already identical are copied if they are not connected by existing integration records.
Sourcepub fn set_force(&mut self, v: bool) -> &mut Self
pub fn set_force(&mut self, v: bool) -> &mut Self
§Description
-f
Force the creation of extra revisions in order to explicitly record that files have been copied. Deleted source files are copied if they do not exist in the target, and files that are already identical are copied if they are not connected by existing integration records.
Sourcepub fn force(self, v: bool) -> Self
pub fn force(self, v: bool) -> Self
§Description
-f
Force the creation of extra revisions in order to explicitly record that files have been copied. Deleted source files are copied if they do not exist in the target, and files that are already identical are copied if they are not connected by existing integration records.
Sourcepub fn get_quiet(&self) -> bool
pub fn get_quiet(&self) -> bool
§Description
-q
Quiet mode, which suppresses normal output messages about the list of files being integrated, copied, or merged. Messages regarding errors or exceptional conditions are displayed.
Sourcepub fn set_quiet(&mut self, v: bool) -> &mut Self
pub fn set_quiet(&mut self, v: bool) -> &mut Self
§Description
-q
Quiet mode, which suppresses normal output messages about the list of files being integrated, copied, or merged. Messages regarding errors or exceptional conditions are displayed.
Sourcepub fn quiet(self, v: bool) -> Self
pub fn quiet(self, v: bool) -> Self
§Description
-q
Quiet mode, which suppresses normal output messages about the list of files being integrated, copied, or merged. Messages regarding errors or exceptional conditions are displayed.
Sourcepub fn get_virtual_integration(&self) -> bool
pub fn get_virtual_integration(&self) -> bool
§Description
-v
Performs a “virtual” integration that does not modify client workspace
files unless target files need to be resolved. After submitting a
“virtual integration”, p4 sync can be used to update the workspace.
Sourcepub fn set_virtual_integration(&mut self, v: bool) -> &mut Self
pub fn set_virtual_integration(&mut self, v: bool) -> &mut Self
§Description
-v
Performs a “virtual” integration that does not modify client workspace
files unless target files need to be resolved. After submitting a
“virtual integration”, p4 sync can be used to update the workspace.
Sourcepub fn virtual_integration(self, v: bool) -> Self
pub fn virtual_integration(self, v: bool) -> Self
§Description
-v
Performs a “virtual” integration that does not modify client workspace
files unless target files need to be resolved. After submitting a
“virtual integration”, p4 sync can be used to update the workspace.
Sourcepub fn get_suppress_keyword_expansion(&self) -> bool
pub fn get_suppress_keyword_expansion(&self) -> bool
Sourcepub fn set_suppress_keyword_expansion(&mut self, v: bool) -> &mut Self
pub fn set_suppress_keyword_expansion(&mut self, v: bool) -> &mut Self
Sourcepub fn suppress_keyword_expansion(self, v: bool) -> Self
pub fn suppress_keyword_expansion(self, v: bool) -> Self
Source§impl Copy<Branch<Unselected>>
impl Copy<Branch<Unselected>>
Sourcepub fn get_branch(&self) -> &str
pub fn get_branch(&self) -> &str
Sourcepub fn set_branch(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_branch(&mut self, v: impl Into<String>) -> &mut Self
Sourcepub fn reverse(self) -> Copy<Branch<BranchReverse>>
pub fn reverse(self) -> Copy<Branch<BranchReverse>>
§Description
-r
Reverse the mappings in the branch view, integrating from the target
files to the source files.
Requires the -b option.
Transitions this command to the BranchReverse state.
Sourcepub fn source(self, v: impl Into<String>) -> Copy<BranchOverride>
pub fn source(self, v: impl Into<String>) -> Copy<BranchOverride>
§Description
-s fromFile[rev]
Treat fromFile as the source and both sides of the branch view as the
target. To restrict the scope of the target further, specify the
optional toFile parameter.
Overrides the -r option, if specified. Requires -b.
Transitions this command to the BranchOverride state.
Source§impl Copy<Branch<BranchReverse>>
impl Copy<Branch<BranchReverse>>
Sourcepub fn get_branch(&self) -> &str
pub fn get_branch(&self) -> &str
Sourcepub fn set_branch(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_branch(&mut self, v: impl Into<String>) -> &mut Self
Source§impl Copy<BranchOverride>
impl Copy<BranchOverride>
Sourcepub fn get_branch(&self) -> &str
pub fn get_branch(&self) -> &str
Sourcepub fn set_branch(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_branch(&mut self, v: impl Into<String>) -> &mut Self
Sourcepub fn get_source(&self) -> &str
pub fn get_source(&self) -> &str
§Description
-s fromFile[rev]
Treat fromFile as the source and both sides of the branch view as the
target. To restrict the scope of the target further, specify the
optional toFile parameter.
Overrides the -r option, if specified. Requires -b.
Sourcepub fn set_source(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_source(&mut self, v: impl Into<String>) -> &mut Self
§Description
-s fromFile[rev]
Treat fromFile as the source and both sides of the branch view as the
target. To restrict the scope of the target further, specify the
optional toFile parameter.
Overrides the -r option, if specified. Requires -b.
Source§impl<S> Copy<Stream<S>>
impl<S> Copy<Stream<S>>
Sourcepub fn get_stream(&self) -> &str
pub fn get_stream(&self) -> &str
§Description
-S stream
Causes p4 copy to use a generated branch view that maps the stream to its parent and copy from a stream to its parent. To reverse the copy direction, use -r with -S.
Copies the source stream spec propagatable fields into the target stream spec and opens for edit both the target stream spec and the stream files.
Sourcepub fn set_stream(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_stream(&mut self, v: impl Into<String>) -> &mut Self
§Description
-S stream
Causes p4 copy to use a generated branch view that maps the stream to its parent and copy from a stream to its parent. To reverse the copy direction, use -r with -S.
Copies the source stream spec propagatable fields into the target stream spec and opens for edit both the target stream spec and the stream files.
Sourcepub fn stream(self, v: impl Into<String>) -> Self
pub fn stream(self, v: impl Into<String>) -> Self
§Description
-S stream
Causes p4 copy to use a generated branch view that maps the stream to its parent and copy from a stream to its parent. To reverse the copy direction, use -r with -S.
Copies the source stream spec propagatable fields into the target stream spec and opens for edit both the target stream spec and the stream files.
Sourcepub fn get_parent(&self) -> Option<&String>
pub fn get_parent(&self) -> Option<&String>
§Description
-P parent
Specify a target stream other than the parent of the source stream.
Requires -S.
Sourcepub fn set_parent(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_parent(&mut self, v: impl Into<String>) -> &mut Self
§Description
-P parent
Specify a target stream other than the parent of the source stream.
Requires -S.
Sourcepub fn parent(self, v: impl Into<String>) -> Self
pub fn parent(self, v: impl Into<String>) -> Self
§Description
-P parent
Specify a target stream other than the parent of the source stream.
Requires -S.
Sourcepub fn get_reverse(&self) -> bool
pub fn get_reverse(&self) -> bool
§Description
-r
Reverse the copy direction. With -S, copies from the parent stream to
the source stream.
Sourcepub fn set_reverse(&mut self, v: bool) -> &mut Self
pub fn set_reverse(&mut self, v: bool) -> &mut Self
§Description
-r
Reverse the copy direction. With -S, copies from the parent stream to
the source stream.
Sourcepub fn reverse(self, v: bool) -> Self
pub fn reverse(self, v: bool) -> Self
§Description
-r
Reverse the copy direction. With -S, copies from the parent stream to
the source stream.
Sourcepub fn get_force_stream_flow(&self) -> bool
pub fn get_force_stream_flow(&self) -> bool
§Description
-F
Force copy operation; perform the operation when the target stream is not configured to accept a copy of the source.
Sourcepub fn set_force_stream_flow(&mut self, v: bool) -> &mut Self
pub fn set_force_stream_flow(&mut self, v: bool) -> &mut Self
§Description
-F
Force copy operation; perform the operation when the target stream is not configured to accept a copy of the source.
Sourcepub fn force_stream_flow(self, v: bool) -> Self
pub fn force_stream_flow(self, v: bool) -> Self
§Description
-F
Force copy operation; perform the operation when the target stream is not configured to accept a copy of the source.
Source§impl Copy<Stream<Unselected>>
impl Copy<Stream<Unselected>>
Sourcepub fn files_only(self) -> Copy<Stream<CopyFilesOnly>>
pub fn files_only(self) -> Copy<Stream<CopyFilesOnly>>
§Description
-Af
Copy the files only (not the stream spec).
Transitions this command to the CopyFilesOnly state.
Sourcepub fn stream_spec_only(self) -> Copy<Stream<CopyStreamSpecOnly>>
pub fn stream_spec_only(self) -> Copy<Stream<CopyStreamSpecOnly>>
§Description
-As
Copy the stream spec only (not the files).
Transitions this command to the CopyStreamSpecOnly state.
Trait Implementations§
Source§impl<B> ParameterizedSpawn<()> for Copy<Branch<B>>where
Branch<B>: ExclusiveOption,
impl<B> ParameterizedSpawn<()> for Copy<Branch<B>>where
Branch<B>: ExclusiveOption,
Source§fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>
Spawns p4 copy -b branch [-r] without target file arguments as a
child process with piped standard output and error streams; use the
returned Child handle to wait for it or interact with it.
type Output = Child
type Error = Error
Source§impl ParameterizedSpawn<()> for Copy<BranchOverride>
impl ParameterizedSpawn<()> for Copy<BranchOverride>
Source§fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>
Spawns p4 copy -b branch -s fromFile[rev] without target file
arguments as a child process with piped standard output and error
streams; use the returned Child handle to wait for it or interact
with it.
type Output = Child
type Error = Error
Source§impl<S> ParameterizedSpawn<()> for Copy<Stream<S>>where
Stream<S>: ExclusiveOption,
impl<S> ParameterizedSpawn<()> for Copy<Stream<S>>where
Stream<S>: ExclusiveOption,
Source§fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>
Spawns p4 copy -S stream [...] without target file arguments as a
child process with piped standard output and error streams; use the
returned Child handle to wait for it or interact with it.
type Output = Child
type Error = Error
Source§impl<A, B> ParameterizedSpawn<(A, B)> for Copy<Unselected>
impl<A, B> ParameterizedSpawn<(A, B)> for Copy<Unselected>
Source§fn spawn_with(
&mut self,
(from_file, to_file): (A, B),
) -> Result<Self::Output, Self::Error>
fn spawn_with( &mut self, (from_file, to_file): (A, B), ) -> Result<Self::Output, Self::Error>
Spawns p4 copy fromFile[rev] toFile with the given source and target
file arguments as a child process with piped standard output and error
streams; use the returned Child handle to wait for it or interact
with it.
type Output = Child
type Error = Error
Source§impl<B, S, I> ParameterizedSpawn<(S,)> for Copy<Branch<B>>
impl<B, S, I> ParameterizedSpawn<(S,)> for Copy<Branch<B>>
Source§fn spawn_with(&mut self, (to_files): (S,)) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (to_files): (S,)) -> Result<Self::Output, Self::Error>
Spawns p4 copy -b branch [-r] [toFile[rev] ...] for the given target
files as a child process with piped standard output and error streams;
use the returned Child handle to wait for it or interact with it.
type Output = Child
type Error = Error
Source§impl<S, I> ParameterizedSpawn<(S,)> for Copy<BranchOverride>
impl<S, I> ParameterizedSpawn<(S,)> for Copy<BranchOverride>
Source§fn spawn_with(&mut self, (to_files): (S,)) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (to_files): (S,)) -> Result<Self::Output, Self::Error>
Spawns p4 copy -b branch -s fromFile[rev] [toFile ...] for the given
target files as a child process with piped standard output and error
streams; use the returned Child handle to wait for it or interact
with it.
type Output = Child
type Error = Error
Source§impl<S, T, I> ParameterizedSpawn<(T,)> for Copy<Stream<S>>
impl<S, T, I> ParameterizedSpawn<(T,)> for Copy<Stream<S>>
Source§fn spawn_with(&mut self, (to_files): (T,)) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (to_files): (T,)) -> Result<Self::Output, Self::Error>
Spawns p4 copy -S stream [...] [toFile[rev] ...] for the given
target files as a child process with piped standard output and error
streams; use the returned Child handle to wait for it or interact
with it.