Index: quilt-0.32/Makefile.in =================================================================== --- quilt-0.32.orig/Makefile.in Sat Mar 13 14:24:46 2004 +++ quilt-0.32/Makefile.in Wed Aug 11 09:06:34 2004 @@ -55,9 +55,9 @@ SRC += $(BIN_SRC:%=bin/%) DIRT += $(BIN_IN:%=bin/%) -QUILT_IN := add applied delete diff edit files fold fork graph import \ - new next patches pop previous push refresh remove series \ - setup snapshot top unapplied +QUILT_IN := add applied commit delete diff edit files fold fork graph \ + import new next patches pop previous push refresh remove \ + series setup snapshot top unapplied QUILT_SRC := $(QUILT_IN:%=%.in) QUILT := $(QUILT_IN) Index: quilt-0.32/quilt/commit.in =================================================================== --- quilt-0.32.orig/quilt/commit.in Fri Apr 2 21:39:45 2004 +++ quilt-0.32/quilt/commit.in Wed Aug 11 09:14:13 2004 @@ -0,0 +1,139 @@ +#! @BASH@ + +# This script is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# See the COPYING and AUTHORS files for more details. + +# Read in library functions +if [ "$(type -t patch_file_name)" != function ] +then + if ! [ -r @SCRIPTS@/patchfns ] + then + echo "Cannot read library @SCRIPTS@/patchfns" >&2 + exit 1 + fi + . @SCRIPTS@/patchfns +fi + +usage() +{ + echo $"Usage: quilt commit [-p patch]" + if [ x$1 = x-h ] + then + echo $" +Commit all changes in the topmost or named patch to the underlying version +control system. + +-n + Show CVS commands, but don't actually run them. +-p patch + Patch to commit files from." + + exit 0 + else + exit 1 + fi +} + +do_cvs() +{ + if [ x$runcvs = xyes ] + then + cvs "$@" + return $? + else + echo cvs "$@" + return 0 + fi +} + +options=`getopt -o p:hn -- "$@"` +if [ $? -ne 0 ] +then + usage +fi + +eval set -- "$options" + +runcvs=yes +while true +do + case "$1" in + -p) + if ! patch=$(find_patch $2) + then + echo $"Patch $2 is not in series" >&2 + exit 1 + fi + shift 2 ;; + -h) + usage -h ;; + -n) + runcvs=no + shift ;; + --) + shift + break ;; + esac +done + +if [ $# -ne 0 ] +then + usage +fi + +if [ -n "$patch" ] +then + if ! is_applied $patch + then + echo $"Patch $patch is not applied" >&2 + exit 1 + fi +else + patch=$(top_patch) + if [ -z "$patch" ] + then + echo $"No patches applied" >&2 + exit 1 + fi +fi + +# Add new files +declare -a addfiles removefiles commitfiles +addfile_count=0 +removefile_count=0 +commitfile_count=0 + +for file in $(files_in_patch $patch) +do + if [ ! -e $file ] + then + removefiles[removefile_count++]=$file + elif [ ! -s $(backup_file_name $patch $file) ] + then + addfiles[addfile_count++]=$file + fi + commitfiles[commitfile_count++]=$file +done + +# Commit the files +if [ $addfile_count -gt 0 ] +then + do_cvs add "address@hidden" 2>/dev/null +fi +if [ $removefile_count -gt 0 ] +then + do_cvs remove "address@hidden" 2>/dev/null +fi +if [ $commitfile_count -gt 0 ] +then + do_cvs commit "address@hidden" || exit $? +fi +exit 0 + +### Local Variables: +### mode: shell-script +### End: +# vim:filetype=sh