summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/diff.c
diff options
context:
space:
mode:
authorjoris <joris@openbsd.org>2007-01-14 23:10:56 +0000
committerjoris <joris@openbsd.org>2007-01-14 23:10:56 +0000
commitff7b57e3f6dc2a8d4cd730a981a371de2cd30297 (patch)
tree5caed1e8b5686380f17e16c7e276937fefd9c77d /usr.bin/cvs/diff.c
parentreset sticky tags with -A; OK joris@. (diff)
downloadwireguard-openbsd-ff7b57e3f6dc2a8d4cd730a981a371de2cd30297.tar.xz
wireguard-openbsd-ff7b57e3f6dc2a8d4cd730a981a371de2cd30297.zip
move things around in rcs_rev_getbuf() and rcs_rev_write_fd()
so that we do keyword expansion on-the-fly if required instead of obtaining the revision in memory first, running over the revision lines while expanding keywords and only then writing them to the fd or memory buffer. this drasticly decreases cpu usage by opencvs on very large trees (like src). OK niallo@
Diffstat (limited to 'usr.bin/cvs/diff.c')
-rw-r--r--usr.bin/cvs/diff.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c
index 5ca0bacf17c..c5736d530da 100644
--- a/usr.bin/cvs/diff.c
+++ b/usr.bin/cvs/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.112 2007/01/12 23:32:01 niallo Exp $ */
+/* $OpenBSD: diff.c,v 1.113 2007/01/14 23:10:56 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -209,11 +209,9 @@ cvs_diff_local(struct cvs_file *cf)
diff_rev1 = r1;
rcsnum_tostr(r1, rbuf , sizeof(rbuf));
cvs_printf("retrieving revision %s\n", rbuf);
- if ((b1 = rcs_rev_getbuf(cf->file_rcs, r1)) == NULL)
+ if ((b1 = rcs_rev_getbuf(cf->file_rcs, r1, 0)) == NULL)
fatal("failed to retrieve revision %s", rbuf);
- b1 = rcs_kwexp_buf(b1, cf->file_rcs, r1);
-
tv[0].tv_sec = rcs_rev_getdate(cf->file_rcs, r1);
tv[0].tv_usec = 0;
tv[1] = tv[0];
@@ -223,11 +221,9 @@ cvs_diff_local(struct cvs_file *cf)
cf->file_status != FILE_REMOVED) {
rcsnum_tostr(diff_rev2, rbuf, sizeof(rbuf));
cvs_printf("retrieving revision %s\n", rbuf);
- if ((b2 = rcs_rev_getbuf(cf->file_rcs, diff_rev2)) == NULL)
+ if ((b2 = rcs_rev_getbuf(cf->file_rcs, diff_rev2, 0)) == NULL)
fatal("failed to retrieve revision %s", rbuf);
- b2 = rcs_kwexp_buf(b2, cf->file_rcs, diff_rev2);
-
tv2[0].tv_sec = rcs_rev_getdate(cf->file_rcs, diff_rev2);
tv2[0].tv_usec = 0;
tv2[1] = tv2[0];