hgeditor
changeset 666 0100a43788ca
parent 665 40fd5722c669
child 682 d6723636c172
equal deleted inserted replaced
665:40fd5722c669 666:0100a43788ca
     7 cleanup_exit() {
     7 cleanup_exit() {
     8     rm -f "$T1" "$T2"
     8     rm -f "$T1" "$T2"
     9     exit $1
     9     exit $1
    10 }
    10 }
    11 
    11 
       
    12 # If you want to pass your favourite editor some other parameters
       
    13 # only for Mercurial, modify this:
    12 case "${EDITOR:=vi}" in
    14 case "${EDITOR:=vi}" in
    13     emacs)
    15     emacs)
    14         EDITOR="$EDITOR -nw"
    16         EDITOR="$EDITOR -nw"
    15         ;;
    17         ;;
    16     gvim|vim)
    18     gvim|vim)
    42     $EDITOR "$T1" "$T2" || cleanup_exit $?
    44     $EDITOR "$T1" "$T2" || cleanup_exit $?
    43     echo "$CHECKSUM" | md5sum -c --status && cleanup_exit 13
    45     echo "$CHECKSUM" | md5sum -c --status && cleanup_exit 13
    44     {
    46     {
    45         head -n 1 "$T1"
    47         head -n 1 "$T1"
    46         echo
    48         echo
    47         grep -v "^HG:" "$T1" | gpg -t -a -u "${HGUSER:-$EMAIL}" --clearsign
    49         grep -v "^HG:" "$T1" | gpg -t -a -u "${HGUSER}" --clearsign
    48     } > "$T2" && mv "$T2" "$1"
    50     } > "$T2" && mv "$T2" "$1"
    49     cleanup_exit $?
    51     cleanup_exit $?
    50 fi
    52 fi
    51 
    53