PrintZip.py #2

  • //
  • guest/
  • lester_cheung/
  • p4util/
  • script/
  • PrintZip.py
  • Commits
# Change User Description Committed
#2 8773 Lester Cheung "p4util" as an importable Python package.
#1 8534 Lester Cheung Great artists steal - so I'm stealing Sven's Python library
to make it better!
//guest/sven_erik_knop/P4Pythonlib/scripts/PrintZip.py
#3 7836 Sven Erik Knop Added option -m (--manifest) to add a manifest file that lists files and revisions in the zip file.
#2 7809 Sven Erik Knop Updated the supportability notice and added my email address.
Also updated the usage comments.
#1 7781 Sven Erik Knop Renamed p4zip.py to PrintZip.py.
Names starting with p4 are reserved for actual products.
//guest/sven_erik_knop/P4Pythonlib/scripts/p4zip.py
#1 7646 Sven Erik Knop Added p4zip.py, a simple script that creates zip files from depot files without the need
to load the files into the workspace first.

Using 'p4 print', p4zip will store the specified files in a zip file. The files names are mapped to local
names using the workspace view mapping. Note that you do not have to be in the workspace to do so.

Usage: p4zip.py [-c|--client client] [-p|--port port] zipfile file[revRange] ...

The workspace view map is used to transform the depot files into local files. For example, if the workspace
has the following view

  //depot/Jam/MAIN/src/... //ws/Jam/MAIN/src/...

then the following command

  p4zip.py --client ws //depot/Jam/MAIN/src/...

would transform the file '//depot/Jam/MAIN/src/compile.c' into 'Jam/MAIN/src/compile.c' in the zip file.

No local files are created but the zip file. Note that the script could consume a lot of memory if the files
to be loaded into the zip files are very large.