bug-cvs
[Top][All Lists]
Advanced

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

new feature: localid (includes patch)


From: wiz
Subject: new feature: localid (includes patch)
Date: Sat, 21 Oct 2000 21:54:13 +0200 (CEST)

>Submitter-Id:   net
>Originator:     Thomas Klausner
>Organization:
>Confidential:  no
>Synopsis:      new feature: localid (includes patch)
>Severity:      serious
>Priority:      high
>Category:      cvs
>Class:         change-request
>Release:       cvs-1.10.8
>Environment:
        
System: NetBSD hiro 1.5H NetBSD 1.5H (HIRO) #0: Sun Oct 15 18:39:16 CEST 2000 
wiz@hiro:/archive/cvs/src/sys-i4b/arch/i386/compile/HIRO i386
>Description:
Some projects want to have their own Id tag instead of 'Id',
cf. FreeBSD, NetBSD, or OpenBSD (which have $FreeBSD$, $NetBSD$, and
$OpenBSD$ resp. as their Id tags).

This patch is the way OpenBSD and now NetBSD changed the cvs source to
achieve this. I feel it's appropriate to include this in the main cvs
tree.

>How-To-Repeat:
n/a

>Fix:

Below is a patch that achieves the wanted (against 1.11).

Index: main.c
===================================================================
RCS file: /cvsroot/gnusrc/gnu/dist/cvs/src/main.c,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -u -r1.1.1.1 -r1.3
--- main.c      2000/09/04 21:47:37     1.1.1.1
+++ main.c      2000/10/21 12:40:23     1.3
@@ -49,6 +50,7 @@
 int top_level_admin = 0;
 
 mode_t cvsumask = UMASK_DFLT;
+char *RCS_citag = NULL;
 
 char *CurDir;
 
Index: mkmodules.c
===================================================================
RCS file: /cvsroot/gnusrc/gnu/dist/cvs/src/mkmodules.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- mkmodules.c 2000/09/04 21:47:39     1.1.1.1
+++ mkmodules.c 2000/10/21 12:40:23     1.2
@@ -297,6 +297,9 @@
     "# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to 
the\n",
     "# history file, or a subset as needed (ie `TMAR' logs all write 
operations)\n",
     "#LogHistory=TOFEWGCMAR\n",
+    "\n",
+    "# Set this to the name of a local tag to use in addition to Id\n",
+    "#tag=OurTag\n",
     NULL
 };
 
Index: parseinfo.c
===================================================================
RCS file: /cvsroot/gnusrc/gnu/dist/cvs/src/parseinfo.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- parseinfo.c 2000/09/04 21:47:44     1.1.1.1
+++ parseinfo.c 2000/10/21 12:40:23     1.2
@@ -335,6 +335,14 @@
                goto error_return;
            }
        }
+       else if (strcmp (line, "tag") == 0) {
+           RCS_citag = strdup(p);
+           if (RCS_citag == NULL) {
+               error (0, 0, "%s: no memory for local tag '%s'",
+                      infopath, p);
+               goto error_return;
+           }
+       }
        else if (strcmp (line, "PreservePermissions") == 0)
        {
            if (strcmp (p, "no") == 0)
Index: rcs.c
===================================================================
RCS file: /cvsroot/gnusrc/gnu/dist/cvs/src/rcs.c,v
retrieving revision 1.1.1.1
retrieving revision 1.4
diff -u -r1.1.1.1 -r1.4
--- rcs.c       2000/09/04 21:48:20     1.1.1.1
+++ rcs.c       2000/10/21 16:59:39     1.4
@@ -3348,7 +3348,7 @@
     size_t len;
 };
 #define KEYWORD_INIT(s) (s), sizeof (s) - 1
-static const struct rcs_keyword keywords[] =
+static struct rcs_keyword keywords[] =
 {
     { KEYWORD_INIT ("Author") },
     { KEYWORD_INIT ("Date") },
@@ -3361,6 +3361,7 @@
     { KEYWORD_INIT ("Revision") },
     { KEYWORD_INIT ("Source") },
     { KEYWORD_INIT ("State") },
+    { NULL, 0 },
     { NULL, 0 }
 };
 enum keyword
@@ -3375,7 +3376,8 @@
     KEYWORD_RCSFILE,
     KEYWORD_REVISION,
     KEYWORD_SOURCE,
-    KEYWORD_STATE
+    KEYWORD_STATE,
+    KEYWORD_LOCALID
 };
 
 /* Convert an RCS date string into a readable string.  This is like
@@ -3512,6 +3514,11 @@
        return;
     }
 
+    if (RCS_citag != NULL) {
+       keywords[KEYWORD_LOCALID].string = RCS_citag;
+       keywords[KEYWORD_LOCALID].len = strlen(RCS_citag);
+    }
+
     /* If we are using -kkvl, dig out the locker information if any.  */
     locker = NULL;
     if (expand == KFLAG_KVL)
@@ -3603,6 +3610,7 @@
 
            case KEYWORD_HEADER:
            case KEYWORD_ID:
+           case KEYWORD_LOCALID:
                {
                    char *path;
                    int free_path;



reply via email to

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