Not sure how merge and push work

Aaron Bentley aaron.bentley at utoronto.ca
Mon Feb 27 20:34:51 GMT 2006


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

Chris Seaton wrote:
> I was reading about the push command, and the help says
> 
> If you want to ensure you have the different changes in the other  branch,
> do a merge (see bzr help merge) from the other branch, and commit that
> before doing a 'push --overwrite'.
> 
> What happens if there are local changes and remote changes, so I  merge
> and then push --overwrite, but someone between the two commands  pushed
> - what stops their changes from being lost?

That help text is a bit wrong, or at least *I* would do:
$ bzr merge ../other
# get tests passing, conflicts fixed
$ bzr commit -m "merged other"
$ bzr push

The advantage of --overwrite is it makes sure the that remote revision
history is the same as your local one; that the revnos are consistent
and the same revisions are considered as mainline (vs. merged).

This is a temporary advantage.  We plan on changing the way we track
revisions, so that revnos are always consistent, even without --overwrite.

The disadvantage of --overwrite is that, if someone else pushes between
the time you merge and the time you push, their push will be
overwritten.  This may annoy them, but of course, it won't destroy the
branch they were pushing *from*, so they can merge and push again.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEA2Jr0F+nu1YWqI0RAvbSAJ4+TxbWbzkLoYsh0FSgB/K5VnOJGgCfckzZ
04ImyAO7l2hsKIiTPXfuVe4=
=1Uhy
-----END PGP SIGNATURE-----




More information about the bazaar mailing list