Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # A script to format BK changeset output in a manner that is easy to read. |
| 3 | # Andreas Dilger <adilger@turbolabs.com> 13/02/2002 |
| 4 | # |
| 5 | # Add diffstat output after Changelog <adilger@turbolabs.com> 21/02/2002 |
| 6 | |
| 7 | PROG=bksend |
| 8 | |
| 9 | usage() { |
| 10 | echo "usage: $PROG -r<rev>" |
| 11 | echo -e "\twhere <rev> is of the form '1.23', '1.23..', '1.23..1.27'," |
| 12 | echo -e "\tor '+' to indicate the most recent revision" |
| 13 | |
| 14 | exit 1 |
| 15 | } |
| 16 | |
| 17 | case $1 in |
| 18 | -r) REV=$2; shift ;; |
| 19 | -r*) REV=`echo $1 | sed 's/^-r//'` ;; |
| 20 | *) echo "$PROG: no revision given, you probably don't want that";; |
| 21 | esac |
| 22 | |
| 23 | [ -z "$REV" ] && usage |
| 24 | |
| 25 | echo "You can import this changeset into BK by piping this whole message to:" |
| 26 | echo "'| bk receive [path to repository]' or apply the patch as usual." |
| 27 | |
| 28 | SEP="\n===================================================================\n\n" |
| 29 | echo -e $SEP |
| 30 | env PAGER=/bin/cat bk changes -r$REV |
| 31 | echo |
| 32 | bk export -tpatch -du -h -r$REV | diffstat |
| 33 | echo; echo |
| 34 | bk export -tpatch -du -h -r$REV |
| 35 | echo -e $SEP |
| 36 | bk send -wgzip_uu -r$REV - |