[merge] update --revision

Robert Collins robertc at robertcollins.net
Sat Sep 16 23:06:32 BST 2006


On Sat, 2006-09-16 at 11:43 +0200, Matthieu Moy wrote:
> Robert Collins <robertc at robertcollins.net> writes:
> 
> > I think this code is more complex than needed. Why not just resolve the
> > revision that is desired from the master branch if there is one or the
> > local otherwise rather than trying for it locally then remotely. This
> > will be more understandable too, because the master should be
> > authoritative for this.
> 
> The idea is to use the local branch as much as possible, for
> performance reason. "bzr update -r something" should be a local
> operation if "something" is already in the local branch.

I think its better to offer --local if you want that.

Trivial example of why:

bzr update -r 4

local branch has revisions: [A, B, C, D, E]
master has [A, B, C, F, G]

(that is D and E are either local commits, or they were uncommitted from
the master by someone else; F and G have been committed to the master
since this branch last did update.)

what revision should -r 4 take the working tree to?
What revision should -r 4 put the local branch at?

I think that it should put the working tree on revision F - because the
master is authoritative.

What should happen to the local branch ? well update -r is generally not
expected to change the branch for users, so theres an argument that
update with a revision other than G (in this example: the tip of master)
should not change the local branch at all, other than to fetch history.
And alternative argument is that it should to a regular update, then to
the revision switching on the working tree.

I think on balance that the local branch should only be changed when we
are updating to the tip of the master branch - that is, when no revision
number was supplied.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060917/2287811e/attachment.pgp 


More information about the bazaar mailing list