pub struct Archive<S = SafeArchive> { /* private fields */ }Expand description
p4 [g-opts] archive [-n -h -p -q -t -z] -D depot File Spec[revSpec]: archive obsolete revisions to an archive depot.
The S type parameter tracks the operation mode at compile time; see
SafeArchive, PhysicalPurge, and Self::purge_physical_files.
Implementations§
Source§impl Archive<SafeArchive>
impl Archive<SafeArchive>
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 archive command.
bin is the path to the Perforce command-line executable.
Sourcepub fn purge_physical_files(self) -> Archive<PhysicalPurge>
pub fn purge_physical_files(self) -> Archive<PhysicalPurge>
§Description
-p
For the specified files in the archive depot, remove the physical file
revisions but retain the revision history with the latest action being set
to purge. File contents are no longer accessible from p4 restore.
If you want to retain the metadata of purged files, do one of the following:
- use the
-poption ofp4 obliterate(recommended) - perform the two-step sequence of
p4 archivefollowed byp4 archive -p(time-consuming)
Transitions this command to the PhysicalPurge state, in which
the -h and -z options are not available; any -h/-z selection
made in the SafeArchive state is discarded.
Source§impl<M> Archive<M>where
Archive<M>: SubCommand,
impl<M> Archive<M>where
Archive<M>: SubCommand,
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_preview(&self) -> bool
pub fn get_preview(&self) -> bool
§Description
-n
Do not archive revisions. Instead, report on which revisions would have been archived.
Sourcepub fn set_preview(&mut self, v: bool) -> &mut Self
pub fn set_preview(&mut self, v: bool) -> &mut Self
§Description
-n
Do not archive revisions. Instead, report on which revisions would have been archived.
Sourcepub fn preview(self, v: bool) -> Self
pub fn preview(self, v: bool) -> Self
§Description
-n
Do not archive revisions. Instead, report on which revisions would have been archived.
Sourcepub fn get_quiet_mode(&self) -> bool
pub fn get_quiet_mode(&self) -> bool
Sourcepub fn set_quiet_mode(&mut self, v: bool) -> &mut Self
pub fn set_quiet_mode(&mut self, v: bool) -> &mut Self
Sourcepub fn quiet_mode(self, v: bool) -> Self
pub fn quiet_mode(self, v: bool) -> Self
Sourcepub fn get_archive_delta(&self) -> bool
pub fn get_archive_delta(&self) -> bool
§Description
-t
Archive text files (or other revisions stored in delta format, such as
files of type binary+D)
Sourcepub fn set_archive_delta(&mut self, v: bool) -> &mut Self
pub fn set_archive_delta(&mut self, v: bool) -> &mut Self
§Description
-t
Archive text files (or other revisions stored in delta format, such as
files of type binary+D)
Sourcepub fn archive_delta(self, v: bool) -> Self
pub fn archive_delta(self, v: bool) -> Self
§Description
-t
Archive text files (or other revisions stored in delta format, such as
files of type binary+D)
Source§impl Archive<SafeArchive>
impl Archive<SafeArchive>
Sourcepub fn get_skip_head_revisions(&self) -> bool
pub fn get_skip_head_revisions(&self) -> bool
Sourcepub fn set_skip_head_revisions(&mut self, v: bool) -> &mut Self
pub fn set_skip_head_revisions(&mut self, v: bool) -> &mut Self
Sourcepub fn skip_head_revisions(self, v: bool) -> Self
pub fn skip_head_revisions(self, v: bool) -> Self
Sourcepub fn get_include_lazy_copies(&self) -> bool
pub fn get_include_lazy_copies(&self) -> bool
Sourcepub fn set_include_lazy_copies(&mut self, v: bool) -> &mut Self
pub fn set_include_lazy_copies(&mut self, v: bool) -> &mut Self
Sourcepub fn include_lazy_copies(self, v: bool) -> Self
pub fn include_lazy_copies(self, v: bool) -> Self
Trait Implementations§
Source§impl<M> ParameterizedSpawn for Archive<M>where
Archive<M>: SubCommand,
impl<M> ParameterizedSpawn for Archive<M>where
Archive<M>: SubCommand,
Source§fn spawn_with<'a>(
&mut self,
files: Self::Input<'a>,
) -> Result<Self::Output<'a>, Self::Error>
fn spawn_with<'a>( &mut self, files: Self::Input<'a>, ) -> Result<Self::Output<'a>, Self::Error>
Spawns p4 archive for the given file specs as a child process with
piped standard output and error streams; use the returned Child
handle to wait for it or interact with it.