“文件内容翻译失败...” Perforce 中的错误

发布于 2024-10-19 12:28:13 字数 185 浏览 2 评论 0原文

从我的 perforce 客户端 (p4v) 提交时出现以下错误消息:

文件内容翻译失败 第 1 行附近提交中止 -- 修复 出现问题然后使用“p4 Submit -c 22”。 某些文件无法传输 来自客户。

我不知道这意味着什么或如何解决这个问题。

I have the following error message in when submitting from my perforce client (p4v):

Translation of file content failed
near line 1 Submit aborted -- fix
problems then use 'p4 submit -c 22'.
Some file(s) could not be transferred
from client.

I don't know what it means or how to solve the problem.

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

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

发布评论

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

评论(5

眉黛浅 2024-10-26 12:28:13

真正的问题是编码,使用“连接 -> 选择字符编码...”菜单项将编码设置为 UTF-8 解决了问题

The real porblem is the encoding, set the encoding to UTF-8 using the "Connection -> Choose Character Encoding..." menu item fixed the problem

天生の放荡 2024-10-26 12:28:13

Perforce 可能会对文件类型感到困惑。也许这是 Perforce 认为是文本的二进制文件?右键单击该文件并选择“更改文件类型...”项。这将打开一个对话框,允许您更改文件的类型。确保设置正确并再次提交文件。

Perforce may be confused as to the file's type. Perhaps this is a binary file that Perforce thinks is text? Right click on the file and select the "Change Filetype..." item. This will open a dialog that allows you to change the file's type. Make sure it is set correctly and submit the file again.

天邊彩虹 2024-10-26 12:28:13

FWIW,这个问题刚刚发生在我身上,我无法恢复任何文件或执行几乎任何操作。即使从工作区中删除文件然后尝试再次获取它们也会导致文件内容的翻译错误。 P4V 崩溃后,这个问题开始出现在我身上。

为了解决这个问题,我只需转到“连接”>“选择“字符编码”,然后单击对话框中的“确定”(没有将编码更改为其他任何内容 - 保持原有状态),这为我修复了它。

FWIW, this issue just occurred to me and I was unable to revert any files or perform pretty much any operation. Even removing files from workspace and then trying to get them again caused the translation of file content error. This issue started happening for me after P4V crashed.

To fix it, I just went to Connection > Choose Character Encoding and clicked OK on the dialog box (did not change the encoding to anything else - kept it what it already was) and that fixed it for me.

戒ㄋ 2024-10-26 12:28:13

当文件实际上不存在于磁盘上时,也会出现此问题。有几个场景可以发挥作用。

  1. 在文件实际存在于磁盘上之前,您打开一个文件以进行“添加”。这是可能的并且是 Perforce 所允许的。如果您在文件存在之前“p4 添加”文件,然后在实际放置本地文件之前尝试提交更改列表,则会收到此错误。
  2. 您打开一个文件进行“编辑”,然后通过某种机制在本地删除该文件,然后再提交。同样,在提交时,您会看到此错误。

老实说,我有点惊讶原始问题中指出的错误是由于文件类型不匹配造成的。我从来没有见过这样的情况。在情况 (1) 中,如果磁盘上不存在文件,则默认情况下将添加“p4 add”文件作为“text”类型。如果该文件应该是二进制文件,则表明类型不匹配,但这并不是无法从客户端传输文件的原因。事实上该文件不存在。

无论如何,这就是我的经验。我想我会分享我看到这个错误的案例。

This problem can also occur when the file doesn't actually exist on disk. A couple of scenarios can play into this.

  1. You open a file for 'add' before the file actually exists on disk. This is possible and allowed by Perforce. If you 'p4 add' a file before it exists and then try and submit the changelist before you actually put a local file in place, you will get this error.
  2. You open a file for 'edit' and then by some mechanism, delete the file locally before you submit. Again, when submitting, you will see this error.

Honestly, I'm a bit surprised that the error indicated in the original question was due to a filetype mismatch. I've never seen that be the case. In case (1), a file that is 'p4 add'ed will be added as type 'text' by default if a file doesn't exist on disk. If the file was supposed to be a binary file, that would indicate a type mismatch, but that's not the cause of failure to transfer the file from the client. It's the fact that the file doesn't exist.

Anyway, that's my experience. I figured that i would share the cases where I've seen this error.

感情旳空白 2024-10-26 12:28:13

这是您的本地工作区认为该文件与服务器愿意通过其类型映射接受的内容进行比较的不匹配。

看起来我的本地工作区 AssemblyInfo.cs 将文件转换为 UTF16(因为它包含一些 UTF16 字符)。当我将文件类型更改回文本时,我能够完美地提交。

所以你也可以。

  1. 更改文件类型以匹配您在命令提示符中使用 p4 typemap 看到的内容。 (例如:text //....cs 表示 .cs 文件应该是文本类型。)
  2. 更改类型映射以匹配本地工作区认为的内容。
  3. 如果不需要该文件,请考虑将其添加到 .p4ignore 文件中。

This is a mismatch of what your local workspace thinks the file is compared to what the server is willing to accept via its typemap.

It seems like my local workspace AssemblyInfo.cs converted a file to UTF16 (since it contained some UTF16 chars). When I changed the filetype back to text I was able to submit flawlessly.

So you can either.

  1. Change the filetype to match what you see with the p4 typemap in command prompt. (Ex: text //....cs indicates that .cs file should be of text type.)
  2. Change the typemap to match what your local workspace believes it to be.
  3. If the file is unneeded, consider adding it to your .p4ignore file.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文