当工作区已从磁盘中删除时,删除带有挂起文件的 Perforce 客户端工作区吗?

发布于 2024-10-19 18:13:23 字数 1314 浏览 1 评论 0原文

当工作区已从磁盘中删除时,如何删除具有挂起文件的工作区?

注意事项:

  • 仅限 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 技术交流群。

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

发布评论

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

评论(5

盛夏已如深秋| 2024-10-26 18:13:23

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.

花桑 2024-10-26 18:13:23

这将为您提供客户端上的待处理更改

p4 changes -c user_workspace

这将删除您选择的待处理更改列表

p4 change -d <change list number>

之后,您可以使用以下命令删除客户端

p4 client -d user_workspace 

this will give you the pending changes on the client

p4 changes -c user_workspace

this will delete the pending change list of your choice

p4 change -d <change list number>

after that, you can delete the client using

p4 client -d user_workspace 
诺曦 2024-10-26 18:13:23

命令行对我不起作用。它不断报告任何命令的“超过许可证配额”。我可能有一些与此相关的配置错误。这意味着我必须首先纠正该问题,然后使用上述解决方案。不过,我找到了另一种方法来使用 p4v 客户端解决此问题。

垃圾工作区是我以前计算机上的旧工作区。那些没有任何文件签出的我可以在工作区选项卡视图中右键单击删除。那些留出文件的工作区我无法像其他人遇到的那样删除。要删除这些,我必须采取一些额外的步骤。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~

* 或者:仅使用 p4v 客户端尝试这四个步骤 *

  1. 编辑工作区并清空旧工作区的主机字段。在另一个线程中,我读到这允许从任何计算机进行编辑。
  2. 切换到工作空间
  3. 恢复 WORKSPACE 视图中的文件;无需将文件同步到我的本地计算机
  4. 切换回工作区选项卡后删除工作区。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~

我希望这对某人有帮助。

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 *

  1. Edit the workspace and just blank out the host field of the old workspace. In another thread I read this allows editing from any computer.
  2. Switch to the workspace
  3. Revert the files in the WORKSPACE view; there was no need to sync the files to my local machine
  4. Delete the workspace after switching back to the workspaces tab.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I hope this helps someone.

嘿咻 2024-10-26 18:13:23

编写了这个名为 p4-delete-client< 的脚本/strong> 用于删除 p4 客户端(有更改列表和其他问题)。
它具有以下功能:

  • 自动删除变更列表(恢复挂起并删除搁置)
  • 修复主机名(如果与创建客户端的主机名不同)
  • 如果锁定则解锁客户端
  • 删除客户端
  • 删除关联文件(可以配置为不从参数中删除) )

请注意,该脚本依赖于 repo 中的其他脚本。

Wrote this script called p4-delete-client for deleting a p4 client (which has changelists & other problems).
It has the following features:

  • automatically deletes changelists (reverts pending & deletes shelved)
  • fixes hostname (if differs from the one the client was created on)
  • unlocks the client if locked
  • deletes the client
  • deletes associated files (can be configured not to from arguments)

Note that the script relies on other scripts in the repo.

凉城凉梦凉人心 2024-10-26 18:13:23

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

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