version 1.24, 2005/10/13 12:35:30 |
version 1.25, 2005/10/13 22:54:46 |
|
|
#define LOCK_LOCK 1 |
#define LOCK_LOCK 1 |
#define LOCK_UNLOCK 2 |
#define LOCK_UNLOCK 2 |
|
|
|
#define DATE_NOW -1 |
|
#define DATE_MTIME -2 |
|
|
static char * checkin_diff_file(RCSFILE *, RCSNUM *, const char *); |
static char * checkin_diff_file(RCSFILE *, RCSNUM *, const char *); |
static char * checkin_getlogmsg(char *, char *, RCSNUM *, RCSNUM *); |
static char * checkin_getlogmsg(char *, char *, RCSNUM *, RCSNUM *); |
|
|
|
|
{ |
{ |
int i, ch, flags, lkmode, interactive, rflag, status; |
int i, ch, flags, lkmode, interactive, rflag, status; |
mode_t fmode; |
mode_t fmode; |
time_t date = -1; |
time_t date = DATE_NOW; |
RCSFILE *file; |
RCSFILE *file; |
RCSNUM *frev, *newrev; |
RCSNUM *frev, *newrev; |
char fpath[MAXPATHLEN]; |
char fpath[MAXPATHLEN]; |
|
|
exit(1); |
exit(1); |
} |
} |
|
|
while ((ch = rcs_getopt(argc, argv, "j:l::M:N:qu::d:r::m:k:V")) != -1) { |
while ((ch = rcs_getopt(argc, argv, "j:l::M:N:qu::d::r::m:k:V")) != -1) { |
switch (ch) { |
switch (ch) { |
case 'd': |
case 'd': |
if ((date = cvs_date_parse(rcs_optarg)) <= 0) { |
if (rcs_optarg == NULL) |
|
date = DATE_MTIME; |
|
else if ((date = cvs_date_parse(rcs_optarg)) <= 0) { |
cvs_log(LP_ERR, "invalide date"); |
cvs_log(LP_ERR, "invalide date"); |
exit(1); |
exit(1); |
} |
} |
|
|
cvs_log(LP_ERR, |
cvs_log(LP_ERR, |
"failed to set new rd_text for head rev"); |
"failed to set new rd_text for head rev"); |
exit (1); |
exit (1); |
|
} |
|
/* |
|
* Set the date of the revision to be the last modification time |
|
* of the working file if -d is specified without an argument. |
|
*/ |
|
if (date == DATE_MTIME) { |
|
struct stat sb; |
|
if (stat(argv[i], &sb) != 0) { |
|
cvs_log(LP_ERRNO, "failed to stat: `%s'", argv[i]); |
|
rcs_close(file); |
|
continue; |
|
} |
|
date = (time_t)sb.st_mtimespec.tv_sec; |
} |
} |
/* |
/* |
* Now add our new revision |
* Now add our new revision |