Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(117)

Unified Diff: lib/Brackup/Root.pm

Issue 718: 'accept' option - a file or directory must match at least one of the accept regexps to be backed up SVN Base: http://brackup.googlecode.com/svn/trunk/
Patch Set: Created 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side by-side-diff with in-line comments
Download patch
Index: lib/Brackup/Root.pm
===================================================================
--- lib/Brackup/Root.pm (revision 194)
+++ lib/Brackup/Root.pm (working copy)
@@ -21,6 +21,7 @@
$self->{gpg_rcpt} = $conf->value('gpg_recipient');
$self->{chunk_size} = $conf->byte_value('chunk_size');
$self->{ignore} = [];
+ $self->{accept} = [];
$self->{smart_mp3_chunking} = $conf->bool_value('smart_mp3_chunking');
@@ -84,6 +85,11 @@
push @{ $self->{ignore} }, $pattern;
}
+sub accept {
+ my ($self, $pattern) = @_;
+ push @{ $self->{accept} }, $pattern;
+}
+
sub path {
return $_[0]{dir};
}
@@ -131,6 +137,26 @@
next DENTRY if $is_dir && "$path/" =~ /$pattern/;
}
+
+ if( @{ $self->{accept} } ) {
+
+ foreach my $pattern (@{ $self->{accept} }) {
+ if( $path =~ /$pattern/ ) {
+ $statcache{$path} = $statobj;
+ push @good_dentries, $dentry;
+ next DENTRY;
+ }
+
+ if( $is_dir && "$path/" =~ /$pattern/ ) {
+ $statcache{$path} = $statobj;
+ push @good_dentries, $dentry;
+ next DENTRY;
+ }
+ }
+
+ next DENTRY;
+ }
+
$statcache{$path} = $statobj;
push @good_dentries, $dentry;
}
« lib/Brackup/Config.pm ('k') | no next file »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r338