[RFC] Update should mention WHAT it is up to date with

Martin Pool mbp at canonical.com
Thu Dec 10 01:29:42 GMT 2009


2009/12/10 Neil Martinsen-Burrell <nmb at wartburg.edu>:
> There have been a sequence of bugs arising from the fact that ``bzr update``
> is a legitimate command in a branch with its own working tree, but often it
> doesn't do what users want.  What people often want is to get their branch
> "up to date" with some other branch and they should be using ``bzr pull`` or
> ``bzr merge`` to do so.  I run into the situation when using bound branches
> that I often unbind for offline commits. Then, when unbound, ``bzr up`` is a
> successful no-op, but what I *meant* is to make this branch up to date with
> the branch it was bound to.
>
> I've wanted for a while to address this by using the message: "Up to date at
> revision x of branch y" and I have a branch of bzr that does that, but it
> causes lots of test failures (understandably) and before I go fixing all of
> them, I wanted to hear some feedback.
>
> Do people feel that this will address the issue with update being not what
> people want, by informing them that their working tree is up to date with
> its (local) branch?  Is it otherwise useful (e.g. for those using switch a
> lot)?

I think this would be great, and could be followed in other cases too.
 For instance, when pushing say "pushing %s to %s".  pqm-submit
(though a bit obscure) would benefit from this even more because there
are so many variables.  It should respect --quiet.

> Implementation questions:
>
> Is there a bzrlib function to take a branch.base URL and shorten it (for
> example, file:/// URLs could have the URL prefix removed)?  Should we try to
> use "." in the shortened form if possible?

Generally things like that would be in urlutils.  There are functions
to turn a url into a local path if possible.

There was a thread a while ago about a display_url or human_url but I
don't think it was implemented.   Would be nice.  You could always add
a stubby implementation ("return url") to start with.

> For tests that have very long and varying branch names, should I just change
> assertEndsWith("Up to date at revision 1\n") to an appropriate
> assertContainsRe?

You could look at using Vincent's shell-like tests where you can just
show some sample output.  I'm sure he would welcome questions or
feedback.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list