equal
deleted
inserted
replaced
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" |