}
sub match_creation_day ($$;@) {
+ my $page=shift;
my $d=shift;
if ($d !~ /^\d+$/) {
return IkiWiki::ErrorReason->new("invalid day $d");
}
- if ((localtime($IkiWiki::pagectime{shift()}))[3] == shift) {
+ if ((localtime($IkiWiki::pagectime{$page}))[3] == $d) {
return IkiWiki::SuccessReason->new('creation_day matched');
}
else {
}
sub match_creation_month ($$;@) {
+ my $page=shift;
my $m=shift;
if ($m !~ /^\d+$/) {
return IkiWiki::ErrorReason->new("invalid month $m");
}
- if ((localtime($IkiWiki::pagectime{shift()}))[4] + 1 == shift) {
+ if ((localtime($IkiWiki::pagectime{$page}))[4] + 1 == $m) {
return IkiWiki::SuccessReason->new('creation_month matched');
}
else {
}
sub match_creation_year ($$;@) {
+ my $page=shift;
my $y=shift;
if ($y !~ /^\d+$/) {
return IkiWiki::ErrorReason->new("invalid year $y");
}
- if ((localtime($IkiWiki::pagectime{shift()}))[5] + 1900 == $y) {
+ if ((localtime($IkiWiki::pagectime{$page}))[5] + 1900 == $y) {
return IkiWiki::SuccessReason->new('creation_year matched');
}
else {
# in order to see all changes.
my ($subdir, $rootdir) = git_find_root();
$git_dir=$rootdir;
- my @ret=git_parse_changes(git_commit_info($sha1, 1));
+ my @commits=git_commit_info($sha1, 1);
$git_dir=undef;
- return @ret;
+
+ if (! @commits) {
+ error "unknown commit"; # just in case
+ }
+
+ # git revert will fail on merge commits. Add a nice message.
+ if (exists $commits[0]->{parents} &&
+ @{$commits[0]->{parents}} > 1) {
+ error gettext("you are not allowed to revert a merge");
+ }
+
+ return git_parse_changes(@commits);
}
sub rcs_revert ($) {
-ikiwiki (3.20101020) UNRELEASED; urgency=low
+ikiwiki (3.20101023) unstable; urgency=low
* Fix typo that broke anonymous git push.
- * fix web reversion when the srcdir is in a subdir of the git repo.
+ * Fix web reversion when the srcdir is in a subdir of the git repo.
- -- Joey Hess <joeyh@debian.org> Sat, 23 Oct 2010 15:25:19 -0400
+ -- Joey Hess <joeyh@debian.org> Sat, 23 Oct 2010 16:36:50 -0400
ikiwiki (3.20101019) unstable; urgency=low