[PATCH] --revision allows extra revision ids

John Arbash Meinel john at arbash-meinel.com
Thu May 26 22:08:14 BST 2005


Attached is a patch extending the --revision argument to support more
than just revision numbers.

Specifically it provides a Branch.get_revision_info() function, which
will translate a string or integer into a revision number (and id) based
on the branch.

Martin & I discussed the format, we decided to use {} to indicate that
the entry is not an explicit id.

Now that this has been implemented, you can do things like:

    bzr log -r 10:20 # This already existed
    bzr log -r {revid:mdp at sourcefrog.net-234234}
    bzr log -r {revid:mdp at sourcefrog.net-2034234}:{revid:...}
    bzr log -r {date:yesterday}: #Print all changes since yesterday
    bzr log -r {date:2005-01-01}: # All changes this year

It also added a new hidden function bzr revision-info:
    bzr revision-info -r 10:20 # Print out revno + revid for the range
    bzr revision-info 10 20 # Print out explicitly 10 and 20
    bzr revision-info revid:mdp at aoeuntaoeun # Just the revision
    bzr revision-info -r {revid:mdp at aoeuaoeu} # Just one revision

I chose to leave the {} off of the explicitly named arguments, but '-r'
does a range, while explicit does just the specified version, which I
thought seemed reasonable.

It comes with some doctest cases. I can also create some blackbox tests,
but I would like the testbzr stuff updated first. (A project to run some
tests against would be nice).

Anyway, please give it a look-over.

I'm also thinking that Branch.lookup_revision() should either be
deprecated or replaced by get_revision_info().

Also, this leads the way for bzr diff to support multiple revisions as
part of -r.

John
=:->

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: revision-accepts-ids.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20050526/066a401c/attachment.diff 
-------------- 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/20050526/066a401c/attachment.pgp 


More information about the bazaar mailing list