Perforce声明文件与其他文件不同 [英] Perforce claims file is different when it's not

查看:109
本文介绍了Perforce声明文件与其他文件不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个文件,似乎已进入怪异状态. Perforce声称它已被修改且未打开:

I have this file that seems to have gotten into a weird state. Perforce claims it's modified and unopened:

> p4 diff -se
data.xml

通常,当文件被修改并未打开时,我可以使用sync -f对其进行修复.但是,由于某种原因,这个特定文件确实很固执:

Normally, when a file is modified and unopened, I can use sync -f to fix it. But, for some reason, this particular file is being really stubborn:

> p4 sync -f data.xml
//Depot/Stream/data.xml#19 - refreshing data.xml

> p4 diff -se
data.xml

sync -f类似,clean似乎可以工作,但仍声称已对其进行了修改:

Like with sync -f, clean appears to work, but it still claims it's modified:

> p4 clean data.xml
//Depot/Stream/data.xml#19 - refreshing data.xml

> p4 diff -se
data.xml

毫不奇怪,当我尝试reconcile -w时,会发生相同的事情:

Unsurprisingly, the same thing happens when I try to reconcile -w:

> p4 reconcile -w data.xml
//Depot/Stream/data.xml#19 - refreshing data.xml

> p4 diff -se
data.xml

如果我使用reconcile(不使用-w),则会打开该文件,但是P4Merge即使不忽略空格或行尾也将文件显示为相同:

If I use reconcile (without -w), the file is opened, but P4Merge shows the files as identical even without ignoring whitespace or line endings:

> p4 reconcile data.xml
//Depot/Stream/data.xml#19 - opened for edit

> p4 diff -se

> p4 diff -sa
data.xml

使用revert只是将其恢复为之前的状态:

Using revert just puts it back into the state it was in before:

> p4 revert data.xml
//Depot/Stream/data.xml#19 - was edit, reverted

> p4 diff -sa

> p4 diff -se
data.xml

有什么作用?我以前已经复制了该文件,但没有偶然打开它进行编辑.是否使它进入了不可逆的状态,也许与Windows权限有关?

What gives? I had previously copied over this file without opening it for edit first by accident. Did that put it into an irreversible state, perhaps regarding Windows permissions?

我尝试删除文件(del data.xml)并再次获取,但是Perforce创建的新副本也存在相同的问题.

I tried deleting the file (del data.xml) and getting it again, but the new copy created by Perforce had the same problem.

推荐答案

我想到了两种可能性:

  1. 服务器的文件校验和与内容不匹配(这意味着diff将始终显示为不同).您的管理员可以使用p4 verify命令对此进行检查.
  2. 文件中的行尾不一致,并且您具有share LineEnd选项,该选项实质上是每当从本地磁盘读取文件时对每个文件进行隐式的dos2unix行尾转换.如果dos2unix是no-op,则文件将显示为相同;如果文件中有\r,则将其删除显示为diff.
  1. The server's checksum of the file doesn't match its contents (which means a diff will always show it as different). Your admin can check this with the p4 verify command.
  2. The line endings in the file are inconsistent and you have the share LineEnd option, which essentially does an implicit dos2unix line ending conversion on every file whenever it's read from local disk. If the dos2unix is a no-op the file will show as identical; if there are \rs in the file then their removal will show as a diff.

在任何一种情况下,提交都可能会通过创建一个带有校验和的修订版本来修复"该文件,该修订与您的工作空间中的内容相匹配-但我建议进行管理员检查p4 verify,因为如果文件变质了可能是更大问题(磁盘故障等)的症状.

In either case submitting is likely to "fix" the file by creating a revision with a checksum that matches whatever is in your workspace -- but I'd recommend having an admin check p4 verify since if a file has gone bad it's likely to be a symptom of a larger problem (disk failure, etc).

这篇关于Perforce声明文件与其他文件不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