xcode4 不支持 Perforce?

发布于 2024-10-21 22:58:27 字数 114 浏览 1 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

画离情绘悲伤 2024-10-28 22:58:27

值得注意的是,首选项/行为中有一个设置可以将行为添加到特定操作。其中之一是 Unlock File,它可以绑定到 shell 脚本,如下所示:

#!/bin/sh

RESULT=`/opt/local/bin/p4 edit  ${1#file://localhost} 2>&1`
SHRESULT=$?
while [ $SHRESULT -ne 0 ] 
    do
    SCRIPT="tell application \"XCode\" to display dialog \"$RESULT\" buttons {\"Try again\",\"Cancel\"} default button 1"
    osascript -e "$SCRIPT"
    if [ $? -ne 0 ]
    then
        break
    fi
    RESULT=`/opt/local/bin/p4 edit  ${1#file://localhost} 2>&1`
    SHRESULT=$?
done  

exit $SHRESULT

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:

#!/bin/sh

RESULT=`/opt/local/bin/p4 edit  ${1#file://localhost} 2>&1`
SHRESULT=$?
while [ $SHRESULT -ne 0 ] 
    do
    SCRIPT="tell application \"XCode\" to display dialog \"$RESULT\" buttons {\"Try again\",\"Cancel\"} default button 1"
    osascript -e "$SCRIPT"
    if [ $? -ne 0 ]
    then
        break
    fi
    RESULT=`/opt/local/bin/p4 edit  ${1#file://localhost} 2>&1`
    SHRESULT=$?
done  

exit $SHRESULT

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 set P4CLIENT, and that makes sure that the p4 command knows which stream to use.

幸福%小乖 2024-10-28 22:58:27

我组合了几个 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

终陌 2024-10-28 22:58:27

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.

王权女流氓 2024-10-28 22:58:27

我在这个问题中提到的技术也适用于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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文