New page: == Mercurial vs. Subversion == One side note in the chapter 13 compares behaviour of Mercurial and Subversion. A curious reader sent a commen...
New page
== Mercurial vs. Subversion ==
One side note in the [[Extreme_Advice_Considered_Harmful|chapter 13]] compares behaviour of [[Mercurial]] and [[Subversion]]. A curious reader sent a comment:
: Page 241: In the scenario described [[Subversion]] behaves the same way as [[Mercurial]],
: so it would not be possible to checkin changes without first synchronizing against
: the HEAD revision (assuming checking goes to HEAD). See, for instance,
: [http://subversion.tigris.org/faq.html Subversion FAQ], question
: '''I'm trying to commit, but Subversion says my working copy is out of date?''', answer 3.
Looks like sometimes the '''svn up''' is needed. However not in regular workflow. I've just tried:
<source lang="bash">
# create a new file as user A:
svn co file:///home/jarda/tmp/svn/r/
echo Hi. >readme.txt
svn add readme.txt
svn ci -m "adding readme.txt by user A"
# create another new file as user B:
svn co file:///home/jarda/tmp/svn/r/
echo >b.txt
svn add b.txt
svn ci -m "Adding file b.txt from user B"
# now, as user A change the readme file, without updating
# e.g. without knowing that there is the b.txt file:
echo Hello >readme.txt
svn diff
svn ci -m "Changing content of file readme.txt as A, without updating to B's latest version"
</source>
This is a significant difference between [[Subversion]] and [[Mercurial]]. [[Subversion]] lets the user A integrate changes without knowing what the final state after the integration will be. Seen from rationalistic point of view, this is not ''correct''. [[Mercurial]] would refuse such integration asking the user A to '''svn update''' to latest version of the repository first. This is the correct behaviour. However it is not really [[cluelessness|clueless]] and enormous majority of developers I know is complaining about such [[Mercurial]] restrictions. This is another example of ''correct but complex'' behaviour. Such correctness is reached at the expense of usability. Nice illustration of what can happen when one strives to make an [[API has to be Correct|API correct]].