How Bazaar works
Daniel Carrera
daniel.carrera at theingots.org
Thu Jan 21 12:38:06 GMT 2010
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
which conflates the repository and the working set. I'm working on a
project, so I clone a remote repository into a local directory. I make
changes to feature A. While I'm working on A, I get a high-priority
request to work on feature B. Either I clone the remote repository
again (needs network, needs time, hits the remote server harder in a
large project, wastes space as the repository itself is recopied, etc.)
or I clone my local copy in A (which just wastes the space).
Let's say we took the second option. While I'm working in B, I finish
my work in A. I push my changes and delete A ... and WHOOPS! I just
screwed up B, didn't I? B is expecting A as an uplink which is now gone
because the distinction between the working set and the repository is
fuzzy. I can reseat B to point to another copy of the repository (and
hope that that repository doesnt' have changes which clash with the
changes I made in A and in B) but I think anybody can see that this is
not a particularly good solution.
</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.
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.
More information about the bazaar
mailing list