Good work!

John Arbash Meinel john at arbash-meinel.com
Thu Feb 22 13:54:27 GMT 2007


Henrik Westlund wrote:
> Hello, just wanted to say Hi.
> Just got in contact with bazaar and it seems great, atleast a good start!
> It was very easy to setup a repository and making branches, merges
> etc, but I did not figure out how to access and compare different
> versions of a file.
> I am also missing tag-functionality ("label" in clearcase).
> / Henrik (loves Python BTW)

For "access and compare different versions" I would guess you want to
use something like:

'bzr diff -r 20 file/foo'

Which will show you the diff between the current "file/foo" and what it
was at revno 20.

You could also use "bzr cat -r 20 file/foo" to get the full contents of
an old version.

Also, I find it very useful to supply negative numbers to '-r', since
that counts backwards from the current tip. So:

"bzr diff -r -2 file/foo"

Will show you the diff between the current contents, and the content
that was committed 2 revisions ago.


There are other possibilities as well, in case looking at a unified diff
is not your preferred format.

The 'difftools' plugin (found from http://bazaar-vcs.org/BzrPlugins)
allows you to supply a "--using" flag to 'bzr diff', which lets you
select a different diff program. (such as 'bzr diff --using meld). There
are plans to integrate that functionality into the core of bzr at some
point.

I personally like the "vimdiff" plugin (also shown on that page). Which
lets me do:

bzr vimdiff -r 10 file/foo

or

bzr gvimdiff -r 10 file/foo

It should be the same thing as

bzr diff --using vim -r 10 file/foo

I've just been using it for a long time.


As far as "tag" functionality, I'm not sure of the specific
functionality of Clearcase's "label" command. Martin is just putting the
polishing steps on a "tag" command for bzr, which lets you tag tree
states (whole tree tags) which are carried around with the branch.

In the short term, you can always to "svn" style tagging. Which is
basically just creating a branch at the appropriate revision. For example:

bzr branch -r 100 trunk tags/release-100

And if you use a shared repository ("bzr help init-repo" or
http://bazaar-vcs.org/SharedRepository) the new branch is very cheap.

I hope this helps, feel free to ask questions if you have any problems.

John
=:->





More information about the bazaar mailing list