[RFC] browsing history API

Martin Pool mbp at canonical.com
Tue May 23 09:01:13 BST 2006


On 23 May 2006, Johan Rydberg <jrydberg at gnu.org> wrote:
> > In our current implementation only the inventory, with the last-modified
> > field, can say when a file was modified : the VersionedFile graph and
> > the revisions that modified a file will intersect, but neither is a
> > subset of the other in the general case. (Reparents are not listed in
> > the versioned-file graph, and changes in other branches should not be in
> > the modifying revisions list from the point of view of 'log' - which
> > wants only the left-most parents according to the revision graph,
> > intersected with the versioned file graph.).
> 
> I've run into this problem a few days ago, when hacking on ViewVC. 
> 
> How exactly do one go about to get revisions that are the intersection
> between branch available per-file revisions and repository per-file
> revisions, in a quick manner? (ie, exclude file revisions that are not
> referenced by the branch).  Iterating through the revisions, starting
> at the last-modified revision, seems kinda slow.  But I'm afraid there
> is no other way.
> 
> You state that 'log' only wants the intersected graph between the
> left-most revision graph and the versioned file graph.  But that will
> exclude merged revisions.  So I suppose it must be the intersection
> between the _whole_ revision graph and the versioned file graph.
> Correct?

I think you will want the entire graph of the file leading up to the
version present in a particular tree.  Although there may be other
irrelevant versions of that file that haven't been merged, all the ones
that have been merged in are by definition relevant.  You can do this
just by looking at the file's graph.

(Or if not, maybe you can explain more about what you want to get out.)

I've been wondering if we should save for each revision a list of the
modifified files, with some details including their file name and
directory, and the previous revision that modified that particular file
- essentially a structured diff between the two inventories, similar to
what is held by a TreeDelta.  Some operations need this information,
including log -v and files_affected.  If we include the previous
revision then we can skip back through these records without needing to read
every revision.

-- 
Martin Pool




More information about the bazaar mailing list