changeset 202:a6326c9c7edb

Check activation status first when trying to commit
author Franz Glasner <hg@dom66.de>
date Sun, 14 Oct 2018 13:22:38 +0200
parents 8e0a12929be9
children 956a7fd70319
files extensions/timestamps.py
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/extensions/timestamps.py	Sat Oct 06 20:38:02 2018 +0200
+++ b/extensions/timestamps.py	Sun Oct 14 13:22:38 2018 +0200
@@ -649,11 +649,18 @@
 
         def commit(self, text="", user=None, date=None, match=None,
                    force=False, editor=False, extra=None, *args, **kwargs):
-            self.ui.debug("TimestampedRepo.commit()\n")
-            #
-            # match: "hg ci" -> alwaysmatcher
-            #        "hg ci file1 ... -> patternmatcher with the files
-            #
+            wctx = self[None]
+            tsmatch = gen_matcher(self, wctx)
+            if tsmatch is not None:
+                self.ui.debug("TimestampedRepo.commit():"
+                              " handling timestamps\n")
+                #
+                # match: "hg ci" -> alwaysmatcher
+                #        "hg ci file1 ... -> patternmatcher with the files
+                #
+            else:
+                self.ui.debug("TimestampedRepo.commit():"
+                              "timestamps not activated\n")
             super(TimestampedRepo, self).commit(
                 *args,
                 text=text, user=user, date=date, match=match, force=force,