Module Name:    src
Committed By:   christos
Date:           Thu Mar  8 21:32:28 UTC 2012

Modified Files:
        src/gnu/usr.bin/rcs/lib: rcsbase.h rcssyn.c
        src/gnu/usr.bin/rcs/rlog: rlog.1 rlog.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/gnu/usr.bin/rcs/lib/rcsbase.h
cvs rdiff -u -r1.4 -r1.5 src/gnu/usr.bin/rcs/lib/rcssyn.c
cvs rdiff -u -r1.5 -r1.6 src/gnu/usr.bin/rcs/rlog/rlog.1
cvs rdiff -u -r1.6 -r1.7 src/gnu/usr.bin/rcs/rlog/rlog.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/usr.bin/rcs/lib/rcsbase.h
diff -u src/gnu/usr.bin/rcs/lib/rcsbase.h:1.12 src/gnu/usr.bin/rcs/lib/rcsbase.h:1.13
--- src/gnu/usr.bin/rcs/lib/rcsbase.h:1.12	Thu Jan 12 09:10:56 2012
+++ src/gnu/usr.bin/rcs/lib/rcsbase.h	Thu Mar  8 16:32:28 2012
@@ -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 @@ Report problems and direct all questions
 
 /*
  * $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 @@ struct hshentry {
 	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	    */

Index: src/gnu/usr.bin/rcs/lib/rcssyn.c
diff -u src/gnu/usr.bin/rcs/lib/rcssyn.c:1.4 src/gnu/usr.bin/rcs/lib/rcssyn.c:1.5
--- src/gnu/usr.bin/rcs/lib/rcssyn.c:1.4	Tue Oct 15 03:00:26 1996
+++ src/gnu/usr.bin/rcs/lib/rcssyn.c	Thu Mar  8 16:32:28 2012
@@ -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 @@ Report problems and direct all questions
 
 /*
  * $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 @@ char const
 	Kauthor[]   = "author",
 	Kbranch[]   = "branch",
 	Kcomment[]  = "comment",
+	Kcommitid[] = "commitid",
 	Kdate[]     = "date",
 	Kdesc[]     = "desc",
 	Kexpand[]   = "expand",
@@ -435,6 +440,17 @@ getdelta()
 	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;

Index: src/gnu/usr.bin/rcs/rlog/rlog.1
diff -u src/gnu/usr.bin/rcs/rlog/rlog.1:1.5 src/gnu/usr.bin/rcs/rlog/rlog.1:1.6
--- src/gnu/usr.bin/rcs/rlog/rlog.1:1.5	Thu Feb  7 20:26:52 2002
+++ src/gnu/usr.bin/rcs/rlog/rlog.1	Thu Mar  8 16:32:28 2012
@@ -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 @@ The options below restrict this output.
 .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

Index: src/gnu/usr.bin/rcs/rlog/rlog.c
diff -u src/gnu/usr.bin/rcs/rlog/rlog.c:1.6 src/gnu/usr.bin/rcs/rlog/rlog.c:1.7
--- src/gnu/usr.bin/rcs/rlog/rlog.c:1.6	Fri Jan  6 10:16:03 2012
+++ src/gnu/usr.bin/rcs/rlog/rlog.c	Thu Mar  8 16:32:28 2012
@@ -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 @@ Report problems and direct all questions
 
 /*
  * $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 char const *insDelFormat;
 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 @@ static struct stateattri *statelist;
 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 @@ mainProg(rlogId, "rlog", "Id: rlog.c,v 5
 	argv = newargv;
 	while (a = *++argv,  0<--argc && *a++=='-') {
 		switch (*a++) {
+		case 'c':
+			commitid = true;
+			break;
 
 		case 'L':
 			onlylockflag = true;
@@ -593,6 +601,8 @@ putadelta(node,editscript,trunk)
 		date2str(node->date, datebuf),
 		node->author, node->state
 	);
+	if (commitid && node->commitid)
+	    aprintf(out, "  commitid: %s;", node->commitid);
 
         if ( editscript ) {
            if(trunk)

Reply via email to