当工作区已从磁盘中删除时,删除带有挂起文件的 Perforce 客户端工作区吗?
当工作区已从磁盘中删除时,如何删除具有挂起文件的工作区?
注意事项:
- 仅限 p4 命令行;不是 p4v gui
- 常规用户访问;无管理员访问
权限 场景:
- 在磁盘上的
~/my_workspace
目录中创建一个名为user_workspace
的工作区 - p4 在默认挂起的更改列表上编辑工作区中的文件
- 手动删除工作区 (
rm -rf ~/my_workspace
)- 服务器上仍然存在工作区,其中有待处理的文件
不起作用的解决方案:
1:删除工作区
不起作用,因为工作区已打开文件。
p4 client -d user_workspace
客户端“user_workspace”已打开文件;使用 -f 强制删除。
2:强行删除工作区
不起作用,因为不是管理员。
p4 client -d -f user_workspace
您无权执行此操作。
3:删除待处理的变更列表;然后删除工作区(尝试1)
p4更改-c user_workspace -s挂起
仅列出挂起的编号更改列表,不处理默认的挂起更改列表。
p4 -c user_workspace -d changelist_number
不可能,因为待处理的变更列表没有变更列表编号。
4:删除待处理的变更列表;然后删除工作区(尝试 2)
尝试对不再存在的目录执行 p4 还原会出现奇怪的错误。
p4 revert ~/my_workspace
/home/user/my_workspace - 必须引用客户端“user_workspace”。
p4 -c user_workspace revert ~/my_workspace
/home/user/my_workspace - 必须引用客户端“user_workspace”。
setenv P4CLIENT user_workspace; p4 -c user_workspace revert ~/my_workspace
/home/user/my_workspace - 必须引用客户端“user_workspace”。
How do I delete a workspace that has pending files when that workspace has already been removed from disk?
Caveats:
- p4 command line only; not p4v gui
- regular user access; no admin access
Scenario:
- create a workspace named
user_workspace
on the disk in the~/my_workspace
directory - p4 edit files in workspace on the default pending changelist
- remove workspace by hand (
rm -rf ~/my_workspace
)- workspace still exists on server with pending files
Solutions that don't work:
1: Delete workspace
Doesn't work because the workspace has files opened.
p4 client -d user_workspace
Client 'user_workspace' has files opened; use -f to force delete.
2: Delete workspace with force
Doesn't work because not admin.
p4 client -d -f user_workspace
You don't have permission for this operation.
3: Delete the pending changelist; then delete workspace (try 1)
p4 changes -c user_workspace -s pending
Only lists pending numbered changelists, does not handle the default pending changelist.
p4 -c user_workspace -d changelist_number
Not possible because there is no changelist number for the pending changelist.
4: Delete the pending changelist; then delete workspace (try 2)
Trying to do a p4 revert on a directory that does not exist anymore gives a strange error.
p4 revert ~/my_workspace
/home/user/my_workspace - must refer to client 'user_workspace'.
p4 -c user_workspace revert ~/my_workspace
/home/user/my_workspace - must refer to client 'user_workspace'.
setenv P4CLIENT user_workspace; p4 -c user_workspace revert ~/my_workspace
/home/user/my_workspace - must refer to client 'user_workspace'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
1. 恢复挂起的变更列表
必须使用 Perforce depot 表示法而不是本地目录表示法,因为本地目录不再存在。
p4 -c user_workspace revert -k //...
//blah/blah/blah/file#rev - was edit, reverted
2. 删除客户端工作空间
p4 client -d user_workspace< /code>
客户端 user_workspace 已删除。
1. Revert the pending changelist
Have to use Perforce depot notation instead of local directory notation because the local directory does not exist anymore.
p4 -c user_workspace revert -k //...
//blah/blah/blah/file#rev - was edit, reverted
2. Delete the client workspace
p4 client -d user_workspace
Client user_workspace deleted.
这将为您提供客户端上的待处理更改
这将删除您选择的待处理更改列表
之后,您可以使用以下命令删除客户端
this will give you the pending changes on the client
this will delete the pending change list of your choice
after that, you can delete the client using
命令行对我不起作用。它不断报告任何命令的“超过许可证配额”。我可能有一些与此相关的配置错误。这意味着我必须首先纠正该问题,然后使用上述解决方案。不过,我找到了另一种方法来使用 p4v 客户端解决此问题。
垃圾工作区是我以前计算机上的旧工作区。那些没有任何文件签出的我可以在工作区选项卡视图中右键单击删除。那些留出文件的工作区我无法像其他人遇到的那样删除。要删除这些,我必须采取一些额外的步骤。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~
* 或者:仅使用 p4v 客户端尝试这四个步骤 *
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~
我希望这对某人有帮助。
The command line did not work for me. It kept reporting "over license quota" for any commands. I probably have something configured wrong related to that. This would mean I would have to first correct that problem and then use the above solution. However, I found another way to fix this issue using the p4v client.
The junk workspaces were old workspaces from my previous computer. Those without any files checked out I was able to right-click delete in the workspaces tab view. Those workspaces with files left checked out I was not able to remove as other are experiencing. To removes these I had to take a few extra steps.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Alternatively: Try these four step using only the p4v client *
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I hope this helps someone.
编写了这个名为 p4-delete-client< 的脚本/strong> 用于删除 p4 客户端(有更改列表和其他问题)。
它具有以下功能:
Wrote this script called p4-delete-client for deleting a p4 client (which has changelists & other problems).
It has the following features:
rm -rf 命令仅删除了系统上的文件,工作区仍然存在于 perforce 中。如果要删除它,必须先恢复文件。
p4 恢复 ~/my_workspace
p4 客户端 -d user_workspace
The rm -rf command only deleted files on your system, the workspace still exists in perforce. If you want to delete it, you have to revert the files first.
p4 revert ~/my_workspace
p4 client -d user_workspace