2010/1/21 Daniel Carrera <[email protected]>

> > 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.
>


> I think that's bad. Darcs doesn't do that, and I would venture to guess
> that Bazaar and Mercurial don't either. Branches should be equal and
> independent.
>

Really?  Watch and learn.

mich...@isolde:~/junk$ mkdir A B Remote
mich...@isolde:~/junk$ cd Remote
mich...@isolde:~/junk/Remote$ darcs initialize
mich...@isolde:~/junk/Remote$ touch 1
mich...@isolde:~/junk/Remote$ darcs add 1 ; darcs record
addfile ./1
Shall I record this change? (1/1)  [ynWsfvplxdaqjk], or ? for help: y
What is the patch name? file 1 in Remote
Do you want to add a long comment? [yn]n
Finished recording patch 'file 1 in Remote'
mich...@isolde:~/junk/Remote$ cd ../A
mich...@isolde:~/junk/A$ darcs initialize ; darcs pull ../Remote
Thu Jan 21 21:01:48 CST 2010  [email protected]
  * file 1 in Remote
Shall I pull this patch? (1/1)  [ynWsfvplxdaqjk], or ? for help: a
Finished pulling and applying.
mich...@isolde:~/junk/A$ touch 2
mich...@isolde:~/junk/A$ darcs add 2
mich...@isolde:~/junk/A$ darcs record
addfile ./2
Shall I record this change? (1/1)  [ynWsfvplxdaqjk], or ? for help: a
What is the patch name? file 2 in A
Do you want to add a long comment? [yn]n
Finished recording patch 'file 2 in A'
mich...@isolde:~/junk/A$ cd ../B
mich...@isolde:~/junk/B$ darcs initialize
mich...@isolde:~/junk/B$ darcs pull ../A
Thu Jan 21 21:01:48 CST 2010  [email protected]
  * file 1 in Remote
Shall I pull this patch? (1/2)  [ynWsfvplxdaqjk], or ? for help: a
Finished pulling and applying.
mich...@isolde:~/junk/B$ touch 3
mich...@isolde:~/junk/B$ darcs add 3
mich...@isolde:~/junk/B$ darcs record
addfile ./3
Shall I record this change? (1/1)  [ynWsfvplxdaqjk], or ? for help: a
What is the patch name? file 3 in B
Do you want to add a long comment? [yn]n
Finished recording patch 'file 3 in B'

The stage is now set.  We have a "remote" repository.  We have a local
repository A taken from the remote one that has added some stuff.  We have a
local repository B taken from A that has added some stuff.  Now watch:

mich...@isolde:~/junk/B$ cd ..
mich...@isolde:~/junk$ rm -fR A
removed `A/1'
removed `A/_darcs/tentative_pristine'
removed
`A/_darcs/patches/0000000115-3cd043376a21c461f8605abb2a579f58ff2419e37248c357425a3a143a9d6ecb'
removed `A/_darcs/patches/pending'
removed
`A/_darcs/patches/0000000110-b044ffccac260b63c9f0f4d92b1c5b85e4221128a9ddf37c12a36415a8d2bdd4'
removed `A/_darcs/patches/pending.tentative'
removed directory: `A/_darcs/patches'
removed
`A/_darcs/inventories/0000000187-198d8c81582fe412f44f446a65a8e40b3b1267107a3e6e72ad2b50a27dbd67e9'
removed
`A/_darcs/inventories/0000000369-511de1bfebfc9e3803f8c9d12aef84bf5312f03b013eb16c07709fc8b67ba625'
removed directory: `A/_darcs/inventories'
removed `A/_darcs/format'
removed `A/_darcs/prefs/repos'
removed `A/_darcs/prefs/boring'
removed `A/_darcs/prefs/author'
removed `A/_darcs/prefs/binaries'
removed `A/_darcs/prefs/motd'
removed `A/_darcs/prefs/defaultrepo'
removed directory: `A/_darcs/prefs'
removed `A/_darcs/hashed_inventory'
removed
`A/_darcs/pristine.hashed/0000000168-cdb7d192d528a5ab1468b5d4339004ddf47442b6bd2d2e2a6f3ba38c724c0883'
removed `A/_darcs/pristine.hashed/da39a3ee5e6b4b0d3255bfef95601890afd80709'
removed
`A/_darcs/pristine.hashed/0000000000-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
removed
`A/_darcs/pristine.hashed/0000000084-555aaf4b6798d05de804c5dd6de6d1707fece5d5d1dcc9dd34c3834e55058b1e'
removed directory: `A/_darcs/pristine.hashed'
removed directory: `A/_darcs'
removed `A/2'
removed directory: `A'
mich...@isolde:~/junk$ cd B
mich...@isolde:~/junk/B$ darcs push

darcs failed:  Not a repository: /home/michael/junk/A
(/home/michael/junk/A/_darcs/inventory: openBinaryFile: does not exist (No
such file or directory))

Oops.  So much for "equal and independent" branches!

This is what happens when your working set and your repository are one and
the same.  You create chains of relationships that can *and do* (keep in
mind that I have used both Mercurial and Darcs long before I found fossil)
lead to lost data and difficult to debug problems.

Consider this sequence instead:

   - I clone a remote repository to A.
   - Someone else clones my repository A to B.
   - I make my changes and push them.
   - The other guy makes his changes and pushes them.
   - I don't notice this last thing and think that I'm done with my work and
   delete my working set/repository.
   - He thinks his work is done and deletes his working set/repository.

The other guy's work is now lost because of that chain of working
set/repositories.  In fossil the workflow is different:

   - I clone a remote repository to a repository file in a known location.
   (For my work I have them in ~/Repositories.  For my shared work I have them
   in /var/repositories.)
   - I open a working set from that repository.
   - Someone else opens a working set from that same repository.
   - I make my changes and push them.
   - He makes his changes and pushes them.
   - I delete my working set.
   - He deletes his working set.

No work is lost because the working set and the repository are two different
beasts.

And please, before you dig yourself in deeper with something ridiculous like
"this kind of stuff doesn't happen in practice" keep in mind that I switched
*away* from Mercurial and Darcs precisely *because* such things happened in
practice.  (That and sharing repositories with Fossil is a lot easier than
any other system I evaluated ever.)  Yes, the problems with Mercurial and
Darcs (and Git and ...) can be worked around by disciplined work flow
control, but in complex or highly active projects it is very easy to make
the kinds of mistakes that lead to loss of data and work.

I'd much rather my tool protect me from this, thank you very much.
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to