Note:

This page is primarily intended for developers of Mercurial.

Note:

This page is no longer relevant but is kept for historical purposes.

Crossed Linkrevs

When working with filelogs (and manifest logs), it is important to be aware that file revisions may not necessarily appear in an order that corresponds to the changelog. In other words, filelogs may contain "crossed linkrevs". Consider:

The filelog graph itself will continue to be topologically sorted (all ancestors before descendants) as will the changelog graph, but the orderings may be different. Thus, you cannot for instance assume that if you find a filelog with linkrev x, you have found all filelogs with linkrev < x.

If you need to iterate across file revisions in a "changelog-compatible" order, it may often be sufficient to do the following:

visit = range(len(fl)).sort(key=fl.linkrev)
for r in visit:
    ...


CategoryInternals

CrossedLinkrevs (last edited 2012-10-25 21:30:54 by mpm)