'''Bazaar''' is another [[DistributedSCM]] (see http://bazaar-vcs.org/). A Bazaar "branch" roughly corresponds to a Mercurial [[Repository|repository]]. Bazaar's "branch" command corresponds to "clone" in Mercurial. <> == Comparing Use Cases == === Push === ''Bazaar'' In Bazaar, the [[http://doc.bazaar-vcs.org/bzr.dev/en/user-reference/bzr_man.html#push|push command]] has an {{{--overwrite}}} option '''which modifies the history''' of the target branch (provided the target branch was not explicitly created using the {{{--append-revisions-only}}} option, see addendum below). Example: Assume we have a Bazaar branch in directory {{{bzr1}}} (created with "{{{bzr init}}}") and branched that to {{{bzr1-1}}} (using {{{bzr branch bzr1 bzr1-1}}}). Then we commit some changes in both branches, thus making the branches diverge. Then in {{{bzr1-1}}} doing: {{{ > bzr push ..\bzr1 bzr: ERROR: These branches have diverged. Try using "merge" and then "push". }}} will fail because the two branches have diverged. But specifying {{{--overwrite}}} will succeed: {{{ > bzr push ..\bzr1 --overwrite All changes applied successfully. Pushed up to revision 2. }}} by changing the history of {{{bzr1}}}. '''Some already committed changes to branch {{{bzr1}}} are deleted''' (the diverging changes). ~-Quote from Bazaar manual: ''"If branches have diverged, you can use 'bzr push --overwrite' to replace the other branch completely, discarding its unmerged changes."''-~ '''Addendum''': If branch {{{bzr1}}} is created using {{{ bzr init --append-revisions-only }}} (see [[http://doc.bazaar-vcs.org/bzr.dev/en/user-reference/bzr_man.html#init|bzr init]]), then {{{push --overwrite}}} will be denied if the branches have diverged: {{{ > bzr push ..\bzr1 --overwrite bzr: ERROR: Operation denied because it would change the main history, which is not permitted by the append_revisions_only setting on branch "C:/tmp/bzr1/". }}} So this ensures that pushes cannot change existing history (however, this is not the default behaviour). ''Mercurial'' In Mercurial, it is not possible to delete already committed changesets when doing a [[Push|push]]. Assume we have two Mercurial repositories {{{hg1}}} and {{{hg1-1}}} ({{{hg1-1}}} cloned at some time from {{{hg1}}}) with diverging changes. In {{{hg1-1}}} doing: {{{ > hg push ..\hg1 pushing to ..\hg1 searching for changes abort: push creates new remote branches! (did you forget to merge? use push -f to force) }}} will fail as with {{{bzr push}}}. But doing: {{{ > hg push --force ..\hg1 pushing to ..\hg1 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) }}} simply adds a new [[Head|head]] to the target repository. History is preserved. (Sidenote: This is inherent in Mercurial, as the underlying [[Revlog|revlog]] format used for all versioned information in Mercurial is ''append only'' by design). == General Comparison == * [[BzrVsHg]] * [[http://www.selenic.com/pipermail/mercurial-devel/2008-January/004361.html|bzr wins a performance test]], by Bryan O'Sullivan, Fri Jan 18 15:33:47 CST 2008 == See also == * [[SpiderGoat]] == References == * [[http://doc.bazaar-vcs.org/bzr.dev/en/user-reference/bzr_man.html|Bazaar User Reference]] (manual) * [[http://www.selenic.com/mercurial/hg.1.html|Mercurial man page]]