Suffering from CVS mindset

Johan Samyn johan.samyn at gmail.com
Sun Apr 11 03:51:47 CDT 2010


[snip]
>>> The trial hg repo I'm working with covers a `projects' area where the
>>> structure is along the lines of a directory with shell script
>>> experiments, another with perl script experiments, backup
>>> experimentation.
>>>
[snip]

The other people have given very informative answers, showing how to
do it in Hg. But let me try to help you from a slightly different
angle. I remember my own struggle to make the mental switch for
working with a dvcs, coming from Cvs too.

In Cvs you track files. While in a dvcs you track some kind of unit-of-work.

So if a unit-of-work needs changes to more than one file, you can
simply do that, and then commit as a whole. All files will then be
'grouped' together in that one committed changeset.That perfectly
explains the word 'changeset' : a set (= maybe more than one) of
changes that belong together.

This changeset has more than one extra value over committing single
files : you can f.i. 'undo' a complete change in one move being sure
the changes in all the files of that unit-of-work are undone together.
(Try that with Cvs ...)
You can export a changeset, being sure you have all changes belonging
together in that bundle. Etcetera.

So if you make different changes into your different 'modules' (perl,
backup, etc), it's up to you to determine what are the right
units-of-work for those uncommitted changes. If the one perl file is a
u-o-w, then commit it separately. If two files where changed for the
backup experiment, commit those two together in a separate commit too.
Then you can register a really meaningfull commit message for every
separate commit.

The Hg tool has no way of determining what changes belong toether for
your units-of-work. Not even by considering the top-folder names. So
you - the human - have to do the book keeping yourself (explicitely
mentioning the files for a commit), or only work on one unit-of-work
at a time (which indeed allows you to simply do 'hg ci', without
mentioning files).

I hope this makes things somewhat more clear to you.
Johan


More information about the Mercurial mailing list