initial commit with v2.6.9
[linux-2.6.9-moxart.git] / Documentation / BK-usage / cpcset
blobb8faca97dab9145615c57d3bbd75ea60b76cac7d
1 #!/bin/sh
3 # Purpose: Copy changeset patch and description from one
4 # repository to another, unrelated one.
6 # usage: cpcset [revision] [from-repository] [to-repository]
9 REV=$1
10 FROM=$2
11 TO=$3
12 TMPF=/tmp/cpcset.$$
14 rm -f $TMPF*
16 CWD_SAVE=`pwd`
17 cd $FROM
18 bk changes -r$REV | \
19 grep -v '^ChangeSet' | \
20 sed -e 's/^ //g' > $TMPF.log
22 USERHOST=`bk changes -r$REV | grep '^ChangeSet' | awk '{print $4}'`
23 export BK_USER=`echo $USERHOST | awk '-F@' '{print $1}'`
24 export BK_HOST=`echo $USERHOST | awk '-F@' '{print $2}'`
26 bk export -tpatch -hdu -r$REV > $TMPF.patch && \
27 cd $CWD_SAVE && \
28 cd $TO && \
29 bk import -tpatch -CFR -y"`cat $TMPF.log`" $TMPF.patch . && \
30 bk commit -y"`cat $TMPF.log`"
32 rm -f $TMPF*
34 echo changeset $REV copied.
35 echo ""