Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .