本文介绍了perforce - 快速同步特定修订的多个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法快速同步特定修订的多个文件.

Is there a way to synch multiple files at specific revisions quickly.

例如指定文件和修订的列表如下:foo#1酒吧#4巴兹#3

For example specify a list of files and revisions as follows:foo#1bar#4baz#3

我可以在 shell 中的 foreach 循环中单独同步这些 - 但对于大型列表来说这会很慢.那么有没有一种快速/批量的方法来做到这一点?

I could sync these in a foreach loop in he shell individually - but this would be slow for large lists. So is there a quick/batch way of doing this?

我知道如何使用标签 - 但在这种情况下,我们必须假设这组文件和修订版不存在标签 - 我们拥有的唯一来源是如上所示的列表.

I do know about using labels - but in this case we must assume no label existed for this set of files and revisions - the only source we have is the list as shown above.

推荐答案

正如 Bryan 在他的评论中提到的,您可以使用文件作为带有 -x 全局选项标志的参数.

You can use a file as an argument with the -x global option flag, as Bryan mentioned in his comment.

EXAMPLE - sync

-- Notice the file contents of 'syncfile.txt' with three filenames, at specific revisions.

$ cat syncfile.txt
foo#1
bar#4
baz#3

-- The client workspace currently has all the head revisions.

$ p4 have //depot/test/...
//depot/test/bar#5 - /home/admin/depot/test/bar
//depot/test/baz#4 - /home/admin/depot/test/baz
//depot/test/foo#5 - /home/admin/depot/test/foo

-- Now the file is passed as an argument with the 'sync' command, and the updates display

$ p4 -x syncfile.txt sync
//depot/test/foo#1 - updating /home/admin/depot/test/foo
//depot/test/bar#4 - updating /home/admin/depot/test/bar
//depot/test/baz#3 - updating /home/admin/depot/test/baz

-- Running the 'have' command again to verify that indeed the specific revisions were synced.

$ p4 have //depot/test/...
//depot/test/bar#4 - /home/admin/depot/test/bar
//depot/test/baz#3 - /home/admin/depot/test/baz
//depot/test/foo#1 - /home/admin/depot/test/foo

EXAMPLE - ADD

-- Notice the file contents of 'addfiles.txt' with three filenames.

$ cat addfiles.txt
who
me
you

-- The file is passed as an argument with the 'add' command, and the files listed are added.

$ p4 -x addfiles.txt add
//depot/test/who#1 - opened for add
//depot/test/me#1 - opened for add
//depot/test/you#1 - opened for add

以下是如何在文档中使用-x"标志的示例:

Here are examples of how to use the '-x' flag in documentation:

http://answers.perforce.com/articles/KB_Article/The-x标志

http://answers.perforce.com/articles/KB_Article/添加目录树

http://answers.perforce.com/文章/KB_Article/Integ-Using-the-x-Global-Option

http://www.perforce.com/perforce/doc.current/manuals/cmdref/global.options.html

这篇关于perforce - 快速同步特定修订的多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 07:31