4
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

svn、チケット駆動開発時のtrunkマージスクリプト

「refs #1234」とかでチケット番号に紐付けてコミットしていることを前提
引数にチケットの番号のみを渡してmerge_ticket.shを実行、trunkにマージされる幸せ(▰˘◡˘▰)

svn
└── huge
      ├── branches
      │     └──── 1.1
      └── trunk

script
├── merge_ticket.sh
└── svn
      └── merge_ticket_number.sh
merge_ticket.sh
#!/bin/bash

PWDDIR=`pwd`
cd $PWDDIR

# 開発ディレクトリ
DIR=/home/soramugi/svn/huge/branches/1.1/
# trunk
TRUNK=/home/soramugi/svn/huge/trunk/

source svn/merge_ticket_number.sh $*
merge_ticket_number.sh
#!/bin/bash

set -e

# チケット番号に紐付けてコミットしていることを前提
# 引数にチケットの番号のみを渡す

if [ "$1" = '' ]; then
  exit 1
fi

SERCHE=''
for i in $@
do
  if [ "$SERCHE" != '' ]; then
    SERCHE=$SERCHE'\|'
  fi
  SERCHE=$SERCHE'#'$i
done


cd $DIR
pwd
RIPOURL=`svn info | grep URL: | grep -o 'http.\+'`
/usr/bin/svn up
REVISIONS=`/usr/bin/svn log | /bin/grep -B 3 "$SERCHE" | /bin/grep -o '^r[0-9]\+' | /bin/grep -o '[0-9]\+' | sort -n`

echo $REVISIONS

cd $TRUNK
pwd
/usr/bin/svn up

/usr/bin/svn merge -c "$REVISIONS" $RIPOURL
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
4
Help us understand the problem. What are the problem?