hgeditor
changeset 11266 2b440bb8a66b
parent 11190 43337076ba92
child 26781 1aee2ab0f902
equal deleted inserted replaced
11265:ffd85ab578be 11266:2b440bb8a66b
    25 
    25 
    26 # Remove temporary files even if we get interrupted
    26 # Remove temporary files even if we get interrupted
    27 trap "cleanup_exit" 0 # normal exit
    27 trap "cleanup_exit" 0 # normal exit
    28 trap "exit 255" HUP INT QUIT ABRT TERM
    28 trap "exit 255" HUP INT QUIT ABRT TERM
    29 
    29 
    30 HGTMP="${TMPDIR-/tmp}/hgeditor.$RANDOM.$RANDOM.$RANDOM.$$"
    30 HGTMP=$(mktemp -d ${TMPDIR-/tmp}/hgeditor.XXXXXX)
    31 (umask 077 && mkdir "$HGTMP") || {
    31 [ x$HGTMP != x -a -d $HGTMP ] || {
    32     echo "Could not create temporary directory! Exiting." 1>&2
    32   echo "Could not create temporary directory! Exiting." 1>&2
    33     exit 1
    33   exit 1
    34 }
    34 }
    35 
    35 
    36 (
    36 (
    37     grep '^HG: changed' "$1" | cut -b 13- | while read changed; do
    37     grep '^HG: changed' "$1" | cut -b 13- | while read changed; do
    38         "$HG" diff "$changed" >> "$HGTMP/diff"
    38         "$HG" diff "$changed" >> "$HGTMP/diff"