强制 Perforce 接受工作区视图有效

发布于 2024-10-30 20:49:51 字数 609 浏览 1 评论 0原文

我已签出许多文件,并准备提交更改。

我意识到我的客户端规范对我的备用根进行了硬编码,因此我从客户端规范中的所有行中删除了备用根,并在备用根框中指定了它。

我还有一些未签出的文件,我还没有准备好添加到更改列表中,因此我重命名了下面的目录结构,然后同步了我需要的所有分支,然后将目录重命名为 AltBranch 并将旧的重命名回来。

然而,现在所有签出的文件都被列为“未映射到工作区视图” - 但它们仍然存在。

我想强制 perforce 同意我的版本,所以我尝试了 p4sync -k,但是我收到错误,

//.../X.cpp#10 - is opened for edit and can't be deleted

然后我尝试了 p4sync -k -f,但我 而言,我真的很喜欢 Perforce,但是它坚持始终了解最好的信息,这令人沮丧

//.../X.cpp#10 - refreshing C:\Work\...\X.cpp
//.../X.cpp#10 - is opened for edit and can't be deleted

总体

I have a number of files checked out with changes ready to submit.

I realised that my client spec was hardcoding my alternate root, so I removed the alternate root from all lines in the client spec, and specified it in the alternate root box instead.

I also had some files not checked out that I wasn't ready to add to changelists so I renamed the directory structure underneath and then synced all branches I needed and then renamed the directory to AltBranch and renamed the old one back.

Now however all the checked out files are listed as "not mapped to workspace view" - they are still there however.

I wanted to force perforce to agree with my version, so I tried p4 sync -k, however I get the error

//.../X.cpp#10 - is opened for edit and can't be deleted

I then tried p4 sync -k -f, but I get the error

//.../X.cpp#10 - refreshing C:\Work\...\X.cpp
//.../X.cpp#10 - is opened for edit and can't be deleted

On the whole I really like Perforce, however its insistence in always knowing best is frustrating

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

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

发布评论

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

评论(4

污味仙女 2024-11-06 20:49:51

当您没有签出文件时,重新安排客户端映射要容易得多。你们有规格仓库吗?如果是这样,您可以通过从规范库恢复客户端定义来轻松恢复到以前的版本。然后,提交或搁置您的文件,以便您可以达到工作区中没有打开的文件的程度。然后,您可以重新排列客户端映射并尝试不同的布局,Perforce 会很高兴地对磁盘上的文件重新排序,而不会遇到打开文件的问题。

It's far easier to re-arrange your client mapping when you don't have files checked out. Do you have a spec depot? If so, you can easily get back to the previous version of your client definition by recovering it from the spec depot. Then, submit or shelve your files, so that you can get to a point where you've got no opened files in your workspace. Then, you can re-arrange your client mapping and experiment with different layouts, and Perforce will happily reorder the files on your disk without running into problems with opened files.

云朵有点甜 2024-11-06 20:49:51

我已经设法生成一个批处理文件,其中包含一系列 Perforce 命令来实现我想要的效果。

此解决方案特定于 Windows/DOS - 尽管我想象其他命令 shell 可以执行此修复所需的解析:

 @ echo off
 echo Please Exit Perforce
 pause
 setlocal
 rem Retrieve depot spec format of file
 for /f "delims=# " %%d in ('p4 files %1') do set p4name=%%d
 rem Retrieve current pending changelist
 for /f "tokens=5 delims= " %%d in ('p4 opened %p4name%') do set change=%%d
 p4 revert -k %p4name%
 p4 sync -k %p4name%
 p4 edit -c %change% %1

此版本特定于文件,尽管目录版本可以用 files 替换 >dirs

同样愚蠢的是,如果刻度中的命令失败,命令提示符不会设置 ERRORLEVEL。

I have managed to produce a batch file that contains a sequence of Perforce commands to achieve what I want.

This solution is Windows/DOS specific - although I would imagine other command shells could do the parsing needed for this fix:

 @ echo off
 echo Please Exit Perforce
 pause
 setlocal
 rem Retrieve depot spec format of file
 for /f "delims=# " %%d in ('p4 files %1') do set p4name=%%d
 rem Retrieve current pending changelist
 for /f "tokens=5 delims= " %%d in ('p4 opened %p4name%') do set change=%%d
 p4 revert -k %p4name%
 p4 sync -k %p4name%
 p4 edit -c %change% %1

This version is specific to files, although a directory version would be possible substituting files for dirs

Also stupidly the Command Prompt does not set ERRORLEVEL if the command in the ticks fails.

在你怀里撒娇 2024-11-06 20:49:51

我认为您可以重新打开 p4 ,它应该会恢复正常。

I think you can do a p4 reopen <changelist> and it should be back to normal.

新人笑 2024-11-06 20:49:51

我有“未映射到工作区视图”,结果我的客户端规范/工作区中有两个映射必须重新排序。

坏:

//B/foo/... //mySpec/foo/...
//A/... //mySpec/...

好:

//A/... //mySpec/...
//B/foo/... //mySpec/foo/...

I had the "not mapped to workspace view" and it turned out I had two mappings in my client spec/workspace that had to be reordered.

bad:

//B/foo/... //mySpec/foo/...
//A/... //mySpec/...

good:

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