pub struct Depot<M = Unselected> { /* private fields */ }Expand description
p4 [g-opts] depot [-t type] depotname
p4 [g-opts] depot -d [-f] depotname
p4 [g-opts] depot -o [-t type] depotname
p4 [g-opts] depot -i
Create, edit, or delete a depot specification.
A branch, depot, label, and workspace cannot share the same name.
The M type parameter tracks the command form at compile time. The
default Unselected state is the regular form with no options;
Self::delete, Self::stdout, and Self::stdin transition to the
Delete, Stdout, and Stdin modes
, while Self::depot_type transitions to the Regular mode carrying -t type.
Implementations§
Source§impl Depot<Unselected>
impl Depot<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 depot command.
bin is the path to the Perforce command-line executable.
Sourcepub fn delete(self) -> Depot<Delete>
pub fn delete(self) -> Depot<Delete>
§Description
-d depotname
Delete the depot depotname.
A classic depot must not contain any files. The P4 Server user with the super access level can permanently remove files with p4 obliterate.
A stream depot must not contain any streams. A P4 Server user with the admin access level can can use the --obliterate option of p4 stream to permanently remove a stream.
If the depot is remote, p4 obliterate must still be run: no files are deleted, but any outstanding client or label records referring to that depot are eliminated.
The name of a depot cannot be the same as the name of a branch, client workspace, or label.
Transitions this command to the Delete mode.
Source§impl Depot<Delete>
impl Depot<Delete>
Sourcepub fn get_force(&self) -> bool
pub fn get_force(&self) -> bool
§Description
-f
By default, when you delete a depot, the directory specified by the
Map field (typically under P4ROOT) must be empty. Use the -f option to remove all files even if the directory is not empty.
The P4 Server will not delete files on disk if they are referenced elsewhere (due to being branched or integrated to another depot as a lazy copy). You should not remove referenced files from disk manually using operating system commands. For more information, see Deleting depots.
Sourcepub fn set_force(&mut self, v: bool) -> &mut Self
pub fn set_force(&mut self, v: bool) -> &mut Self
§Description
-f
By default, when you delete a depot, the directory specified by the
Map field (typically under P4ROOT) must be empty. Use the -f option to remove all files even if the directory is not empty.
The P4 Server will not delete files on disk if they are referenced elsewhere (due to being branched or integrated to another depot as a lazy copy). You should not remove referenced files from disk manually using operating system commands. For more information, see Deleting depots.
Sourcepub fn force(self, v: bool) -> Self
pub fn force(self, v: bool) -> Self
§Description
-f
By default, when you delete a depot, the directory specified by the
Map field (typically under P4ROOT) must be empty. Use the -f option to remove all files even if the directory is not empty.
The P4 Server will not delete files on disk if they are referenced elsewhere (due to being branched or integrated to another depot as a lazy copy). You should not remove referenced files from disk manually using operating system commands. For more information, see Deleting depots.
Source§impl Depot<Regular>
impl Depot<Regular>
Sourcepub fn get_depot_type(&self) -> Option<DepotType>
pub fn get_depot_type(&self) -> Option<DepotType>
§Description
-t type
The type of the depot: local, remote, spec, stream, unload,
archive, or tangent. To support Git workflows, a special type is graph.
Sourcepub fn set_depot_type(&mut self, v: DepotType) -> &mut Self
pub fn set_depot_type(&mut self, v: DepotType) -> &mut Self
§Description
-t type
The type of the depot: local, remote, spec, stream, unload,
archive, or tangent. To support Git workflows, a special type is graph.
Sourcepub fn depot_type(self, v: DepotType) -> Self
pub fn depot_type(self, v: DepotType) -> Self
§Description
-t type
The type of the depot: local, remote, spec, stream, unload,
archive, or tangent. To support Git workflows, a special type is graph.
Source§impl Depot<Stdout>
impl Depot<Stdout>
Sourcepub fn get_depot_type(&self) -> Option<DepotType>
pub fn get_depot_type(&self) -> Option<DepotType>
§Description
-t type
The type of the depot: local, remote, spec, stream, unload,
archive, or tangent. To support Git workflows, a special type is graph.
Sourcepub fn set_depot_type(&mut self, v: DepotType) -> &mut Self
pub fn set_depot_type(&mut self, v: DepotType) -> &mut Self
§Description
-t type
The type of the depot: local, remote, spec, stream, unload,
archive, or tangent. To support Git workflows, a special type is graph.
Sourcepub fn depot_type(self, v: DepotType) -> Self
pub fn depot_type(self, v: DepotType) -> Self
§Description
-t type
The type of the depot: local, remote, spec, stream, unload,
archive, or tangent. To support Git workflows, a special type is graph.
Source§impl<M: ExclusiveOption> Depot<M>
impl<M: ExclusiveOption> Depot<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
Trait Implementations§
Source§impl<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Unselected>
impl<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Unselected>
Source§fn spawn_with(&mut self, (depotname): (I,)) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (depotname): (I,)) -> Result<Self::Output, Self::Error>
Spawns p4 depot depotname with the given depot name 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<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Delete>
impl<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Delete>
Source§fn spawn_with(&mut self, (depotname): (I,)) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (depotname): (I,)) -> Result<Self::Output, Self::Error>
Spawns p4 depot -d [-f] depotname with the given depot name 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<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Stdout>
impl<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Stdout>
Source§fn spawn_with(&mut self, (depotname): (I,)) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (depotname): (I,)) -> Result<Self::Output, Self::Error>
Spawns p4 depot -o [-t type] depotname with the given depot name 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<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Regular>
Available on non-crate feature lt2015_2 only.
impl<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Regular>
lt2015_2 only.Source§fn spawn_with(&mut self, (depotname): (I,)) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (depotname): (I,)) -> Result<Self::Output, Self::Error>
Spawns p4 depot [-t type] depotname with the given depot name 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<(Stdio,)> for Depot<Stdin>
impl ParameterizedSpawn<(Stdio,)> for Depot<Stdin>
Source§fn spawn_with(&mut self, (stdio): (Stdio,)) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (stdio): (Stdio,)) -> Result<Self::Output, Self::Error>
Spawns p4 depot -i with the given standard input configuration and
piped standard output and error streams; use the returned Child
handle to wait for it or interact with it.
Pass Stdio::piped() to obtain a writable child.stdin handle and
feed the depot specification into it; pass Stdio::inherit() to read
the specification from the spawning process’s own standard input.