Perforce:如何从不同版本中检出相同文件?
例如,我在更改列表中签出了数百个文件:
//Development/MyProject/Version1.0/Coord/File1.cs
//Development/MyProject/Version1.0/Coord/File2.cs
...
//Development/MyProject/Version1.0/Coord/Filen.cs
//Development/MyProject/Version1.0/Common/File1.cs
...
//Development/MyProject/Version1.0/Common/Filen.cs
在其他一些目录中也是如此。现在我想在 Version2.0
中签出类似的文件,
//Development/MyProject/Version2.0/Coord/File1.cs
//Development/MyProject/Version2.0/Coord/File2.cs
...
//Development/MyProject/Version2.0/Coord/Filen.cs
//Development/MyProject/Version2.0/Common/File1.cs
...
//Development/MyProject/Version2.0/Common/Filen.cs
我可以通过查看在 Version1.0
中签出哪些文件并转到 中的每个目录来完成此操作>Version2.0
并签出这些文件。这是一项乏味的工作。
有什么光明正大的方法可以做到这一点吗?
For example, I have 100s of files checked out in a changelist:
//Development/MyProject/Version1.0/Coord/File1.cs
//Development/MyProject/Version1.0/Coord/File2.cs
...
//Development/MyProject/Version1.0/Coord/Filen.cs
//Development/MyProject/Version1.0/Common/File1.cs
...
//Development/MyProject/Version1.0/Common/Filen.cs
Similarly in some more directories. Now I want to checkout similar files in Version2.0
//Development/MyProject/Version2.0/Coord/File1.cs
//Development/MyProject/Version2.0/Coord/File2.cs
...
//Development/MyProject/Version2.0/Coord/Filen.cs
//Development/MyProject/Version2.0/Common/File1.cs
...
//Development/MyProject/Version2.0/Common/Filen.cs
I can do this by looking at what files have been checked out in Version1.0
and go to each directory in Version2.0
and checkout those files. This is tedious job.
Any aboveboard way of doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 linux/Unix/macOS shell 中,我建议使用以下方法。除非您安装了 UNIX 工具,否则在 Windows 中情况会明显不同。
p4 opens ... | sed 's/\#[1-9].*$//' | sed 's/\/Version1.0\//\/Version2.0\//' |
p4 -x - edit
注意:如果您的任何文件名称中包含“#”符号,则需要进行一些调整。这是一个快速而肮脏的修复。感谢上面的 Bryan Pendleton,他基本上更简短地说了同样的事情。
From the linux/Unix/macOS shell, I suggest the following method. It would be significantly different in Windows unless you had unix tools installed there.
p4 opened ... | sed 's/\#[1-9].*$//' | sed 's/\/Version1.0\//\/Version2.0\//' |
p4 -x - edit
Note: this would need some tweaking if any of your files have '#' symbols in their names. It's a quick-and-dirty fix. And credit to Bryan Pendleton above, who basically said the same thing much more briefly.