summaryrefslogtreecommitdiff
path: root/IkiWiki/Rcs
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-11-20 02:46:58 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-11-20 02:46:58 +0000
commit702b8721d360ca132ff5c8f43d332757694b98da (patch)
treed413a57c6922c70a79e7033347c5549a8b149d78 /IkiWiki/Rcs
parent8a06d15e50f6c1a697e38522945f0af9c4dba95f (diff)
* Add an openid plugin to support logging in using OpenID.
* Web commits by OpenID users will record the full OpenID url for the user, but in recentchanges, these urls will be converted to a simplified display form+link. * Modified svn, git, tla backends to recognise such web commits.
Diffstat (limited to 'IkiWiki/Rcs')
-rw-r--r--IkiWiki/Rcs/git.pm5
-rw-r--r--IkiWiki/Rcs/svn.pm6
-rw-r--r--IkiWiki/Rcs/tla.pm6
3 files changed, 6 insertions, 11 deletions
diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm
index c8b5adc45..868bec40d 100644
--- a/IkiWiki/Rcs/git.pm
+++ b/IkiWiki/Rcs/git.pm
@@ -12,7 +12,6 @@ my $origin_branch = 'origin'; # Git ref for main repository
my $master_branch = 'master'; # working branch
my $sha1_pattern = qr/[0-9a-fA-F]{40}/; # pattern to validate Git sha1sums
my $dummy_commit_msg = 'dummy commit'; # message to skip in recent changes
-my $web_commit_msg = qr/^web commit (by (\w+)|from (\d+\.\d+\.\d+\.\d+)):?(.*)/;
sub _safe_git (&@) { #{{{
# Start a child process safely without resorting /bin/sh.
@@ -375,7 +374,7 @@ sub rcs_recentchanges ($) { #{{{
push @message, { line => $title };
if (defined $message[0] &&
- $message[0]->{line} =~ m/$web_commit_msg/) {
+ $message[0]->{line} =~ m/$config{web_commit_regexp}/) {
$user=defined $2 ? "$2" : "$3";
$message[0]->{line}=$4;
} else {
@@ -424,7 +423,7 @@ sub rcs_notify () { #{{{
my @changed_pages = map { $_->{'file'} } @{ $ci->{'details'} };
my ($user, $message);
- if (@{ $ci->{'comment'} }[0] =~ m/$web_commit_msg/) {
+ if (@{ $ci->{'comment'} }[0] =~ m/$config{web_commit_regexp}/) {
$user = defined $2 ? "$2" : "$3";
$message = $4;
} else {
diff --git a/IkiWiki/Rcs/svn.pm b/IkiWiki/Rcs/svn.pm
index 2d3ad046c..71189c82e 100644
--- a/IkiWiki/Rcs/svn.pm
+++ b/IkiWiki/Rcs/svn.pm
@@ -7,8 +7,6 @@ use POSIX qw(setlocale LC_CTYPE);
package IkiWiki;
-my $svn_webcommit=qr/^web commit (by (\w+)|from (\d+\.\d+\.\d+\.\d+)):?(.*)/;
-
# svn needs LC_CTYPE set to a UTF-8 locale, so try to find one. Any will do.
sub find_lc_ctype() {
my $current = setlocale(LC_CTYPE());
@@ -162,7 +160,7 @@ sub rcs_recentchanges ($) { #{{{
my $committype="web";
if (defined $message[0] &&
- $message[0]->{line}=~/$svn_webcommit/) {
+ $message[0]->{line}=~/$config{web_commit_regexp}/) {
$user=defined $2 ? "$2" : "$3";
$message[0]->{line}=$4;
}
@@ -204,7 +202,7 @@ sub rcs_notify () { #{{{
my $user=`svnlook author $config{svnrepo} -r $rev`;
chomp $user;
my $message=`svnlook log $config{svnrepo} -r $rev`;
- if ($message=~/$svn_webcommit/) {
+ if ($message=~/$config{web_commit_regexp}/) {
$user=defined $2 ? "$2" : "$3";
$message=$4;
}
diff --git a/IkiWiki/Rcs/tla.pm b/IkiWiki/Rcs/tla.pm
index c71c9e6ee..00ee7e7a0 100644
--- a/IkiWiki/Rcs/tla.pm
+++ b/IkiWiki/Rcs/tla.pm
@@ -7,8 +7,6 @@ use POSIX qw(setlocale LC_CTYPE);
package IkiWiki;
-my $tla_webcommit=qr/^web commit (by (\w+)|from (\d+\.\d+\.\d+\.\d+)):?(.*)/;
-
sub quiet_system (@) {
# See Debian bug #385939.
open (SAVEOUT, ">&STDOUT");
@@ -117,7 +115,7 @@ sub rcs_recentchanges ($) {
my $when = time - str2time($sdate, 'UTC');
my $committype = "web";
- if (defined $summ && $summ =~ /$tla_webcommit/) {
+ if (defined $summ && $summ =~ /$config{web_commit_regexp}/) {
$user = defined $2 ? "$2" : "$3";
$summ = $4;
}
@@ -176,7 +174,7 @@ sub rcs_notify () { #{{{
my @changed_pages = grep { !/(^.*\/)?\.arch-ids\/.*\.id$/ }
split(/ /, "$newfiles $modfiles $remfiles .arch-ids/fake.id");
- if ($message =~ /$tla_webcommit/) {
+ if ($message =~ /$config{web_commit_regexp}/) {
$user=defined $2 ? "$2" : "$3";
$message=$4;
}