[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cvs annotate bug
From: |
Doug Horner |
Subject: |
cvs annotate bug |
Date: |
Sun, 1 Jun 2008 09:45:23 -0400 |
I am not sure if this is where this should be directed, but:
When doing an annotate on files that have keywords in them the output is
not be correct. Line numbering may be incorrect (particularly when
$Log:$ is used) and version numbers are wrong.
I have included this patch file that does keyword expansion and makes
sure line numbers match.
patch -p0 < cvs-1.11.23.new.patch
see below for patch file.
---------------
Douglas R. Horner
Medical Informatics Engineering, Inc.
6302 Constitution Dr.. Fort Wayne, IN 46804
Phone: 260-459-6270x400 Fax: 260-459-6271
http://www.mieweb.com/
diff -ur cvs-1.11.23/src/annotate.c cvs-1.11.23.new/src/annotate.c
--- cvs-1.11.23/src/annotate.c 2005-04-04 16:46:07.000000000 -0400
+++ cvs-1.11.23.new/src/annotate.c 2008-06-01 07:26:19.000000000
-0400
@@ -268,6 +268,8 @@
struct file_info *finfo;
{
char *expand, *version;
+ char *log;
+ size_t loglen;
if (finfo->rcs == NULL)
return (1);
@@ -295,7 +297,7 @@
else
{
RCS_deltas (finfo->rcs, (FILE *) NULL, (struct rcsbuffer *)
NULL,
- version, RCS_ANNOTATE, NULL, NULL, NULL, NULL);
+ version, RCS_ANNOTATE, NULL, NULL, &log, &loglen);
}
free (version);
return 0;
diff -ur cvs-1.11.23/src/rcs.c cvs-1.11.23.new/src/rcs.c
--- cvs-1.11.23/src/rcs.c 2008-05-07 11:57:34.000000000 -0400
+++ cvs-1.11.23.new/src/rcs.c 2008-06-01 08:24:26.000000000 -0400
@@ -7729,9 +7729,46 @@
cvs_output (ym - 2, 2);
}
cvs_output ("): ", 0);
- if (headlines.vector[ln]->len != 0)
- cvs_output (headlines.vector[ln]->text,
- headlines.vector[ln]->len);
+ if (headlines.vector[ln]->len != 0) {
+ char *nametag=NULL;
+ char *nlog=NULL;
+ size_t nloglen=0;
+ char *tvalue, *new_tvalue;
+ size_t tlen, new_tlen;
+ char *t,*f;
+ size_t l;
+
+ if (log) {
+ nlog = *log;
+ nloglen = *loglen;
+ }
+ tvalue = headlines.vector[ln]->text;
+ tlen = headlines.vector[ln]->len;
+ expand_keywords (rcs, prvers, nametag, nlog,
nloglen,
+ KFLAG_KVL, tvalue, tlen,
&new_tvalue, &new_tlen);
+ f = new_tvalue;
+ l = new_tlen;
+ while ((t=memchr(f, '\n', l))) {
+ char buf[200];
+ cvs_output (f,t-f+1);
+ l=l-(t-f+1);
+ f=t+1;
+ if (l) {
+ sprintf (buf, "%-12s (%-8.8s ):
",
+ prvers->version,
+ prvers->author);
+ cvs_output (buf, 0);
+ }
+ }
+ if (l)
+ cvs_output (f,l);
+ if (new_tvalue!=tvalue)
+ free(new_tvalue);
+
+
+ //cvs_output (headlines.vector[ln]->text,
+ // headlines.vector[ln]->len);
+ }
cvs_output ("\n", 1);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- cvs annotate bug,
Doug Horner <=