]> git.hungrycats.org Git - linux/commitdiff
[BK] add two helper scripts to Documentation/BK-usage
authorJeff Garzik <jgarzik@redhat.com>
Sat, 10 Jan 2004 16:20:44 +0000 (11:20 -0500)
committerJeff Garzik <jgarzik@redhat.com>
Sat, 10 Jan 2004 16:20:44 +0000 (11:20 -0500)
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
Documentation/BK-usage/cpcset [new file with mode: 0755]
Documentation/BK-usage/gcapatch [new file with mode: 0755]

index 061a63df8843b9e7d793fa9d40df567ccb180a59..82768784ea5258aec2de1892049b05a324c881f5 100644 (file)
@@ -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 (executable)
index 0000000..b8faca9
--- /dev/null
@@ -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 (executable)
index 0000000..aaeb17d
--- /dev/null
@@ -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`,+