[PATCH] Trivial: bzr log fails when start/end_revision is the latest one
John A Meinel
john at arbash-meinel.com
Tue Aug 16 17:26:37 BST 2005
Aaron Bentley wrote:
> The patch looks correct, but all of this code violates DRY. There
> should be one and only one way to determine whether a given revno exists
> in the branch.
>
> Aaron
>
I can't say I recognize "DRY", care to define?
My feeling is the basic problem is that 'log' works on a sequence of
revisions based on their revision numbers, rather than working on
revision ids.
It would be really nice to support giving an arbitrary revision, and if
it exists in the store (regardless if it is in the direct revision
history) you could get the log.
The problem is how do you handle ranges. If I give:
bzr log -r rev:123123123..rev:234234234234
There can be multiple paths between them. In fact, with branching and
merging there are 2^N paths (I may have the wrong number, but the point
is it gets big fast with the more branches and merges you have).
You could always do some sort of graph search to figure out what to print.
I guess I would argue that "bzr log" could take a single revision, and
print its log anywhere in the revision-store, but if given a range it
should be in the revision-history.
You could certainly use:
start_revno, start_rev_id = branch.get_revision_info(...)
To see if there is a revision number and/or a revision id (right now
get_revision_info only supports entries in the revision-history, but we
discussed fixing that in the future).
The reason the patch is needed is because of the revision numbers
starting at 1 but lists starting at 0, so revno==len(revs) is still a
valid revision number. So it certainly needs to be added. (And it
explains why my bzr rpull has been failing with an InvalidRevisionNumber
error when trying to display the logs).
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050816/da7f661a/attachment.pgp
More information about the bazaar
mailing list