How Bazaar works

Scott Aubrey scottaubrey at capuk.org
Thu Jan 21 12:55:40 GMT 2010


On 21 Jan 2010, at 12:38, Daniel Carrera wrote:

> Hello,
> 
> I'm on the mailing list of another DVCS called fossil and someone there made a comment about other DVCS tools which doesn't sound right at all:
> 
> <quote>
> Consider the case of hg or darcs or some other such distributed system 
<snip>
> </quote>
> 
> 
> This doesn't sound right. The idea that each branch is dependent on another branch, forming some sort of DAG tree, seems wrong. I expect that in any decent distributed SCM, each branch is equal and independent. So if you create branch A, then from there create branch B, from that point on B is totally independent on branch A, and it doesn't matter if you delete A.
> 
Right. What's weird about what the OP is that he says other tools "conflate" the repo and working tree, i.e. all together in the same directory (which is correct default bazaar behaviour), then makes an argument that seems to imply that they are seperate and somehow rely on each other. Making a branch locally makes a new repository (using default behaviour in Bazaar) in the new location. I think mercurial uses/used to use hardlinks for branching, but even then that should still work fine if the original branch is removed. 

Note: Bazaar can allow you to create a new WT to an existing branch, then deleting the original branch would break, but this is not "branching locally" and certainly not default behaviour for Bazaar (see "checkouts").

> When I expressed my doubt that distributed SCMs work like this (I know that Darcs doesn't) another poster assured me that this is true:
> 
> <quote>
> When you clone REMOTE to A, a note is made in A that you cloned from
> REMOTE.  So when you are working in A and you push or pull or sync it
> knows that the endpoint of that operation is REMOTE.
> 
> When you clone A to B, a note is made in B that you cloned from A.  So
> when you are working in B and you push or pull or sync it knows that the
> endpoint of that operation is A.
> 
> Then you delete A.  And you go into B and make some changes, and commit,
> and push.  And it says "Can't.  A is missing".  And you have to
> explicitly tell it that you want to sync with REMOTE instead of A.
> </quote>
> 
> 
> On a second reading, maybe the guy is just saying that when you push you have to put the URL of the repository you are pushing to. If so, that's not a dependency!
> 
> Any comments?
> 
> Daniel.

Exactly right.... but that explanation doesn't sound the same as what the OP was saying.

Further, in Bazaar, if changes made in A were push to REMOTE, REMOTE and B branches are now "diverged", so pushing to REMOTE from B in the example above would not work, and would need to be merged, or using a history altering commands such as rebase.

- Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20100121/1b7d602a/attachment.htm 


More information about the bazaar mailing list