Repository: borgbackup/borg

Issue:
Fix the Quick Start regarding --prefix
--prefix was deprecated (#6806) but the quickstart-guide still uses the --prefix -option (https://borgbackup.readthedocs.io/en/stable/quickstart.html)


Discussion:
I am student of BITS Pilani, India. Please, assign me this issue.
@protocolog thanks for helping!
Hi, First of all thanks for assigning me and I am new in web handling but I have little experience in Django and flask. Can you tell me how can I run the quickstart.html on my local machine to check my updates? I have gone through quickstart.rst I understand the issue. @ThomasWaldmann 
https://borgbackup.readthedocs.io/en/stable/development.html#documentation did you read this already?
Hi, I am trying to build html version using sphinx, But I am getting error in make command. I have installed the sphinx properly and still it is giving me borg._version module error. Please help me here.
@ThomasWaldmann 
you need to install sphinx and also borg. usually, as a developer, one installs both into the active venv, see our install and development docs.
In src/borg __init__.py you have imported _version but you don't have that file in the directory, Which is why getting error while making the HTML file. Please help me here. I have created the VEnv in pycharm(Linux). I tried to update the module but still giving error. I have gone through documentation and installed requirements.
@ThomasWaldmann 
as i said, you need to **install** borg (the `_version` module will then be auto-created by `setuptools_scm`), like `pip install -e .` .
Can you provide community channel link on slack?
I don't use slack for borgbackup, but you can use the issue tracker and discussions on github, the mailing list or the irc channel, see our homepage / docs for details.
Any progress here?

Resolving patch:
diff --git a/src/borg/archiver.py b/src/borg/archiver.py
--- a/src/borg/archiver.py
+++ b/src/borg/archiver.py
@@ -327,7 +327,7 @@ def do_check(self, args, repository):
                 return EXIT_ERROR
         if args.repo_only and any(
            (args.verify_data, args.first, args.last, args.prefix is not None, args.glob_archives)):
-            self.print_error("--repository-only contradicts --first, --last, --prefix and --verify-data arguments.")
+            self.print_error("--repository-only contradicts --first, --last, --glob-archives, --prefix and --verify-data arguments.")
             return EXIT_ERROR
         if args.repair and args.max_duration:
             self.print_error("--repair does not allow --max-duration argument.")
@@ -2556,7 +2556,7 @@ def do_break_lock(self, args, repository):
 
             borg create /path/to/repo::{hostname}-{user}-{utcnow} ...
             borg create /path/to/repo::{hostname}-{now:%Y-%m-%d_%H:%M:%S} ...
-            borg prune --prefix '{hostname}-' ...
+            borg prune --glob-archives '{hostname}-*' ...
 
         .. note::
             systemd uses a difficult, non-standard syntax for command lines in unit files (refer to
@@ -2948,12 +2948,11 @@ def define_archive_filters_group(subparser, *, sort_by=True, first_last=True):
                                                          'Archive filters can be applied to repository targets.')
             group = filters_group.add_mutually_exclusive_group()
             group.add_argument('-P', '--prefix', metavar='PREFIX', dest='prefix', type=PrefixSpec, action=Highlander,
-                               help='only consider archive names starting with this prefix.')
+                               help='only consider archive names starting with this prefix. (deprecated)')
             group.add_argument('-a', '--glob-archives', metavar='GLOB', dest='glob_archives',
                                type=GlobSpec, action=Highlander,
                                help='only consider archive names matching the glob. '
-                                    'sh: rules apply, see "borg help patterns". '
-                                    '``--prefix`` and ``--glob-archives`` are mutually exclusive.')
+                                    'sh: rules apply, see "borg help patterns".')
 
             if sort_by:
                 sort_by_default = 'timestamp'
@@ -3837,11 +3836,9 @@ def define_borg_mount(parser):
         that is how much your repository will shrink.
         Please note that the "All archives" stats refer to the state after deletion.
 
-        You can delete multiple archives by specifying their common prefix, if they
-        have one, using the ``--prefix PREFIX`` option. You can also specify a shell
-        pattern to match multiple archives using the ``--glob-archives GLOB`` option
-        (for more info on these patterns, see :ref:`borg_patterns`). Note that these
-        two options are mutually exclusive.
+        You can delete multiple archives by specifying a shell pattern to match
+        multiple archives using the ``--glob-archives GLOB`` option (for more info on
+        these patterns, see :ref:`borg_patterns`).
 
         To avoid accidentally deleting archives, especially when using glob patterns,
         it might be helpful to use the ``--dry-run`` to test out the command without
diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py
--- a/src/borg/testsuite/archiver.py
+++ b/src/borg/testsuite/archiver.py
@@ -1575,7 +1575,7 @@ def test_delete(self):
         self.cmd('create', self.repository_location + '::another_test.2', 'input')
         self.cmd('extract', '--dry-run', self.repository_location + '::test')
         self.cmd('extract', '--dry-run', self.repository_location + '::test.2')
-        self.cmd('delete', '--prefix', 'another_', self.repository_location)
+        self.cmd('delete', '--glob-archives', 'another_*', self.repository_location)
         self.cmd('delete', '--last', '1', self.repository_location)
         self.cmd('delete', self.repository_location + '::test')
         self.cmd('extract', '--dry-run', self.repository_location + '::test.2')
@@ -2259,12 +2259,12 @@ def test_prune_repository_glob(self):
         self.assert_in('2015-08-12-10:00-bar', output)
         self.assert_in('2015-08-12-20:00-bar', output)
 
-    def test_list_prefix(self):
+    def test_list_glob(self):
         self.cmd('init', '--encryption=repokey', self.repository_location)
         self.cmd('create', self.repository_location + '::test-1', src_dir)
         self.cmd('create', self.repository_location + '::something-else-than-test-1', src_dir)
         self.cmd('create', self.repository_location + '::test-2', src_dir)
-        output = self.cmd('list', '--prefix=test-', self.repository_location)
+        output = self.cmd('list', '--glob-archives=test-*', self.repository_location)
         self.assert_in('test-1', output)
         self.assert_in('test-2', output)
         self.assert_not_in('something-else', output)
@@ -2672,13 +2672,13 @@ def test_fuse_mount_options(self):
             assert sorted(os.listdir(os.path.join(mountpoint))) == ['arch11', 'arch12']
         with self.fuse_mount(self.repository_location, mountpoint, '--last=2', '--sort=name'):
             assert sorted(os.listdir(os.path.join(mountpoint))) == ['arch21', 'arch22']
-        with self.fuse_mount(self.repository_location, mountpoint, '--prefix=arch1'):
+        with self.fuse_mount(self.repository_location, mountpoint, '--glob-archives=arch1*'):
             assert sorted(os.listdir(os.path.join(mountpoint))) == ['arch11', 'arch12']
-        with self.fuse_mount(self.repository_location, mountpoint, '--prefix=arch2'):
+        with self.fuse_mount(self.repository_location, mountpoint, '--glob-archives=arch2*'):
             assert sorted(os.listdir(os.path.join(mountpoint))) == ['arch21', 'arch22']
-        with self.fuse_mount(self.repository_location, mountpoint, '--prefix=arch'):
+        with self.fuse_mount(self.repository_location, mountpoint, '--glob-archives=arch*'):
             assert sorted(os.listdir(os.path.join(mountpoint))) == ['arch11', 'arch12', 'arch21', 'arch22']
-        with self.fuse_mount(self.repository_location, mountpoint, '--prefix=nope'):
+        with self.fuse_mount(self.repository_location, mountpoint, '--glob-archives=nope*'):
             assert sorted(os.listdir(os.path.join(mountpoint))) == []
 
     @unittest.skipUnless(llfuse, 'llfuse not installed')
@@ -3650,7 +3650,7 @@ def test_check_usage(self):
         output = self.cmd('check', '-v', '--archives-only', self.repository_location, exit_code=0)
         self.assert_not_in('Starting repository check', output)
         self.assert_in('Starting archive consistency check', output)
-        output = self.cmd('check', '-v', '--archives-only', '--prefix=archive2', self.repository_location, exit_code=0)
+        output = self.cmd('check', '-v', '--archives-only', '--glob-archives=archive2', self.repository_location, exit_code=0)
         self.assert_not_in('archive1', output)
         output = self.cmd('check', '-v', '--archives-only', '--first=1', self.repository_location, exit_code=0)
         self.assert_in('archive1', output)


Test patch: