Can CVS repository commit command pass command line arguments to the files?

82 views Asked by At

Is there a way to pass command line arguments to the files present in the CVS repository. Say, my CVS repository has a .tcl file which prints version number and date along with other processing. I don't want to hardcode the version number and date into that file. Whenever somebody modifies the file and checks it into CVS, can they add a tag for version number and date which will modify the tcl file accordingly?

Say I have test.tcl

puts "Version Number: **V1.2**
puts "Date: 05/05/10"
....
.....

If I modify the file and want to commit into CVS, saying "cvs commit test.tcl v1.3 06/19/15" or something like that

the test.tcl should get committed in CVS and it should be:

    puts "Version Number: **V1.3**
    puts "Date: 06/19/15"

......
......

Is there a way to get this done?

1

There are 1 answers

0
Str. On BEST ANSWER

First hint: keyword substituion

If you just want version numbers or commit time - CVS has something that enraged Linus Torvalds so much he started to design git: it can change your files on commit. See for example $Id$ and others at this MIT doc page.

Second hint: see Running arbitrary scripts under CVS, the title says it all.