From ecdfd1b8644bc926db008054ab6192e18351afed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 17:35:21 -0400 Subject: rcs_commit and rcs_commit_staged api changes Using named parameters for these is overdue. Passing the session in a parameter instead of passing username and IP separately will later allow storing other session info, like username or part of the email. Note that these functions are not part of the exported API, and the prototype change will catch (most) skew, so I am not changing API versions. Any third-party plugins that call them will need updated though. --- t/mercurial.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 't/mercurial.t') diff --git a/t/mercurial.t b/t/mercurial.t index 954b17526..b64ea8e56 100755 --- a/t/mercurial.t +++ b/t/mercurial.t @@ -22,13 +22,22 @@ $config{srcdir} = "$dir/repo"; IkiWiki::loadplugins(); IkiWiki::checkconfig(); +use CGI::Session; +my $session=CGI::Session->new; +$session->param("name", "Joe User"); + system "hg init $config{srcdir}"; # Web commit my $test1 = readfile("t/test1.mdwn"); writefile('test1.mdwn', $config{srcdir}, $test1); IkiWiki::rcs_add("test1.mdwn"); -IkiWiki::rcs_commit("test1.mdwn", "Added the first page", "moo", "Joe User"); +IkiWiki::rcs_commit( + file => "test1.mdwn", + message => "Added the first page", + token => "moo", + session => $session, +); my @changes; @changes = IkiWiki::rcs_recentchanges(3); -- cgit v1.2.3 From 1f6ea9a626d9983ce84343e6a73604d58aa1df09 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 25 Jun 2010 00:30:12 -0400 Subject: clean up messages about unavailable vcs programs --- t/bazaar.t | 7 +++++-- t/cvs.t | 7 +++++-- t/git.t | 7 +++++-- t/mercurial.t | 7 +++++-- t/svn.t | 7 +++++-- 5 files changed, 25 insertions(+), 10 deletions(-) (limited to 't/mercurial.t') diff --git a/t/bazaar.t b/t/bazaar.t index 3e54ec4dc..cd840fbe1 100755 --- a/t/bazaar.t +++ b/t/bazaar.t @@ -6,11 +6,14 @@ BEGIN { $dir = "/tmp/ikiwiki-test-bzr.$$"; my $bzr=`which bzr`; chomp $bzr; - if (! -x $bzr || ! mkdir($dir)) { + if (! -x $bzr) { eval q{ - use Test::More skip_all => "bzr not available or could not make test dir" + use Test::More skip_all => "bzr not available" } } + if (! mkdir($dir)) { + die $@; + } } use Test::More tests => 17; diff --git a/t/cvs.t b/t/cvs.t index 96359ab6e..5ed377ed5 100755 --- a/t/cvs.t +++ b/t/cvs.t @@ -8,11 +8,14 @@ BEGIN { chomp $cvs; my $cvsps=`which cvsps`; chomp $cvsps; - if (! -x $cvs || ! -x $cvsps || ! mkdir($dir)) { + if (! -x $cvs || ! -x $cvsps) { eval q{ - use Test::More skip_all => "cvs or cvsps not available or could not make test dir" + use Test::More skip_all => "cvs or cvsps not available" } } + if (! mkdir($dir)) { + die $@; + } foreach my $module ('File::ReadBackwards', 'File::MimeInfo') { eval qq{use $module}; if ($@) { diff --git a/t/git.t b/t/git.t index ee778ebf0..6d847dfb0 100755 --- a/t/git.t +++ b/t/git.t @@ -7,11 +7,14 @@ BEGIN { $dir="/tmp/ikiwiki-test-git.$$"; my $git=`which git`; chomp $git; - if (! -x $git || ! mkdir($dir)) { + if (! -x $git) { eval q{ - use Test::More skip_all => "git not available or could not make test dir" + use Test::More skip_all => "git not available" } } + if (! mkdir($dir)) { + die $@; + } } use Test::More tests => 18; diff --git a/t/mercurial.t b/t/mercurial.t index b64ea8e56..4918fc76e 100755 --- a/t/mercurial.t +++ b/t/mercurial.t @@ -6,11 +6,14 @@ BEGIN { $dir = "/tmp/ikiwiki-test-hg.$$"; my $hg=`which hg`; chomp $hg; - if (! -x $hg || ! mkdir($dir)) { + if (! -x $hg) { eval q{ - use Test::More skip_all => "hg not available or could not make test dir" + use Test::More skip_all => "hg not available" } } + if (! mkdir($dir)) { + die $@; + } } use Test::More tests => 11; diff --git a/t/svn.t b/t/svn.t index 82b71b5fc..cce8452a6 100755 --- a/t/svn.t +++ b/t/svn.t @@ -8,11 +8,14 @@ BEGIN { chomp $svn; my $svnadmin=`which svnadmin`; chomp $svnadmin; - if (! -x $svn || ! -x $svnadmin || ! mkdir($dir)) { + if (! -x $svn || ! -x $svnadmin) { eval q{ - use Test::More skip_all => "svn not available or could not make test dir" + use Test::More skip_all => "svn or svnadmin not available" } } + if (! mkdir($dir)) { + die $@; + } } use Test::More tests => 12; -- cgit v1.2.3