Perforce:重命名仓库
In Perforce, is it possible to rename a depot?
I would imagine that you could integrate across different named depots, but I do not think that would carry over the full depot's history.
I have seen this Renaming Depot Directories article, but this applies only to directories under a depot (and not the depot itself).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不可以。您无法重命名仓库,因为除非仓库 B 已经存在,否则 Perforce 不会让您将文件从仓库 A 移动到仓库 B。如果您希望将仓库 A 重命名为仓库 B,请执行以下操作:
过去,在 Perforce 中将文件移动到新位置意味着您会丢失其历史记录。旧文件被删除,然后再次添加到新位置,就好像它从未受到版本控制一样。现在情况已不再如此。我不记得他们具体是什么时候这样做的(也许是在 2008.x 系列中?),但他们最终做到了,以便在移动/重命名/集成过程中维护文件历史记录。
编辑:在下面的评论中,Greg Whitfield 告诉我 Perforce 一直在跨集成维护文件历史记录。我猜它默认是关闭的,但在 P4V 的最新版本中是打开的?
No. You can't rename a depot because Perforce won't let you move files from depot A to depot B unless depot B already exists. If you wish to rename depot A to depot B, do the following:
It used to be that moving files to a new location in Perforce meant you lost their history. The old file was deleted and then added again in the new location as though it had never been under version control. That is no longer the case. I don't recall exactly when they did it (perhaps in the 2008.x series?), but they finally made it so that file history is maintained across a move/rename/integration.
Edit: In the comments below, Greg Whitfield informs me that Perforce has been maintaining file history across integrations all along. I guess it was off by default and turned on in a fairly recent version of P4V?
联系 Perforce 支持。他们可以指导和支持您完成实际重命名仓库的过程,其中涉及操作元数据。
Contact Perforce support. They can guide and support you through the process of actually renaming a depot, which involves manipulating the metadata.
披露:我为 Perforce 工作。
无论您打算做什么 - 在将数据置于危险之中之前一定要进行测试。 :)
支持的版本(在线):
http://answers.perforce.com/articles /KB_Article/Renaming-Depot-Directories
不支持的版本(离线):
获取http://swarm.public.perforce.com/files/guest/tony_smith/perforce/utils/rename_depot.pl
运行它:
perl rename_depot.pl olddepot newdepot checkpoint.NNN > checkpoint.NNN.new
从检查点恢复。
通过编辑(重命名的)仓库规范中的“地图”字段来移动存档位置和仓库地图。
通过编辑(重命名的)仓库规范中的“地图”字段来移动存档位置
不受支持的版本(在线):
May Perforce 与您同在。
Disclosure: I work for Perforce.
Whatever you plan to do - do test it before putting your data at risk. :)
Supported version (online):
http://answers.perforce.com/articles/KB_Article/Renaming-Depot-Directories
Unsupported version (offline):
Get http://swarm.public.perforce.com/files/guest/tony_smith/perforce/utils/rename_depot.pl
Run it as:
perl rename_depot.pl olddepot newdepot checkpoint.NNN > checkpoint.NNN.new
Restore from checkpoint.
Move the archive location and the depot map by editing the "Map" field in the (renamed) depot spec.
Unsupported version (online):
May Perforce be with you.