info-cvs
[Top][All Lists]
Advanced

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

Re: Rename atomicity


From: Assar Westerlund
Subject: Re: Rename atomicity
Date: 23 Mar 2001 23:24:19 +0100
User-agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6

"Derek R. Price" <address@hidden> writes:
> Could you resubmit it to address@hidden  This releases it under the GPL.
> :)  Then I'll take a look.

Sure, included below.

> I'm not promising anything, but if you simply
> fixed '-n' to make the server read only, I can't think of an offhand reason
> to object.  If you did more than this, please either back the rest out or
> provide me with a good argument for the other bits before I spend time trying
> to decipher source code.

That's not what I did.  What the patch below does is introduce an
option (`-R') for running without creating any lock-files.

This allows you to have a non-server based r/o CVSROOT (or where a
particular user does not have write permission).

I'm of course more than welcome to discuss how this should be done,
but I do think that this is something that the users actually want.

/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]