summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/diff3.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-12-03 01:02:10 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-12-03 01:02:10 +0000
commitef47fbf93d2302d521921cce5f98a093b4779e9f (patch)
tree50d76a77cc19c09cea910a3890611cb290e63bab /usr.bin/cvs/diff3.c
parent1c6cd252eaeaeedbd87c69d5843ae9550b20ee91 (diff)
add very basic support for the following stuff:
- checkout in local mode (example: /cvs) - update in local and server mode (example: /cvs and user@host:/cvs) - import in local and server mode (example: /cvs and user@host:/cvs) what remains to be done: - not all options are supported yet, and update cannot pick up newly added files yet. these things are pending and will be commited real soon. - checkout only works locally right now. - fix rcs parsing code so that we don't fucking hog 100% cpu on really BIG BIG BIG ass trees. mainly tested by pedro@ and myself, thanks a lot pedro! "go for it" niallo@
Diffstat (limited to 'usr.bin/cvs/diff3.c')
-rw-r--r--usr.bin/cvs/diff3.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c
index 0c98b74a065..498b4dcc780 100644
--- a/usr.bin/cvs/diff3.c
+++ b/usr.bin/cvs/diff3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3.c,v 1.6 2005/11/08 16:06:03 xsa Exp $ */
+/* $OpenBSD: diff3.c,v 1.7 2005/12/03 01:02:08 joris Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -71,7 +71,7 @@ static const char copyright[] =
#endif /* not lint */
#ifndef lint
-static const char rcsid[] = "$OpenBSD: diff3.c,v 1.6 2005/11/08 16:06:03 xsa Exp $";
+static const char rcsid[] = "$OpenBSD: diff3.c,v 1.7 2005/12/03 01:02:08 joris Exp $";
#endif /* not lint */
#include <sys/queue.h>
@@ -235,16 +235,23 @@ cvs_diff3(RCSFILE *rf, char *workfile, RCSNUM *rev1, RCSNUM *rev2)
argv[argc++] = path1;
argv[argc++] = path2;
argv[argc++] = path3;
- if ((diff3_conflicts = diff3_internal(argc, argv, workfile, r2)) < 0)
+
+ diff3_conflicts = diff3_internal(argc, argv, workfile, r2);
+ if (diff3_conflicts < 0) {
+ cvs_buf_free(diffb);
+ diffb = NULL;
goto out;
+ }
if (cvs_buf_putc(diffb, '\0') < 0) {
cvs_buf_free(diffb);
+ diffb = NULL;
goto out;
}
if (cvs_buf_putc(b1, '\0') < 0) {
cvs_buf_free(diffb);
+ diffb = NULL;
goto out;
}
@@ -258,6 +265,11 @@ 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) {
+ cvs_printf("%d conflict%s found during merge, please correct.\n",
+ diff3_conflicts, (diff3_conflicts > 1) ? "s" : "");
+ }
+
free(data);
free(patch);