[MERGE/RFC] Dotted-decimal revision numbers in 'bzr log'

Martin Pool mbp at canonical.com
Thu Sep 7 15:40:43 BST 2006


On  7 Sep 2006, Robert Collins <robertc at robertcollins.net> wrote:

> Sample output for bzr.dev is here:
> http://people.ubuntu.com/~robertc/baz2.0/sample-log.txt
> 
> I think it would be nice to remove the 'merged ...' lines from merged
> revisions, but only once the dotted decimal revision-numbers are
> accessible from commands like 'bzr diff' and 'bzr pull' etc.

I agree.  Obviously they should still be shown if --show-ids is given.

One other highly useful place for this would be in annotate output, which
is quite hard to represent in text form at the moment.

I mentioned to Robert today that if this goes I think we should at least
apologize that these are not accepted for -r parameters.  Otherwise it
would just be very confusing.

I like the effect this has on the ui of letting people understand the
graph better and more easily point to non-mainline revisions.  Unless
we find a problem in the behaviour  

> +    * ``bzr log`` Now shows dotted-decimal revision numbers for all revisions,
                    ^
		    "now", since it continues the sentence.

> +      rather than just showing a decimal revision number for revisions on the
> +      mainline. These revision numbers are not yet accepted as input into bzr
> +      commands - such as log, diff etc. (Robert Collins)

and remove the hyphen.

> === modified file 'bzrlib/tests/blackbox/test_log.py'
> --- bzrlib/tests/blackbox/test_log.py	2006-07-28 16:05:23 +0000
> +++ bzrlib/tests/blackbox/test_log.py	2006-09-07 03:24:18 +0000

Thanks for updating the example in this comment.  It seems to me that
now we have assertEqualDiff we could compare the whole thing, if we just
pass extra parameters to the commits to set the committer, time, 
timezone and rev_id?  That would be nicer.

> -def merge_sort(graph, branch_tip, mainline_revisions=None):
> +def merge_sort(graph, branch_tip, mainline_revisions=None, generate_revno=False):
>      """Topological sort a graph which groups merges.
>  
>      :param graph: sequence of pairs of node->parents_list.
> @@ -174,18 +174,29 @@
>                                 old revision listed in the mainline revisions
>                                 list.
>                                 The order for this parameter is oldest-first.
> +    :generate_revno: Optional parameter controlling the generation of revision
> +        number sequences in the output. See the output description of the
> +        MergeSorter docstrng for details.
>  
> -    The result is a list of node names, such that all parents come before
> -    their children.
> +    The result is a list sorted to that all parents come before
> +    their children. Each element of the list is a tuple containing:
> +    (sequence_number, node_name, merge_depth, end_of_merge)
> +     * sequence_number: The sequence of this row in the output. Useful for 
> +       GUIs.
> +     * node_name: The node name, opaque text to the merge routine.
> +     * merge_depth: How many levels of merging deep this node has been found.
> +     * end_of_merge: When True the next node is part of a different merge.

Surely api stability implies not changing the return type?

-- 
Martin




More information about the bazaar mailing list