info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I want recursion, just not into other modules: possible?


From: Richard J. Duncan
Subject: Re: I want recursion, just not into other modules: possible?
Date: Sun, 8 Oct 2000 21:11:26 -0500 (CDT)

> main
> main/module1 
> main/module2
> ...
> main/src
> main/src/module5
> main/src/module6
> ...
> 
> where main is the main module (which contains a src sub-directory),
> which happens to be on a branch other than the module* modules.
> 
> When I want to update `main' onto yet another branch, I do this:
> 
> cd main
> cvs update -d -r branch_foo
> 
> which of course descends into `main' and all the module* modules.
> Because there is not a branch_foo tag in the module* modules, it
> removes all the files in those modules.  Then, I have to go into them
> (I have a script that does it) and "cvs update -d -r <original tag>".
> 
> This entire process takes 30 minutes, whereas it would take minutes if
> I didn't have to do the last step.


> Either I'm using cvs wrong, which I would argue I'm not, or cvs is
> lacking a feature that will allow me to use it more effectively.

I'll leave this question to the gurus, but here is an easy
optimization for your current process. Why not check for the existance
of the tag before you start updating? Ie,

runme.pl branch_foo

#!/usr/local/bin/perl
# file: runme.pl
#
$tag = shift;

chdir($ENV{CVSROOT});
@dirs = `find . -type d -maxdepth 1 -mindepth 1 -print`

foreach $dir (@dirs) {
 open(FP, "cvs status -l -v $dir") or die "can't run command: $!";
 while (<FP>) {
  if (/\s$tag\s/) {
     system "cvs update -d -r $tag $dir";
     break;
  } 
 }
 close(FP);
}

-Rick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]