[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Rdiff-backup-commits] rdiff-backup ./CHANGELOG rdiff_backup/selection..
From: |
Ben Escoto |
Subject: |
[Rdiff-backup-commits] rdiff-backup ./CHANGELOG rdiff_backup/selection... |
Date: |
Tue, 10 Jan 2006 04:56:44 +0000 |
CVSROOT: /sources/rdiff-backup
Module name: rdiff-backup
Branch:
Changes by: Ben Escoto <address@hidden> 06/01/10 04:56:44
Modified files:
. : CHANGELOG
rdiff_backup : selection.py
testing : selectiontest.py
Log message:
Fix for Toni Price's empty dir --include **XXX selection bug
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/rdiff-backup/CHANGELOG.diff?tr1=1.177&tr2=1.178&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/rdiff-backup/rdiff_backup/selection.py.diff?tr1=1.41&tr2=1.42&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/rdiff-backup/testing/selectiontest.py.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
Patches:
Index: rdiff-backup/CHANGELOG
diff -u rdiff-backup/CHANGELOG:1.177 rdiff-backup/CHANGELOG:1.178
--- rdiff-backup/CHANGELOG:1.177 Sun Jan 1 02:36:19 2006
+++ rdiff-backup/CHANGELOG Tue Jan 10 04:56:44 2006
@@ -1,3 +1,11 @@
+New in v1.1.6 (????/??/??)
+--------------------------
+
+Selection fix: empty directories could sometimes be improperly
+excluded if certain include expressions involving a non-trailing '**'
+were used. Bug reported by Toni Price.
+
+
New in v1.1.5 (2006/01/01)
--------------------------
Index: rdiff-backup/rdiff_backup/selection.py
diff -u rdiff-backup/rdiff_backup/selection.py:1.41
rdiff-backup/rdiff_backup/selection.py:1.42
--- rdiff-backup/rdiff_backup/selection.py:1.41 Tue Aug 9 05:35:47 2005
+++ rdiff-backup/rdiff_backup/selection.py Tue Jan 10 04:56:44 2006
@@ -209,10 +209,12 @@
def Select(self, rp):
"""Run through the selection functions and return dominant val
0/1/2"""
+ scanned = 0 # 0, by default, or 2 if prev sel func scanned rp
for sf in self.selection_functions:
result = sf(rp)
- if result == 1 or result == 0 or (result == 2 and
rp.isdir()):
- return result
+ if result == 1: return 1
+ elif result == 0: return scanned
+ elif result == 2: scanned = 2
return 1
def ParseArgs(self, argtuples, filelists):
Index: rdiff-backup/testing/selectiontest.py
diff -u rdiff-backup/testing/selectiontest.py:1.15
rdiff-backup/testing/selectiontest.py:1.16
--- rdiff-backup/testing/selectiontest.py:1.15 Tue Aug 9 05:35:47 2005
+++ rdiff-backup/testing/selectiontest.py Tue Jan 10 04:56:44 2006
@@ -448,4 +448,27 @@
# verbose = 1)
+class CommandTest(unittest.TestCase):
+ """Test rdiff-backup on actual directories"""
+ def testEmptyDirInclude(self):
+ """Make sure empty directories are included with **xx exps
+
+ This checks for a bug present in 1.0.3/1.1.5 and similar.
+
+ """
+ outrp = MakeOutputDir()
+ selrp = rpath.RPath(Globals.local_connection,
'testfiles/seltest')
+ re_init_dir(selrp)
+ emptydir = selrp.append('emptydir')
+ emptydir.mkdir()
+
+ rdiff_backup(1, 1, selrp.path, outrp.path,
+ extra_options = ("--include **XX "
+
"--exclude testfiles/seltest/YYYY"))
+
+ outempty = outrp.append('emptydir')
+ assert outempty.isdir(), outempty
+
+
+
if __name__ == "__main__": unittest.main()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Rdiff-backup-commits] rdiff-backup ./CHANGELOG rdiff_backup/selection...,
Ben Escoto <=