While trying to figure out a way to import symblic links, I started
reading 1.10.7 code and discovered that the revision files can already
handle symbolic links in most routines (and most importantly
add_rcs_file()), using the PRESERVE_PERMISSIONS_SUPPORT code.

I'm curious why import ignores symlinks, then.  From the import output
documentation:

    `L FILE'
         The file is a symbolic link; `cvs import' ignores symbolic
         links.  People periodically suggest that this behavior should
         be changed, but if there is a consensus on what it should be
         changed to, it doesn't seem to be apparent.  (Various options
         in the `modules' file can be used to recreate symbolic links on
         checkout, update, etc).

Now looking at the PreservePermissions code, it seems a simple matter to
allow import to do symbolic links as well:

   --- import.c.orig       Sun May  7 13:18:41 2000
   +++ import.c    Sun May  7 13:20:35 2000
   @@ -451,17 +451,16 @@
                   n->key = xstrdup (dp->d_name);
                   addnode(dirlist, n);
               }
   -           else if (
   +           else
   +           {
   +               if (
    #ifdef DT_DIR
                   dp->d_type == DT_LNK || dp->d_type == DT_UNKNOWN &&
    #endif
                   islink (dp->d_name))
               {
                   add_log ('L', dp->d_name);
   -               err++;
               }
   -           else
   -           {
    #ifdef CLIENT_SUPPORT
                   if (client_active)
                       err += client_process_import_file (message, dp->d_name,

This produces an L line, followed by an N line, on import of a symlink.
I have tried this patch and as long as PerservePermissions is on, it
seems to work fine on import; export already worked.  I have observed
that HEAD of the devel tree doesn't have any symlink-related change to
import.c either.

I am using CVS for SA work (configuration management) and as such, have
a very high degree of interest in maintaining symlinks.  Does anyone
know why the code that is already there isn't used on import? Or if
there is some reason I should not use this patch at our site?

-- 
Scott

Reply via email to