summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2006-03-14 15:59:07 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2006-03-14 15:59:07 +0000
commit87658690ec71fec07a9118602b0509e4269659a6 (patch)
tree057b194029659fb51c69dfdd93e075419ddb4978
parent6394563ad4360b338a8cf3f3156e0f2d089d571f (diff)
add an argument to cvs_diff3() to be able to handle verbosity of
commands; fixes rcsmerge -q behaviour. OK niallo@ ray@.
-rw-r--r--usr.bin/cvs/diff.h4
-rw-r--r--usr.bin/cvs/diff3.c14
-rw-r--r--usr.bin/cvs/update.c4
-rw-r--r--usr.bin/rcs/rcsmerge.c5
4 files changed, 15 insertions, 12 deletions
diff --git a/usr.bin/cvs/diff.h b/usr.bin/cvs/diff.h
index 7d0d7f38f1a..e9020a8e30e 100644
--- a/usr.bin/cvs/diff.h
+++ b/usr.bin/cvs/diff.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.h,v 1.7 2005/11/21 15:01:10 xsa Exp $ */
+/* $OpenBSD: diff.h,v 1.8 2006/03/14 15:59:06 xsa Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
* All rights reserved.
@@ -97,7 +97,7 @@
struct cvs_lines;
#endif
-BUF *cvs_diff3(RCSFILE *, char *, RCSNUM *, RCSNUM *);
+BUF *cvs_diff3(RCSFILE *, char *, RCSNUM *, RCSNUM *, int);
void diff_output(const char *, ...);
int cvs_diffreg(const char *, const char *, BUF *out);
int ed_patch_lines(struct cvs_lines *, struct cvs_lines *);
diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c
index ec0fdc47f8f..2ef09bae38c 100644
--- a/usr.bin/cvs/diff3.c
+++ b/usr.bin/cvs/diff3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3.c,v 1.17 2006/03/06 13:22:59 xsa Exp $ */
+/* $OpenBSD: diff3.c,v 1.18 2006/03/14 15:59:06 xsa 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.17 2006/03/06 13:22:59 xsa Exp $";
+ "$OpenBSD: diff3.c,v 1.18 2006/03/14 15:59:06 xsa Exp $";
#endif /* not lint */
#include "includes.h"
@@ -155,7 +155,7 @@ static int diff3_internal(int, char **, const char *, const char *);
int diff3_conflicts = 0;
BUF *
-cvs_diff3(RCSFILE *rf, char *workfile, RCSNUM *rev1, RCSNUM *rev2)
+cvs_diff3(RCSFILE *rf, char *workfile, RCSNUM *rev1, RCSNUM *rev2, int verbose)
{
int ret, argc;
char *data, *patch;
@@ -173,11 +173,13 @@ cvs_diff3(RCSFILE *rf, char *workfile, RCSNUM *rev1, RCSNUM *rev2)
if ((b1 = cvs_buf_load(workfile, BUF_AUTOEXT)) == NULL)
goto out;
- cvs_printf("Retrieving revision %s\n", r1);
+ if (verbose == 1)
+ cvs_printf("Retrieving revision %s\n", r1);
if ((b2 = rcs_getrev(rf, rev1)) == NULL)
goto out;
- cvs_printf("Retrieving revision %s\n", r2);
+ if (verbose == 1)
+ cvs_printf("Retrieving revision %s\n", r2);
if ((b3 = rcs_getrev(rf, rev2)) == NULL)
goto out;
@@ -237,7 +239,7 @@ cvs_diff3(RCSFILE *rf, char *workfile, RCSNUM *rev1, RCSNUM *rev2)
if ((diffb = cvs_patchfile(data, patch, ed_patch_lines)) == NULL)
goto out;
- if (diff3_conflicts != 0) {
+ if ((verbose ==1) && (diff3_conflicts != 0)) {
cvs_log(LP_WARN, "%d conflict%s found during merge, "
"please correct.", diff3_conflicts,
(diff3_conflicts > 1) ? "s" : "");
diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c
index f42a945bece..5f2946f9905 100644
--- a/usr.bin/cvs/update.c
+++ b/usr.bin/cvs/update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: update.c,v 1.54 2006/01/27 15:26:38 xsa Exp $ */
+/* $OpenBSD: update.c,v 1.55 2006/03/14 15:59:06 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -284,7 +284,7 @@ cvs_update_local(CVSFILE *cf, void *arg)
* available, we try to merge it into the existing changes.
*/
if (revdiff == 1) {
- fbuf = cvs_diff3(rf, fpath, cf->cf_lrev, frev);
+ fbuf = cvs_diff3(rf, fpath, cf->cf_lrev, frev, 0);
if (fbuf == NULL) {
cvs_log(LP_ERR, "merge failed");
break;
diff --git a/usr.bin/rcs/rcsmerge.c b/usr.bin/rcs/rcsmerge.c
index 58b1e6e1211..31a53805553 100644
--- a/usr.bin/rcs/rcsmerge.c
+++ b/usr.bin/rcs/rcsmerge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsmerge.c,v 1.19 2006/03/08 12:34:53 xsa Exp $ */
+/* $OpenBSD: rcsmerge.c,v 1.20 2006/03/14 15:59:06 xsa Exp $ */
/*
* Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org>
* All rights reserved.
@@ -133,7 +133,8 @@ rcsmerge_main(int argc, char **argv)
"%s into %s%s\n", r1, r2, argv[i],
(pipeout == 1) ? "; result to stdout":"");
- if ((bp = cvs_diff3(file, argv[i], baserev, frev)) == NULL) {
+ if ((bp = cvs_diff3(file, argv[i], baserev,
+ frev, verbose)) == NULL) {
cvs_log(LP_ERR, "failed to merge");
rcs_close(file);
continue;