{"id":120,"date":"2009-02-02T09:27:46","date_gmt":"2009-02-02T09:27:46","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2009\/02\/02\/how-cvs-will-help-to-realtime-developers-2\/"},"modified":"2017-12-26T02:24:37","modified_gmt":"2017-12-26T02:24:37","slug":"how-cvs-will-help-to-realtime-developers-2","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-cvs-will-help-to-realtime-developers-2\/","title":{"rendered":"How CVS will help to Realtime Developers ?"},"content":{"rendered":"<h1><span style=\"color: #0000ff;\"><strong>CVS<\/strong> Tips &amp; Tricks<\/span><\/h1>\n<p>The <strong>CVS<\/strong> commands here assume that you are using the command line version of <strong>CVS<\/strong>. Tips and tricks for a specific <strong>CVS<\/strong> GUI are specific to each GUI and do not really belong here.<\/p>\n<h2>Viewing the commit log of a file.<\/h2>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ cvs log <em>filename<\/em><\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2>Show current status of a file.<\/h2>\n<p>The status command will show you the latest version, the version in your working directory and if your local copy has been modified.<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ cvs status <em>filename<\/em><\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2><span style=\"color: #0000ff;\">Performing a <strong>CVS<\/strong> diff<\/span><\/h2>\n<p>After developers have checked in updates to the code it may be beneficial to see what has changed, either to help solve bugs or to track changes. There are several option to do this.<\/p>\n<ol>\n<li><strong>Perform a diff between complete branches: <\/strong><\/li>\n<\/ol>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ <\/strong><strong>cvs -q diff -u -r BRANCH1 -r BRANCH2 <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ol>\n<li><strong>Perform a diff between a single file in two branches: <\/strong><\/li>\n<\/ol>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ <\/strong><strong>cvs -q diff -u -r BRANCH1 -r BRANCH2 filename <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ol>\n<li><strong>Perform a diff between different versions of a file: <\/strong><\/li>\n<\/ol>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ <\/strong><strong>cvs -q diff -u -r version1 -r version2 filename <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ol>\n<li><strong>Perform a diff between working version and most up to date file in database: <\/strong><\/li>\n<\/ol>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ <\/strong><strong>cvs -q diff -u filename <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ol>\n<li><strong>Perform a diff between working version and a specific database version: <\/strong><\/li>\n<\/ol>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ <\/strong><strong>cvs -q diff -u -r version filename <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2><span style=\"color: #0000ff;\"><strong>Retrieving <\/strong><strong>CVS Information on Files<\/strong><\/span><\/h2>\n<p>To retrieve the current version and other relevant information about a file run:<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ cvs status filename <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>To retrieve the entire change log pertaining to a file run:<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ cvs log filename <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2><strong><span style=\"color: #0000ff;\">Retrieving CVS Files Based Upon Revision<\/span><\/strong><\/h2>\n<p>To retrieve a file from <strong>CVS<\/strong> based upon a revision number perform the following:<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ cvs -q up -Pd -r revision filename <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ul>\n<li>To get the revision number use the log command above<\/li>\n<\/ul>\n<h2><span style=\"color: #0000ff;\"><strong>Tag file in <\/strong><strong>CVS as a Release<\/strong><\/span><\/h2>\n<p>To tag files in <strong>CVS<\/strong> as a release perform the following:<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ cvs tag <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ul>\n<li>Run the command from within the release source dir.<\/li>\n<\/ul>\n<h2><span style=\"color: #0000ff;\"><strong>Creating a Branch<\/strong><\/span><\/h2>\n<p>I like to do the following before creating a branch:<\/p>\n<p>See what tags are available and pick one.<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>$ <strong>cvs<\/strong> -q log <em>filename<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Revert to a tagged version of HEAD.<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ cvs -q up -r TAG_Version <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>To create a branch in <strong>CVS<\/strong> perform the following:<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>$ cvs tag -b <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Run the command from within the release source dir. This should be done in the top level directory of the project. The chosen_branch is something like BRANCH_36_BUG_.<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>cvs -q up -r <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>$ <\/strong><strong>cvs -q status &lt;&#8211; confirm that the branch has specified as the tag <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>$ <\/strong><strong>cvs tag _mm_day_year &lt;&#8211; eg: BRANCH_12_BUG_12345_07_17_2009 <\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2><strong><span style=\"color: #0000ff;\">Reverting to a Branch<\/span><\/strong><\/h2>\n<p>To revert to a branch in <strong>CVS<\/strong> perform the following:<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>$ <strong>cvs<\/strong> -q <strong>up &#8211;<\/strong>r<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ul>\n<li>Run the command from within the release source dir. This should be done in the top level directory of the project. The chosen_branch is something like BRANCH_BUG_.<\/li>\n<\/ul>\n<h2><strong><span style=\"color: #0000ff;\">Verifying you are in a branch<\/span><\/strong><\/h2>\n<p>To verify you are in a branch<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>$ <strong>cvs<\/strong> -q status<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will see that the branch is a sticky tag.<\/p>\n<h2>Merge Current Branch with HEAD<\/h2>\n<p>Ensure that you are in the branch by reverting to the branch and Verifying that you are in the branch.<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>$ <strong>cvs<\/strong> update -j<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>This will ensure that you are your branch is getting merged properly with HEAD so the only differences you see between your branch and the are changes that you made. You can verify this from your branch with:<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>$ <strong>cvs<\/strong> -q diff -u -r | less<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will eventually have to commit your changes you should always do a tag on the branch after your commit.<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>$ <strong>cvs<\/strong> tag<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2>Merge HEAD into Current Branch Multiple Times (with tags) and without -kk option<\/h2>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>$ <strong>cvs<\/strong> update -j -j<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>This command will unfortunenately result in a lot of your ID tags getting changed at the top. Using the &#8211;kk option will avoid this problem. But then you won&#8217;t see which files have changed and You won&#8217;t know who last modified a file easily. After you run this command I recommend:<\/p>\n<pre>$ vim `<strong>cvs<\/strong> up -d | grep '^C' | sed -e 's\/^C \/\/'`<\/pre>\n<p>You may find the following page interesting as well: <a href=\"http:\/\/kb.wisc.edu\/middleware\/page.php?id=4087\" target=\"_blank\" rel=\"noopener\">http:\/\/kb.wisc.edu\/middleware\/page.php?id=4087<\/a><\/p>\n<p>This will grab all of the conflicting files. You can save them with :w. And step through them with :bn. You can easily close them all with :wq!.<\/p>\n<h2><span style=\"color: #0000ff;\"><strong>Merge HEAD into Current Branch Multiple Times (with tags)<\/strong><\/span><\/h2>\n<p>To merge current HEAD into a branch that has already had HEAD merged into it once, the differences between that last merge and current HEAD need to be gathered and applied to the branch. This is done by finding out when the last time HEAD was merged with the branch. Hopefully you tagged your branch. Repeat steps 1 and 2 from the previous section to create a tag for HEAD and to create a tag for your branch so you can have a backup\/reference point. Then, perform the following if you have tagged the branch when merging the last time:<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>$ <strong>cvs<\/strong> update -kk -j -j<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ul>\n<li>Run the command from within the branched version. is the old tag in HEAD from the last time you merged (the tag that you created in Step one from the previous section). If you in this case, the format will likely be the following:<\/li>\n<\/ul>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>$ <strong>cvs<\/strong> update -kk -j UPDATE_HEAD_36_BUG__06_16_2008 -j UPDATE_HEAD_36_BUG__07_23_2008<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The first tag is the one created the last time HEAD was merged into the branch. The second tag is one that should have been just created. This will take all the differences between the two tags, and bring them into the branch. The next time a merge from HEAD into the branch occurs, this latest tag will be the &#8220;old&#8221; tag, and the new tag will be created at the time of the merge.<\/p>\n<p>The reason for tagging the branch before a join\/merge like this is to create a reference point to revert to if the need ever arises. The -kk option removes rcsid tags so that the <strong>cvs<\/strong> tag at the top doesn&#8217;t get flagged as a conflict on every merge\/join.<\/p>\n<h2><span style=\"color: #0000ff;\"><strong>Merge HEAD into Current Branch Multiple Times (without tags)<\/strong><\/span><\/h2>\n<p>If no tags have been created for the branch when HEAD was merged into a branch at a previous time, an alternative is to use the daily build tag. Find the commit message of the last time HEAD was merged into the branch and was committed and select the daily build tag the day BEFORE that one (but only if the commit was before the daily build that day, i.e. before lunch time for GMT -06:00). An example is provided below on how to merge without tagging:<\/p>\n<div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>$ <strong>cvs<\/strong> update -kk -j Tag_Branch -j HEAD&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Run the command from within the branched version.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n<strong>To Avoide network confusion :-<\/strong><\/p>\n<p>use :- alias cvs=`cvs -z9`<\/p>\n<p>causes cvs to use compression level 6.<\/p>\n<p>Good links for it:-<\/p>\n<ul>\n<li><a href=\"http:\/\/datagrams.blogspot.com\/2009\/01\/how-to-deploy-cvs-concurrent-versions.html\" target=\"_blank\" rel=\"noopener\">http:\/\/datagrams.blogspot.com\/2009\/01\/how-to-deploy-cvs-concurrent-versions.html<\/a><\/li>\n<\/ul>\n<ul>\n<li><a href=\"http:\/\/kb.wisc.edu\/middleware\/page.php?id=4087\" target=\"_blank\" rel=\"noopener\">http:\/\/kb.wisc.edu\/middleware\/page.php?id=4087<\/a><\/li>\n<li><a href=\"http:\/\/ximbiot.com\/cvs\/manual\/cvs-1.11.21\/cvs_10.html#SEC85\" target=\"_blank\" rel=\"noopener\">http:\/\/ximbiot.com\/cvs\/manual\/cvs-1.11.21\/cvs_10.html#SEC85<\/a><\/li>\n<li><a href=\"http:\/\/ximbiot.com\/cvs\/wiki\/Special\/Index\" target=\"_blank\" rel=\"noopener\">http:\/\/ximbiot.com\/cvs\/wiki\/Special\/Index<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>CVS Tips &amp; Tricks The CVS commands here assume that you are using the command line version of CVS. Tips and tricks for a specific CVS GUI are specific to&#8230; <\/p>\n","protected":false},"author":1,"featured_media":4032,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[20],"tags":[369,3117,3116,3118,977,3115,2975,2977,3114,3119],"class_list":["post-120","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cvs-concurrent-version-system","tag-cvs","tag-cvs-afvantages","tag-cvs-features","tag-cvs-techniques","tag-developers","tag-how-cvs-can-help-developers","tag-realtime","tag-realtime-developers","tag-software-developers","tag-useful-cvs-features"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":4033,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/120\/revisions\/4033"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/4032"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}