summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/diff3.c
diff options
context:
space:
mode:
authorniallo <niallo@openbsd.org>2007-01-12 23:32:01 +0000
committerniallo <niallo@openbsd.org>2007-01-12 23:32:01 +0000
commit0dbb72f1b23a83ad5d0727796cbdc2ed429b89e8 (patch)
treec26328e77bd4496669fd780c97dbcd8dc9d7eafc /usr.bin/cvs/diff3.c
parentMini-PCI Express -> PCI Express Mini Card as per PCI-SIG name. (diff)
downloadwireguard-openbsd-0dbb72f1b23a83ad5d0727796cbdc2ed429b89e8.tar.xz
wireguard-openbsd-0dbb72f1b23a83ad5d0727796cbdc2ed429b89e8.zip
major re-work of the RCS api. this results in 100x performance improvements in some places and much
reduced memory usage. note that only checkout has been fully converted to use the new high-performance functions. other codepaths (e.g. update) still use the old method which is provided for backwards compatibility. we can convert the remaining slow bits over to the new api piece-by-piece. "commit this, now" joris@ brad@ tested, too.
Diffstat (limited to 'usr.bin/cvs/diff3.c')
-rw-r--r--usr.bin/cvs/diff3.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c
index cde14172d0e..b7a43e097aa 100644
--- a/usr.bin/cvs/diff3.c
+++ b/usr.bin/cvs/diff3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3.c,v 1.31 2007/01/12 17:25:33 joris Exp $ */
+/* $OpenBSD: diff3.c,v 1.32 2007/01/12 23:32:01 niallo Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -72,7 +72,7 @@ static const char copyright[] =
#ifndef lint
static const char rcsid[] =
- "$OpenBSD: diff3.c,v 1.31 2007/01/12 17:25:33 joris Exp $";
+ "$OpenBSD: diff3.c,v 1.32 2007/01/12 23:32:01 niallo Exp $";
#endif /* not lint */
#include "includes.h"
@@ -173,16 +173,6 @@ cvs_diff3(RCSFILE *rf, char *workfile, int workfd, RCSNUM *rev1,
if ((b1 = cvs_buf_load_fd(workfd, BUF_AUTOEXT)) == NULL)
goto out;
- if (verbose == 1)
- cvs_printf("Retrieving revision %s\n", r1);
- if ((b2 = rcs_getrev(rf, rev1)) == NULL)
- goto out;
-
- if (verbose == 1)
- cvs_printf("Retrieving revision %s\n", r2);
- if ((b3 = rcs_getrev(rf, rev2)) == NULL)
- goto out;
-
d1 = cvs_buf_alloc((size_t)128, BUF_AUTOEXT);
d2 = cvs_buf_alloc((size_t)128, BUF_AUTOEXT);
diffb = cvs_buf_alloc((size_t)128, BUF_AUTOEXT);
@@ -192,11 +182,12 @@ cvs_diff3(RCSFILE *rf, char *workfile, int workfd, RCSNUM *rev1,
(void)xasprintf(&path3, "%s/diff3.XXXXXXXXXX", cvs_tmpdir);
cvs_buf_write_stmp(b1, path1, NULL);
- cvs_buf_write_stmp(b2, path2, NULL);
- cvs_buf_write_stmp(b3, path3, NULL);
-
- cvs_buf_free(b2);
- b2 = NULL;
+ if (verbose == 1)
+ cvs_printf("Retrieving revision %s\n", r1);
+ rcs_rev_write_stmp(rf, rev1, path2, 0);
+ if (verbose == 1)
+ cvs_printf("Retrieving revision %s\n", r2);
+ rcs_rev_write_stmp(rf, rev2, path3, 0);
cvs_diffreg(path1, path3, d1);
cvs_diffreg(path2, path3, d2);
@@ -249,10 +240,6 @@ cvs_diff3(RCSFILE *rf, char *workfile, int workfd, RCSNUM *rev1,
out:
if (b1 != NULL)
cvs_buf_free(b1);
- if (b2 != NULL)
- cvs_buf_free(b2);
- if (b3 != NULL)
- cvs_buf_free(b3);
if (d1 != NULL)
cvs_buf_free(d1);
if (d2 != NULL)