Merge lp:~aaron-whitehouse/duplicity/bug_1620085_exclude-if-present-locked-folder into lp:~duplicity-team/duplicity/0.8-series

Proposed by Kenneth Loafman
Status: Rejected
Rejected by: Kenneth Loafman
Proposed branch: lp:~aaron-whitehouse/duplicity/bug_1620085_exclude-if-present-locked-folder
Merge into: lp:~duplicity-team/duplicity/0.8-series
Diff against target: 579 lines (+280/-114) (has conflicts)
11 files modified
CHANGELOG (+34/-14)
Changelog.GNU (+49/-26)
README (+1/-1)
README-REPO (+24/-7)
duplicity/selection.py (+18/-4)
po/duplicity.pot (+4/-0)
testing/__init__.py (+5/-1)
testing/functional/test_selection.py (+130/-49)
testing/gnupg/gpg.conf (+0/-9)
testing/test_code.py (+4/-1)
tox.ini (+11/-2)
Text conflict in CHANGELOG
Text conflict in Changelog.GNU
Text conflict in po/duplicity.pot
To merge this branch: bzr merge lp:~aaron-whitehouse/duplicity/bug_1620085_exclude-if-present-locked-folder
Reviewer Review Type Date Requested Status
Kenneth Loafman Disapprove
Review via email: mp+304924@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Aaron, there are a lot of conflicts in this merge. Would you mind pulling the latest lp:duplicity and generating the merge again?

review: Needs Fixing
Revision history for this message
Aaron Whitehouse (aaron-whitehouse) wrote :

Hi Kenneth,

Apologies for any confusion. This branch is based of the current 0.7-series branch, not lp:duplicity.

I deliberately proposed this for merging into the 0.7-series (off which it was based):
https://code.launchpad.net/~aaron-whitehouse/duplicity/bug_1620085_exclude-if-present-locked-folder/+merge/304872

It looks like you then proposed this merge into the 0.8-series which has caused the conflicts?

My intention was that once it was merged into 0.7 we could then easily merge all changes in 0.7 up into 0.8 and wrap up both this and any other improvements/fixes in the 0.7 series. Or, if you don't like that plan, I can easily make the same fixes on a branch from the 0.8 series.

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Sorry, my confusion. Going to mark as rejected and clear the books.

