“文件内容翻译失败...” Perforce 中的错误
从我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
真正的问题是编码,使用“连接 -> 选择字符编码...”菜单项将编码设置为 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
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.
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.
当文件实际上不存在于磁盘上时,也会出现此问题。有几个场景可以发挥作用。
老实说,我有点惊讶原始问题中指出的错误是由于文件类型不匹配造成的。我从来没有见过这样的情况。在情况 (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.
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.
这是您的本地工作区认为该文件与服务器愿意通过其类型映射接受的内容进行比较的不匹配。
看起来我的本地工作区 AssemblyInfo.cs 将文件转换为 UTF16(因为它包含一些 UTF16 字符)。当我将文件类型更改回文本时,我能够完美地提交。
所以你也可以。
p4 typemap
看到的内容。 (例如:text //....cs
表示 .cs 文件应该是文本类型。)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.
p4 typemap
in command prompt. (Ex:text //....cs
indicates that .cs file should be of text type.)