Thursday, March 15, 2012

Unified DIFF from perforce changelist spec

Because this snippet is very useful when dealing with Perforce, I thought I'd share it real quick.

Ever wondered how to obtains a DIFF of a specific changelist spec? Try this.

($1 is the P4CLIENT name and $2 is the changeset spec)
P4CLIENT=$1 p4 opened -c $2 | sed -e 's/#.*$//' | P4CLIENT=$1 p4 -x - diff