Add debug message in RepositoryManager.notify when ChangesetNotFound
|Reported by:||Owned by:|
Log a message at debug level in
RepositoryManager.notify is called with an invalid changeset, the core system catches the
NoSuchChangeset error and silently ignores the error, skipping all subscribed
change_listeners without calling their methods.
(The situation can easily be reproduced by calling
trac-admin $ENV changeset added $REPO gibberish on the command line.)
There is currently no trace of this in logging output, which can cause user confusion, and makes it unclear where the problem is. A user might not immediately realize that the provided changeset was invalid, and could assume that the problem is a bug in Trac itself and/or a plugin.
Adding some debug output would address the potential user confusion:
diff --git a/trac/versioncontrol/api.py b/trac/versioncontrol/api.py index 926534c..198e8f8 100644
a b class RepositoryManager(Component): 694 694 try: 695 695 repos.sync_changeset(rev) 696 696 changeset = repos.get_changeset(rev) 697 except NoSuchChangeset: 697 except NoSuchChangeset, e: 698 self.log.debug("No changeset %s found in repository %s; skipping subscribers for event %s" % (rev, repos.reponame, event)) 698 699 continue 699 700 self.log.debug("Event %s on %s for revision %s", 700 701 event, repos.reponame or '(default)', rev)
See trac-users thread for more details.
Change History (7)
comment:5 by , 7 years ago
|Release Notes:||modified (diff)|
|Status:||assigned → closed|