+# The newest revision that should not appear in the generated ChangeLog.
+gen_origin=325bf192ae281046834884b12705d6c522871b24
+force=
+output=ChangeLog
+nmax=2
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ -g|--gen-origin) gen_origin="$2" ; shift ;;
+ -f|--force) force=1 ;;
+ -n|--nmax) nmax="$2"; shift ;;
+ -o|--output) output="$2" ; shift ;;
+ *) echo "Unrecognized argument: $1" >&2; exit 1 ;;
+ esac
+ shift
+done
+
+if [ ! -f ChangeLog.$nmax ]; then
+ echo "Can't find ChangeLog.$nmax" >&2
+ echo "Must be run from the top source directory" >&2
+ exit 1
+fi
+
+if [ -f "$output" ]; then
+ [ ! "$force" ] && echo "$output exists" >&2 && exit 1
+ rm -f "$output" || exit 1
+fi