review: Disapprove

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CHANGELOG'
--- CHANGELOG 2016-08-22 11:11:55 +0000
+++ CHANGELOG 2016-09-05 14:30:45 +0000
@@ -1,19 +1,21 @@
1New in v0.8.00 (2016/07/??)1New in v0.7.11 (2016/09/??)
2---------------------------2---------------------------
3* Merged in lp:~aaron-whitehouse/duplicity/remove-python263* Fixed bugs #815510 and #1615480
4 - Remove Python 2.6 support references and tests.4 - Changed default --volsize to 200MB
5* Fixed bug #1600692 with patch from Wolfgang Rohdewald5* Merged in lp:~mstoll-de/duplicity/duplicity
6 - Allow symlink to have optional trailing slash during verify.6 - Backblaze announced a new domain for the b2 api
7* Merged in lp:~aaron-whitehouse/duplicity/07-fix_deja_dup_error_on_locked_files7
8 - Revert log.Error to log.Warn, as it was prior to the merge in rev 1224,8New in v0.7.10 (2016/08/20)
9 as this was affecting other applications (e.g. deja dup; Bug #1605939).9---------------------------
10* Merged in lp:~mwilck/duplicity/duplicity10* Merged in lp:~mwilck/duplicity/0.7-series
11 - Speedup of path_matches_glob() by about 8x. See11 - Speedup of path_matches_glob() by about 8x. See
12 https://code.launchpad.net/~mwilck/duplicity/duplicity/+merge/30126812 https://code.launchpad.net/~mwilck/duplicity/0.7-series/+merge/301332
13 for more details.13 for more details.
14* Remove -w from setsid in functional tests.
14* Fixed conflict in merge from Martin Wilck and applied15* Fixed conflict in merge from Martin Wilck and applied
15 - https://code.launchpad.net/~mwilck/duplicity/0.7-series/+merge/30149216 - https://code.launchpad.net/~mwilck/duplicity/0.7-series/+merge/301492
16 - merge fixes setsid usage in functional testing.17 - merge fixes setsid usage in functional testing.
18<<<<<<< TREE
17* Fixed bug #1612472 with patch from David Cuthbert19* Fixed bug #1612472 with patch from David Cuthbert
18 - Restore from S3 fails with --with-prefix-archive if prefix includes '/'20 - Restore from S3 fails with --with-prefix-archive if prefix includes '/'
19* Merged in lp:~arashad.ahamad/duplicity/duplicity_latest21* Merged in lp:~arashad.ahamad/duplicity/duplicity_latest
@@ -24,6 +26,24 @@
24 - Changed default --volsize to 200MB26 - Changed default --volsize to 200MB
25* Merged in lp:~mstoll-de/duplicity/duplicity27* Merged in lp:~mstoll-de/duplicity/duplicity
26 - Backblaze announced a new domain for the b2 api28 - Backblaze announced a new domain for the b2 api
29=======
30* Fixed bug #1612472 with patch from David Cuthbert
31 - Restore from S3 fails with --with-prefix-archive if prefix includes '/'
32* Merged in lp:~arashad.ahamad/duplicity/duplicity_latest
33 - Changes for connecting to IBM Bluemix ObjectStorage. See man page.
34* Merged in lp:~fenisilius/duplicity/acd_init_mkdir
35 - Allow duplicity to create remote folder
36
37
38New in v0.7.09 (2016/07/24)
39---------------------------
40* Fixed bug #1600692 with patch from Wolfgang Rohdewald
41 - Allow symlink to have optional trailing slash during verify.
42* Merged in lp:~aaron-whitehouse/duplicity/07-fix_deja_dup_error_on_locked_files
43 - Revert log.Error to log.Warn, as it was prior to the merge in rev 1224,
44 as this was affecting other applications (e.g. deja dup; Bug #1605939).
45* Merged in lp:~duplicity-team/duplicity/po-updates
46>>>>>>> MERGE-SOURCE
2747
2848
29New in v0.7.08 (2016/07/02)49New in v0.7.08 (2016/07/02)
@@ -81,6 +101,9 @@
81* Fixed bug #1570293 duplicity is very slow due to excessive fsync101* Fixed bug #1570293 duplicity is very slow due to excessive fsync
82 - removed flush() after write.102 - removed flush() after write.
83 - revert to previous version103 - revert to previous version
104* Merged in lp:~aaron-whitehouse/duplicity/07-fix_deja_dup_error_on_locked_files
105 - Revert log.Error to log.Warn, as it was prior to the merge in rev 1224,
106 as this was affecting other applications (e.g. deja dup; Bug #1605939).
84107
85108
86New in v0.7.07 (2016/04/10)109New in v0.7.07 (2016/04/10)
@@ -333,9 +356,6 @@
333* Merged in lp:~ed.so/duplicity/gpg.binary356* Merged in lp:~ed.so/duplicity/gpg.binary
334 - new parameter --gpg-binary allows user to point to a different gpg binary,357 - new parameter --gpg-binary allows user to point to a different gpg binary,
335 not necessarily in path358 not necessarily in path
336* Merged in lp:~ed.so/duplicity/gpg.binary
337 - new parameter --gpg-binary allows user to point to a different gpg binary,
338 not necessarily in path
339* Merged in lp:~aaron-whitehouse/duplicity/fix_POTFILES.in_and_run-tests359* Merged in lp:~aaron-whitehouse/duplicity/fix_POTFILES.in_and_run-tests
340 - Fixed two filename references in po/POTFILES.in, a mistake which crept in in360 - Fixed two filename references in po/POTFILES.in, a mistake which crept in in
341 rev 1093 and caused testing/run-tests to fail with "IndexError: list index361 rev 1093 and caused testing/run-tests to fail with "IndexError: list index
342362
=== modified file 'Changelog.GNU'
--- Changelog.GNU 2016-08-22 11:11:55 +0000
+++ Changelog.GNU 2016-09-05 14:30:45 +0000
@@ -1,22 +1,48 @@
12016-08-22 Kenneth Loafman <kenneth@loafman.com>1<<<<<<< TREE
222016-08-22 Kenneth Loafman <kenneth@loafman.com>
3 * Fixed bugs #815510 and #16154803
4 - Changed default --volsize to 200MB4 * Fixed bugs #815510 and #1615480
5 * Merged in lp:~mstoll-de/duplicity/duplicity5 - Changed default --volsize to 200MB
6 - Backblaze announced a new domain for the b2 api6 * Merged in lp:~mstoll-de/duplicity/duplicity
77 - Backblaze announced a new domain for the b2 api
82016-08-18 Kenneth Loafman <kenneth@loafman.com>8
992016-08-18 Kenneth Loafman <kenneth@loafman.com>
10 * Merged in lp:~fenisilius/duplicity/acd_init_mkdir10
11 - Allow duplicity to create remote folder11 * Merged in lp:~fenisilius/duplicity/acd_init_mkdir
1212 - Allow duplicity to create remote folder
132016-08-12 Kenneth Loafman <kenneth@loafman.com>13
14142016-08-12 Kenneth Loafman <kenneth@loafman.com>
15 * Fixed bug #1612472 with patch from David Cuthbert15
16 - Restore from S3 fails with --with-prefix-archive if prefix includes '/'16 * Fixed bug #1612472 with patch from David Cuthbert
17 * Merged in lp:~arashad.ahamad/duplicity/duplicity_latest17 - Restore from S3 fails with --with-prefix-archive if prefix includes '/'
18 - Changes for connecting to IBM Bluemix ObjectStorage. See man page.18 * Merged in lp:~arashad.ahamad/duplicity/duplicity_latest
1919 - Changes for connecting to IBM Bluemix ObjectStorage. See man page.
20
21=======
222016-08-22 Kenneth Loafman <kenneth@loafman.com>
23
24 * Fixed bugs #815510 and #1615480
25 - Changed default --volsize to 200MB
26 * Merged in lp:~mstoll-de/duplicity/duplicity
27 - Backblaze announced a new domain for the b2 api
28
292016-08-20 Kenneth Loafman <kenneth@loafman.com>
30
31 * Prep for 0.7.10
32
332016-08-18 Kenneth Loafman <kenneth@loafman.com>
34
35 * Merged in lp:~fenisilius/duplicity/acd_init_mkdir
36 - Allow duplicity to create remote folder
37
382016-08-12 Kenneth Loafman <kenneth@loafman.com>
39
40 * Fixed bug #1612472 with patch from David Cuthbert
41 - Restore from S3 fails with --with-prefix-archive if prefix includes '/'
42 * Merged in lp:~arashad.ahamad/duplicity/duplicity_latest
43 - Changes for connecting to IBM Bluemix ObjectStorage. See man page.
44
45>>>>>>> MERGE-SOURCE
202016-07-31 Kenneth Loafman <kenneth@loafman.com>462016-07-31 Kenneth Loafman <kenneth@loafman.com>
2147
22 * Fixed conflict in merge from Martin Wilck and applied48 * Fixed conflict in merge from Martin Wilck and applied
@@ -25,27 +51,24 @@
2551
262016-07-28 Kenneth Loafman <kenneth@loafman.com>522016-07-28 Kenneth Loafman <kenneth@loafman.com>
2753
28 * Merged in lp:~mwilck/duplicity/duplicity54 * Merged in lp:~mwilck/duplicity/0.7-series
29 - Speedup of path_matches_glob() by about 8x. See55 - Speedup of path_matches_glob() by about 8x. See
30 https://code.launchpad.net/~mwilck/duplicity/duplicity/+merge/30126856 https://code.launchpad.net/~mwilck/duplicity/0.7-series/+merge/301332
31 for more details.57 for more details.
58 * Remove -w from setsid in functional tests.
3259
332016-07-24 Kenneth Loafman <kenneth@loafman.com>602016-07-24 Kenneth Loafman <kenneth@loafman.com>
3461
35 * Merged in lp:~aaron-whitehouse/duplicity/07-fix_deja_dup_error_on_locked_files62 * Merged in lp:~aaron-whitehouse/duplicity/07-fix_deja_dup_error_on_locked_files
36 - Revert log.Error to log.Warn, as it was prior to the merge in rev 1224,63 - Revert log.Error to log.Warn, as it was prior to the merge in rev 1224,
37 as this was affecting other applications (e.g. deja dup; Bug #1605939).64 as this was affecting other applications (e.g. deja dup; Bug #1605939).
65 * Prep for 0.7.09
3866
392016-07-20 Kenneth Loafman <kenneth@loafman.com>672016-07-20 Kenneth Loafman <kenneth@loafman.com>
4068
41 * Fixed bug #1600692 with patch from Wolfgang Rohdewald69 * Fixed bug #1600692 with patch from Wolfgang Rohdewald
42 - Allow symlink to have optional trailing slash during verify.70 - Allow symlink to have optional trailing slash during verify.
4371
442016-07-03 Kenneth Loafman <kenneth@loafman.com>
45
46 * Merged in lp:~aaron-whitehouse/duplicity/remove-python26
47 - Remove Python 2.6 support references and tests.
48
492016-07-02 Kenneth Loafman <kenneth@loafman.com>722016-07-02 Kenneth Loafman <kenneth@loafman.com>
5073
51 * Merged in lp:~aaron-whitehouse/duplicity/PEP8_W503_fixes74 * Merged in lp:~aaron-whitehouse/duplicity/PEP8_W503_fixes
5275
=== modified file 'README'
--- README 2016-07-02 17:12:58 +0000
+++ README 2016-09-05 14:30:45 +0000
@@ -19,7 +19,7 @@
1919
20REQUIREMENTS:20REQUIREMENTS:
2121
22 * Python v2.7 or later22 * Python v2.6 or later
23 * librsync v0.9.6 or later23 * librsync v0.9.6 or later
24 * GnuPG v1.x for encryption24 * GnuPG v1.x for encryption
25 * python-lockfile v0.9 or later for concurrency locking25 * python-lockfile v0.9 or later for concurrency locking
2626
=== modified file 'README-REPO'
--- README-REPO 2016-07-02 17:12:58 +0000
+++ README-REPO 2016-09-05 14:30:45 +0000
@@ -47,18 +47,35 @@
47Please run all tests on your branch (run-tests) before proposing a merge, to47Please run all tests on your branch (run-tests) before proposing a merge, to
48ensure that all tests pass. The decorator @unittest.expectedFailure can be used48ensure that all tests pass. The decorator @unittest.expectedFailure can be used
49to commit a known-failing test case without breaking the test suite, for49to commit a known-failing test case without breaking the test suite, for
50example to exhibit the behaviour in a bug report before it has been fixed.50example to exhibit the behaviour in a bug report before it has been fixed:
51
52if sys.version_info < (2, 7):
53 import unittest2 as unittest
54else:
55 import unittest
56
57
58class TestClass(unittest.TestCase):
59 """Test class to show expectedFailure"""
60
61 @unittest.expectedFailure
62 def test_expected_failure(self):
63 """Test behaviour of expectedFailure"""
64 self.assertEqual(1, 2)
5165
52-----------------------------------------66-----------------------------------------
53Testing against multiple Python versions:67Testing against multiple Python versions:
54-----------------------------------------68-----------------------------------------
5569
56Duplicity uses tox to make it easy to test your code against multiple70Duplicity currently supports Python versions v2.6 or later. Duplicity uses tox
57environments. Running tests using the commands above will automatically test71to make it easy to test your code against multiple Python versions. Running
58code against different supported environments, including the versions of72tests using the commands above will automatically test code against both
59dependencies used by the Launchpad build system.73Python v2.6 and v2.7, if you have both installed on your system. It will also
6074test against the versions of dependencies used by the Launchpad build system.
61You can test against a single environment, e.g.75You can test against a single environment, e.g.
62tox -e py2776tox -e py26
63for example if you are working on fixing a bug, but please do a full run-tests77for example if you are working on fixing a bug, but please do a full run-tests
64before submitting a merge request.78before submitting a merge request.
79
80For instructions on installing Python v2.6 on newer versions of Ubuntu, see
81https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes
6582
=== modified file 'duplicity/selection.py'
--- duplicity/selection.py 2016-07-27 11:56:07 +0000
+++ duplicity/selection.py 2016-09-05 14:30:45 +0000
@@ -447,10 +447,24 @@
447447
448 def exclude_sel_func(path):448 def exclude_sel_func(path):
449 # do not follow symbolic links when checking for file existence!449 # do not follow symbolic links when checking for file existence!
450 if path.isdir() and path.append(filename).exists():450 if path.isdir():
451 return 0451 # First check path is read accessible
452 else:452 if not (os.access(path.name, os.R_OK)):
453 return None453 # Path is not read accessible
454 # ToDo: Ideally this error would only show if the folder
455 # was ultimately included by the full set of selection
456 # functions. Currently this will give an error for any
457 # locked directory within the folder being backed up.
458 log.Warn(_(
459 "Error accessing possibly locked file %s") % util.ufn(
460 path.name),
461 log.WarningCode.cannot_read, util.escape(path.name))
462 if diffdir.stats:
463 diffdir.stats.Errors += 1
464 elif path.append(filename).exists():
465 return 0
466 else:
467 return None
454468
455 if include == 0:469 if include == 0:
456 sel_func = exclude_sel_func470 sel_func = exclude_sel_func
457471
=== modified file 'po/duplicity.pot'
--- po/duplicity.pot 2016-08-18 16:06:51 +0000
+++ po/duplicity.pot 2016-09-05 14:30:45 +0000
@@ -8,7 +8,11 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n"10"Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n"
11<<<<<<< TREE
11"POT-Creation-Date: 2016-08-18 10:50-0500\n"12"POT-Creation-Date: 2016-08-18 10:50-0500\n"
13=======
14"POT-Creation-Date: 2016-08-20 14:02-0500\n"
15>>>>>>> MERGE-SOURCE
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"16"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"17"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"18"Language-Team: LANGUAGE <LL@li.org>\n"
1519
=== modified file 'testing/__init__.py'
--- testing/__init__.py 2016-07-02 19:39:05 +0000
+++ testing/__init__.py 2016-09-05 14:30:45 +0000
@@ -21,7 +21,11 @@
21import os21import os
22import sys22import sys
23import time23import time
24import unittest24
25if sys.version_info < (2, 7):
26 import unittest2 as unittest
27else:
28 import unittest
2529
26from duplicity import backend30from duplicity import backend
27from duplicity import globals31from duplicity import globals
2832
=== modified file 'testing/functional/test_selection.py'
--- testing/functional/test_selection.py 2015-07-31 08:22:31 +0000
+++ testing/functional/test_selection.py 2016-09-05 14:30:45 +0000
@@ -837,6 +837,57 @@
837 self.restore_and_check()837 self.restore_and_check()
838838
839839
840class TestTrailingSlash2(IncludeExcludeFunctionalTest):
841 """ This tests the behaviour of globbing strings with a trailing slash"""
842 # See Bug #1479545 (https://bugs.launchpad.net/duplicity/+bug/1479545)
843
844 def test_no_trailing_slash(self):
845 """ Test that including 1.py works as expected"""
846 self.backup("full", "testfiles/select2",
847 options=["--include", "testfiles/select2/1.py",
848 "--exclude", "**"])
849 self.restore()
850 restore_dir = 'testfiles/restore_out'
851 restored = self.directory_tree_to_list_of_lists(restore_dir)
852 self.assertEqual(restored, [['1.py']])
853
854 def test_trailing_slash(self):
855 """ Test that globs with a trailing slash only match directories"""
856 # Regression test for Bug #1479545
857 # (https://bugs.launchpad.net/duplicity/+bug/1479545)
858 self.backup("full", "testfiles/select2",
859 options=["--include", "testfiles/select2/1.py/",
860 "--exclude", "**"])
861 self.restore()
862 restore_dir = 'testfiles/restore_out'
863 restored = self.directory_tree_to_list_of_lists(restore_dir)
864 self.assertEqual(restored, [])
865
866 def test_include_files_not_subdirectories(self):
867 """ Test that a trailing slash glob followed by a * glob only matches
868 files and not subdirectories"""
869 self.backup("full", "testfiles/select2",
870 options=["--exclude", "testfiles/select2/*/",
871 "--include", "testfiles/select2/*",
872 "--exclude", "**"])
873 self.restore()
874 restore_dir = 'testfiles/restore_out'
875 restored = self.directory_tree_to_list_of_lists(restore_dir)
876 self.assertEqual(restored, [['1.doc', '1.py']])
877
878 def test_include_subdirectories_not_files(self):
879 """ Test that a trailing slash glob only matches directories"""
880 self.backup("full", "testfiles/select2",
881 options=["--include", "testfiles/select2/1/1sub1/**/",
882 "--exclude", "testfiles/select2/1/1sub1/**",
883 "--exclude", "**"])
884 self.restore()
885 restore_dir = 'testfiles/restore_out'
886 restored = self.directory_tree_to_list_of_lists(restore_dir)
887 self.assertEqual(restored, [['1'], ['1sub1'],
888 ['1sub1sub1', '1sub1sub2', '1sub1sub3']])
889
890
840class TestGlobbingReplacement(IncludeExcludeFunctionalTest):891class TestGlobbingReplacement(IncludeExcludeFunctionalTest):
841 """ This tests the behaviour of the extended shell globbing pattern replacement functions."""892 """ This tests the behaviour of the extended shell globbing pattern replacement functions."""
842 # See the manual for a description of behaviours, but in summary:893 # See the manual for a description of behaviours, but in summary:
@@ -875,55 +926,85 @@
875 self.assertEqual(restored, self.expected_restored_tree)926 self.assertEqual(restored, self.expected_restored_tree)
876927
877928
878class TestTrailingSlash(IncludeExcludeFunctionalTest):929class TestExcludeIfPresent(IncludeExcludeFunctionalTest):
879 """ This tests the behaviour of globbing strings with a trailing slash"""930 """ This tests the behaviour of duplicity's --exclude-if-present option"""
880 # See Bug #1479545 (https://bugs.launchpad.net/duplicity/+bug/1479545)931
881932 def test_exclude_if_present_baseline(self):
882 def test_no_trailing_slash(self):933 """ Test that duplicity normally backs up files"""
883 """ Test that including 1.py works as expected"""934 with open("testfiles/select2/1/1sub1/1sub1sub1/.nobackup", "w") as tag:
884 self.backup("full", "testfiles/select2",935 tag.write("Files in this folder should not be backed up.")
885 options=["--include", "testfiles/select2/1.py",936 self.backup("full", "testfiles/select2/1/1sub1",
886 "--exclude", "**"])937 options=["--include", "testfiles/select2/1/1sub1/1sub1sub1/*",
887 self.restore()938 "--exclude", "**"])
888 restore_dir = 'testfiles/restore_out'939 self.restore()
889 restored = self.directory_tree_to_list_of_lists(restore_dir)940 restore_dir = 'testfiles/restore_out'
890 self.assertEqual(restored, [['1.py']])941 restored = self.directory_tree_to_list_of_lists(restore_dir)
891942 self.assertEqual(restored, [['1sub1sub1'],
892 def test_trailing_slash(self):943 ['.nobackup', '1sub1sub1_file.txt']])
893 """ Test that globs with a trailing slash only match directories"""944
894 # ToDo: Bug #1479545945 def test_exclude_if_present_excludes(self):
895 # (https://bugs.launchpad.net/duplicity/+bug/1479545)946 """ Test that duplicity excludes files with relevant tag"""
896 self.backup("full", "testfiles/select2",947 with open("testfiles/select2/1/1sub1/1sub1sub1/.nobackup", "w") as tag:
897 options=["--include", "testfiles/select2/1.py/",948 tag.write("Files in this folder should not be backed up.")
898 "--exclude", "**"])949 self.backup("full", "testfiles/select2/1/1sub1",
899 self.restore()950 options=["--exclude-if-present", ".nobackup",
900 restore_dir = 'testfiles/restore_out'951 "--include", "testfiles/select2/1/1sub1/1sub1sub1/*",
901 restored = self.directory_tree_to_list_of_lists(restore_dir)952 "--exclude", "**"])
902 self.assertEqual(restored, [])953 self.restore()
903954 restore_dir = 'testfiles/restore_out'
904 def test_include_files_not_subdirectories(self):955 restored = self.directory_tree_to_list_of_lists(restore_dir)
905 """ Test that a trailing slash glob followed by a * glob only matches956 self.assertEqual(restored, [])
906 files and not subdirectories"""957
907 self.backup("full", "testfiles/select2",958 def test_exclude_if_present_excludes_2(self):
908 options=["--exclude", "testfiles/select2/*/",959 """ Test that duplicity excludes files with relevant tag"""
909 "--include", "testfiles/select2/*",960 with open("testfiles/select2/1/1sub1/1sub1sub1/EXCLUDE.tag", "w") as tag:
910 "--exclude", "**"])961 tag.write("Files in this folder should also not be backed up.")
911 self.restore()962 self.backup("full", "testfiles/select2/1/1sub1",
912 restore_dir = 'testfiles/restore_out'963 options=["--exclude-if-present", "EXCLUDE.tag",
913 restored = self.directory_tree_to_list_of_lists(restore_dir)964 "--include", "testfiles/select2/1/1sub1/1sub1sub1/*",
914 self.assertEqual(restored, [['1.doc', '1.py']])965 "--exclude", "**"])
915966 self.restore()
916 def test_include_subdirectories_not_files(self):967 restore_dir = 'testfiles/restore_out'
917 """ Test that a trailing slash glob only matches directories"""968 restored = self.directory_tree_to_list_of_lists(restore_dir)
918 self.backup("full", "testfiles/select2",969 self.assertEqual(restored, [])
919 options=["--include", "testfiles/select2/1/1sub1/**/",970
920 "--exclude", "testfiles/select2/1/1sub1/**",971
921 "--exclude", "**"])972class TestLockedFoldersNoError(IncludeExcludeFunctionalTest):
922 self.restore()973 """ This tests that inaccessible folders do not cause an error"""
923 restore_dir = 'testfiles/restore_out'974
924 restored = self.directory_tree_to_list_of_lists(restore_dir)975 def test_locked_baseline(self):
925 self.assertEqual(restored, [['1'], ['1sub1'],976 """ Test no error if locked in path but excluded"""
926 ['1sub1sub1', '1sub1sub2', '1sub1sub3']])977 folder_to_lock = "testfiles/select2/1/1sub1/1sub1sub3"
978 initial_mode = os.stat(folder_to_lock).st_mode
979 os.chmod(folder_to_lock, 0o0000)
980 self.backup("full", "testfiles/select2/1/1sub1",
981 options=["--include", "testfiles/select2/1/1sub1/1sub1sub1/*",
982 "--exclude", "**"])
983 os.chmod(folder_to_lock, initial_mode)
984 self.restore()
985 restore_dir = 'testfiles/restore_out'
986 restored = self.directory_tree_to_list_of_lists(restore_dir)
987 self.assertEqual(restored, [['1sub1sub1'],
988 ['1sub1sub1_file.txt']])
989
990 def test_locked_excl_if_present(self):
991 """ Test no error if excluded locked with --exclude-if-present"""
992 # Regression test for Bug #1620085
993 # https://bugs.launchpad.net/duplicity/+bug/1620085
994 folder_to_lock = "testfiles/select2/1/1sub1/1sub1sub3"
995 initial_mode = os.stat(folder_to_lock).st_mode
996 os.chmod(folder_to_lock, 0o0000)
997 self.backup("full", "testfiles/select2/1/1sub1",
998 options=["--exclude-if-present", "EXCLUDE.tag",
999 "--include", "testfiles/select2/1/1sub1/1sub1sub1/*",
1000 "--exclude", "**"])
1001 os.chmod(folder_to_lock, initial_mode)
1002 self.restore()
1003 restore_dir = 'testfiles/restore_out'
1004 restored = self.directory_tree_to_list_of_lists(restore_dir)
1005 self.assertEqual(restored, [['1sub1sub1'],
1006 ['1sub1sub1_file.txt']])
1007
9271008
928if __name__ == "__main__":1009if __name__ == "__main__":
929 unittest.main()1010 unittest.main()
9301011
=== added file 'testing/gnupg/gpg.conf'
--- testing/gnupg/gpg.conf 1970-01-01 00:00:00 +0000
+++ testing/gnupg/gpg.conf 2016-09-05 14:30:45 +0000
@@ -0,0 +1,9 @@
1# gpg2 doesn't try all secrets by default, so add this option
2# Otherwise the tests with hidden encryption key will fail
3try-all-secrets
4
5# gpg2 2.1.13 has a bug that prevents the line above from working
6# (https://bugs.gnupg.org/gnupg/issue1985)
7# Uncomment the line below if you have gnupg2 2.1.13
8# (but that line will break gpg 1.x, so we can't use it by default)
9#try-secret-key 96B629431B77DC52B1917B40839E6A2856538CCF
010
=== removed file 'testing/gnupg/gpg.conf'
--- testing/gnupg/gpg.conf 2016-08-01 14:57:22 +0000
+++ testing/gnupg/gpg.conf 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
1# gpg2 doesn't try all secrets by default, so add this option
2# Otherwise the tests with hidden encryption key will fail
3try-all-secrets
4
5# gpg2 2.1.13 has a bug that prevents the line above from working
6# (https://bugs.gnupg.org/gnupg/issue1985)
7# Uncomment the line below if you have gnupg2 2.1.13
8# (but that line will break gpg 1.x, so we can't use it by default)
9#try-secret-key 96B629431B77DC52B1917B40839E6A2856538CCF
100
=== modified file 'testing/test_code.py'
--- testing/test_code.py 2016-07-02 19:39:05 +0000
+++ testing/test_code.py 2016-09-05 14:30:45 +0000
@@ -22,7 +22,10 @@
22import sys22import sys
23import subprocess23import subprocess
2424
25import unittest25if sys.version_info < (2, 7):
26 import unittest2 as unittest # @UnresolvedImport @UnusedImport
27else:
28 import unittest # @Reimport
2629
27from . import _top_dir, DuplicityTestCase # @IgnorePep830from . import _top_dir, DuplicityTestCase # @IgnorePep8
2831
2932
=== modified file 'tox.ini'
--- tox.ini 2016-07-02 19:33:34 +0000
+++ tox.ini 2016-09-05 14:30:45 +0000
@@ -1,5 +1,14 @@
1[tox]1[tox]
2envlist=py27,lpbuildd-precise2envlist=py26,py27,lpbuildd-precise
3
4[testenv:py26]
5setenv=
6 RUN_CODE_TESTS=0
7deps=
8 mock==0.7.2
9 pexpect==2.4
10 ptyprocess==0.4
11 unittest2
312
4[testenv:py27]13[testenv:py27]
5setenv=14setenv=
@@ -20,5 +29,5 @@
20 {envpython} {toxinidir}/setup.py test {posargs}29 {envpython} {toxinidir}/setup.py test {posargs}
2130
22[pep8]31[pep8]
23ignore=E402,E73132ignore=E402,E501,E731,W503
24max-line-length=12033max-line-length=120

Subscribers

People subscribed via source and target branches