From c33b0bc0b8a42a60677b2b8996ddc071e47fe270 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Fri, 24 Sep 2004 20:06:49 +0000 Subject: [PATCH] add my script that helps me handle MFC's. It takes in a commit message and generates the proper (hopefully) update -j lines + commit line to do the MFC... This has saved me a lot of time doing recent MFC's... You still should use diff to verify the changes before doing the commit.. --- tools/tools/README | 2 +- tools/tools/mfc/mfc.awk | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tools/tools/mfc/mfc.awk diff --git a/tools/tools/README b/tools/tools/README index 8b0d27985e3..36560674400 100644 --- a/tools/tools/README +++ b/tools/tools/README @@ -36,7 +36,7 @@ kerninclude Shellscript to find unused #includes in the kernel. kernxref Shellscript to cross reference symbols in the LINT kernel. kttcp An in-kernel version of the ttcp network performance tool mfc Merge a directory from HEAD to a branch where it does not - already exist. + already exist and other MFC related script(s). mid Create a Message-ID database for mailing lists. pciid Generate src/share/misc/pci_vendors. portsinfo Generate list of new ports for last two weeks. diff --git a/tools/tools/mfc/mfc.awk b/tools/tools/mfc/mfc.awk new file mode 100644 index 00000000000..f82c5c2ca2b --- /dev/null +++ b/tools/tools/mfc/mfc.awk @@ -0,0 +1,30 @@ +#!/usr/bin/awk -f +# +# $FreeBSD$ +# + +BEGIN { + CVSROOT="ncvs:/home/ncvs" + UPDATEOPTS="-kk" +} + +/^>/ { + sub(">[ ]*", "") +} + +/^Revision/ || $1 == "" { + next +} + +{ + if (sub("1.", "") != 1) + next + if (!(match($2, "\\+[0-9]") && match($3, "-[0-9]"))) + next + printf("cvs -d %s update %s -j 1.%d -j 1.%d %s\n", CVSROOT, UPDATEOPTS, $1 - 1, $1, $4) + files = files " " $4 +} + +END { + printf("cvs -d %s commit %s\n", CVSROOT, files); +}