[MERGE] revisionspec_master plugin

John Arbash Meinel john at arbash-meinel.com
Tue Jun 5 16:02:06 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Václav Šmilauer wrote:
> Attached plugin adds the revisionspec in the format master: (without
> arguments) that will find latest revision of master branch.
> 
> It is useful for those who have checkout'ed branch and want to see its
> status or diff against latest upstream. "bzr status -r master:" is
> therefore functionally equivalent to "svn status -u". This feature was
> requested by one of my co-developers after I amde the whole team switch
> to bzr.
> 
> Much thanks go to jam-laptop at bzr#irc.freenode.net for his help (the code
> is really his)...
> 
> Regards, Vaclav Smilauer
> 

Thanks Václav.

If we decide to add this to bar, it would need a little bit of wrapping (there
are lines longer than 79 chars, etc).

Overall, I think it would be useful to have a "parent:" and a "master:"
revision spec.

What do other people think?

One place where this could break, is that it needs the revisions to be in the
local repository, but doesn't actually pull them. However if you look at the
"branch:" spec which does pull them, it has problems because the local
repository has only been opened in read-mode (for bzr status/bzr diff, which is
often when you would want to use it).

So we need to consider how we want to work around it.

a) Check to see if we need to pull, and only pull if the repository is
write-locked.

b) Secretly re-open the local repository in write-mode and pull using it.
   new_repo = branch.repository.bzrdir.open_repository()
   new_repo.fetch(remote_branch.repository, remote_branch.last_revision())

I would only want to do that if
branch.repository.has_revision(remote_branch.last_revision()) failed.

Thoughts?

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGZXruJdeBCYSNAAMRAp1YAKCF7i6p6nma/CbgpRU/kghdMv6WuACghdlU
L/BQl0/DekAHV5JAXhu2CgQ=
=Yrcr
-----END PGP SIGNATURE-----



More information about the bazaar mailing list