All histories should be linear

Bug #487713 reported by Martin von Gagern
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trac-Bzr
Fix Released
Medium
Martin von Gagern

Bug Description

When viewing the log of a mainline revision (i.e. simple revno), only mainline ancestors (i.e. the "history") are displayed. However, if the starting revision is from a merged branch (i.e. dootted revno or a corresponding revid), then the whole ancestry gets displayed, i.e. revisions from possibly many parallel branches. Both trac and human readers have problems with this, in particular as ordering of these revisions is somewhat arbitrary.

What trac can do, and can do really well, is a linear history. Every branch has a linear history. The current mainline does, these are the simple revision numbers. But every branch merged into mainline does as well. There should be a simple linear mainline path for every revision back to the initial null: revision. I guess it can be obtained by always following the first parent. This would yield dotted revisions from the same branch that contained the starting revision, but not from branches merged into that one.

The other direction is a bit less clear, but I guess that one can look for the earliest mainline revision having the revision in question as an ancestor, and always taking the correct turns in this fashion. Not sure we need a forward history of non-mainline revisions, though.

So I propose to re-implement the history generation to create a simple linear revision as described above.

Related branches

Changed in trac-bzr:
assignee: nobody → Martin von Gagern (gagern)
Revision history for this message
Martin von Gagern (gagern) wrote :

bzrlib.branch.Branch._lefthand_history should do the trick, at least for preceding revisions. The question is, should I use inofficial bzr API or should I copy&paste the implementation of that method? I tend towards the latter.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 487713] Re: All histories should be linear

On Wed, 2009-11-25 at 12:43 +0000, Martin von Gagern wrote:
> bzrlib.branch.Branch._lefthand_history should do the trick, at least for
> preceding revisions. The question is, should I use inofficial bzr API or
> should I copy&paste the implementation of that method? I tend towards
> the latter.

I'd prefer that you use an _ method and keep up to date with bzr than
you copy a method and don't get bugfixes that we may do in the future.

-Rob

Changed in trac-bzr:
importance: Undecided → Medium
milestone: none → 0.3.0
status: New → In Progress
Revision history for this message
Vincent Ladeuil (vila) wrote :

I agree with Robert and would like to add: please, send a mail to <email address hidden> explaining your need so we can provide a public API addressing it.

Revision history for this message
Martin von Gagern (gagern) wrote :
Changed in trac-bzr:
status: In Progress → Fix Committed
Changed in trac-bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.