Additional tweaks to bin/mkpatch; removing buggy -r option.

- Legacy-Id: 17441
This commit is contained in:
Henrik Levkowetz 2020-03-14 19:18:08 +00:00
parent 64111d3ac6
commit 376d5a2ea0

View file

@ -93,7 +93,6 @@ while true ; do
case "$1" in
-c| --change) CHG="$2"; shift;; # the change made by revision ARG
-o| --overwrite) OVER=1;; # overwrite any existing patch file
-r| --revision) REV="$2"; shift;; # the change made between revisions REV
-h| --help) usage; exit;; # Show this help, then exit
-v| --verbose) VERBOSE=1;; # Be more talkative
-V| --version) version; exit;; # Show program version, then exit
@ -107,11 +106,8 @@ done
# The program itself
if [ "$CHG" ]; then
name=$(svn log -c $CHG | sed -r -e '/^---/d' -e '/^r[0-9]+/d' -e '/^$/d' -e 's/(.*)/\L\1/' -e 's/[^[:alnum:]]/-/g' -e 's/-+/-/g' | cut -c 1-32)
name=$(echo $(svn log -c $CHG | sed -r -e '/^---/d' -e '/^r[0-9]+/d' -e '/^$/d') | sed -r -e 's/(.*)/\L\1/' -e 's/[^[:alnum:]]/-/g' -e 's/-+/-/g' | cut -c 1-32)
name="$name-c$CHG"
elif [ "$REV" ]; then
name=$(echo $(svn log -r $REV | sed -r -e '/^---/d' -e '/^r[0-9]+/d' -e '/^$/d') | sed -r -e 's/(.*)/\L\1/g' -e 's/[^[:alnum:]]/-/g' -e 's/-+/-/g' | cut -c 1-32)
name="$name-r${REV/:/-}"
else
if [ $# -lt 2 ]; then die "Expected patch name and file list on the command line."; fi
if [[ $1 =~ / ]]; then die "Expected a patch name, but the first argument to $program seems to be a file path: '$1'"; fi
@ -124,4 +120,4 @@ svn diff ${CHG:+ -c $CHG} ${REV:+ -r $REV} "$@" > $patchfile
less $patchfile
echo ""
echo ""
echo "Patch is in $patchfile."
echo "Patch is in $patchfile"