[EMAIL PROTECTED] wrote:
Is there a CVS command that I can issue that will give me the top-level
directory from within /home/tabi/1639/source?  That is, something like:

[tabi: ~/1639/source] cvs query directory
/home/tabi/1639
[tabi: ~/1639/source]

The reason I do this is that I create a sandbox for each bug that I
work on, and I often work on several bugs at once.  In this case, I'm
working on bug 1639.  I would like to write some shell scripts that
need to know where the top level directory of my sandbox is.  I've
search the Internet and the man pages, and I see no way to do this.

Three possibilities come to mind:

1. Write your shell script to look for the top-level directory by searching up until it finds a directory that doesn't contain a 'CVS' sub-directory. The last directory with a 'CVS' sub-directory is your top-level.

2. If you have a hierarchy containing directories from different respositories, your script could diff the contents of the CVS/Root directory in the current directory with each ancestor CVS/Root file until it finds one that doesn't match. The last directory with a matching 'CVS/Root' file is your top-level.

3. You could simply look at the first path element of the line in the CVS/Repository file. That's normally the name of the top-level directory. (Note, however, that there's no guarantee that the format of this file will remain the same.)

--
----------------
Mark E. Hamilton
Orion International Technologies, Inc.
Sandia National Laboratory, NM.
505-844-7666



_______________________________________________
Info-cvs mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/info-cvs

Reply via email to