P4tar

From PDWiki

Jump to: navigation, search


About

p4tar and p4untar are two scripts that can pack up a changelist and then unpack it on another machine (or the same one). Uses for "tarring" a changelist include:

  • Temporarily "shelving" work in progress so that you can retest against clean depot copies of your files.
  • Moving work in progress from one client machine to another.
  • Sending work in progress to another user for review without first submitting it to the depot.

See also P4 Shelve, which has similar applications but submits the changelist to the depot (in a new branch) rather than creating a client-side tarfile.

Usage

p4tar [-c #] [-q] [-z] archive_name

-c = changelist #
-q = quiet, don't print summary
-z = compress
-i = convert integrates and branches to edits (UNSAFE)


p4untar [-debug] [-revert] [-z] archive_name

-revert = completely revert all changes in this archive (this will DELETE added files)
-c # = changelist
-ld = convert to dos style line-ends
-lu = convert to unix style line-ends
-ln = do not do any line-end conversions
-e = do not extract files, just do edits and adds
-z = uncompress
-d = do not extract files with identical contents
-diff = diff files in archive against client, extract nothing
-unpack = just extract all files into p4tar_unpack/
-q = quiet - emit no output
-nopipe = disable the use of perl's input pipe

Example

C:\test\depot\sam>p4 diff
==== //depot/sam/bar#2 - c:\test\depot\sam\bar ====
3a4
> This is an edit I'm tarring up.

C:\test\depot\sam>perl p4tar.pl -c default test_tar
edited:  1   added: 1   deleted: 0   skipped: 0

C:\test\depot\sam>p4 revert ...
//depot/sam/bar#2 - was edit, reverted
//depot/sam/foo#4 - was add, reverted 

C:\test\depot\sam>perl p4untar.pl test_tar
//depot/sam/bar#2 - file(s) up-to-date.
//depot/sam/bar#2 - opened for edit
//depot/sam/foo#5 - opened for add
edited: 1         added: 1        deleted: 0   skipped: 0

C:\test\depot\sam>p4 diff
==== //depot/sam/bar#2 - c:\test\depot\sam\bar ====
3a4
> This is an edit I'm tarring up.
Personal tools