aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodney W. Grimes <rgrimes@FreeBSD.org>1994-05-24 08:16:26 +0000
committerRodney W. Grimes <rgrimes@FreeBSD.org>1994-05-24 08:16:26 +0000
commit628b2ef68cdc04f2b5d5ec381ab5bc16f16bb7f6 (patch)
tree05a603b490128a1169fee099dac78216ea18ca33
parentb0ca86919bf42703e4d790de6ad718875d39be01 (diff)
downloadsrc-628b2ef68cdc04f2b5d5ec381ab5bc16f16bb7f6.tar.gz
src-628b2ef68cdc04f2b5d5ec381ab5bc16f16bb7f6.zip
Got this from think.com, nice patch to add Index: lines to cvs diff output
so you can put it right into patch. Patch by Brian Berliner.
Notes
Notes: svn path=/head/; revision=1538
-rw-r--r--gnu/usr.bin/cvs/cvs/diff.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/gnu/usr.bin/cvs/cvs/diff.c b/gnu/usr.bin/cvs/cvs/diff.c
index db8b4b746e8d..003c2e3c602a 100644
--- a/gnu/usr.bin/cvs/cvs/diff.c
+++ b/gnu/usr.bin/cvs/cvs/diff.c
@@ -22,6 +22,7 @@ static char rcsid[] = "@(#)diff.c 1.52 92/04/10";
#if __STDC__
static Dtype diff_dirproc (char *dir, char *pos_repos, char *update_dir);
+static int diff_filesdoneproc (int err, char *repos, char *update_dir);
static int diff_dirleaveproc (char *dir, int err, char *update_dir);
static int diff_file_nodiff (char *file, char *repository, List *entries,
List *srcfiles, Vers_TS *vers);
@@ -31,6 +32,7 @@ static void diff_mark_errors (int err);
#else
static int diff_fileproc ();
static Dtype diff_dirproc ();
+static int diff_filesdoneproc ();
static int diff_dirleaveproc ();
static int diff_file_nodiff ();
static void diff_mark_errors ();
@@ -151,7 +153,7 @@ diff (argc, argv)
options = xstrdup ("");
/* start the recursion processor */
- err = start_recursion (diff_fileproc, (int (*) ()) NULL, diff_dirproc,
+ err = start_recursion (diff_fileproc, diff_filesdoneproc, diff_dirproc,
diff_dirleaveproc, argc, argv, local,
W_LOCAL, 0, 1, (char *) NULL, 1);
@@ -226,7 +228,14 @@ diff_fileproc (file, update_dir, repository, entries, srcfiles)
return (0);
}
+ /* Output an "Index:" line for patch to use */
(void) fflush (stdout);
+ if (update_dir[0])
+ (void) printf ("Index: %s/%s\n", update_dir, file);
+ else
+ (void) printf ("Index: %s\n", file);
+ (void) fflush (stdout);
+
if (use_rev2)
{
run_setup ("%s%s %s %s -r%s -r%s", Rcsbin, RCS_DIFF,
@@ -288,7 +297,20 @@ diff_dirproc (dir, pos_repos, update_dir)
}
/*
- * Concoct the proper exit status.
+ * Concoct the proper exit status - done with files
+ */
+/* ARGSUSED */
+static int
+diff_filesdoneproc (err, repos, update_dir)
+ int err;
+ char *repos;
+ char *update_dir;
+{
+ return (diff_errors);
+}
+
+/*
+ * Concoct the proper exit status - leaving directories
*/
/* ARGSUSED */
static int