xcode4 不支持 Perforce?
xcode4 不支持 Perforce?
我在 xcode4 中添加了一个存储库。只能选择subversion和Git。
如何添加 perforce 存储库?
谢谢。
xcode4 doesn't support Perforce?
I add a repository in xcode4. Only subversion and Git to choose.
how to add a perforce repository?
thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
值得注意的是,首选项/行为中有一个设置可以将行为添加到特定操作。其中之一是 Unlock File,它可以绑定到 shell 脚本,如下所示:
In order to invoke p4 edit when the editor Needs to start made a change。
已更新为在 p4 编辑失败时弹出一个对话框。如果您点击“再试一次”,这将重复尝试,并在您点击“取消”时停止,如果您碰巧在第一种情况下登录过期或在第二种情况下未连接到服务器,这将特别有用。
不幸的是,似乎没有检查退出代码以确保解锁成功,并且在这种情况下 Xcode 似乎将文件更改为读/写,因此当您收到错误消息时要小心,您要么得到编辑以成功或稍后编辑该文件。
显然,这只能解决解锁/编辑文件的问题,但我发现无论如何我都喜欢使用 p4v 来提交。
多个客户端/工作区
对于那些可能在同一台计算机上使用多个客户端的人(我们现在在 Perforce 中更频繁地使用 Streams),这可能是一项挑战确保使用正确的客户端来处理您正在编辑的文件。
对于我们来说,我们发现最简单的修复方法是使用
P4CONFIG
来表示特定的 perforce 配置文件。在我们的例子中,我们通常使用.p4config-
,这样我就可以拥有.p4config-laptop-gaige
并选择将其签入 if需要不干扰.p4config-desktop-gaige
。在 .p4config 文件内部,我们设置了 P4CLIENT,这确保了 p4 命令知道要使用哪个流。It's also useful to note that there is a setting in Preferences/Behaviors to add behaviors to particular actions. One of those is Unlock File, which can be bound to a shell script, like the one here:
In order to invoke p4 edit when the editor needs to start making a change.
This has been updated to put up a dialog box if the p4 edit fails. This will repeatedly attempt it if you hit "Try Again" and will stop when you hit "Cancel", which is particularly useful if you happen to have your login expire in the first case or aren't connected to your server in the second place.
Unfortunately, it appears that the exit code isn't checked to make sure that the unlock succeeded, and it appears that Xcode changes the file to r/w in this case, so be careful when you get an error message that you either get the edit to succeed or edit the file later.
Obviously, that only solves the problem of unlocking/editing files, but I find that I like to use p4v to submit anyway.
Multiple clients/workspaces
For those of you who might be using multiple clients on the same machine (something we're doing more of now that we use Streams more often with Perforce), it can be challenging to make sure that the correct client is used to work on the file you are editing.
For us, we found the easiest fix to be using
P4CONFIG
to denote a specific perforce configuration file. In our case, we generally use.p4config-<user/host>
, this way I can have.p4config-laptop-gaige
and choose to either check it in if need be without interfering with the.p4config-desktop-gaige
. Inside of the.p4config
file, we setP4CLIENT
, and that makes sure that thep4
command knows which stream to use.我组合了几个 Automator 服务,让您可以在 Xcode 4 中当前打开的文件上绑定 p4 edit/p4 add 的热键。这并不理想,但它比切换到终端或 p4v 更好。
https://github.com/jcohen/xcode4-perforce-services
I threw together a couple of Automator services that let you bind hotkeys for p4 edit/p4 add on the currently open file in Xcode 4. It's not ideal, but it beats switching to terminal or p4v.
https://github.com/jcohen/xcode4-perforce-services
Xcode 4 正式取消了对 perforce 的支持。除非他们重新添加它,否则您将不得不解决其他问题。
Support for perforce was officially dropped from Xcode 4. Unless they add it back in, you'll have to figure something else out.
我在这个问题中提到的技术也适用于Perforce 。事实上,这是我最初使用 DTerm 的用途。
由于 Perforce 支持在 Xcode 3.0 中被严重破坏,多年来我一直使用 DTerm 来检查文件并获取其状态。
The technique I mentioned in this question works for Perforce as well. In fact, this was my original use for DTerm.
Since Perforce support was severely broken in Xcode 3.0 I have been using DTerm for checking out files and getting their status for several years.