Source-Changes-HG archive

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

[src/trunk]: src/gnu/usr.bin/rcs Teach rcs about the new cvs "commitid" keywo...



details:   https://anonhg.NetBSD.org/src/rev/79b5097e8f98
branches:  trunk
changeset: 777905:79b5097e8f98
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 08 21:32:28 2012 +0000

description:
Teach rcs about the new cvs "commitid" keyword, so that we don't bitch each
time we play with an RCS file maintained by CVS.

diffstat:

 gnu/usr.bin/rcs/lib/rcsbase.h |   7 ++++++-
 gnu/usr.bin/rcs/lib/rcssyn.c  |  18 +++++++++++++++++-
 gnu/usr.bin/rcs/rlog/rlog.1   |   4 +++-
 gnu/usr.bin/rcs/rlog/rlog.c   |  14 ++++++++++++--
 4 files changed, 38 insertions(+), 5 deletions(-)

diffs (148 lines):

diff -r 401cee80296e -r 79b5097e8f98 gnu/usr.bin/rcs/lib/rcsbase.h
--- a/gnu/usr.bin/rcs/lib/rcsbase.h     Thu Mar 08 20:54:18 2012 +0000
+++ b/gnu/usr.bin/rcs/lib/rcsbase.h     Thu Mar 08 21:32:28 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rcsbase.h,v 1.12 2012/01/12 14:10:56 joerg Exp $       */
+/*     $NetBSD: rcsbase.h,v 1.13 2012/03/08 21:32:28 christos Exp $    */
 
 /* RCS common definitions and data structures */
 
@@ -33,6 +33,10 @@
 
 /*
  * $Log: rcsbase.h,v $
+ * Revision 1.13  2012/03/08 21:32:28  christos
+ * Teach rcs about the new cvs "commitid" keyword, so that we don't bitch each
+ * time we play with an RCS file maintained by CVS.
+ *
  * Revision 1.12  2012/01/12 14:10:56  joerg
  * Second try to sort out the dangling elses. Just use {} markers.
  * Produces identical on amd64.
@@ -383,6 +387,7 @@
        char const        * lockedby; /* who locks the revision             */
        char const        * state;    /* state of revision (Exp by default) */
        char const        * name;     /* name (if any) by which retrieved   */
+       char const        * commitid; /* unique commit identifier           */
        struct cbuf         log;      /* log message requested at checkin   */
         struct branchhead * branches; /* list of first revisions on branches*/
        struct cbuf         ig;       /* ignored phrases in admin part      */
diff -r 401cee80296e -r 79b5097e8f98 gnu/usr.bin/rcs/lib/rcssyn.c
--- a/gnu/usr.bin/rcs/lib/rcssyn.c      Thu Mar 08 20:54:18 2012 +0000
+++ b/gnu/usr.bin/rcs/lib/rcssyn.c      Thu Mar 08 21:32:28 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rcssyn.c,v 1.4 1996/10/15 07:00:26 veego Exp $ */
+/*     $NetBSD: rcssyn.c,v 1.5 2012/03/08 21:32:28 christos Exp $      */
 
 /* RCS file syntactic analysis */
 
