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

Debian JP master SVN www commits (rev.940)



=======================================================
Repository: /org/svn.debian.or.jp/repos
  Revision: 940
  Commiter: kmuto
      Date: 2009-10-13 09:58:17 +0900 (火, 13 10月 2009)
=======================================================
Log:

add committer side tool

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

U   webwml-sync/trunk/sync
U   webwml-sync/trunk/webwml-git-committer.rb
A   webwml-sync/trunk/webwml-patch-commit

Modified: webwml-sync/trunk/sync
===================================================================
--- webwml-sync/trunk/sync	2009-10-11 12:52:44 UTC (rev 939)
+++ webwml-sync/trunk/sync	2009-10-13 00:58:17 UTC (rev 940)
@@ -2,6 +2,8 @@
 #  Copyright 2009 Kenshi Muto <kmuto@debian.org>
 
 # copy from webwml CVS to Git.
+( cd webwml && cvs -q up -d -P english japanese )
+
 rsync -aqu --delete --exclude CVS --exclude .cvsignore webwml/english webwml-git
 rsync -aqu --delete --exclude CVS --exclude .cvsignore webwml/japanese webwml-git
 

Modified: webwml-sync/trunk/webwml-git-committer.rb
===================================================================
--- webwml-sync/trunk/webwml-git-committer.rb	2009-10-11 12:52:44 UTC (rev 939)
+++ webwml-sync/trunk/webwml-git-committer.rb	2009-10-13 00:58:17 UTC (rev 940)
@@ -1,7 +1,7 @@
 #!/usr/bin/ruby
 #  Copyright 2009 Kenshi Muto <kmuto@debian.org>
 
-fromaddress = "webwml sync robot <kmuto_webwml@xxxxxxxx>"
+fromaddress = "webwml sync agent <kmuto_webwml@xxxxxxxx>"
 exit(0) if File.exists?("../webwml-git-committer-lock")
 
 File.new("../webwml-git-committer-lock", "w")
@@ -21,7 +21,7 @@
   end
 }
 if lines.size > 0 || ARGV[0] == "force"
-  fork { exec("git", "commit", "--author", fromaddress, "-m",  "* [auto] sync with cvs.", "-a", "-q") }
+  fork { exec("git", "commit", "--author", fromaddress, "-m",  "[auto] sync with cvs.", "-a", "-q") }
   Process.waitall
 end
 File.unlink("../webwml-git-committer-lock")

Added: webwml-sync/trunk/webwml-patch-commit
===================================================================
--- webwml-sync/trunk/webwml-patch-commit	                        (rev 0)
+++ webwml-sync/trunk/webwml-patch-commit	2009-10-13 00:58:17 UTC (rev 940)
@@ -0,0 +1,59 @@
+#!/bin/bash
+#  Copyright 2009 Kenshi Muto <kmuto@debian.org>
+
+skipauthor="webwml sync agent"
+lastcommitfile=$(pwd)/lastcommit
+gitdir=$(pwd)/webwml-work
+cvsdir=$(pwd)/webwml
+patchesdir=$(pwd)/patches
+patcheddir=$(pwd)/patched
+
+patchedprefix=$(date +'%Y%m%d')-
+
+cd $gitdir
+git pull
+git format-patch -o $patchesdir $(cat $lastcommitfile)
+
+cd $patchesdir
+for pf in $(ls *.patch); do
+  sha1=$(head -n 1 $pf | sed -e "s/From //" -e "s/ .*//")
+
+  if [ "$(head -n 2 $pf | grep "From: $skipauthor")" ]; then
+    # This patch should be already applied
+    echo "[SKIP] $pf by agent"
+    mv $pf $patcheddir/$patchedprefix$pf
+    echo $sha1 > $lastcommitfile
+  else
+    # Test
+    cd $cvsdir
+    patch --dry-run -p1 -f < ${patchesdir}/$pf
+    if [ $? != 0 ]; then
+      while true; do
+        echo -n "[ERROR] $pf failed to apply! Exit now? [y/n]"
+        read yn
+        if [ "$yn" = "y" ]; then
+          exit
+        elif [ "$yn" = "n" ]; then
+          break
+        fi
+      done
+    else
+      logmsg=$(head -n 4 $patchesdir/$pf | grep Subject: | sed -e "s/Subject: \[PATCH\] //")
+      while true; do
+        echo -n "[COMMIT] $pf as $logmsg. OK? [y/n]"
+        read yn
+        if [ "$yn" = "y" ]; then
+          patch -p1 -f < ${patchesdir}/$pf
+          cd japanese # assurance to not break other languages
+          cvs commit -m "$logmsg"
+          mv $patchesdir/$pf $patcheddir/$patchedprefix$pf
+          echo $sha1 > $lastcommitfile
+          break
+        elif [ "$yn" = "n" ]; then
+          break
+        fi
+      done
+    fi
+    cd $patchesdir
+  fi
+done


Property changes on: webwml-sync/trunk/webwml-patch-commit
___________________________________________________________________
Name: svn:executable
   + *