Struct p4_cmd::P4[][src]

pub struct P4 { /* fields omitted */ }

Methods

impl P4
[src]

Overrides the p4 command used.

This is useful for "portable" installs (not in system path) and performance (caching the PATH lookup via where crate).

Overrides any P4PORT setting with the specified protocol:host:port.

Overrides any P4USER, USER, or USERNAME setting with the specified user name.

Overrides any P4PASSWD setting with the specified passwo

Overrides any P4CLIENT setting with the specified client name.

Number of times a command should be retried if the network times out (takes longer than N seconds to respond to a single I/O operation) during command execution.

Write a depot file to standard output

Retrieve the contents of a depot file to the client's standard output. The file is not synced. If file is specified using client syntax, Perforce uses the client view to determine the corresponding depot file.

By default, the head revision is printed. If the file argument includes a revision, the specified revision is printed. If the file argument has a revision range, then only files selected by that revision range are printed, and the highest revision in the range is printed. For details about revision specifiers, see 'p4 help revisions'.

Examples

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

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);
}

List files in the depot.

List details about specified files: depot file name, revision, file, type, change action and changelist number of the current head revision. If client syntax is used to specify the file argument, the client view mapping is used to determine the corresponding depot files.

By default, the head revision is listed. If the file argument specifies a revision, then all files at that revision are listed. If the file argument specifies a revision range, the highest revision in the range is used for each file. For details about specifying revisions, see 'p4 help revisions'.

Examples

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

List depot subdirectories

List directories that match the specified file pattern (dir). This command does not support the recursive wildcard (...). Use the * wildcard instead.

Perforce does not track directories individually. A path is treated as a directory if there are any undeleted files with that path as a prefix.

By default, all directories containing files are listed. If the dir argument includes a revision range, only directories containing files in the range are listed. For details about specifying file revisions, see 'p4 help revisions'.

Examples

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

Show how file names are mapped by the client view

Where shows how the specified files are mapped by the client view. For each argument, three names are produced: the name in the depot, the name on the client in Perforce syntax, and the name on the client in local syntax.

If the file parameter is omitted, the mapping for all files in the current directory and below) is returned.

Note that 'p4 where' does not determine where any real files reside. It only displays the locations that are mapped by the client view.

Examples

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

Trait Implementations

impl Clone for P4
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for P4
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for P4

impl Sync for P4