How does one delete a stream depot in Perforce?

让人想犯罪 __ 提交于 2019-12-11 02:03:56

问题


Basically what I want to do is delete a depot off the server. I have access to both P4Admin and the P4Helix.

Now I understand that I must first delete all workspaces then streams then delete the depot. But I am looking for a workaround to this process (personally I find it stupid, what if someone left the company and doesn't want to cooperate?), is there one?

Can I force delete a depot and its Streams without going to every single possible user that may have used this depot and ask them to delete workspaces for it?


回答1:


  • First, obliterate all the files in the depot.
  • Next, delete all the clients of all the streams in the depot.
  • Next, delete all the streams in the depot.
  • Last, delete the depot.

This sort of thing is always easier to do via the CLI than P4Admin, IMO. Here are the four command lines that do those four things:

p4 obliterate -y //yourdepot/...
p4 -F "clients -S %stream%" streams //yourdepot/... | p4 -F "client -df %domainName%" -x - run | p4 -x - run
p4 -F "stream -d %stream%" streams //yourdepot/... | p4 -x - run
p4 depot -d yourdepot

Note that you need admin/super access to run most of these commands. p4 client -df is what allows you to force the deletion of a client that you don't own.

You may also need to run the third command (the one that deletes the streams) a couple of times, since child streams need to be deleted before their parents. You could write a clever script that does a graph search and then deletes the streams in a bottom-up order, but it's a lot easier to just brute force it by running multiple passes, since each time through you'll take out at least one entire layer of the hierarchy. :)

(I agree it'd be nice it there was more of a one-shot way of doing this, but the command line at least makes it easy to plumb queries together so you don't need to hunt each thing down manually.)



来源:https://stackoverflow.com/questions/57888229/how-does-one-delete-a-stream-depot-in-perforce

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!