Detecting out of date checkouts, plus bind without arguments

Adeodato Simó dato at net.com.org.es
Tue Jun 20 11:22:04 BST 2006


Hello!

I have a simple question, see below for the full story. I'd like to
reliably detect when a branch has its working tree out of date, and
needs `bzr update`. I'm doing it like this, but I'd like a word about if
this will always work, or not. Thanks in advance.

  for d in `list_of_branches`; do
    if [ "$d/.bzr/repository/revisions.kndx" -nt \
         "$d/.bzr/checkout/last-revision" ]; then
      bzr update "$d"
    fi
  done

The story: I have in my desktop a number of branches under ~/code
(normal branches, no repository involved), which I regularly rsync to my
webserver. Then, in my laptop, I have a checkout of each of those
branches, so that each commit in the laptop goes to the desktop as well
(unless there's no network, and I play with unbind and bind afterwards).

The issue is, of course, that the working trees in the desktop branches
don't get updated after receiving a commit from the laptop, so I've
included in my rsync-script a snippet like the above to make sure that
the webserver has not only the repository up to date, but the working
tree as well (so that people browising it do get the latest version).

That's it.

P.S.: I don't know if it has been proposed before, but would you think
it'd make sense for `bzr bind $foo` to record $foo as the default bind
location (a-la-pull), so that `bzr unbind; bzr bind` works and is a
noop? I guess you can see the usefulness of it in a scenario like the
above, when the location to bind to is always the same (a pretty common
scenario, I'd say?)

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
                                     Listening to: María Jiménez - Ruido





More information about the bazaar mailing list