Perforce 解决方法以添加带有“@"的文件 [英] Perforce workaround to add files with '@'

查看:60
本文介绍了Perforce 解决方法以添加带有“@"的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据设计,Perforce 不允许使用文件名添加通配符 @#%*.它给出了这个错误:

By design, Perforce does not allow filenames with wildcards @#%* be added. It is giving this error:

Can't add filenames with wildcards [@#%*] in them.
Use -f option to force add.

但是,我有带有 @ 的 SASS 文件以支持混合.例如:

However, I have SASS files that have @ on them to support mixins. For example:

carbon-fibre-@2X.png
sprite-dashboard-@2X.png

将这些文件添加到 Perforce 的最佳解决方法是什么,对签入、签出、编译、构建和部署流程的干扰最小?

What is the best workaround to have these files added to Perforce, with most minimal disruption on checkin, checkout, compile, build, and deploy flow ?

推荐答案

您可以添加带有 Perforce 通配符的文件.如'p4帮助添加'页面文件:

You can add files with Perforce wildcard characters in them. As the 'p4 help add' page documents:

要添加文件名包含通配符的文件,指定 -f 标志.包含特殊字符的文件名'@'、'#'、'%' 或 '*' 被重新格式化以使用ASCII 十六进制表示.添加文件后,您必须使用重新格式化的文件名来引用它们,因为 Perforce无法识别本地文件系统名称.

To add files with filenames that contain wildcard characters, specify the -f flag. Filenames that contain the special characters '@', '#', '%' or '*' are reformatted to encode the characters using ASCII hexadecimal representation. After the files are added, you must refer to them using the reformatted file name, because Perforce does not recognize the local filesystem name.

从那时起使用编码的%40"统一引用文件名的要求很烦人,我同意,但它确实有效.

The requirement to uniformly refer to the filename from then on using the encoded '%40' is annoying, I agree, but it does work.

这是一个简短的例子:

$ touch 'carbon-fiber-@2X.png'
$ p4 add 'carbon-fiber-@2X.png'
The file named 'carbon-fiber-@2X.png' contains wildcards [@#%*].
Can't add filenames with wildcards [@#%*] in them.
Use -f option to force add.
$ p4 add -f 'carbon-fiber-@2X.png'
//depot/carbon-fiber-%402X.png#1 - opened for add
/path/to/carbon-fiber-@2X.png - empty, assuming text.
$ p4 submit -d added-carbon-fibre
Submitting change 2.
Locking 1 files ...
add //depot/carbon-fiber-%402X.png#1
Change 2 submitted.
$ p4 files //...
//depot/carbon-fiber-%402X.png#1 - add change 2 (text)
$ p4 fstat //depot/carbon-fiber-%402X.png
... depotFile //depot/carbon-fiber-%402X.png
... clientFile /path/to/carbon-fiber-@2X.png
... isMapped 
... headAction add
... headType text
... headTime 1466547058
... headRev 1
... headChange 2
... headModTime 1466547033
... haveRev 1

这篇关于Perforce 解决方法以添加带有“@"的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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