验证 Perforce 客户端文件副本
我有一个大型 Perforce 仓库,我相信我的客户端当前有大约 2GB 与服务器同步的文件,但是验证我的文件是否完整、同步且最新到给定更改级别的最佳方法是什么(这可能比当前客户端上的少数文件要高)?
我看到 p4 verify 命令,它是 MD5,但这些似乎来自服务器对该文件的各种修订。有没有办法将服务器上的 MD5 与客户端所需修订的 MD5 进行比较?
我基本上是在尝试最大限度地减少带宽和时间消耗以实现完整的验证。我不想将 -f 同步到特定的修订号。我只想要一个与我试图达到的更改级别不一致的所有文件的列表。然后我可以通过编程强制同步这几个文件。
I have a large Perforce depot and I believe my client currently has about 2GB of files that are in sync with the server, but what's the best way to verify my files are complete, in-sync, and up to date to a given change level (which is perhaps higher then a handful of files on the client currently)?
I see the p4 verify command, and it's MD5s, but these just seem to be from the server's various revisions for the file. Is there a way to compare the MD5 on the server with the MD5 of the revision required on my client?
I am basically trying to minimize bandwidth and time consumed to achieve a complete verification. I don't want to have to sync -f
to a specific revision number. I'd just like a list of any files that are inconsistent with the change level I am attempting to attain. Then I can programmatically force a sync of those few files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你想要“p4 diff -se”。
这应该对客户端文件进行 md5 哈希,并将其与服务器上存储的哈希进行比较。
You want "p4 diff -se".
This should do an md5 hash of the client's file and compare it to the stored hash on the server.
Perforce 的设计目的是让您随时了解所有文件的签出状态。如果您或您团队中的其他程序员正在使用 perforce 并编辑未签出的文件,那么这才是您应该解决的真正问题。
Perforce is designed to work when you keep it informed about the checked out status of all your files. If you or other programmers in your team are using perforce and editing files that are not checked out then that is the real issue you should fix.
有
p4 clean -n
(相当于p4 reconcile -w -n
),这也会为您提供 p4 将更新的文件列表。当然,您也可以传递一个更改列表来对齐。
您可能想禁用对本地文件的检查,否则会删除这些文件!
如果您没有太多传入更新,则可以考虑使用离线本地清单文件,其中包含存储库中所有文件的大小和哈希值。对其进行迭代并检查是否存在、大小和哈希,从而产生丢失或更改的文件。
在我们公司,让内联网上的 p4 服务器通过本地清单进行检查实际上并不比要求
p4 clean
快多少。不过有一点!!而且它根本不使用带宽。现在通过互联网和 VPN 更好!There is
p4 clean -n
(equivalent top4 reconcile -w -n
)which would also get you a list of files that p4 would update. Of course you could also pass a changelist to align to.
You might want to disable checking for local files that it would delete tho!
If you don't have many incoming updates one might consider an offline local manifest file with sizes and hashes of all the files in the repository. Iterating over it and checking for existence, size and hash yielding missing or changed files.
In our company, having the p4 server on the intranet checking via local manifest it's actually not much faster than asking for
p4 clean
. But a little!! And it uses no bandwidth at all. Now over internet and VPN even better!!