]> git.pld-linux.org Git - packages/php-ffmpeg.git/blob - branch.sh
add todo and notes
[packages/php-ffmpeg.git] / branch.sh
1 #!/bin/sh
2 set -e
3 svnroot=https://ffmpeg-php.svn.sourceforge.net/svnroot/ffmpeg-php
4 tag=branches/ffmpeg-php/ffmpeg-php-0.6.0
5 trunk=trunk/ffmpeg-php
6 out=branch.diff
7
8 d=$-
9 filter() {
10         set -$d
11         # remove revno's for smaller diffs
12         sed -e 's,^\([-+]\{3\} .*\)\t(revision [0-9]\+)$,\1,'
13 }
14
15 old=$svnroot/$tag
16 new=$svnroot/$trunk
17 echo >&2 "Running diff: $old -> $new"
18 LC_ALL=C svn diff --old=$old --new=$new > $out.tmp
19 revno=$(sed -ne 's,^[-+]\{3\} .*\t(revision \([0-9]\+\))$,\1,p' $out.tmp | sort -urn | head -n1)
20 echo >&2 "Revision $revno"
21 [ "$revno" -gt 0 ] || exit 1
22
23 sed -i -e "1i# Revision $revno" $out.tmp
24 filter < $out.tmp > $out.tmp2 && mv -f $out.{tmp2,tmp}
25
26 if cmp -s branch.diff{,.tmp}; then
27         echo >&2 "No new diffs..."
28         rm -f branch.diff.tmp
29         exit 0
30 fi
31 mv -f branch.diff{.tmp,}
This page took 0.070527 seconds and 3 git commands to generate.