@@ -39,6 +39,10 @@
 
 /*
  * $Log: rcssyn.c,v $
+ * Revision 1.5  2012/03/08 21:32:28  christos
+ * Teach rcs about the new cvs "commitid" keyword, so that we don't bitch each
+ * time we play with an RCS file maintained by CVS.
+ *
  * Revision 1.4  1996/10/15 07:00:26  veego
  * Merge rcs 5.7.
  *
@@ -176,6 +180,7 @@
        Kauthor[]   = "author",
        Kbranch[]   = "branch",
        Kcomment[]  = "comment",
+       Kcommitid[] = "commitid",
        Kdate[]     = "date",
        Kdesc[]     = "desc",
        Kexpand[]   = "expand",
@@ -435,6 +440,17 @@
        getkey(Knext);
        Delta->next = num = getdnum();
        getsemi(Knext);
+       if (getkeyopt(Kcommitid)) {
+           if (nexttok == ID) {
+               Delta->commitid = NextString;
+               nextlex();
+           } else {
+               fatserror("missing %s", Kcommitid);
+               Delta->commitid = NULL;
+           }
+           getsemi(Kcommitid);
+       } else
+           Delta->commitid = NULL;
        Delta->lockedby = 0;
        Delta->log.string = 0;
        Delta->selector = true;
diff -r 401cee80296e -r 79b5097e8f98 gnu/usr.bin/rcs/rlog/rlog.1
--- a/gnu/usr.bin/rcs/rlog/rlog.1       Thu Mar 08 20:54:18 2012 +0000
+++ b/gnu/usr.bin/rcs/rlog/rlog.1       Thu Mar 08 21:32:28 2012 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: rlog.1,v 1.5 2002/02/08 01:26:52 ross Exp $
+.\"    $NetBSD: rlog.1,v 1.6 2012/03/08 21:32:28 christos Exp $
 .\"
 .de Id
 .ds Rv \\$3
@@ -48,6 +48,8 @@
 .ds n \nn
 .if \n(.g .if r an-tag-sep .ds n \w'\f3\-V\fP\f2n\fP'u+\n[an-tag-sep]u
 .TP \*n
+.B \-c
+Print the commitid if available.
 .B \-L
 Ignore \*r files that have no locks set.
 This is convenient in combination with
diff -r 401cee80296e -r 79b5097e8f98 gnu/usr.bin/rcs/rlog/rlog.c
--- a/gnu/usr.bin/rcs/rlog/rlog.c       Thu Mar 08 20:54:18 2012 +0000
+++ b/gnu/usr.bin/rcs/rlog/rlog.c       Thu Mar 08 21:32:28 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rlog.c,v 1.6 2012/01/06 15:16:03 joerg Exp $   */
+/*     $NetBSD: rlog.c,v 1.7 2012/03/08 21:32:28 christos Exp $        */
 
 /* Print log messages and other information about RCS files.  */
 
@@ -31,6 +31,10 @@
 
 /*
  * $Log: rlog.c,v $
+ * Revision 1.7  2012/03/08 21:32:28  christos
+ * Teach rcs about the new cvs "commitid" keyword, so that we don't bitch each
+ * time we play with an RCS file maintained by CVS.
+ *
  * Revision 1.6  2012/01/06 15:16:03  joerg
  * Don't use dangling elses.
  *
@@ -223,6 +227,7 @@
 static int branchflag; /*set on -b */
 static int exitstatus;
 static int lockflag;
+static int commitid;
 static struct Datepairs *datelist, *duelst;
 static struct Revpairs *revlist, *Revlst;
 static struct authors *authorlist;
@@ -233,7 +238,7 @@
 mainProg(rlogId, "rlog", "Id: rlog.c,v 5.18 1995/06/16 06:19:24 eggert Exp")
 {
        static char const cmdusage[] =
-               "\nrlog usage: rlog -{bhLNRt} -ddates -l[lockers] -r[revs] -sstates -Vn -w[logins] -xsuff -zzone file ...";
+               "\nrlog usage: rlog -{cbhLNRt} -ddates -l[lockers] -r[revs] -sstates -Vn -w[logins] -xsuff -zzone file ...";
 
        register FILE *out;
        char *a, **newargv;
@@ -260,6 +265,9 @@
        argv = newargv;
        while (a = *++argv,  0<--argc && *a++=='-') {
                switch (*a++) {
+               case 'c':
+                       commitid = true;
+                       break;
 
                case 'L':
                        onlylockflag = true;
@@ -593,6 +601,8 @@
                date2str(node->date, datebuf),
                node->author, node->state
        );
+       if (commitid && node->commitid)
+           aprintf(out, "  commitid: %s;", node->commitid);
 
         if ( editscript ) {
            if(trunk)



Home | Main Index | Thread Index | Old Index