PageRenderTime 22ms CodeModel.GetById 18ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Documentation/BK-usage/cpcset

https://bitbucket.org/evzijst/gittest
Shell | 36 lines | 21 code | 8 blank | 7 comment | 4 complexity | b2748e13258780d57d3aa3a2da5c853d MD5 | raw file
 1#!/bin/sh
 2#
 3# Purpose: Copy changeset patch and description from one
 4#	   repository to another, unrelated one.
 5#
 6# usage:  cpcset [revision] [from-repository] [to-repository]
 7#
 8
 9REV=$1
10FROM=$2
11TO=$3
12TMPF=/tmp/cpcset.$$
13
14rm -f $TMPF*
15
16CWD_SAVE=`pwd`
17cd $FROM
18bk changes -r$REV			|	\
19	grep -v '^ChangeSet'		|	\
20	sed -e 's/^  //g' > $TMPF.log
21
22USERHOST=`bk changes -r$REV | grep '^ChangeSet' | awk '{print $4}'`
23export BK_USER=`echo $USERHOST | awk '-F@' '{print $1}'`
24export BK_HOST=`echo $USERHOST | awk '-F@' '{print $2}'`
25
26bk export -tpatch -hdu -r$REV > $TMPF.patch && \
27cd $CWD_SAVE && \
28cd $TO && \
29bk import -tpatch -CFR -y"`cat $TMPF.log`" $TMPF.patch . && \
30bk commit -y"`cat $TMPF.log`"
31
32rm -f $TMPF*
33
34echo changeset $REV copied.
35echo ""
36