验证 Perforce 客户端文件副本

发布于 2024-11-30 10:29:36 字数 301 浏览 3 评论 0原文

我有一个大型 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

谎言月老 2024-12-07 10:29:36

你想要“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.

一场春暖 2024-12-07 10:29:36

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.

瘫痪情歌 2024-12-07 10:29:36

p4 clean -n (相当于 p4 reconcile -w -n

,这也会为您提供 p4 将更新的文件列表。当然,您也可以传递一个更改列表来对齐。
您可能想禁用对本地文件的检查,否则会删除这些文件!

如果您没有太多传入更新,则可以考虑使用离线本地清单文件,其中包含存储库中所有文件的大小和哈希值。对其进行迭代并检查是否存在、大小和哈希,从而产生丢失或更改的文件。

在我们公司,让内联网上的 p4 服务器通过本地清单进行检查实际上并不比要求 p4 clean 快多少。不过有一点!!而且它根本不使用带宽。现在通过互联网和 VPN 更好!

There is p4 clean -n (equivalent to p4 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!!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文