Edgewall Software
Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11386 closed enhancement (fixed)

Add debug message in RepositoryManager.notify when ChangesetNotFound

Reported by: ethan.jucovy@… Owned by: ethan.jucovy@…
Priority: normal Milestone: 1.0.2
Component: version control Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Log a message at debug level in RepositoryManager.notify when changeset is not found.

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.

Attachments (0)

Change History (7)

comment:1 by Ryan J Ollos, 10 years ago

Milestone: 1.0.2
Owner: set to Ryan J Ollos
Status: newassigned

comment:2 by Ryan J Ollos, 10 years ago

Looks good! I made a minor addition, which can be found in log:rjollos.git:t11386.

comment:3 by Jun Omae, 10 years ago

It would be good to pass format and arguments to logging api, instead of formatted text.

comment:4 by Ryan J Ollos, 10 years ago

Thanks for catching that. Fixed in log:rjollos.git:t11386.2.

comment:5 by Ryan J Ollos, 10 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 1.0-stable in [12287] and merged to trunk in [12288].

comment:6 by Ryan J Ollos, 10 years ago

Owner: changed from Ryan J Ollos to ethan.jucovy@…

comment:7 by Ryan J Ollos, 10 years ago

#11775 is related to this ticket.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain ethan.jucovy@….
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from ethan.jucovy@… to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.