我想编写一个脚本来处理已编辑的文件。 p4 opened
提供了一个很好的列表,但它使用的是depot语法。有没有办法以本地语法获取输出,以便我可以将结果传递给我的脚本?
我在Linux上运行Perforce。
答案 0 :(得分:3)
p4 where
会告诉您本地仓库文件的位置。
您需要获取p4 opened
的输出并使用p4 where
将每个软件仓库路径转换为本地路径。
This answer可能会提供一些提示。
编辑:同时查看p4 -ztag opened
是否符合您的需求。 -ztag
经常会产生更详细,但脚本友好的输出。
答案 1 :(得分:0)
如果您只想要文件的客户端语法,可以使用 ' p4 -Ztag打开'命令,例如以下任一示例:
$ p4 -Ztag opened | grep clientFile
... clientFile //admin14streams/depot/www/dev/Jam.html
... clientFile //admin14streams/depot/www/dev/Jambase.html
... clientFile //admin14streams/depot/www/dev/Jamfile.html
... clientFile //admin14streams/depot/www/dev/Jamlang.html
... clientFile //admin14streams/depot/www/dev/images/jamgraph-jam.gif
... clientFile //admin14streams/depot/www/dev/index.html
$ p4 -Ztag opened | grep clientFile | cut -d ' ' -f3
//admin14streams/depot/www/dev/Jam.html
//admin14streams/depot/www/dev/Jambase.html
//admin14streams/depot/www/dev/Jamfile.html
//admin14streams/depot/www/dev/Jamlang.html
//admin14streams/depot/www/dev/images/jamgraph-jam.gif
//admin14streams/depot/www/dev/index.html
' p4'命令将为您提供本地文件系统 但是,如果这就是你想要的位置。
$ p4 where //depot/www/dev/Jam.html
//depot/www/dev/Jam.html //admin14streams/depot/www/dev/Jam.html /home/bruno/myspaces/admin14streams/depot/www/dev/Jam.html
$ p4 -Ztag where //depot/www/dev/Jam.html
... depotFile //depot/www/dev/Jam.html
... clientFile //admin14streams/depot/www/dev/Jam.html
... path /home/bruno/myspaces/admin14streams/depot/www/dev/Jam.html
希望这有帮助。