简体   繁体   English

perforce p4 同步问题

[英]perforce p4 sync issue

I've created a workspace through the GUI using p4v in the following path:我在以下路径中使用p4v通过 GUI 创建了一个工作区:

/home/RND/abrodov/Perforce/abrodov_tlv-cc-32_93

I'm trying to use the p4 commands, for example i've tried:我正在尝试使用p4命令,例如我尝试过:

p4 sync -f

and i got the following error:我收到以下错误:

Client 'tlv-cc-32' unknown - use 'client' command to create it.

This is the environment variable that i'm using for P4 :这是我用于P4的环境变量:

export p4v=/opt/p4v-2014.2.973065/bin
export P4PORT=IP:PORT
export P4USER=$USER
export P4CLIENT=$HOSTNAME
alias p4v="p4v &"
export PATH=$p4v:$PATH

Since client 'tlv-cc-32' is unknown to the server, that must not be the correct name of the client you're using with P4V.由于服务器不知道客户端“tlv-cc-32”,因此它不能是您与 P4V 一起使用的客户端的正确名称。

Run

p4 clients -u $P4USER

to get a list of all your workspace names, then find the one that you're using with P4V.获取所有工作区名称的列表,然后找到与 P4V 一起使用的名称。 (Alternatively, in P4V, use the "Edit Current Connection" menu to see your "Workspace name:") (或者,在 P4V 中,使用“编辑当前连接”菜单查看您的“工作区名称:”)

Then set P4CLIENT to the correct name of your P4V workspace, and use 'p4 info' to verify that the server associates that client name with your workstation's root directory.然后将 P4CLIENT 设置为 P4V 工作区的正确名称,并使用“p4 info”来验证服务器是否将该客户端名称与工作站的根目录相关联。

Then然后

p4 sync -f

will work just fine.会工作得很好。

(Though, one wonders, why do you feel the need to run 'p4 sync -f'?) (不过,有人想知道,为什么您觉得需要运行“p4 sync -f”?)

Summary概括

Remove any extra spaces.删除任何多余的空格。

Detailed explanation.详细解释。

P4 command can throw this error because of extra spaces too.由于额外的空格,P4 命令也可能抛出此错误。 I faced a similar issue when setting p4 global options via environment variables (windows).通过环境变量(Windows)设置 p4 全局选项时,我遇到了类似的问题。

set GLOBAL_OPTIONS="-c sahil"                  REM **INCORRECT**
p4 %GLOBAL_OPTIONS% sync //file/path

sahil is my workspace name. sahil 是我的工作区名称。 p4 was interpreting the name as " sahil" (with space), and therefore was failing to find it. p4 将名称解释为“sahil”(带空格),因此未能找到它。 The following worked.以下工作。

set GLOBAL_OPTIONS="-csahil"                  REM **CORRECT**
p4 %GLOBAL_OPTIONS% sync //file/path

For the same reason among the following 2 commands, 1st one fails to work, 2nd one works fine.出于同样的原因,在以下 2 个命令中,第一个无法工作,第二个工作正常。

p4 "-c sahil" sync //file/path REM **INCORRECT**
p4  -c sahil  sync //file/path REM **CORRECT**

The space causes this subtle issue which can be hard to detect.空间导致了这个难以察觉的微妙问题。 In my case the workspace name "sahil" did exist, I was however not aware about how p4 interprets spaces.在我的情况下,工作区名称“sahil”确实存在,但是我不知道 p4 如何解释空格。

PS: Not the reason why the author of the question faced this error, but it is one of the causes for which p4 can throw this error, and which took me some time to figure out. PS:不是问题的作者面临这个错误的原因,而是 p4 可以抛出这个错误的原因之一,我花了一些时间才弄清楚。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM