Perforce is a great version control system which I've been using at work since 2005 (well, strictly speaking, I started using it in 2004, but that was just casual usage). On this page, I'll list some hints on Perforce, which I tend to forget on how to do. If other folks can find this scratchpad useful too, that's a bonus :-)
$ p4 describe 35297
$ p4 describe -S 35297
$ p4 integrate -n -b mybranch-2.0 -s @35297,35297
$ p4 changelists -s pending -u myuser
This is how you check all changes in the source tree (from where you stand) between the first of January 2011 and the first of February the same year:
$ p4 changes ...@2011/01/01,2011/02/01
Checkout all files you've edited locally but have forgotten to run p4
edit on first:
$ p4 diff -se ... | xargs p4 edit
I've created BASH completion for all p4 commands, you can get the completion file here.
With it in place, you can do:
$ p4 c[TAB][TAB]
change changelists client counter
changelist changes clients counters
$ p4 integrate -b plugins-comm[TAB][TAB]
plugins-common-1.1 plugins-community-3.1 plugins-community-3.4
plugins-community plugins-community-3.2 plugins-community-3.5
plugins-community-3.0 plugins-community-3.3 plugins-community-3.6
The branch list is cached, in case you were wondering :-) See ~/.p4.d.
$ p4 changes -u s[TAB][TAB]
saa shah shud soku stbe sym sai shaon sms sta support
The user list is cached, in case you were wondering :-) See ~/.p4.d.
$ p4 integrate -[TAB][TAB]
-b -d -Ds -f -i -n -r -t
-c -Di -Dt -h -I -o -s -v
$ p4 print //depot/[TAB][TAB]
//depot/BETA //depot/core //depot/projects //depot/tools
//depot/branches //depot/escenic //depot/ps
//depot/BUILD //depot/main //depot/RELEASE
# apt-get install colordiff
Then add the following to your .bashrc:
export P4DIFF=colordiff
Once you've evaluated your .p4config or .bashrc, you'll get your
diffs in wonderful colours.