v0.8 Release – Problems with Displaying Merge Changesets

In my goals blog post I outlined that I wanted to fix this problem with displaying merge changesets. This is the only major problem remaining with my patch for bug 459727. I had talked to about in a previous post and at that time I thought that the problem was not with my code. However, it seems that I was mistaken. I had a little chat with ted and he seems to think that my problem is that I have merges within merges. This is why the right amount of pushes are not showing up.

I’ve been thinking how I can I solve this problem. I’m gonna have to alter my server side code. Currently it looks like the following:

def pushes_worker(query, repo):
    """Given a PushlogQuery, return a data structure mapping push IDs
    to a map of data about the push."""
    pushes = {}
    for id, user, date, node in query.entries:
        mergeData = []
        ctx = repo.changectx(node)
        if len(ctx.parents()) > 1:
          for cs in ctx.parents():
            mergeData.append(hex(cs.node()) + '|-|' + clean(person(cs.user())) + '|-|' + clean(cs.description()))
        if id in pushes:
            # we get the pushes in reverse order
            pushes[id]['changesets'].insert(0, node)
            pushes[id]['mergeData'].insert(0, mergeData)
        else:
            pushes[id] = {'user': user,
                          'date': date,
                          'changesets': [node],
                          'formattedDate': util.datestr(localdate(date)),
                          'individualChangeset': hex(ctx.node()),
                          'author': clean(person(ctx.user())),
                          'desc': clean(ctx.description()),
                          'mergeData': mergeData,
                          'id': id
                          }
    return pushes

I’ll probably be moving this functionality into a function and then hopefully use some recursion to access the merges within the merges. I don’t think I will need to change any of my server side code though, which is a relief.

I think I have it in mind how I want to implement this. I don’t forsee any problems at the moment. Watch out for another post detailing my fix for this issue.

This entry was posted in DPS911, 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>