English 中文(简体)
cvs return status of working copy revision
原标题:

I m working on a puppet manifest to deploy our code from a cvs repository. I have the following so far:

define codedeploy::cvs ($module, $tag, $copydir) {

    file { "$copydir":
        owner => www-data,
        group => www-data,
        mode => 755,
        ensure => directory
    }

    #bypass cvs login, we ll just inject a ~/.cvspass file
        # to do

    #initial cvs checkout
    exec { "cvscheckout-$name":
        command => "cvs co -r $tag -d $name $module",
        creates => "$copydir/$name/CVS",
        require => [Package[cvs], File["$copydir"]],
        environment => "CVSROOT=:pserver:robots@codeserver:/cvs/repository",
        cwd => "$copydir"
    }

    #cvs update to tag
    exec { "cvsupdate-$name":
        command => "cvs up -r $tag",
        require => [Package[cvs], File["$copydir"], Exec["cvscheckout-$name"] ],
        environment => "CVSROOT=:pserver:robots@codeserver:/cvs/repository",
        cwd => "$copydir/$name",
        unless => #NEED TO FIGURE THIS PART OUT!
    }
}

The part which I don t know is how I can return the revision status of the working copy, so that it won t call cvs update every puppet run. Does cvs has a command to return the current tag or revision id of the entire working tree? When I do a cvs diff it seems to know it should be diffing all the files under that tag, however I m not sure how I can just return the tag id for my working copy after I ve checked it out.

Thanks!

问题回答

I would guess that you can use cvs status to see if you need to check any changes in.

However, what s the harm in just running cvs up every time? I have cron jobs that do the same thing hourly or daily, and I don t think it s much of an issue. If your codebase is ginormous I suppose that s a reason :)





相关问题
Use the commit message in a CVS pre-commit hook

Is it possible to use the commit message in a pre-commit hook in CVS? The CVS server is running remotely, and I access it using pserver. Ideally, I want to allow the commit if the files pass the ...

Using CVS to #ifdef my changes

I have a large project that has many changes not yet checked in. I want to check them in but have them only take effect when a certain symbol is #define d CVS does have the ability to format diffs ...

Netbeans CVS - existing repo - existing working copy

I m using Netbeans to develop with Drupal. I m trying to let Netbeans get drupal core and modules from the repository on drupal.org to my local working copy. Problem is: I already have a working ...

Does an Eclipse CVS merge appear in the log view of a file?

I m not new to the Branch/Merge idea, but I m new to CVS. I have a sample file that I have brached off of the main trunk, and have made non-conflicting edits to both the branch and the main. When I ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Get local cvs comment history when committing file/s in emacs

I often commit files with similar cvs comment but not in a single operation. I would like to able to bring up previous comments I ve used in a previous commit when I am in the process of writing a ...

热门标签