Sorry to be insisting, but I need some more information.

It appeared to me the history log is provided in MercurialNode.get_history.
There are two cases here, one for directories (including the whole tree) and
one for files:

    def get_history(self, limit=None):
        newer = None # 'newer' is the previously seen history tuple
        older = None # 'older' is the currently examined history tuple
        repo = self.repos.repo
        log = repo.changelog

        # directory history
        if self.isdir:
            if not self.path: # special case for the root
                for r in xrange(log.rev(self.n), -1, -1):
                    yield ('', self.repos.hg_display(log.node(r)),
                           r and Changeset.EDIT or Changeset.ADD)
                return
            getchange = cachefunc(lambda r:repo.changectx(r).changeset())
            pats = ['path:' + self.path]
            opts = {'rev': ['%s:0' % hex(self.n)], 'follow_first:' True }
########### gwk
            wcr = walkchangerevs(self.repos.ui, repo, pats, getchange, opts)
            for st, rev, fns in wcr[0]:
                if st == 'iter':
                    yield (self.path, self.repos.hg_display(log.node(rev)),
                           Changeset.EDIT)
            return
        # file history
        # FIXME: COPY currently unsupported
        for file_rev in xrange(self.filectx.filerev(), -1, -1):
            file_node = self.filectx.filelog().node(file_rev)
            rev = log.node(self.filectx.filectx(file_node).linkrev())
            older = (self.path, self.repos.hg_display(rev), Changeset.ADD)
            if newer:
                change = newer[0] == older[0] and Changeset.EDIT or \
                         Changeset.COPY
                newer = (newer[0], newer[1], change)
                yield newer
            newer = older
        if newer:
            yield newer

As you see I already tried to add the follow_first option into the directory
case. But how to do the same for the file case?

Why is the file case different anyhow, couldn't we use the same code as with
directories?

Note I didn't test anything yet, just thinking.

--
Regards,
Georg.


2009/7/20 Georg <[email protected]>

> Hi,
>
> when I look at history in Trac I usually expect linear history.  This is
> the easiest comprehensible view and supported by the well known SVN (and
> CVS) model.
>
> In Mercurial that does not hold.  The changelog intermingles changesets
> from various branches in roughly chronological order (perhaps).
>
> What do you think about doing an implicit "hg log --follow-first" for
> creating the changelog display in the Trac plugin?  Which place would I have
> to modify in order to try that out?
>
> --
> Regards,
> Georg.
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to