[plugin] 'bzr push-and-update'

John Arbash Meinel john at arbash-meinel.com
Mon Feb 12 23:22:27 GMT 2007


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

I just wrote a quick plugin that will run 'bzr update' after you push
your changes to the remote location.

https://launchpad.net/bzr-push-and-update

It adds the command 'bzr push-and-update', which assumes you have ssh
access to the remote location, and that 'bzr' is in your remote path. So
that running:

 ssh host bzr update /path/to/branch

Will work.

I didn't try to have it handle every possible use case, and it doesn't
come with a test suite. But I think it solves a problem people
frequently run into, where they have a shared location that is supposed
to maintain a production working tree. I personally don't recommend
working that way, but it comes up fairly often on the mailing list, so
now we at least have code that can help people.

Because the remote doesn't think it is a tty (I suppose I could use 'ssh
- -t') this is what the output looks like:

bzr push-and-update  bzr+ssh://juju/home/jameinel/dev/bzr/test-3
Updating location: bzr+ssh://juju/home/jameinel/dev/bzr/test-3
Pushed 2 revisions (2 mainline) to revno 5
running "ssh juju bzr update /home/jameinel/dev/bzr/test-3/"
Preparing file merge: ...
Resolution pass: .
Apply phase: ......
All changes applied successfully.
Updated to revision 5.


A different way that this could be written would hook into our set_rh or
post_push hook, and if the url isn't local, it could check if it has a
working tree (NotLocalUrl versus NoWorkingTree), and if it has a working
tree, it could spawn ssh.

Anyway, I thought some people might find it useful.

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

iD8DBQFF0PayJdeBCYSNAAMRAnKfAJ4u1Ry8+vmN1psMJebJorkESN3tDgCg1jI9
Hwoioi7SR/+oBb9R4ng3VRk=
=YJgU
-----END PGP SIGNATURE-----



More information about the bazaar mailing list