bzr pull vs. bzr update

John Arbash Meinel john at arbash-meinel.com
Wed Dec 16 19:44:51 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


...

> 
> IIUC, following these steps the trunk/ directory is a checkout, and
> bzr info agrees:

"bzr bind" turns a regular separate branch into a checkout.

> 
>     C:\...\trunk> bzr info
>     Repository checkout (format: 2a)
...

> 
> However, references to updating the trunk/ directory on
> BzrForEmacsDevs always use "bzr pull" and not "bzr update", for
> example:

I assume this is because they don't do bind?

> 
>       cd $DEVHOME/emacs/trunk/
>       bzr pull
>       bzr merge ../quickfixes
>       bzr commit -m "Merge: fix bla bla bla (closes Bug #1)."
> 
> From the Bazaar docs I gather that the expected way to update a
> checkout is with "bzr update", which will merge the upstream changes
> with any pending change in trunk/. With the workflow above the
> difference is not relevant, because trunk/ is never going to have
> changes, but I can also imagine doing this
> 
>       cd $DEVHOME/emacs/trunk/
>       bzr merge ../quickfixes
>       # oops, I forgot to update
>       bzr update
>       # resolve any conflict, then
>       bzr commit -m "Merge: fix bla bla bla (closes Bug #1)."
> 
> where "bzr pull" would force me to do a revert-and-merge-again.

If you haven't committed, I'm pretty sure that pull will work here.

> 
> Also, when there are no changes upstream or on the wc, update seems
> way faster than pull, at least over SFTP.

I recently posted that I think "bzr pull" has lots its fast-path for no
changes. Specifically, we can compare the two branch tip pointers and
see that nothing needs to be done. When I was just trying it, I saw that
it actually goes and tries to do a remote fetch, find revisions to pull,
etc, only to find out you already have everything.

So my guess is that *today* update is faster than pull, but that is
probably a bug in pull.

> 
> I asked Karl why he recommended pull, and he said:
> 
>    Just because 'bzr pull' is what I always use? :-)
> 
> and
> 
>   Oh, we've asked the experts.  Depending on which expert you ask, you get
>   a different answer.  Welcome to Bazaar :-).
> 
> Then he recommended that I brought the issue here. Which I'm doing :-)
> 
> So, which is the True Way in this case? Or did I misunderstood everything?
> 
>     Juanma

If you are working in a checkout, 'update' is the recommended command.
For your specific use cases "bzr update" is equivalent to "bzr pull
$MASTER". The divergence between them is mostly around what happens if
you have local commits, etc.

There are other reasons as well. For example "cd checkout; bzr pull
$NOT_MASTER". Will turn your master branch into $NOT_MASTER, as well as
your local checkout. Which has valid use cases, but infrequent. At least
IMO, using 'bzr update' is a different mental request than 'bzr pull'.


John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkspOLMACgkQJdeBCYSNAAPdewCfVIMjBpmChpE2s/Tiy2U0ui50
L6sAoLlxBjzBm8lO2zRDd55K4ZntY05N
=Lnp+
-----END PGP SIGNATURE-----



More information about the bazaar mailing list