From d84f1ec616971638290fd8641b06db41befb9218 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sat, 10 Jun 2023 14:52:00 -0700 Subject: [PATCH] Add bootstrap action to NEWS and make post-PR tweaks (#697). --- NEWS | 4 ++++ borgmatic/actions/config/__init__.py | 0 borgmatic/commands/arguments.py | 4 ---- setup.py | 2 +- tests/unit/actions/test_create.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 borgmatic/actions/config/__init__.py diff --git a/NEWS b/NEWS index 87252c7b..54d6d69e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +1.7.15.dev0 + * #697: Extract borgmatic configuration from backup via "borgmatic bootstrap" action—even when + borgmatic has no configuration yet! + 1.7.14 * #484: Add a new verbosity level (-2) to disable output entirely (for console, syslog, log file, or monitoring), so not even errors are shown. diff --git a/borgmatic/actions/config/__init__.py b/borgmatic/actions/config/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/borgmatic/commands/arguments.py b/borgmatic/commands/arguments.py index 64858521..ca4c2dbc 100644 --- a/borgmatic/commands/arguments.py +++ b/borgmatic/commands/arguments.py @@ -1086,10 +1086,6 @@ def make_parsers(): ) borg_group.add_argument('-h', '--help', action='help', help='Show this help message and exit') - merged_subparsers = argparse._SubParsersAction( - None, None, metavar=None, dest='merged', parser_class=None - ) - merged_subparsers = merge_subparsers(subparsers, config_subparsers) return top_level_parser, merged_subparsers diff --git a/setup.py b/setup.py index df0718de..8fb11b1f 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import find_packages, setup -VERSION = '1.7.14' +VERSION = '1.7.15.dev0' setup( diff --git a/tests/unit/actions/test_create.py b/tests/unit/actions/test_create.py index 5846b8ad..7eeca8b2 100644 --- a/tests/unit/actions/test_create.py +++ b/tests/unit/actions/test_create.py @@ -115,7 +115,7 @@ def test_create_borgmatic_manifest_creates_manifest_file(): flexmock(module.os).should_receive('makedirs').and_return(True) flexmock(module.importlib_metadata).should_receive('version').and_return('1.0.0') - flexmock(module.json).should_receive('dump').and_return(True) + flexmock(module.json).should_receive('dump').and_return(True).once() module.create_borgmatic_manifest({}, 'test.yaml', False) @@ -136,7 +136,7 @@ def test_create_borgmatic_manifest_creates_manifest_file_with_custom_borgmatic_s __exit__=lambda *args: None, ) ) - flexmock(module.json).should_receive('dump').and_return(True) + flexmock(module.json).should_receive('dump').and_return(True).once() module.create_borgmatic_manifest( {'borgmatic_source_directory': '/borgmatic'}, 'test.yaml', False