summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-08-09 05:35:47 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-08-09 05:35:47 +0000
commitf0ec078e6acbe86342ed6066ae886ceac3c5d855 (patch)
tree0f886caa9494ac10393c7d3b0f71e330a2045337
parent54f02ea7da4223001b22e2f0b8c9427f1cdadd1b (diff)
downloadrdiff-backup-f0ec078e6acbe86342ed6066ae886ceac3c5d855.tar.gz
Fixed selection bug reported by Daniel Richard G. and added test to
selectiontest.py to check for it. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@602 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG2
-rw-r--r--rdiff-backup/rdiff_backup/selection.py3
-rw-r--r--rdiff-backup/testing/selectiontest.py8
3 files changed, 12 insertions, 1 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index ba54d5c..3b7059f 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -35,6 +35,8 @@ when the repository has permission problems.
Added Keith Edmunds patch adding the --create-full-path option.
+Fixed selection bug reported by Daniel Richard G.
+
New in v0.13.6 (2005/04/07)
---------------------------
diff --git a/rdiff-backup/rdiff_backup/selection.py b/rdiff-backup/rdiff_backup/selection.py
index 88f9676..310aed3 100644
--- a/rdiff-backup/rdiff_backup/selection.py
+++ b/rdiff-backup/rdiff_backup/selection.py
@@ -211,7 +211,8 @@ class Select:
"""Run through the selection functions and return dominant val 0/1/2"""
for sf in self.selection_functions:
result = sf(rp)
- if result is not None: return result
+ if result == 1 or result == 0 or (result == 2 and rp.isdir()):
+ return result
return 1
def ParseArgs(self, argtuples, filelists):
diff --git a/rdiff-backup/testing/selectiontest.py b/rdiff-backup/testing/selectiontest.py
index 228d5b2..3151bf9 100644
--- a/rdiff-backup/testing/selectiontest.py
+++ b/rdiff-backup/testing/selectiontest.py
@@ -413,6 +413,14 @@ testfiles/select**/2
("--exclude", "**")],
[(), ('1',), ('1', '1'), ('1', '2')])
+ def testGlob3(self):
+ """Test for bug when **is in front"""
+ self.ParseTest([("--include", "**NOTEXIST"),
+ ("--exclude", "**NOTEXISTEITHER"),
+ ("--include", "testfiles/select/efools"),
+ ("--exclude", "**")],
+ [(), ('efools',), ('efools', 'ping')])
+
def testAlternateRoot(self):
"""Test select with different root"""
self.root = rpath.RPath(Globals.local_connection, "testfiles/select/1")