Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>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:</p> <pre><code>#!/bin/sh RESULT=`/opt/local/bin/p4 edit ${1#file://localhost} 2&gt;&amp;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&gt;&amp;1` SHRESULT=$? done exit $SHRESULT </code></pre> <p>In order to invoke p4 edit when the editor needs to start making a change.</p> <p>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.</p> <p>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.</p> <p>Obviously, that only solves the problem of unlocking/editing files, but I find that I like to use p4v to submit anyway.</p> <p><strong>Multiple clients/workspaces</strong></p> <p>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. </p> <p>For us, we found the easiest fix to be using <code>P4CONFIG</code> to denote a specific perforce configuration file. In our case, we generally use <code>.p4config-&lt;user/host&gt;</code>, this way I can have <code>.p4config-laptop-gaige</code> and choose to either check it in if need be without interfering with the <code>.p4config-desktop-gaige</code>. Inside of the <code>.p4config</code> file, we set <code>P4CLIENT</code>, and that makes sure that the <code>p4</code> command knows which stream to use.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload