Perforce save local copy of open file

I checked several files on the perforce client. I can get a list of these files with the command 'p4 open' It gives the path as // depot / ... like I want to know how this can be converted to a path on the local path (I mean the client path) So I can create batch file for backup only until the end of the day Thank you in advance

+3
source share
9 answers

You can use p4 wheredepot to convert local file specifications to convert files.

To analyze the output p4 wherefrom a Windows batch file, the following may help:

for /f "tokens=3" %%i in ('p4 where %my_depot_filespec%') do echo %%i

, for , , p4 where. , .

+5

, , Perforce.

, ( " " ) . Perforce, , .

, .

, .

+4

script .

for /F "tokens=1,5,6 delims=# " %%a IN ('p4 opened') do for /F "tokens=3" %%j IN ('p4 where %%a') do zip %%b%%c %%j

:

change571620.zip
change673450.zip
change723098.zip
defaultchange.zip
+4
p4 where filename

, .

, . cut .

+2

p4-, //depot . //depot , , .

, .

+1

BAT script perforce
( % 1)

p4 -c% 1 > open-% 1.txt
for/F "tokens = 1 delims = #" %% IN (open-% 1.txt) do call: add-to-zip %%

: add-to-zip
for/F "tokens = 3" %% j IN ('p4 % 1') zip [zip-file-name] %% j

+1

script .

for/F "tokens = 1,5,6 delims = #" %% a IN ('p4 open') do /F "tokens = 3" %% j IN ('p4, %% a') zip% % b %% c %% j

:
change571620.zip
change673450.zip
change723098.zip
defaultchange.zip

+1

:-) , , . , script :-)

0

FYI, as of v2012 / 2013, you would be better off using the Perforce shelving feature for your daily backup operation. Then other users in your team will be able to access these shelves. Using this for backup in this way prevents your history from being polluted with intermediate file options that you really don't need (or parts of them are not suitable for verification).

0
source

Source: https://habr.com/ru/post/1704181/


All Articles