version 1.153, 2006/04/18 03:35:57 |
version 1.154, 2006/04/19 06:53:41 |
|
|
static int checkin_checklock(struct checkin_params *); |
static int checkin_checklock(struct checkin_params *); |
static char *checkin_diff_file(struct checkin_params *); |
static char *checkin_diff_file(struct checkin_params *); |
static char *checkin_getdesc(void); |
static char *checkin_getdesc(void); |
static char *checkin_getlogmsg(RCSNUM *, RCSNUM *); |
static char *checkin_getlogmsg(RCSNUM *, RCSNUM *, int); |
static int checkin_init(struct checkin_params *); |
static int checkin_init(struct checkin_params *); |
static int checkin_keywordscan(char *, RCSNUM **, time_t *, char **, |
static int checkin_keywordscan(char *, RCSNUM **, time_t *, char **, |
char **); |
char **); |
|
|
fatal("invalid symbol `%s'", pb.symbol); |
fatal("invalid symbol `%s'", pb.symbol); |
break; |
break; |
case 'q': |
case 'q': |
verbose = 0; |
pb.flags |= QUIET; |
break; |
break; |
case 'r': |
case 'r': |
rcs_setrevstr(&rev_str, rcs_optarg); |
rcs_setrevstr(&rev_str, rcs_optarg); |
|
|
if (pb.file == NULL) |
if (pb.file == NULL) |
fatal("failed to open rcsfile '%s'", pb.fpath); |
fatal("failed to open rcsfile '%s'", pb.fpath); |
|
|
if (verbose == 1) |
if (!(pb.flags & QUIET)) |
printf("%s <-- %s\n", pb.fpath, pb.filename); |
printf("%s <-- %s\n", pb.fpath, pb.filename); |
|
|
/* XXX - Should we rcsnum_free(pb.newrev)? */ |
/* XXX - Should we rcsnum_free(pb.newrev)? */ |
|
|
rcs_close(pb.file); |
rcs_close(pb.file); |
} |
} |
|
|
if (verbose == 1 && status == 0) |
if (!(pb.flags & QUIET) && status == 0) |
printf("done\n"); |
printf("done\n"); |
|
|
return (status); |
return (status); |
|
|
* Returns pointer to a char array on success, NULL on failure. |
* Returns pointer to a char array on success, NULL on failure. |
*/ |
*/ |
static char * |
static char * |
checkin_getlogmsg(RCSNUM *rev, RCSNUM *rev2) |
checkin_getlogmsg(RCSNUM *rev, RCSNUM *rev2, int flags) |
{ |
{ |
char *rcs_msg, nrev[16], prev[16]; |
char *rcs_msg, nrev[16], prev[16]; |
const char *prompt = |
const char *prompt = |
|
|
rcsnum_tostr(rev2, nrev, sizeof(nrev)); |
rcsnum_tostr(rev2, nrev, sizeof(nrev)); |
rcsnum_free(tmprev); |
rcsnum_free(tmprev); |
|
|
if (verbose == 1) |
if (!(flags & QUIET)) |
printf("new revision: %s; previous revision: %s\n", nrev, |
printf("new revision: %s; previous revision: %s\n", nrev, |
prev); |
prev); |
|
|
|
|
|
|
/* If no log message specified, get it interactively. */ |
/* If no log message specified, get it interactively. */ |
if (pb->flags & INTERACTIVE) |
if (pb->flags & INTERACTIVE) |
pb->rcs_msg = checkin_getlogmsg(pb->frev, pb->newrev); |
pb->rcs_msg = checkin_getlogmsg(pb->frev, pb->newrev, |
|
pb->flags); |
|
|
if (rcs_lock_remove(pb->file, pb->username, pb->frev) < 0) { |
if (rcs_lock_remove(pb->file, pb->username, pb->frev) < 0) { |
if (rcs_errno != RCS_ERR_NOENT) |
if (rcs_errno != RCS_ERR_NOENT) |
|
|
* emulate odd GNU behaviour and fetch log message. |
* emulate odd GNU behaviour and fetch log message. |
*/ |
*/ |
if (fetchlog == 1) { |
if (fetchlog == 1) { |
pb->rcs_msg = checkin_getlogmsg(pb->frev, pb->newrev); |
pb->rcs_msg = checkin_getlogmsg(pb->frev, pb->newrev, |
|
pb->flags); |
rcsnum_free(pb->frev); |
rcsnum_free(pb->frev); |
} |
} |
|
|
|
|
} |
} |
|
|
|
|
if (verbose == 1) { |
if (!(pb->flags & QUIET)) { |
fprintf(stderr, "initial revision: %s\n", |
fprintf(stderr, "initial revision: %s\n", |
rcsnum_tostr(pb->newrev, numb, sizeof(numb))); |
rcsnum_tostr(pb->newrev, numb, sizeof(numb))); |
} |
} |
|
|
{ |
{ |
char rbuf[16]; |
char rbuf[16]; |
int ret; |
int ret; |
if (verbose == 1) |
if (!(pb->flags & QUIET)) |
printf("symbol: %s\n", pb->symbol); |
printf("symbol: %s\n", pb->symbol); |
if (pb->flags & CI_SYMFORCE) { |
if (pb->flags & CI_SYMFORCE) { |
if (rcs_sym_remove(pb->file, pb->symbol) < 0) { |
if (rcs_sym_remove(pb->file, pb->symbol) < 0) { |