changeset 210:aea0875c48e7

Amend the match function with the database file on committing
author Franz Glasner <hg@dom66.de>
date Tue, 16 Oct 2018 09:38:41 +0200
parents b078d3a02205
children 1ce805370b1e
files extensions/timestamps.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/extensions/timestamps.py	Tue Oct 16 09:32:39 2018 +0200
+++ b/extensions/timestamps.py	Tue Oct 16 09:38:41 2018 +0200
@@ -706,7 +706,15 @@
                     pass
                 else:
                     wctx.add([TIMESTAMPS_DATABASE])
-                # XXX TBD: add the database to `match`
+                # add the timestamps database to the match
+                if match.always():
+                    # already included
+                    pass
+                else:
+                    # also handles the very rare cases if match.isexact() holds
+                    match = _matchmod.unionmatcher(
+                        [match,
+                         _matchmod.exact(self.root, '', [TIMESTAMPS_DATABASE])])
             else:
                 self.ui.debug("TimestampedRepo.commit():"
                               " timestamps not activated/configured\n")