Skip to main content

Archive

Struct Archive 

Source
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>

Source

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.

Source

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 -p option of p4 obliterate (recommended)
  • perform the two-step sequence of p4 archive followed by p4 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,

Source

pub fn get_global_opts(&self) -> &GlobalOpts

§Description

g-opts

See Global options.

Source

pub fn set_global_opts(&mut self, v: GlobalOpts) -> &mut Self

§Description

g-opts

See Global options.

Source

pub fn global_opts(self, v: GlobalOpts) -> Self

§Description

g-opts

See Global options.

Source

pub fn get_depot(&self) -> Option<&String>

§Description

-D depot

Specify an archive depot to which files are to be archived.

Source

pub fn set_depot(&mut self, v: impl Into<String>) -> &mut Self

§Description

-D depot

Specify an archive depot to which files are to be archived.

Source

pub fn depot(self, v: impl Into<String>) -> Self

§Description

-D depot

Specify an archive depot to which files are to be archived.

Source

pub fn get_preview(&self) -> bool

§Description

-n

Do not archive revisions. Instead, report on which revisions would have been archived.

Source

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.

Source

pub fn preview(self, v: bool) -> Self

§Description

-n

Do not archive revisions. Instead, report on which revisions would have been archived.

Source

pub fn get_quiet_mode(&self) -> bool

§Description

-q

Quiet mode, which suppresses messages about skipped revisions.

Source

pub fn set_quiet_mode(&mut self, v: bool) -> &mut Self

§Description

-q

Quiet mode, which suppresses messages about skipped revisions.

Source

pub fn quiet_mode(self, v: bool) -> Self

§Description

-q

Quiet mode, which suppresses messages about skipped revisions.

Source

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)

Source

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)

Source

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>

Source

pub fn get_skip_head_revisions(&self) -> bool

§Description

-h

Do not archive head revisions.

Source

pub fn set_skip_head_revisions(&mut self, v: bool) -> &mut Self

§Description

-h

Do not archive head revisions.

Source

pub fn skip_head_revisions(self, v: bool) -> Self

§Description

-h

Do not archive head revisions.

Source

pub fn get_include_lazy_copies(&self) -> bool

§Description

-z

Includes any files that have lazy copies or are lazy copies. See Criteria with -z.

Source

pub fn set_include_lazy_copies(&mut self, v: bool) -> &mut Self

§Description

-z

Includes any files that have lazy copies or are lazy copies. See Criteria with -z.

Source

pub fn include_lazy_copies(self, v: bool) -> Self

§Description

-z

Includes any files that have lazy copies or are lazy copies. See Criteria with -z.

Trait Implementations§

Source§

impl<S: Clone> Clone for Archive<S>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: Debug> Debug for Archive<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: Default> Default for Archive<S>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

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>

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.

Source§

type Input<'a> = &'a [&'a OsStr]

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl<S: ExclusiveOption> SubCommand for Archive<S>

Source§

fn name(&self) -> &str

Source§

fn inject_local_args(&self, command: &mut Command)

Source§

fn global_opts(&self) -> Option<&GlobalOpts>

Source§

fn inject_args(&self, command: &mut Command)

Source§

fn setup_command<S: AsRef<OsStr>>(&self, bin: S) -> Command

Auto Trait Implementations§

§

impl<S> Freeze for Archive<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for Archive<S>
where S: RefUnwindSafe,

§

impl<S> Send for Archive<S>
where S: Send,

§

impl<S> Sync for Archive<S>
where S: Sync,

§

impl<S> Unpin for Archive<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for Archive<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for Archive<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ParameterizedOutput for T
where T: for<'a> ParameterizedSpawn<Output<'a> = Child, Error = Error>,

Source§

type Input<'a> = <T as ParameterizedSpawn>::Input<'a>

Source§

type Error = Error

Source§

fn output_with<'a>( &mut self, input: <T as ParameterizedOutput>::Input<'a>, ) -> Result<Output, <T as ParameterizedOutput>::Error>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.