version 1.146, 2006/04/14 00:22:46 |
version 1.147, 2006/04/14 01:11:07 |
|
|
rcs_close(pb.file); |
rcs_close(pb.file); |
} |
} |
|
|
if ((verbose == 1) && (status == 0)) |
if (verbose == 1 && status == 0) |
printf("done\n"); |
printf("done\n"); |
|
|
return (status); |
return (status); |
|
|
filec = (char *)cvs_buf_release(bp); |
filec = (char *)cvs_buf_release(bp); |
|
|
/* If this is a zero-ending RCSNUM eg 4.0, increment it (eg to 4.1) */ |
/* If this is a zero-ending RCSNUM eg 4.0, increment it (eg to 4.1) */ |
if ((pb->newrev != NULL) && (RCSNUM_ZERO_ENDING(pb->newrev))) |
if (pb->newrev != NULL && RCSNUM_ZERO_ENDING(pb->newrev)) |
pb->newrev = rcsnum_inc(pb->newrev); |
pb->newrev = rcsnum_inc(pb->newrev); |
|
|
if (checkin_checklock(pb) < 0) |
if (checkin_checklock(pb) < 0) |
|
|
* XXX only applies to ci -r1.2 foo for example if HEAD is > 1.2 and |
* XXX only applies to ci -r1.2 foo for example if HEAD is > 1.2 and |
* there is no lock set for the user. |
* there is no lock set for the user. |
*/ |
*/ |
if ((pb->newrev != NULL) |
if (pb->newrev != NULL && |
&& (rcsnum_cmp(pb->newrev, pb->frev, 0) > 0)) { |
rcsnum_cmp(pb->newrev, pb->frev, 0) > 0) { |
cvs_log(LP_ERR, |
cvs_log(LP_ERR, |
"%s: revision %s too low; must be higher than %s", |
"%s: revision %s too low; must be higher than %s", |
pb->file->rf_path, |
pb->file->rf_path, |
|
|
* Set the date of the revision to be the last modification |
* Set the date of the revision to be the last modification |
* time of the working file if -d has no argument. |
* time of the working file if -d has no argument. |
*/ |
*/ |
if (pb->date == DATE_MTIME |
if (pb->date == DATE_MTIME && |
&& (checkin_mtimedate(pb) < 0)) |
(checkin_mtimedate(pb) < 0)) |
goto fail; |
goto fail; |
|
|
/* Date from argv/mtime must be more recent than HEAD */ |
/* Date from argv/mtime must be more recent than HEAD */ |
|
|
fatal("failed to set new head revision"); |
fatal("failed to set new head revision"); |
|
|
/* Attach a symbolic name to this revision if specified. */ |
/* Attach a symbolic name to this revision if specified. */ |
if (pb->symbol != NULL |
if (pb->symbol != NULL && |
&& (checkin_attach_symbol(pb) < 0)) |
(checkin_attach_symbol(pb) < 0)) |
goto fail; |
goto fail; |
|
|
/* Set the state of this revision if specified. */ |
/* Set the state of this revision if specified. */ |
|
|
rcs_write(pb->file); |
rcs_write(pb->file); |
|
|
/* Do checkout if -u or -l are specified. */ |
/* Do checkout if -u or -l are specified. */ |
if (((pb->flags & CO_LOCK) || (pb->flags & CO_UNLOCK)) |
if (((pb->flags & CO_LOCK) || (pb->flags & CO_UNLOCK)) && |
&& !(pb->flags & CI_DEFAULT)) |
!(pb->flags & CI_DEFAULT)) |
checkout_rev(pb->file, pb->newrev, pb->filename, pb->flags, |
checkout_rev(pb->file, pb->newrev, pb->filename, pb->flags, |
pb->username, pb->author, NULL, NULL); |
pb->username, pb->author, NULL, NULL); |
|
|
|
|
struct stat st; |
struct stat st; |
|
|
/* If this is a zero-ending RCSNUM eg 4.0, increment it (eg to 4.1) */ |
/* If this is a zero-ending RCSNUM eg 4.0, increment it (eg to 4.1) */ |
if ((pb->newrev != NULL) && (RCSNUM_ZERO_ENDING(pb->newrev))) { |
if (pb->newrev != NULL && RCSNUM_ZERO_ENDING(pb->newrev)) { |
pb->frev = rcsnum_alloc(); |
pb->frev = rcsnum_alloc(); |
rcsnum_cpy(pb->newrev, pb->frev, 0); |
rcsnum_cpy(pb->newrev, pb->frev, 0); |
pb->newrev = rcsnum_inc(pb->newrev); |
pb->newrev = rcsnum_inc(pb->newrev); |
|
|
* Set the date of the revision to be the last modification |
* Set the date of the revision to be the last modification |
* time of the working file if -d has no argument. |
* time of the working file if -d has no argument. |
*/ |
*/ |
if (pb->date == DATE_MTIME |
if (pb->date == DATE_MTIME && |
&& (checkin_mtimedate(pb) < 0)) |
(checkin_mtimedate(pb) < 0)) |
goto fail; |
goto fail; |
|
|
/* Now add our new revision */ |
/* Now add our new revision */ |
|
|
} |
} |
|
|
/* Attach a symbolic name to this revision if specified. */ |
/* Attach a symbolic name to this revision if specified. */ |
if (pb->symbol != NULL |
if (pb->symbol != NULL && |
&& (checkin_attach_symbol(pb) < 0)) |
(checkin_attach_symbol(pb) < 0)) |
goto fail; |
goto fail; |
|
|
/* Set the state of this revision if specified. */ |
/* Set the state of this revision if specified. */ |
|
|
rcs_write(pb->file); |
rcs_write(pb->file); |
|
|
/* Do checkout if -u or -l are specified. */ |
/* Do checkout if -u or -l are specified. */ |
if (((pb->flags & CO_LOCK) || (pb->flags & CO_UNLOCK)) |
if (((pb->flags & CO_LOCK) || (pb->flags & CO_UNLOCK)) && |
&& !(pb->flags & CI_DEFAULT)) { |
!(pb->flags & CI_DEFAULT)) { |
checkout_rev(pb->file, pb->newrev, pb->filename, pb->flags, |
checkout_rev(pb->file, pb->newrev, pb->filename, pb->flags, |
pb->username, pb->author, NULL, NULL); |
pb->username, pb->author, NULL, NULL); |
} |
} |
|
|
} |
} |
} |
} |
} |
} |
if ((ret = rcs_sym_add(pb->file, pb->symbol, pb->newrev) == -1) |
if ((ret = rcs_sym_add(pb->file, pb->symbol, pb->newrev) == -1) && |
&& (rcs_errno == RCS_ERR_DUPENT)) { |
(rcs_errno == RCS_ERR_DUPENT)) { |
rcsnum_tostr(rcs_sym_getrev(pb->file, pb->symbol), |
rcsnum_tostr(rcs_sym_getrev(pb->file, pb->symbol), |
rbuf, sizeof(rbuf)); |
rbuf, sizeof(rbuf)); |
cvs_log(LP_ERR, |
cvs_log(LP_ERR, |
|
|
struct rcs_lock *lkp; |
struct rcs_lock *lkp; |
|
|
TAILQ_FOREACH(lkp, &(pb->file->rf_locks), rl_list) { |
TAILQ_FOREACH(lkp, &(pb->file->rf_locks), rl_list) { |
if ((!strcmp(lkp->rl_name, pb->username)) && |
if (!strcmp(lkp->rl_name, pb->username) && |
(!rcsnum_cmp(lkp->rl_num, pb->frev, 0))) |
!rcsnum_cmp(lkp->rl_num, pb->frev, 0)) |
return (0); |
return (0); |
} |
} |
|
|