Repository: borgbackup/borg

Issue:
fix --newer/older/newest/oldest options / support code
master branch only:

as `define_archive_filters_group` defaults to adding these options, **all** commands calling this now suddenly "support" these options, according to their help.

but they do not really support these options, because the appropriate code is not there:
- `list_considering` does not yet support them
- check other places



Discussion:
@Michael-Girma ^ found this issue after merging.
I did make changes to ```list_considering``` should those be removed?
I think you only changed `.list`, but not `.list_considering`.
btw, update your local master branch first from borg master.

Resolving patch:
diff --git a/src/borg/manifest.py b/src/borg/manifest.py
--- a/src/borg/manifest.py
+++ b/src/borg/manifest.py
@@ -164,8 +164,12 @@ def list_considering(self, args):
             sort_by=args.sort_by.split(","),
             consider_checkpoints=consider_checkpoints,
             match=args.match_archives,
-            first=args.first,
-            last=args.last,
+            first=getattr(args, "first", None),
+            last=getattr(args, "last", None),
+            older=getattr(args, "older", None),
+            newer=getattr(args, "newer", None),
+            oldest=getattr(args, "oldest", None),
+            newest=getattr(args, "newest", None),
         )
 
     def set_raw_dict(self, d):
diff --git a/src/borg/testsuite/archiver/rlist_cmd.py b/src/borg/testsuite/archiver/rlist_cmd.py
--- a/src/borg/testsuite/archiver/rlist_cmd.py
+++ b/src/borg/testsuite/archiver/rlist_cmd.py
@@ -40,6 +40,32 @@ def test_archives_format(self):
         self.assert_in("test-1 comment 1" + os.linesep, output_3)
         self.assert_in("test-2 comment 2" + os.linesep, output_3)
 
+    def test_date_matching(self):
+        self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION)
+        earliest_ts = "2022-11-20T23:59:59"
+        ts_in_between = "2022-12-18T23:59:59"
+        self.create_src_archive("archive1", ts=earliest_ts)
+        self.create_src_archive("archive2", ts=ts_in_between)
+        self.create_src_archive("archive3")
+        output = self.cmd(f"--repo={self.repository_location}", "rlist", "-v", "--oldest=23e", exit_code=2)
+        output = self.cmd(f"--repo={self.repository_location}", "rlist", "-v", "--oldest=1m", exit_code=0)
+        self.assert_in("archive1", output)
+        self.assert_in("archive2", output)
+        self.assert_not_in("archive3", output)
+
+        output = self.cmd(f"--repo={self.repository_location}", "rlist", "-v", "--newest=1m", exit_code=0)
+        self.assert_in("archive3", output)
+        self.assert_not_in("archive2", output)
+        self.assert_not_in("archive1", output)
+        output = self.cmd(f"--repo={self.repository_location}", "rlist", "-v", "--newer=1d", exit_code=0)
+        self.assert_in("archive3", output)
+        self.assert_not_in("archive1", output)
+        self.assert_not_in("archive2", output)
+        output = self.cmd(f"--repo={self.repository_location}", "rlist", "-v", "--older=1d", exit_code=0)
+        self.assert_in("archive1", output)
+        self.assert_in("archive2", output)
+        self.assert_not_in("archive3", output)
+
     def test_rlist_consider_checkpoints(self):
         self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION)
         self.cmd(f"--repo={self.repository_location}", "create", "test1", src_dir)


Test patch: