Struct p4_cmd::sync::SyncCommand[][src]

pub struct SyncCommand<'p, 'f> { /* fields omitted */ }

Synchronize the client with its view of the depot

Sync updates the client workspace to reflect its current view (if it has changed) and the current contents of the depot (if it has changed). The client view maps client and depot file names and locations.

Sync adds files that are in the client view and have not been retrieved before. Sync deletes previously retrieved files that are no longer in the client view or have been deleted from the depot. Sync updates files that are still in the client view and have been updated in the depot.

By default, sync affects all files in the client workspace. If file arguments are given, sync limits its operation to those files. The file arguments can contain wildcards.

If the file argument includes a revision specifier, then the given revision is retrieved. Normally, the head revision is retrieved.

If the file argument includes a revision range specification, only files selected by the revision range are updated, and the highest revision in the range is used.

See 'p4 help revisions' for help specifying revisions or ranges.

Normally, sync does not overwrite workspace files that the user has manually made writable. Setting the 'clobber' option in the client specification disables this safety check.

Examples

let p4 = p4_cmd::P4::new();
let dirs = p4.sync("//depot/dir/*").run().unwrap();
for dir in dirs {
    println!("{:?}", dir);
}

Methods

impl<'p, 'f> SyncCommand<'p, 'f>
[src]

The -f flag forces resynchronization even if the client already has the file, and overwriting any writable files. This flag doesn't affect open files.

The -n flag previews the operation without updating the workspace.

The -k flag updates server metadata without syncing files. It is intended to enable you to ensure that the server correctly reflects the state of files in the workspace while avoiding a large data transfer. Caution: an erroneous update can cause the server to incorrectly reflect the state of the workspace.

The -p flag populates the client workspace, but does not update the server to reflect those updates. Any file that is already synced or opened will be bypassed with a warning message. This option is very useful for build clients or when publishing content without the need to track the state of the client workspace.

The -s flag adds a safety check before sending content to the client workspace. This check uses MD5 digests to compare the content on the clients workspace against content that was last synced. If the file has been modified outside of Perforce's control then an error message is displayed and the file is not overwritten. This check adds some extra processing which will affect the performance of the operation. Clients with 'allwrite' and 'noclobber' set do this check by default.

The -m flag limits sync to the first 'max' number of files. This option is useful in conjunction with tagged output and the '-n' flag, to preview how many files will be synced without transferring all the file data.

The --parallel flag specifies options for parallel file transfer. If your administrator has enabled parallel file transfer by setting the net.parallel.max configurable, and if there are sufficient resources across the system, a sync command may execute more rapidly by transferring multiple files in parallel. Specify threads=N to request files be sent concurrently, using N independent network connections. The N threads grab work in batches; specify batch=N to control the number of files in a batch, or batchsize=N to control the number of bytes in a batch. A sync that is too small will not initiate parallel file transfers; specify min=N to control the minimum number of files in a parallel sync, or minsize=N to control the minimum number of bytes in a parallel sync. Requesting progress indicators causes the --parallel flag to be ignored.

Auto parallel sync may be enabled by setting the net.parallel.threads configurable to the desired number of threads to be used by all sync commands. This value must be less than or equal to the value of net.parallel.max. Other net.parallel.* configurables may be specified as well, but are not required. See 'p4 help configurables' to see the options and their defaults. Auto parallel sync is turned off by unsetting the net.parallel.threads configurable. A user may override the configured auto parallel sync options on the command line, or may disable it via 'p4 sync --parallel=0'.

Run the sync command.

Trait Implementations

impl<'p, 'f> Debug for SyncCommand<'p, 'f>
[src]

Formats the value using the given formatter. Read more

impl<'p, 'f> Clone for SyncCommand<'p, 'f>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<'p, 'f> Send for SyncCommand<'p, 'f>

impl<'p, 'f> Sync for SyncCommand<'p, 'f>