From 5606c8f93acbd8daeb97d2ea702b2f9096a067a2 Mon Sep 17 00:00:00 2001 From: bescoto Date: Tue, 9 Aug 2005 06:05:17 +0000 Subject: Backport for selection bugfix/addition reported by Daniel Richard G. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/branches/r0-12@603 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 6 ++++++ rdiff-backup/rdiff_backup/selection.py | 3 ++- rdiff-backup/testing/selectiontest.py | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index 7acb9e2..8a11ebf 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -1,3 +1,9 @@ +New in v0.12.9 (????/??/??) +--------------------------- + +Fixed selection bug reported by Daniel Richard G. + + New in v0.12.8 (2005/04/07) --------------------------- diff --git a/rdiff-backup/rdiff_backup/selection.py b/rdiff-backup/rdiff_backup/selection.py index 30bc68f..062ea26 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 2e0cd78..6536e0b 100644 --- a/rdiff-backup/testing/selectiontest.py +++ b/rdiff-backup/testing/selectiontest.py @@ -405,6 +405,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") -- cgit v1.2.1