diff options
author | peter <peter@FreeBSD.org> | 1998-01-26 03:09:57 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-01-26 03:09:57 +0000 |
commit | e6e45661e44f15cb8c5c6f063080509bd910b98d (patch) | |
tree | a9812ba7ade0fde6f62c1626b45d522ba104c314 /contrib/cvs/src/edit.c | |
parent | 571cfa0005d94d99d1341bf8ab02be04d4df5f9f (diff) | |
download | FreeBSD-src-e6e45661e44f15cb8c5c6f063080509bd910b98d.zip FreeBSD-src-e6e45661e44f15cb8c5c6f063080509bd910b98d.tar.gz |
Import cvs-1.9.23 as at 19980123. There are a number of really nice
things fixed in here, including the '-ko' vs. -A problem with
remote cvs which caused all files with -ko to be resent each time
(which is damn painful over a modem, I can tell you). It also found a
heap of stray empty directories that should have been pruned with the -P
flag to cvs update but were not for some reason.
It also has the fully integrated rcs and diff, so no more fork/exec
overheads for rcs,ci,patch,diff,etc. This means that it parses the control
data in the rcs files only once rather than twice or more.
If the 'cvs diff' vs. Index thing is going to be fixed for future patch
compatability, this is the place to do it.
Diffstat (limited to 'contrib/cvs/src/edit.c')
-rw-r--r-- | contrib/cvs/src/edit.c | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/contrib/cvs/src/edit.c b/contrib/cvs/src/edit.c index 33e9c61..6c6f040 100644 --- a/contrib/cvs/src/edit.c +++ b/contrib/cvs/src/edit.c @@ -284,6 +284,18 @@ edit_fileproc (callerdat, finfo) if (noexec) return 0; + /* This is a somewhat screwy way to check for this, because it + doesn't help errors other than the nonexistence of the file + (e.g. permissions problems). It might be better to rearrange + the code so that CVSADM_NOTIFY gets written only after the + various actions succeed (but what if only some of them + succeed). */ + if (!isfile (finfo->file)) + { + error (0, 0, "no such file %s; ignored", finfo->fullname); + return 0; + } + fp = open_file (CVSADM_NOTIFY, "a"); (void) time (&now); @@ -326,6 +338,14 @@ edit_fileproc (callerdat, finfo) copy_file (finfo->file, basefilename); free (basefilename); + { + Node *node; + + node = findnode_fn (finfo->entries, finfo->file); + if (node != NULL) + base_register (finfo, ((Entnode *) node->data)->version); + } + return 0; } @@ -336,6 +356,7 @@ static const char *const edit_usage[] = "-R: Process directories recursively\n", "-a: Specify what actions for temporary watch, one of\n", " edit,unedit,commit,all,none\n", + "(Specify the --help global option for a list of other help options)\n", NULL }; @@ -475,6 +496,39 @@ unedit_fileproc (callerdat, finfo) CVSADM_NOTIFY); } + /* Now update the revision number in CVS/Entries from CVS/Baserev. + The basic idea here is that we are reverting to the revision + that the user edited. If we wanted "cvs update" to update + CVS/Base as we go along (so that an unedit could revert to the + current repository revision), we would need: + + update (or all send_files?) (client) needs to send revision in + new Entry-base request. update (server/local) needs to check + revision against repository and send new Update-base response + (like Update-existing in that the file already exists. While + we are at it, might try to clean up the syntax by having the + mode only in a "Mode" response, not in the Update-base itself). */ + { + char *baserev; + Node *node; + Entnode *entdata; + + baserev = base_get (finfo); + node = findnode_fn (finfo->entries, finfo->file); + /* The case where node is NULL probably should be an error or + something, but I don't want to think about it too hard right + now. */ + if (node != NULL) + { + entdata = (Entnode *) node->data; + Register (finfo->entries, finfo->file, baserev, entdata->timestamp, + entdata->options, entdata->tag, entdata->date, + entdata->conflict); + } + free (baserev); + base_deregister (finfo); + } + xchmod (finfo->file, 0); return 0; } @@ -552,14 +606,14 @@ editor_set (filename, editor, val) edlist = fileattr_get0 (filename, "_editors"); newlist = fileattr_modify (edlist, editor, val, '>', ','); - if (edlist != NULL) - free (edlist); /* If the attributes is unchanged, don't rewrite the attribute file. */ if (!((edlist == NULL && newlist == NULL) || (edlist != NULL && newlist != NULL && strcmp (edlist, newlist) == 0))) fileattr_set (filename, "_editors", newlist); + if (edlist != NULL) + free (edlist); if (newlist != NULL) free (newlist); } @@ -916,6 +970,7 @@ static const char *const editors_usage[] = "Usage: %s %s [-lR] [files...]\n", "\t-l\tProcess this directory only (not recursive).\n", "\t-R\tProcess directories recursively.\n", + "(Specify the --help global option for a list of other help options)\n", NULL }; |