在Unix上的Perforce中,如何添加作为符号链接的目录?

问题描述:

我已经在Unix中创建了一个符号链接目录,我想将其添加到perforce.

I have created a symbolic link directory in Unix and I would like to add it to perforce.

(此问题与Unix上的符号链接有关. Windows符号链接的行为可能与Unix完全不同.)

(this question relates to symlinks on Unix. Windows symbolic links can have very different behaviour from Unix.)

  • ../blah/dir1是源目录,其中包含Perforce中已经存在的文件
  • dir2是我要检入的源目录的符号链接

ln -s ../blah/dir1 dir2

如果我在p4v GUI中右键单击"dir2",它将把../blah/dir1下的每个文件添加为新文件(即使这些文件已经在Perforce中),并且禁止所有操作.

If I right-click on "dir2" in the p4v GUI, it will add every file under ../blah/dir1 as a new file (even if these files are already in Perforce) and fubar everything.

如果我从命令行执行"p4 add dir2",它将把../blah/dir1下的每个文件添加为新文件(即使这些文件已经在Perforce中),并且禁止所有操作.

If I do a "p4 add dir2" from the command line, it will add every file under ../blah/dir1 as a new file (even if these files are already in Perforce) and fubar everything.

正确的语法是什么?

使用-t选项从shell中添加符号链接以设置符号链接类型.

Add the symbolic link from the shell using the -t option to set the symlink type.

p4 add -t symlink dir2