[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Debian JP master SVN www commits (rev.947)



=======================================================
Repository: /org/svn.debian.or.jp/repos
  Revision: 947
  Commiter: kmuto
      Date: 2009-10-15 10:18:13 +0900 (木, 15 10月 2009)
=======================================================
Log:

support add/remove (not tested yet)

=======================================================
Changed:

U   webwml-sync/trunk/webwml-patch-commit

Modified: webwml-sync/trunk/webwml-patch-commit
===================================================================
--- webwml-sync/trunk/webwml-patch-commit	2009-10-14 00:11:58 UTC (rev 946)
+++ webwml-sync/trunk/webwml-patch-commit	2009-10-15 01:18:13 UTC (rev 947)
@@ -9,6 +9,7 @@
 cvsdir=$(pwd)/webwml
 patchesdir=$(pwd)/patches
 patcheddir=$(pwd)/patched
+targetlang=japanese
 
 patchedprefix=$(date +'%Y%m%d')-
 
@@ -23,7 +24,7 @@
 git format-patch -o $patchesdir $lastrev
 
 cd $cvsdir
-cvs -q update -d -P english japanese
+cvs -q update -d -P english $targetlang
 
 cd $patchesdir
 for pf in $(ls *.patch); do
@@ -55,8 +56,21 @@
         read yn
         if [ "$yn" = "y" ]; then # apply
           patch -p1 -f < ${patchesdir}/$pf
-          cd japanese # fool proof
+
+          addfiles=$( cd $gitdir && git-whatchanged -1 --pretty=format:"" $sha1 | grep "$targetlang/" | awk '{if ($5 == "A") print $6}' | xargs )
+          rmfiles=$( cd $gitdir && git-whatchanged -1 --pretty=format:"" $sha1 | grep "$targetlang/" | awk '{if ($5 == "D") print $6}' | xargs )
+
+          cd $targetlang # fool proof
+
+          if [ "$addfiles" ]; then
+            eval cvs add $addfiles
+          fi
+          if [ "$rmfiles" ]; then
+            eval cvs remove $rmfiles
+          fi
+
           cvs commit -m "$logmsg"
+
           mv $patchesdir/$pf $patcheddir/$patchedprefix$pf
           echo $sha1 > $lastcommitfile
           break