Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

#7003 closed defect (fixed)

No such changeset error after a login attempt

Reported by: dkt Owned by: Christian Boos
Priority: high Milestone: not applicable
Component: plugin/mercurial Version:
Severity: normal Keywords:
Cc: remy.blank@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I'm using a multirepo branch of Trac and Mercurial plugin 0.12.

I get the following error when I try to login:

No changeset None in the repository

I read the file log but I have no clue what's wrong.

2008-03-13 17:50:34,392 Trac[loader] DEBUG: Loading hg from /var/trac/qutecom/plugins/TracMercurial-0.12.0.1-py2.5.egg
2008-03-13 17:50:34,395 Trac[default_workflow] DEBUG: Workflow actions at initialization: {'resolve': {'operations': [u'set_resolution'], 'name': 'resolve', 'default': 
0, 'newstate': u'closed', 'oldstates': [u'new', u'assigned', u'accepted', u'reopened'], 'permissions': [u'TICKET_MODIFY']}, 'accept': {'operations': [u'set_owner_to_sel
f'], 'name': 'accept', 'default': 0, 'newstate': u'accepted', 'oldstates': [u'new', u'assigned', u'accepted', u'reopened'], 'permissions': [u'TICKET_MODIFY']}, 'leave':
 {'operations': [u'leave_status'], 'name': 'leave', 'default': 1, 'newstate': u'*', 'oldstates': [u'*'], 'permissions': []}, 'reopen': {'operations': [u'del_resolution'
], 'name': 'reopen', 'default': 0, 'newstate': u'reopened', 'oldstates': [u'closed'], 'permissions': [u'TICKET_CREATE']}, 'reassign': {'operations': [u'set_owner'], 'na
me': 'reassign', 'default': 0, 'newstate': u'assigned', 'oldstates': [u'new', u'assigned', u'accepted', u'reopened'], 'permissions': [u'TICKET_MODIFY']}, '_reset': {'op
erations': ['reset_workflow'], 'name': 'reset', 'default': 0, 'newstate': 'new', 'oldstates': [], 'permissions': []}}

2008-03-13 17:50:34,397 Trac[env] WARNING: base_url option not set in configuration, generated links may be incorrect
2008-03-13 17:50:34,397 Trac[main] DEBUG: Dispatching <Request "GET u'/login'">
2008-03-13 17:50:34,405 Trac[svn_fs] DEBUG: Subversion bindings imported
2008-03-13 17:50:34,421 Trac[main] WARNING: 404 No such changeset (No changeset None in the repository)

Attachments (3)

hg.patch (430 bytes ) - added by dkt 16 years ago.
Patch of the log module
hg.2.patch (430 bytes ) - added by dkt 16 years ago.
Patch of mercurial plugin (previous comment attached file is wrong)
log.patch (794 bytes ) - added by dkt 16 years ago.
Patch of the log module

Download all attachments as: .zip

Change History (11)

comment:1 by Christian Boos, 16 years ago

Component: generalplugin/mercurial
Milestone: 0.11not applicable
Owner: changed from Jonas Borgström to Christian Boos
Priority: normalhigh

I have that as well, must be a str(rev) with rev==None somewhere.

by dkt, 16 years ago

Attachment: hg.patch added

Patch of the log module

by dkt, 16 years ago

Attachment: hg.2.patch added

Patch of mercurial plugin (previous comment attached file is wrong)

by dkt, 16 years ago

Attachment: log.patch added

Patch of the log module

comment:2 by dkt, 16 years ago

I've put in attachment some patches which correct bug. As expected, bug came from a rev!=None with rev in string format. I had another bug with multirepo branch during request matching. When a login request is done (/login), the logModule matches and authentication is messed up. The attached patch redefines the matching pattern.

comment:3 by anonymous, 16 years ago

tested and works even with TracAccountManager 0.2dev-r3111

comment:4 by anonymous, 16 years ago

Thanks, this worked for me too. Without these patches, I could not log in at all, making Trac not very useful.

comment:5 by Christian Boos, 16 years ago

reworked log.patch committed as [6850].

For the original problem (was it even related?), I'd prefer to fix the fact that rev ends up being the string 'None' rather than coping with it in the Mercurial plugin. But for now, I can't figure out how to reproduce the issue…

comment:6 by remy.blank@…, 16 years ago

How about MercurialRepository.normalize_rev()? A simple search for str(rev) turned that up, so good guess!

I have the same problem with two repositories, an SVN repo as the default and an additional Mercurial repo. The error comes when I select the root of the Hg repo, then click on "Revision log". The url is:

http://localhost:8000/multi/log/hg/

However, if I change the url to the following, the problem disappears:

http://localhost:8000/multi/log/hg/?rev=

Probably because rev becomes the empty string instead of None.

The following patch fixes the problem for me:

  • tracext/hg/backend.py

     
    292292
    293293    def normalize_rev(self, rev):
    294294        """Return the changelog node for the specified rev"""
    295         return self.hg_display(self.hg_node(str(rev)))
     295        if rev is not None:
     296            rev = str(rev)
     297        return self.hg_display(self.hg_node(rev))
    296298
    297299    def short_rev(self, rev):
    298300        """Return the revision number for the specified rev, in compact form.

comment:7 by remy.blank@…, 16 years ago

Cc: remy.blank@… added

comment:8 by Christian Boos, 16 years ago

Resolution: fixed
Status: newclosed

Right, that was it.

Fixed in [6854:6858] (hm, sorry for the mess).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos 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.