How to check if bzr "Tree is up to date" ? (to only build when necessary)

0

I'm setting up a script to download, build and install a big project (that uses bazaar) and want to trigger the build process only if the "bzr update" does NOT return "Tree is up to date at revision n" ; How can I do that ? Are there specific return codes to look for ? Ideally I would be able to do that on other VC systems, namely git & svn.

yPhil

Posted 2012-06-30T09:02:30.937

Reputation: 1 261

Answers

1

You can use the exit code of bzr missing URL to decide whether you need to do bzr up and rebuild. The exit code is 0 if there are no updates, 1 otherwise.

In bzr missing URL you only need to specify URL once, afterwards you can use the :parent shortcut, or you could set parent_location in .bzr/branch/branch.conf and use :parent always.

janos

Posted 2012-06-30T09:02:30.937

Reputation: 2 449

0

It would be easiest to just grep for Tree is up to date in the bzr up output I imagine. There is no return code you can use.

Alternatively, you can use bzr missing :parent before you run bzr up to see if there are any revisions that are missing locally.

jelmer

Posted 2012-06-30T09:02:30.937

Reputation: 315