diff options
Diffstat (limited to 'contrib/cvs/src/checkin.c')
-rw-r--r-- | contrib/cvs/src/checkin.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/contrib/cvs/src/checkin.c b/contrib/cvs/src/checkin.c index 0da220c..1d89ae1 100644 --- a/contrib/cvs/src/checkin.c +++ b/contrib/cvs/src/checkin.c @@ -3,7 +3,7 @@ * Copyright (c) 1989-1992, Brian Berliner * * You may distribute under the terms of the GNU General Public License as - * specified in the README file that comes with the CVS 1.4 kit. + * specified in the README file that comes with the CVS source distribution. * * Check In * @@ -69,7 +69,10 @@ Checkin (type, finfo, rcs, rev, tag, options, message) } } - switch (RCS_checkin (rcs, NULL, message, rev, 0)) + if (finfo->rcs == NULL) + finfo->rcs = RCS_parse (finfo->file, finfo->repository); + + switch (RCS_checkin (finfo->rcs, NULL, message, rev, 0)) { case 0: /* everything normal */ @@ -85,12 +88,6 @@ Checkin (type, finfo, rcs, rev, tag, options, message) if (strcmp (options, "-V4") == 0) /* upgrade to V5 now */ options[0] = '\0'; - /* Reparse the RCS file, so that we can safely call - RCS_checkout. FIXME: We could probably calculate - all the changes. */ - freercsnode (&finfo->rcs); - finfo->rcs = RCS_parse (finfo->file, finfo->repository); - /* FIXME: should be checking for errors. */ (void) RCS_checkout (finfo->rcs, finfo->file, rev, (char *) NULL, options, RUN_TTY, @@ -117,7 +114,7 @@ Checkin (type, finfo, rcs, rev, tag, options, message) * If we want read-only files, muck the permissions here, before * getting the file time-stamp. */ - if (cvswrite == FALSE || fileattr_get (finfo->file, "_watched")) + if (!cvswrite || fileattr_get (finfo->file, "_watched")) xchmod (finfo->file, 0); /* Re-register with the new data. */ @@ -173,6 +170,7 @@ Checkin (type, finfo, rcs, rev, tag, options, message) if (rev) { (void) RCS_unlock (finfo->rcs, NULL, 1); + RCS_rewrite (finfo->rcs, NULL, NULL); } #ifdef SERVER_SUPPORT |