如何删除 Perforce 中的工作区(使用 p4v)?

发布于 2024-08-01 20:06:22 字数 319 浏览 2 评论 0原文

我是 Perforce 的新手,创建了一些工作区作为熟悉它的练习。 现在我想删除一些工作区。 我只是想删除工作区,以便它们不会出现在工作区视图的下拉列表中(不想想要对实际的仓库文件执行任何操作)。

谷歌搜索答案会产生“使工作区处于活动状态”的建议(我猜这意味着在工作区下拉列表中选择它?),然后从“编辑”菜单中将其删除。 不幸的是,当我尝试此操作时,删除选项呈灰色。

有人知道如何做到这一点,还是我只能忍受垃圾工作区? 我已经从磁盘中物理删除了其中一个,它仍然出现在工作区下拉列表中,而且我现在甚至无法将其与软件仓库同步,​​所以我想这不是该怎么做。

I'm new to Perforce and have created a few workspaces as exercises for getting familiar with it. Now I would like to delete some of the workspaces. I just want to get rid of the workspaces so that they do not appear on the drop-down in the workspaces view (do not want to do anything with actual depot files).

Googling up an answer yields the suggestion to "make the workspace active" (I guess that means select it in the workspace dropdown?) and then delete it from the "edit" menu. Unfortunately, the delete option is grayed-out when I try this.

Anyone know how to do this, or do I just have to live with junk workspaces? I've physically deleted one of them from the disk, and it still appears in the workspace drop down, and I can't even synchronise it with the depot now, so I guess that's not how to do it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

童话里做英雄 2024-08-08 20:06:22

从“查看”菜单中,选择“工作区”。 您将看到您创建的所有工作区。 选择要删除的工作区,点击“编辑”-> “删除工作区”,或右键单击并选择“删除工作区”。 如果工作区被“锁定”以防止更改,您将收到一条错误消息。

要解锁工作区,请单击“编辑”(或右键单击并单击“编辑工作区”)以拉出工作区编辑器,取消选中“锁定”复选框,然后保存更改。 工作区解锁后,您可以将其删除。

根据我的经验,工作区将继续显示在下拉列表中,直到您单击它,此时 p4v 会发现您已删除它并将其从列表中删除。

From the "View" menu, select "Workspaces". You'll see all of the workspaces you've created. Select the workspaces you want to delete and click "Edit" -> "Delete Workspace", or right-click and select "Delete Workspace". If the workspace is "locked" to prevent changes, you'll get an error message.

To unlock the workspace, click "Edit" (or right-click and click "Edit Workspace") to pull up the workspace editor, uncheck the "locked" checkbox, and save your changes. You can delete the workspace once it's unlocked.

In my experience, the workspace will continue to be shown in the drop-down list until you click on it, at which point p4v will figure out you've deleted it and remove it from the list.

花落人断肠 2024-08-08 20:06:22

也可以在没有可视客户端的情况下使用以下小脚本来完成。

$ cat ~/bin/pdel

#!/bin/sh

#Todo: add error handling

( p4 -c $1 client -o | perl -pne 's/\blocked\s//' | p4 -c $1  client -i ) && p4 client -d $1

It could also be done without a visual client with the following small script.

$ cat ~/bin/pdel

#!/bin/sh

#Todo: add error handling

( p4 -c $1 client -o | perl -pne 's/\blocked\s//' | p4 -c $1  client -i ) && p4 client -d $1
九厘米的零° 2024-08-08 20:06:22

在 P4V 中点击查看> 工作区

如果要删除的工作区在列表中不可见,您可能需要取消选中仅显示可供此计算机使用的工作区框,

右键单击要删除的工作区。删除并选择编辑工作区“My_workspace”

高级选项卡上取消选中锁定:只有所有者可以编辑工作区设置>复选框 然后点击确定

现在回到Perforce的工作区选项卡右键单击要删除的工作区并选择删除工作区'My_workspace'

P4V应该删除单击下拉列表中的项目。

有时,以前删除的工作空间仍保留在下拉列表中,P4V 显示以下错误:

P4V 工作区切换错误。 此工作区无法在此计算机上使用,因为主机字段与您的计算机名称不匹配,或者工作区根目录无法在此计算机上使用。


如果发生此错误时,工作区(可能在另一台主机上)可能只是被卸载。 单击 P4V 工作区回收站

P4V Recycle

在出现的已卸载工作区窗口中右键单击有问题的工作区工作区,然后选择删除工作区“My_workspace”。 P4V 现在应该从下拉列表中删除工作区项目。

In P4V click View > Workspaces

If the workspace to be deleted is not visible in the list you may have to uncheck the box Show only workspaces available for use on this computer

Right-click the workspace to be deleted and choose Edit Workspace 'My_workspace'

On the Advanced tab uncheck the box Locked: only the owner can edit workspace settings > then click OK

Now back on the Workspaces tab of Perforce right-click the workspace to be deleted and choose Delete Workspace 'My_workspace'

P4V should remove the item from the drop-down list when clicking on it.

There is a case where a previously deleted workspace remains in the drop-down list, and P4V displays the following error:

P4V Workspace Switch Error. This workspace cannot be used on this computer either because the host field does not match your computer name or the workspace root cannot be used on this computer.

If this error occurs, the workspace(possibly on another host) may have only been unloaded. Click the P4V Workspaces Recycle bin

P4V Recycle

In the resulting Unloaded Workspaces window right-click the offending workspace and choose Delete Workspace 'My_workspace'. P4V should now remove the workspace item from the drop-down list.

对你而言 2024-08-08 20:06:22
  1. Ctrl + 5

查看 p4v 中的工作空间

  1. 删除相关工作空间

在此处输入图像描述

  1. Ctrl + 5

view workspace in p4v

  1. Delete the relevant workspace

enter image description here

微暖i 2024-08-08 20:06:22

如果您已成功从工作区选项卡中删除,但它仍然显示在下拉菜单中。 然后,您也可以按照以下步骤成功删除它:

  1. 转到 C:/Users/user_name/.p4qt

user_name 将是您计算机的用户名

  1. 001Clients 文件夹中的 WorkspaceSettings.xml 文件将在那里。

将有两个标记

  1. varName = "RecentlyUsedWorkspaces" 删除已删除的工作空间标记

  2. propertyList 标记将在那里,其中 varName=deleted_workspace_name
    删除该标签。

下拉菜单中的工作区名称将被删除

If you have successfully deleted from workspace tab but still it is showing in drop down menu. Then also you can successfully remove that by following these steps:

  1. Go to C:/Users/user_name/.p4qt

user_name will be your username of your computer

  1. Inside 001Clients folder WorkspaceSettings.xml file will be there.

There will be two tag

  1. varName = "RecentlyUsedWorkspaces" remove the deleted workspace tag

  2. A propertyList tag will be there with varName=deleted_workspace_name
    delete that tag.

from drop down menu workspace name will be deleted

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