info-cvs
[Top][All Lists]
Advanced

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

patch to allow r/o CVSROOT


From: Assar Westerlund
Subject: patch to allow r/o CVSROOT
Date: 18 Feb 2001 03:21:59 +0100
User-agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6

Hi, cvs-ers.

Here's a patch that I (and other people) have found very useful over
the years.  It disables the creation of lock files thereby allowing
you to use a CVSROOT (non-server based) where you don't have
write-permission.  It's relative to the current CVS-tree.  Any
questions/comments?

/assar

Index: src/cvs.h
===================================================================
RCS file: /home2/cvsroot/ccvs/src/cvs.h,v
retrieving revision 1.216
diff -u -w -r1.216 cvs.h
--- src/cvs.h   2001/02/14 04:31:26     1.216
+++ src/cvs.h   2001/02/18 02:18:05
@@ -401,6 +401,7 @@
 extern int trace;              /* Show all commands */
 extern int noexec;             /* Don't modify disk anywhere */
 extern int logoff;             /* Don't write history entry */
+extern int nolock;             /* Don't do any locking */
 
 extern int top_level_admin;
 
Index: src/lock.c
===================================================================
RCS file: /home2/cvsroot/ccvs/src/lock.c,v
retrieving revision 1.54
diff -u -w -r1.54 lock.c
--- src/lock.c  2001/02/06 15:29:43     1.54
+++ src/lock.c  2001/02/18 02:18:05
@@ -396,7 +396,7 @@
     FILE *fp;
     char *tmp;
 
-    if (noexec)
+    if (noexec || nolock)
        return (0);
 
     /* we only do one directory at a time for read locks! */
@@ -468,7 +468,7 @@
 {
     char *wait_repos;
 
-    if (noexec)
+    if (noexec || nolock)
        return (0);
 
     /* We only know how to do one list at a time */
Index: src/main.c
===================================================================
RCS file: /home2/cvsroot/ccvs/src/main.c,v
retrieving revision 1.160
diff -u -w -r1.160 main.c
--- src/main.c  2001/02/14 04:31:26     1.160
+++ src/main.c  2001/02/18 02:18:05
@@ -42,6 +42,7 @@
 int trace = 0;
 int noexec = 0;
 int logoff = 0;
+int nolock = 0;
 
 /* Set if we should be writing CVSADM directories at top level.  At
    least for now we'll make the default be off (the CVS 1.9, not CVS
@@ -242,6 +243,7 @@
     "    -r           Make checked-out files read-only.\n",
     "    -w           Make checked-out files read-write (default).\n",
     "    -l           Turn history logging off.\n",
+    "    -R           Don't create lock files (allow r/o CVSROOT), implies 
-l.\n",
     "    -n           Do not execute anything that will change the disk.\n",
     "    -t           Show trace of program execution -- try with -n.\n",
     "    -v           CVS version and copyright.\n",
@@ -436,7 +438,7 @@
     int help = 0;              /* Has the user asked for help?  This
                                   lets us support the `cvs -H cmd'
                                   convention to give help for cmd. */
-    static const char short_options[] = "+Qqrwtnlvb:T:e:d:Hfz:s:xa";
+    static const char short_options[] = "+QqrwtnlRvb:T:e:d:Hfz:s:xa";
     static struct option long_options[] =
     {
         {"help", 0, NULL, 'H'},
@@ -567,6 +569,10 @@
            case 'n':
                noexec = 1;
            case 'l':                   /* Fall through */
+               logoff = 1;
+               break;
+           case 'R':
+               nolock = 1;
                logoff = 1;
                break;
            case 'v':



reply via email to

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