Repository: borgbackup/borg
Pull request: do not show archive name in error msgs referring to repository
Fixes [issue](https://github.com/borgbackup/borg/issues/6014) where the error message would display the archive when the Respository does not exist by removing the archive name from the error string when `Repository.DoesNotExist`
is raised.

Problem statement:
borg create: bad error msg when repo not found
borg 1.1.16 on debian bullseye:

```
Repository ssh://borg@backup:22/mnt/backup/server::server-home-2021-10-16T23:50:01 does not exist.
```

Guess the backup disk was not mounted at that moment, so the repo at that path was not found.

It's a bit bad though that the error message also mentions the **archive name** which it intended to create.

Of course, the full location specified on the command line for borg create included the to-be-created archive name, but it should not be shown in that error msg, but only the repo part.

Hints from issue discussion:
@ThomasWaldmann Can I work on this issue?
@sw9719 sure, just create a PR.

Commit message: Added method in Location class to remove archive name

Patch to review:
diff --git a/src/borg/archiver.py b/src/borg/archiver.py
index 60081f7615..daae7e782f 100644
--- a/src/borg/archiver.py
+++ b/src/borg/archiver.py
@@ -158,7 +158,7 @@ def wrapper(self, args, **kwargs):
             if argument(args, fake) ^ invert_fake:
                 return method(self, args, repository=None, **kwargs)
             elif location.proto == 'ssh':
-                repository = RemoteRepository(location, create=create, exclusive=argument(args, exclusive),
+                repository = RemoteRepository(location.omit_archive(), create=create, exclusive=argument(args, exclusive),
                                               lock_wait=self.lock_wait, lock=lock, append_only=append_only,
                                               make_parent_dirs=make_parent_dirs, args=args)
             else:
diff --git a/src/borg/helpers/parseformat.py b/src/borg/helpers/parseformat.py
index 96d1b31a58..942f309cf0 100644
--- a/src/borg/helpers/parseformat.py
+++ b/src/borg/helpers/parseformat.py
@@ -492,6 +492,10 @@ def with_timestamp(self, timestamp):
             'utcnow': DatetimeWrapper(timestamp),
         })
 
+    def omit_archive(self):
+        #self.orig = self.orig.split("::")[0]
+        return self
+
 
 def location_validator(archive=None, proto=None):
     def validator(text):
@@ -521,6 +525,8 @@ def validator(text):
     return validator
 
 
+
+
 class BaseFormatter:
     FIXED_KEYS = {
         # Formatting aids


Code review comments:
diff_hunk: @@ -492,6 +492,10 @@ def with_timestamp(self, timestamp):
             'utcnow': DatetimeWrapper(timestamp),
         })
 
+    def omit_archive(self):
+        #self.orig = self.orig.split("::")[0]
+        return self
path: src/borg/helpers/parseformat.py
text: @user1:
This must be something like:
```
loc = Location(...)  # create new instance
... # modify instance as needed
return loc
```