From 5fc87357d47bc573d4b172cc007054c20b15f93a Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 10 Jan 2004 11:20:44 -0500 Subject: [PATCH] [BK] add two helper scripts to Documentation/BK-usage cpcset: copy changset from one repository to another gcapatch: Generate GNU diff of local changes, versus latest upstream (well, GCA...) --- Documentation/BK-usage/00-INDEX | 13 ++++++++++++ Documentation/BK-usage/cpcset | 36 +++++++++++++++++++++++++++++++++ Documentation/BK-usage/gcapatch | 8 ++++++++ 3 files changed, 57 insertions(+) create mode 100755 Documentation/BK-usage/cpcset create mode 100755 Documentation/BK-usage/gcapatch diff --git a/Documentation/BK-usage/00-INDEX b/Documentation/BK-usage/00-INDEX index 061a63df8843b..82768784ea525 100644 --- a/Documentation/BK-usage/00-INDEX +++ b/Documentation/BK-usage/00-INDEX @@ -17,6 +17,14 @@ bz64wrap: helper script. Uncompressed input is piped to this script, which compresses its input, and then outputs the uu-/base64-encoded version of the compressed input. +cpcset: Copy changeset between unrelated repositories. +Attempts to preserve changeset user, user address, description, in +addition to the changeset (the patch) itself. +Typical usage: + cd my-updated-repo + bk changes # looking for a changeset... + cpcset 1.1511 . ../another-repo + csets-to-patches: Produces a delta of two BK repositories, in the form of individual files, each containing a single cset as a GNU patch. Output is several files, each with the filename "/tmp/rev-$REV.patch" @@ -33,6 +41,11 @@ Typical usage: bk changes -L ~/repo/original-repo 2>&1 | \ perl cset-to-linus > summary.txt +gcapatch: Generates patch containing changes in local repository. +Typical usage: + cd my-updated-repo + gcapatch > foo.patch + unbz64wrap: Reverse an encoded, compressed data stream created by bz64wrap into an uncompressed, typically text/plain output. diff --git a/Documentation/BK-usage/cpcset b/Documentation/BK-usage/cpcset new file mode 100755 index 0000000000000..b8faca97dab91 --- /dev/null +++ b/Documentation/BK-usage/cpcset @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Purpose: Copy changeset patch and description from one +# repository to another, unrelated one. +# +# usage: cpcset [revision] [from-repository] [to-repository] +# + +REV=$1 +FROM=$2 +TO=$3 +TMPF=/tmp/cpcset.$$ + +rm -f $TMPF* + +CWD_SAVE=`pwd` +cd $FROM +bk changes -r$REV | \ + grep -v '^ChangeSet' | \ + sed -e 's/^ //g' > $TMPF.log + +USERHOST=`bk changes -r$REV | grep '^ChangeSet' | awk '{print $4}'` +export BK_USER=`echo $USERHOST | awk '-F@' '{print $1}'` +export BK_HOST=`echo $USERHOST | awk '-F@' '{print $2}'` + +bk export -tpatch -hdu -r$REV > $TMPF.patch && \ +cd $CWD_SAVE && \ +cd $TO && \ +bk import -tpatch -CFR -y"`cat $TMPF.log`" $TMPF.patch . && \ +bk commit -y"`cat $TMPF.log`" + +rm -f $TMPF* + +echo changeset $REV copied. +echo "" + diff --git a/Documentation/BK-usage/gcapatch b/Documentation/BK-usage/gcapatch new file mode 100755 index 0000000000000..aaeb17dc7c7f2 --- /dev/null +++ b/Documentation/BK-usage/gcapatch @@ -0,0 +1,8 @@ +#!/bin/sh +# +# Purpose: Generate GNU diff of local changes versus canonical top-of-tree +# +# Usage: gcapatch > foo.patch +# + +bk export -tpatch -hdu -r`bk repogca bk://linux.bkbits.net/linux-2.5`,+ -- 2.53.0