summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/diff.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2007-01-14 23:10:57 +0000
committerJoris Vink <joris@cvs.openbsd.org>2007-01-14 23:10:57 +0000
commit8e2e51c2f75899482f2a59499239c2bb54d1eaeb (patch)
tree1075dbd3e0bc73127a2870e494198b16d702e983 /usr.bin/cvs/diff.c
parent4a6ace10112dd859902ed70625edfcbbd9f62161 (diff)
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];