Edgewall Software

Opened 10 years ago

Last modified 10 years ago

#11386 closed enhancement

Add debug message in RepositoryManager.notify when ChangesetNotFound — at Initial Version

Reported by: ethan.jucovy@… Owned by:
Priority: normal Milestone: 1.0.2
Component: version control Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
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):  
    694694                    try:
    695695                        repos.sync_changeset(rev)
    696696                        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))
    698699                        continue
    699700                self.log.debug("Event %s on %s for revision %s",
    700701                               event, repos.reponame or '(default)', rev)

See trac-users thread for more details.

Change History (0)

Note: See TracTickets for help on using tickets.