From 6335d593ab9ec48d3e7c13933316194d745a516b Mon Sep 17 00:00:00 2001 From: Marian Beermann Date: Mon, 15 May 2017 23:38:17 +0200 Subject: [PATCH] Revert "Merge pull request #2231 from leo-b/1.0-maint-patterns" This reverts commit 9a5bc514b3cbc0d810d3ed0c304cff20fc94ce18, reversing changes made to 8b5ad3819cfd319ed0af2139de5ee681f4cdb4ad. --- borg/helpers.py | 2 +- borg/testsuite/archiver.py | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/borg/helpers.py b/borg/helpers.py index fc0ae09cb..9f0d09329 100644 --- a/borg/helpers.py +++ b/borg/helpers.py @@ -386,7 +386,7 @@ class ArgparsePatternFileAction(argparse.Action): self.parse(f, args) def parse(self, fobj, args): - load_pattern_file(fobj, args.paths, args.patterns) + load_pattern_file(fobj, args.roots, args.patterns) class ArgparseExcludeFileAction(ArgparsePatternFileAction): diff --git a/borg/testsuite/archiver.py b/borg/testsuite/archiver.py index 9e92c0716..82ccc4310 100644 --- a/borg/testsuite/archiver.py +++ b/borg/testsuite/archiver.py @@ -214,7 +214,6 @@ class ArchiverTestCaseBase(BaseTestCase): self.keys_path = os.path.join(self.tmpdir, 'keys') self.cache_path = os.path.join(self.tmpdir, 'cache') self.exclude_file_path = os.path.join(self.tmpdir, 'excludes') - self.patterns_file_path = os.path.join(self.tmpdir, 'patterns') os.environ['BORG_KEYS_DIR'] = self.keys_path os.environ['BORG_CACHE_DIR'] = self.cache_path os.mkdir(self.input_path) @@ -224,8 +223,6 @@ class ArchiverTestCaseBase(BaseTestCase): os.mkdir(self.cache_path) with open(self.exclude_file_path, 'wb') as fd: fd.write(b'input/file2\n# A comment line, then a blank line\n\n') - with open(self.patterns_file_path, 'wb') as fd: - fd.write(b'+input/file_important\n- input/file*\n# A comment line, then a blank line\n\n') self._old_wd = os.getcwd() os.chdir(self.tmpdir) @@ -679,23 +676,9 @@ class ArchiverTestCase(ArchiverTestCaseBase): '--pattern=+input/file_important', '--pattern=-input/file*', self.repository_location + '::test', 'input') self.assert_in("A input/file_important", output) - self.assert_not_in('file1', output) - self.assert_not_in('file2', output) - - def test_create_pattern_file(self): - """test file patterns during create""" - self.cmd('init', self.repository_location) - self.create_regular_file('file1', size=1024 * 80) - self.create_regular_file('file2', size=1024 * 80) - self.create_regular_file('otherfile', size=1024 * 80) - self.create_regular_file('file_important', size=1024 * 80) - output = self.cmd('create', '-v', '--list', - '--pattern=-input/otherfile', '--patterns-from=' + self.patterns_file_path, - self.repository_location + '::test', 'input') self.assert_in("A input/file_important", output) self.assert_not_in('file1', output) self.assert_not_in('file2', output) - self.assert_not_in('otherfile', output) def test_extract_pattern_opt(self): self.cmd('init', self.repository_location)