version 1.60, 2005/11/17 00:03:04 |
version 1.61, 2005/11/17 00:16:35 |
|
|
static char * checkin_getlogmsg(RCSNUM *, RCSNUM *); |
static char * checkin_getlogmsg(RCSNUM *, RCSNUM *); |
static void checkin_init(struct checkin_params *); |
static void checkin_init(struct checkin_params *); |
static void checkin_revert(struct checkin_params *pb); |
static void checkin_revert(struct checkin_params *pb); |
|
static int checkin_setrevdate(struct checkin_params *pb); |
|
|
void |
void |
checkin_usage(void) |
checkin_usage(void) |
|
|
* 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 |
if (stat(pb.filename, &sb) != 0) { |
&& (checkin_setrevdate(&pb) < 0)) |
cvs_log(LP_ERRNO, "failed to stat: `%s'", |
continue; |
pb.filename); |
|
rcs_close(pb.file); |
|
continue; |
|
} |
|
pb.date = (time_t)sb.st_mtimespec.tv_sec; |
|
} |
|
|
|
/* |
/* |
* Now add our new revision |
* Now add our new revision |
|
|
rcs_close(pb->file); |
rcs_close(pb->file); |
return (-1); |
return (-1); |
} |
} |
|
return (0); |
|
} |
|
|
|
/* |
|
* checkin_setrevdate() |
|
* |
|
* Set the date of the revision to be the last modification |
|
* time of the working file if -d has no argument. |
|
* |
|
* On success, return 0. On error return -1. |
|
*/ |
|
static int |
|
checkin_setrevdate(struct checkin_params *pb) |
|
{ |
|
struct stat sb; |
|
if (stat(pb->filename, &sb) != 0) { |
|
cvs_log(LP_ERRNO, "failed to stat: `%s'", |
|
pb->filename); |
|
rcs_close(pb->file); |
|
return (-1); |
|
} |
|
pb->date = (time_t)sb.st_mtimespec.tv_sec; |
return (0); |
return (0); |
} |
} |