Tags & production questions

Guido Ostkamp hg at ostkamp.fastmail.fm
Wed May 2 22:57:51 UTC 2007


Hello,

I am relatively new to Mercurial and have to use ClearCase at work, I am 
partially familiar with SVN and CVS as well. I have some questions 
regarding use of 'Tags' regarding doing productions with Mercurial.

The following situation is quite common at office:

At a certain time the team sets up a production using a number of tagged 
(=labelled) sources , e.g. after a source code freeze. In ClearCase or CVS 
this looks like the following (I have simplified the per file version 
numbers a bit):

File A: 1 2    3 4 5
File B:  1 2 3    4 5 6
         -----> time ---->
               ^
               frozen & tagged Release1

So the Tag "Release1" consists of these file versions:

A: 2
B: 3

In Mercurial or SVN the numbers are not defined per file, but per 
repository, so the same situation would look like

File A: 1 3    6 7 9
File B:  2 4 5    8 10 11
         -----> time ---->
               ^
               frozen & tagged Release1

Tag "Release1": 5


Now - while development continues with versions 6-11 - the production team 
detects a bug. The correction is e.g. in File B ClearCase/CVS version 5, 
or in version 10 of the Mercurial/SVN repository respectively.

With ClearCase/CVS the solution is easy: The tag label 'Release1' for the 
file B is moved to version 5 and we can go on with a fixed production.

With SVN, the 'Tag' is realized as copy of repository version 5 to another 
tag-specific-directory; here we can copy file B as in repository version 
10 on top of the tag-specific-subdirectory and are done.

The question now is: How can we solve the problem in Mercurial?

If I move the tag marker to version 10 of the repository, then I get 
unwanted changes in File A as well which is not allowed.

If I setup a branch based on version 5 of the repository, then I no longer 
use tags, but branches instead. And I do not know how to merge in just the 
changes from version 8 and 10 into that branch while ignoring versions 6-9 
and 11.

Another question is whether it is possible to copy over an older version 
of a file with history to a new location. SVN has something like 'svn cp' 
with a '-r <rev>' option that allows to pick an older version. I could not 
find a '-r' option for the 'hg cp' command.

Any ideas are appreciated.

Thanks and regards,

Guido



More information about the Mercurial mailing list