Ticket #5874: svndumpchangesets.sh

File svndumpchangesets.sh, 987 bytes (added by mmadia, 14 years ago)

script for individual patches of creating commit message + changest from SVN

Line 
1#!/bin/bash
2#usage:
3# svndumpchangesets [<int> [<int>]]
4
5# defaults
6rev=0
7tip=`svn info`
8max=`echo ${tip} | awk '{ print $12 }' | sed -e 's/:.*//g'`
9
10# parse command line options, if specified
11if [ "$1" != "" ] ; then
12 if [ $1 -gt 0 ] ; then
13 rev=$1
14 fi
15 if [ "$2" != "" ] ; then
16 if [ $2 -gt $1 ] ; then
17 max=$2
18 fi
19 fi
20fi
21
22if [ $rev -gt $max ] ; then
23 echo 'A revision greater than the working repository was specified. Exiting ...'
24 exit 1
25fi
26
27output='dumped_changesets'
28if [ -d ${output} ] ; then
29 # be happy
30 echo ''
31else
32 mkdir ${output}
33fi
34echo $rev
35echo $max
36while [ $rev -le $max ] ; do
37 echo "Creating a logged patch for ${rev} ..."
38 #echo "hg -v log -r ${rev} > ${output}/${rev}.patch"
39 #echo "hg diff -r ${rev} >> ${output}/${rev}.patch"
40 #svn log -r ${rev} | sed -e '1,3d' | sed -e '$d' | sed -e '/^$/d' > ${output}/${rev}.patch
41 patchfile="${output}/svn-${rev}.patch"
42 svn log -c ${rev} > ${patchfile}
43 svn diff -c ${rev} >> ${patchfile}
44 rev=`expr ${rev} + 1`
45done