[PATCH] --revision uses ellipsis (..) and allows namespaces

John A Meinel john at arbash-meinel.com
Mon Jul 11 06:29:20 BST 2005


About a month ago, I did some work to allow --revision to take
namespaces rather than just revision numbers. I brought back the patch,
and updated it.

To handle namespaces nicely, I use the double dot ellipsis ('..') to
separate entries. So now, instead of using "bzr log -r 10:50" you use
"bzr log -r 10..50". If it helps, just think that the colon died from
being disliked and fell over. :)

Anyway, for strict numerical values, I kept support for "bzr log -r
10:50", though I issue a warning about it being deprecated. This is just
to ease the transition.

So for now, I have created the following namespaces:
	revno:	Just the same as supplying the number directly
	revid:	Give the full revision identifier
	last:	Takes a number and counts back from the end with 1 = end
	date:	Some logic for extracting a revision number by date
		committed, it's a little bit rough, but you can do
		bzr log -r date:+yesterday..
		To see all the stuff that has happened since yesterday.
	tag:	This has been defined, but not implemented


I made the namespace code extendable. So plugins can now register their
own namespace by adding an entry into the dictionary at
bzrlib.branch.Branch.REVISION_NAMESPACES

They can also overwrite the default ones, in case someone doesn't like
the way they work.

I was thinking that since Johan implemented support for "bzr tag" in a
plugin, he might consider implementing the "tag:" namespace.

What is also nice about this implementation, is that we also get support
for "bzr merge ./@last:10" syntax.

Both of these start to become extra useful for things like "tag:". Since
if you add a tag, you can then use it as a base for merging.

All of this work is available from my branch at:
http://bzr.arbash-meinel.com/bzr-revision-uses-ellipsis/

Attached is just a rollup changeset against the current mainline.
(should be applyable with standard patch)

John
=:->
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: revision-uses-ellipsis.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20050711/ee918e87/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/20050711/ee918e87/attachment.pgp 


More information about the bazaar mailing list