[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Soft link in CVS
From: |
Philip Lijnzaad |
Subject: |
Re: Soft link in CVS |
Date: |
15 Oct 2001 11:57:44 +0100 |
> Hi,
> =20
> Does anyone know of the best way to support soft link in UNIX in a
> CVSROOT ?
> =20
> I want some files that reside in one directory to be linked to files
> exist in other directory. When I checkout/update/commit the files in any
> of the directories it will update the second one.
> Thanks=20
Kaz Kylheku posted this here a while back. I haven't used it, but it does
look useful (and I'd be interested in feedback on it). Cheers,
Philip
------------------------------------------------------------------------
From: address@hidden (Kaz Kylheku)
Subject: possible solution! (was Re: symbolic links in repository)
Newsgroups: gnu.cvs.help
Date: Fri, 07 May 1999 17:35:51 GMT
Organization: Psycho-Neurotic Institute for The Very, Very Nervous
Path:
hgmp.mrc.ac.uk!server1.netnews.ja.net!server5.netnews.ja.net!HEAnet!newsfeed.esat.net!nntp.primenet.com!newsfeed.direct.ca!newsgate.direct.ca!kaz
References: <address@hidden>
Message-ID: <address@hidden>
X-Newsreader: slrn (0.9.4.3 UNIX)
Lines: 38
NNTP-Posting-Host: 204.239.179.1
X-Trace: newsgate.direct.ca 926098551 204.239.179.1 (Fri, 07 May 1999
10:35:51 PDT)
NNTP-Posting-Date: Fri, 07 May 1999 10:35:51 PDT
Xref: hgmp.mrc.ac.uk gnu.cvs.help:74
On Fri, 07 May 1999 00:20:29 GMT, Kaz Kylheku <address@hidden> wrote:
>Say I have a file called ``xyzzy.c,v'' inside the repository for module
>``foo''. And I symbolically link to it from module ``bar''. If two
programmers
>are concurrently commiting the file in separate modules, or if one is
commiting
>while another one is reading, there will be a problem. I mean, looking at
>foo/xyzzy.c,v alone, you have no clue what links may be pointing at it, short
>of doing an exhaustive search. It would be good if CVS would go to the
>directory where the file actually resides and create the lock there, but it
>doesn't seem to do that.
I have figured out an ingenious way to use symbolic links among files in
modules and have correct locks. This method is based around the ``LockDir''
feature of CVS 1.10.
Here is how it works: say you have two modules foo and bar which have links
(hard or sym) to each other's ,v files in the repository. In order to have
consistent locking, you edit your CVSROOT/config file to set up a separate
locking hierarchy using LockDir=<directory>. Then you create that top level
lock directory and check out foo and bar. This will create the lock directory
structure.
Now here is the trick: you now perform some symbolic link magic within the
lock
directory structure. If foo and bar share files, then what you want is to
merge their lock directories so that whenever foo is locked, bar is also
locked. The way you do this is to turn one of them into a symbolic link to the
other. So from the point of view of locking, there is now only a single
directory for both modules, even though the are distinct directories. Simply
rmdir bar, and then ln -s foo bar. CVS is fooled; it follows the symbolic
links in the LockDir hierarchy and creates its lock dirs and files wherever
you
want it to.
For more then two modules, you simply have to do more merging by transitive
closure of the sharing relation. So if module A and B share files, and module
B
and C share files, you have to treat things as though A and C share and create
a single locking directory for A, B, and C. (Of course, this merging of
locks reduces concurrency.
Looks marvellous to me so far. Any comments from CVS experts?
------------------------------------------------------------------------
--
The mail transport agent is not liable for any coffee stains in this message
-----------------------------------------------------------------------------
Philip Lijnzaad, address@hidden European Bioinformatics Institute,rm A2-08
+44 (0)1223 49 4639 Wellcome Trust Genome Campus, Hinxton
+44 (0)1223 49 4468 (fax) Cambridgeshire CB10 1SD, GREAT BRITAIN
- Soft link in CVS, Eli Eaton, 2001/10/14
- Soft link in CVS, Eli Eaton, 2001/10/15
- Re: Soft link in CVS,
Philip Lijnzaad <=
- RE: Soft link in CVS, Kostur, Andre, 2001/10/15
- RE: Soft link in CVS, Kostur, Andre, 2001/10/15
- Re: Soft link in CVS, Dorothy Valiga, 2001/10/22