Mercurial > hgrepos > DevTools > mercurial-extensions
changeset 395:fdf77e125eb3
Prepend a "timestamps:" prefix to most timestamps related messages
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 04 Aug 2019 18:01:23 +0200 |
| parents | 0fd1473ff168 |
| children | 36eeab6e14b5 |
| files | extensions/timestamps.py |
| diffstat | 1 files changed, 24 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/extensions/timestamps.py Sun Aug 04 17:57:53 2019 +0200 +++ b/extensions/timestamps.py Sun Aug 04 18:01:23 2019 +0200 @@ -263,7 +263,7 @@ wctx = self[None] tsconfmatch = _gen_matcher_from_tsconfig(wctx) if tsconfmatch is not None: - self.ui.debug(b"TimestampedRepo.commit():" + self.ui.debug(b"timestamps: TimestampedRepo.commit():" b" handling timestamps\n") ts = _Timestamps.from_ctx(wctx, self.ui) if ts is None: @@ -343,7 +343,7 @@ auto_included)]) self.ui.note(_(b"timestamps have been collected\n")) else: - self.ui.debug(b"TimestampedRepo.commit():" + self.ui.debug(b"timestamps: TimestampedRepo.commit():" b" timestamps not activated/configured\n") return match @@ -382,7 +382,8 @@ self._tss_update_update(tsconfmatch, ts, allow_other_region=True) else: - self.ui.debug(b"update.timestamps: timestamps not activated/configured\n") + self.ui.debug(b"timestamps: updating:" + b" timestamps not activated/configured\n") def _tss_update_update(self, tsconfmatch, ts, allow_other_region=False): """:hg:`update`, :hg:`merge --abort`""" @@ -390,19 +391,20 @@ for p in self._tss_from_parents: status = self.status(p) if _DEV: - self.ui.debug(b"FROM PARENT: " + p + b" Status: " + self.ui.debug(b"timestamps: FROM PARENT: " + p + + b" Status: " + pycompat.bytestr(repr(status)) + b'\n') to_update.update(set(status.added)) to_update.update(set(status.modified)) if _DEV: - self.ui.debug("UPDATE TO_UPDATE: " + repr(to_update) - + '\n') + self.ui.debug("timestamps: UPDATE TO_UPDATE: " + + repr(to_update) + '\n') ms = _mergemod.mergestate.read(self) _debug_mergestate(self.ui, ms) if ms.active(): to_update.difference_update(set(ms.files())) if _DEV: - self.ui.debug("UPDATE TO_UPDATE w/o resolved: " + self.ui.debug("timestamps: UPDATE TO_UPDATE w/o resolved: " + repr(to_update) + '\n') _do_restore_timestamps(self, to_update, None, tsconfmatch, ts, allow_other_region=allow_other_region) @@ -418,6 +420,8 @@ This generic dispatcher hook simplifies configuration. """ + ui.debug(b"timestamps: GENERIC PRE HOOK: " + hooktype + b'\n') + ui.debug("timestamps: GENERIC PRE HOOK: " + repr(kwds) + '\n') if not repo.local(): return repo._tss_record_pre_data(hooktype, **kwds) @@ -432,8 +436,8 @@ Current implementations exist for :hg:`revert` and :hg:`resolve`. """ - ui.debug(b"POST HOOK: " + hooktype + b'\n') - ui.debug("POST HOOK: " + repr(kwds) + '\n') + ui.debug(b"timestamps: GENERIC POST HOOK: " + hooktype + b'\n') + ui.debug("timestamps: GENERIC POST HOOK: " + repr(kwds) + '\n') if not repo.local(): return @@ -474,8 +478,8 @@ """ if _DEV: - ui.debug("UPDATE: " + repr(repo) + '\n') - ui.debug("UPDATE: " + repr(kwds) + '\n') + ui.debug("timestamps: UPDATE HOOK: " + repr(repo) + '\n') + ui.debug("timestamps: UPDATE HOOK: " + repr(kwds) + '\n') # # Note: We get only the target revisions. We cannot just compute the # difference @@ -652,11 +656,11 @@ if fstatus.modified or fstatus.added or fstatus.clean: configname = TIMESTAMPS_CONFIGFILE else: - ui.debug(b"timestamps configuration file found but not" - b" tracked\n") + ui.debug(b"timestamps: timestamps configuration file found" + b" but not tracked\n") if configname is None: - ui.debug(b"no timestamps configuration file `%s' found\n" + ui.debug(b"timestamps: no timestamps configuration file `%s' found\n" % TIMESTAMPS_CONFIGFILE) return None # @@ -985,7 +989,7 @@ ts.read(fp) return ts except IOError as e: - ui.debug(b"cannot read from file: %s\n" % name) + ui.debug(b"timestamps: cannot read from file: %s\n" % name) return None @classmethod @@ -996,7 +1000,7 @@ ts.read(fp) return ts except (error.ManifestLookupError, IOError) as e: - ui.debug(b"file not found in context: %s\n" % name) + ui.debug(b"timestamps: file not found in context: %s\n" % name) return None @property @@ -1172,7 +1176,7 @@ v = tmp if hits > 1: if ui: - ui.warn(_(b"file `%s' is not unique in the timestamps database\n") % key) + ui.warn(_(b"timestamps: file `%s' is not unique in the timestamps database\n") % key) return default if v is _noobj: assert hits == 0 @@ -1235,12 +1239,12 @@ else: real_fname = visu_fname = os.path.join(destdir, f) if _DEV: - ui.debug(b"RESTORING TIMESTAMP: " + visu_fname + b' -> ' - + mtime + b'\n') + ui.debug(b"timestamps: RESTORING TIMESTAMP: " + + visu_fname + b' -> ' + mtime + b'\n') try: os.utime(real_fname, (time.time(), mt)) except IOError: - ui.warn(_(b"cannot set mtime for file: %s") % real_fname) + ui.warn(_(b"timestamps: cannot set mtime for file: %s") % real_fname) def _debug_mergestate(ui, ms):
