About the first possibility below, this was the first thing that I tried before I sent the message to the mailing list. I noticed that I have a problem with sticky dates: I cannot take the sticky date from the output of "cvs status" and just use "cvs update -D <sticky-date>". I need to do a format conversion, and moreover, I need to translate the timezone!
I preferred not to use the 2nd option because then I would need to add support for each OS/shell. (The copy command would be different.) Just FYI, I am no longer interested in a solution for this because I am now taking a different approach to my problem, which avoids the need in any CVS operations. However, I have learned a few very valuable and interesting things during this discussion... Thanks, Shlomo -----Original Message----- From: Eric Siegerman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 25, 2002 1:31 AM To: '[EMAIL PROTECTED]' Subject: Re: How to find out the CVSROOT and location in the repository of a w orking directory > To be more specific about what I need (maybe there's a way to do it without > caring for the CVSROOT and location), I have a file in each module that has > a fixed name and is used by my script to enable users to "lock" the module > for a short time. Whenever a new branch is created for a module, this file > should be "initialized" for that branch, to indicate that the branch is "not > locked". To do this, the script should modify it and commit a new revision > of it into the branch. (This is needed because the file might indicate > "locked" state for the root of the branch.) In order to do this, I want to > check-out a fresh copy of that file (okay, with its whole directory) to a > temporary directory, and then do these things on the copy in the temporary > directory. In order to check it out, I need the CVSROOT and location within > the repository. Three possibilities: 1. Do this in place, without using a temporary directory: - use "cvs status lock-file" (no -t needed) to learn which is the sticky branch or date for the file, if any - use "cvs update -r <new-branch> lock-file" to put the lock file onto the correct branch - make your changes, and commit - use "cvs update -C" (and either -D/-r or -A) to restore the lock file to its previous state 2. Use the temporary directory, but copy it from the working directory rather than checking it out fresh. - Use something like this shell pseudocode to set up the temporary directory: cd working-dir mkdir /tmp/foo$$ cp -pR lock-file CVS /tmp/foo$$ (Note that we only copy the lock file itself, not the rest of the directory's contents.) - Make your changes to the temporary copy - Commit. You'll have to name the file explicitly: cvs commit lock-file Otherwise the up-to-date check will fail, because all the other files in the (temporary) working directory will be missing. 3. As Larry Jones says, give in and use CVS/Root and CVS/Repository. -- | | /\ |-_|/ > Eric Siegerman, Toronto, Ont. [EMAIL PROTECTED] | | / Anyone who swims with the current will reach the big music steamship; whoever swims against the current will perhaps reach the source. - Paul Schneider-Esleben _______________________________________________ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs _______________________________________________ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
