#! /bin/sh

# Copyright (C) 1999, Free Software Foundation
# Originally by Alexandre Oliva <oliva@gnu.org>

# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License.  A copy of
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html

# This script is useful to install the same patch in multiple branches
# of a CVS tree, when you have them all checked out.  After installing
# the patch in one of the trees, run:

# Usage: cvsdiff2 /path/to/the/other/tree args-to-cvsdiff...

dir="$1"
shift || exit 1
cvsdiff ${1+"$@"} |
(cd "$dir" && cl2patch -r . | patch -p0)
