r53144 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53143‎ | r53144 | r53145 >
Date:19:17, 12 July 2009
Author:avar
Status:deferred
Tags:
Comment:
Scripts to create a git mirror of the MediaWiki SVN repository
Modified paths:
  • /trunk/tools/mediawiki-svn-to-git-gateway (added) (history)
  • /trunk/tools/mediawiki-svn-to-git-gateway/update-git.pl (added) (history)

Diff [purge]

Index: trunk/tools/mediawiki-svn-to-git-gateway/update-git.pl
@@ -0,0 +1,29 @@
 2+#!/usr/bin/env perl
 3+use feature ':5.10';
 4+use strict;
 5+use warnings;
 6+
 7+my $repository = '/home/avar/src/mediawiki';
 8+
 9+chdir $repository or die $!;
 10+
 11+my @last_irc_revs = last_irc_revs();
 12+my $last_git_rev = last_git_rev();
 13+
 14+if ($last_irc_revs[-1] != $last_git_rev) {
 15+ say "Need to update from $last_irc_revs[-1] to $last_git_rev (" . ($last_irc_revs[-1] - $last_git_rev) . " revisions)";
 16+ system 'git svn rebase';
 17+}
 18+
 19+sub last_irc_revs
 20+{
 21+ my @lines = `tail -n1000 /home/avar/.irssi/logs/freenode/#mediawiki.log*`;
 22+ my @rev = map { /r(\d+)/; $1 } grep { /^\d+:\d+ < CIA-\d+> \S+ \* r(\d+).*/ } @lines;
 23+ return @rev;
 24+}
 25+
 26+sub last_git_rev
 27+{
 28+ my ($ver) = `git svn log --oneline --limit 1` =~ /r(\d+)/;
 29+ return $ver;
 30+}

Status & tagging log