version 1.26, 2006/04/14 16:28:24 |
version 1.27, 2006/04/19 06:53:41 |
|
|
#include "rcsprog.h" |
#include "rcsprog.h" |
#include "diff.h" |
#include "diff.h" |
|
|
static int kflag = RCS_KWEXP_ERR; |
|
|
|
int |
int |
rcsmerge_main(int argc, char **argv) |
rcsmerge_main(int argc, char **argv) |
{ |
{ |
int i, ch; |
int i, ch, flags, kflag; |
char *fcont, fpath[MAXPATHLEN], r1[16], r2[16], *rev_str1, *rev_str2; |
char *fcont, fpath[MAXPATHLEN], r1[16], r2[16], *rev_str1, *rev_str2; |
RCSFILE *file; |
RCSFILE *file; |
RCSNUM *rev1, *rev2; |
RCSNUM *rev1, *rev2; |
BUF *bp; |
BUF *bp; |
|
|
|
flags = 0; |
|
kflag = RCS_KWEXP_ERR; |
rev1 = rev2 = NULL; |
rev1 = rev2 = NULL; |
rev_str1 = rev_str2 = NULL; |
rev_str1 = rev_str2 = NULL; |
|
|
|
|
break; |
break; |
case 'q': |
case 'q': |
rcs_setrevstr2(&rev_str1, &rev_str2, rcs_optarg); |
rcs_setrevstr2(&rev_str1, &rev_str2, rcs_optarg); |
verbose = 0; |
flags |= QUIET; |
break; |
break; |
case 'r': |
case 'r': |
rcs_setrevstr2(&rev_str1, &rev_str2, rcs_optarg); |
rcs_setrevstr2(&rev_str1, &rev_str2, rcs_optarg); |
|
|
if ((file = rcs_open(fpath, RCS_READ)) == NULL) |
if ((file = rcs_open(fpath, RCS_READ)) == NULL) |
continue; |
continue; |
|
|
if (verbose == 1) |
if (!(flags & QUIET)) |
fprintf(stderr, "RCS file: %s\n", fpath); |
fprintf(stderr, "RCS file: %s\n", fpath); |
|
|
if (rev1 != NULL) { |
if (rev1 != NULL) { |
|
|
continue; |
continue; |
} |
} |
|
|
if (verbose == 1) { |
if (!(flags & QUIET)) { |
(void)rcsnum_tostr(rev1, r1, sizeof(r1)); |
(void)rcsnum_tostr(rev1, r1, sizeof(r1)); |
(void)rcsnum_tostr(rev2, r2, sizeof(r2)); |
(void)rcsnum_tostr(rev2, r2, sizeof(r2)); |
|
|
|
|
} |
} |
|
|
if ((bp = cvs_diff3(file, argv[i], rev1, rev2, |
if ((bp = cvs_diff3(file, argv[i], rev1, rev2, |
verbose)) == NULL) { |
!(flags & QUIET))) == NULL) { |
cvs_log(LP_ERR, "failed to merge"); |
cvs_log(LP_ERR, "failed to merge"); |
rcs_close(file); |
rcs_close(file); |
continue; |
continue; |