Any Change Creates New Heads?

Doug Philips dgou at mac.com
Tue Apr 28 21:43:52 CDT 2009


On or about Tuesday, April 28, 2009, at 09:21PM, Stephen Rasku indited:
>What do you mean CVS would hide it?  Do you mean that if another
>developer changed a file you didn't edit that you wouldn't necessarily
>notice that.

Precisely.

>We intend to convert from our current CVS repository to Mercurial so
>any information regarding CVS users is useful.

here is some stuff I wrote up about CVS -> Hg for our CVS users. Maybe it'll help a bit.

-Doug


h3. A Fundamental Difference between CVS and Mercurial
h4. What is versioned?

In CVS, files are all versioned independently.
Any notion of a consistent/coherent state of the repository is done by convention.
Perhaps it is the use of tags, or a social policy of "don't commit if you'll break the world" or "tips will always be consistent", or ...

In Mercurial, the entire repository is revision controlled. There is no support for having individual revisions on individual files.

This is a _significant_ difference in how to think about version control and how to use the tools.
Old habits die hard. It will take some time, even after you think that you "get it," until you do. :)



h3. Terminology
h4. Repos and Working Directories

!http://www.infoq.com/resource/articles/dvcs-guide/en/resources/CVCSvsDVCS.png!
(Image from http://www.infoq.com/resource/articles/dvcs-guide)

CVS users are used to thinking about checked-out directories as sandboxes that are just the working directory that is backed by a shared repository of history.

DVCSs provide each sandbox with a working directory backed by a per-sandbox repository. (see image)
That is a very significant difference in how you use your sandbox and what it means to commit and merge and move around in the history of the repository.
In the CVS world, you can be working away on the head of the main branch, and if someone else does a commit, bam!, you are not on the head any more.
Since CVS treats each file in the repository as having its own history, having someone else move the head of your common/shared repository may or may not be a big deal.
With Mercurial (and DVCSs in general), what someone else does to their repository, or to a common repository, is completely isolated from what you do to yours.
Someone else pushing to a common/shared repo does not change the state of your repo at all.
You are in control of when you pull changes from somewhere else, when you push them, and what you decide to do about differences.


h4. Commit (CVS) vs. Push (Mercurial)

CVS commits are used to both register your changes and share them with others.
Mercurial commits are used to register your changes in your local repo and push is used to share your Changesets with others.
The difference in operation is important.
CVS provides no way to record changes (commit) without sharing.
This often encourages big commits with lots of potentially unrelated changes.
Mercurial provides separate commit and push operations.
The user is free to commit when it makes sense for the changes they are making.
They are then free to push (or otherwise make available) their committed changes only when it makes sense to share.

--- end of snip ---


More information about the Mercurial mailing list