#11386 closed enhancement (fixed)
Add debug message in RepositoryManager.notify when ChangesetNotFound
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | version control | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Log a message at debug level in |
||
API Changes: | |||
Internal Changes: |
Description
If 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:
-
trac/versioncontrol/api.py
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.
Attachments (0)
Change History (7)
comment:1 by , 11 years ago
Milestone: | → 1.0.2 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:2 by , 11 years ago
comment:3 by , 11 years ago
It would be good to pass format and arguments to logging api, instead of formatted text.
comment:5 by , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:6 by , 11 years ago
Owner: | changed from | to
---|
Looks good! I made a minor addition, which can be found in log:rjollos.git:t11386.