#!/bin/sh
#

if [[ ! `type -p p4` ]]; then
    echo 'p4 not found.  Install Perforce client and add to PATH'
    exit
fi
if [[ -e /bin/cygpath ]]; then
    p4() { command p4 -d $(cygpath -w $PWD) "$@"; }  
fi

if [[ $# -lt 1 ]]; then
    find . -mtime -60 -type f | p4 -x - diff -se | p4 -x - edit
else
    p4 diff -se "$@" | p4 -x - edit
fi
