All rcs backends need to implement rcs_remove

(Done for svn, git.)
master
Joey Hess 2008-07-21 13:40:06 -04:00
parent a204f86786
commit c6d1ae33d2
9 changed files with 59 additions and 9 deletions

View File

@ -33,6 +33,12 @@ sub rcs_add ($) {
# prepare for it to be checked in when rcs_commit is called.
}
sub rcs_remove ($) {
# Remove a file. The filename is relative to the root of the srcdir.
# Note that this should not check the removal in, it should only
# prepare for it to be checked in when rcs_commit is called.
}
sub rcs_recentchanges ($) {
# Examine the RCS history and generate a list of recent changes.
# The data structure returned for each change is:

View File

@ -89,6 +89,12 @@ sub rcs_add ($) { # {{{
}
} #}}}
sub rcs_remove ($) { # {{{
my ($file) = @_;
error("rcs_remove not implemented for bzr"); # TODO
} #}}}
sub rcs_recentchanges ($) { #{{{
my ($num) = @_;

View File

@ -348,6 +348,14 @@ sub rcs_add ($) { # {{{
run_or_cry('git', 'add', $file);
} #}}}
sub rcs_remove ($) { # {{{
# Remove file from archive.
my ($file) = @_;
run_or_cry('git', 'rm', '-f', $file);
} #}}}
sub rcs_recentchanges ($) { #{{{
# List of recent changes.

View File

@ -101,6 +101,12 @@ sub rcs_add ($) { # {{{
}
} #}}}
sub rcs_remove ($) { # {{{
my ($file) = @_;
error("rcs_remove not implemented for mercurial"); # TODO
} #}}}
sub rcs_recentchanges ($) { #{{{
my ($num) = @_;

View File

@ -370,6 +370,12 @@ sub rcs_add ($) { #{{{
}
} #}}}
sub rcs_remove ($) { # {{{
my $file = shift;
error("rcs_remove not implemented for monotone"); # TODO
} #}}}
sub rcs_recentchanges ($) { #{{{
my $num=shift;
my @ret;

View File

@ -134,6 +134,23 @@ sub rcs_add ($) { #{{{
}
} #}}}
sub rcs_remove ($) { #{{{
# filename is relative to the root of the srcdir
my $file=shift;
if (-d "$config{srcdir}/.svn") {
my $parent=dirname($file);
while (! -d "$config{srcdir}/$parent/.svn") {
$file=$parent;
$parent=dirname($file);
}
if (system("svn", "rm", "--force", "--quiet", "$config{srcdir}/$file") != 0) {
warn("svn rm failed\n");
}
}
} #}}}
sub rcs_recentchanges ($) { #{{{
my $num=shift;
my @ret;

View File

@ -88,6 +88,12 @@ sub rcs_add ($) { #{{{
}
} #}}}
sub rcs_remove ($) { # {{{
my $file = shift;
error("rcs_remove not implemented for tla"); # TODO
} #}}}
sub rcs_recentchanges ($) {
my $num=shift;
my @ret;

1
debian/changelog vendored
View File

@ -3,6 +3,7 @@ ikiwiki (2.55) UNRELEASED; urgency=low
* prefix_directives enabled in doc wiki, all preprocessor directives
converted. (Simon McVittie)
* editpage: Don't show attachments link when attachments are disabled.
* All rcs backends need to implement rcs_rm. (Done for svn, git).
-- Joey Hess <joeyh@debian.org> Mon, 21 Jul 2008 11:35:46 -0400

View File

@ -395,16 +395,10 @@ is checked too.
## RCS
Two new optional functions are added to the RCS interface:
Two new functions are added to the RCS interface:
* `rcs_delete(file, message, rcstoken, user, ipaddr)`
* `rcs_rename(old, new, message, rcstoken, user, ipaddr)`
The page move/rename code will check if these are not available, and error
out.
Similar to `rcs_commit` both of these take a rcstoken, which is generated
by an earlier `rcs_prepedit`.
* `rcs_remove(file)`
* `rcs_rename(old, new)`
## conflicts