v0.2 Release – Showing the Correct Author Name for bug 459727

My v0.2 for the pushlog is coming along at a steady pace. There are still some problems but hopefully I will have them solved soon. Right now, the following is how new entries look like OnScrollDown:

http://sidkalra.com/files/mercurial/improvedPushlog2.png

Now have a look at the author column (in the above image). Sometimes the text under that column is a name while other times it is an email. This is not the functionality I want. It should always be a name, never the email (there is already a column for that). Currently I am using ctx.user() to populate the author column. This obviously doesn’t give me the right data. I can’t use the user column straight from the db (I already use it to populate the email column) since it doesn’t give me the author name either.

I need to find some other way of acquiring the author name. I was wondering if there is some other ctx function that I could use to acquire the right data. I tried guessing it by going ctx.author() or ctx.person() or ctx.name() but no luck so far.

I had a look at how it is done for the initially loaded data. The answer is in the map file. The author name is printed by going #author|person#. I don’t really understand what that means and how this variable gets the correct author name for each row. I’ll have to consult ted, djc or jorendorff on this issue.

EDIT: I’ve managed to fix this issue. It was actually quite simple in the end. I had a talk with ted and we discussed what #author|person# does. He said it was just a filter that takes whatever is in ctx.user() and tries to remove the email. I needed to do something similar for my solution so bsmedberg recommended importing mercurial.templatefilters.person which will allow me to perform person(ctx.user()) which returns the name every time. Problem solved! View the result

This entry was posted in Mercurial Project, Open Source and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>