summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/cvs/client.c27
-rw-r--r--usr.bin/cvs/commit.c18
2 files changed, 31 insertions, 14 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c
index 1caea4dd164..9ad18a2a966 100644
--- a/usr.bin/cvs/client.c
+++ b/usr.bin/cvs/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.40 2006/12/21 22:32:30 xsa Exp $ */
+/* $OpenBSD: client.c,v 1.41 2007/01/02 23:55:15 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -741,24 +741,27 @@ cvs_client_removed(char *data)
void
cvs_client_remove_entry(char *data)
{
+ int l;
CVSENTRIES *entlist;
- struct cvs_ent *ent;
- char *dir, *entry;
+ char *filename, *rpath, *fpath;
- dir = cvs_remote_input();
- entry = cvs_remote_input();
- xfree(dir);
+ rpath = cvs_remote_input();
+ if ((filename = strrchr(rpath, '/')) == NULL)
+ fatal("bad rpath in cvs_client_remove_entry: %s", rpath);
+ *filename++;
+
+ fpath = xmalloc(MAXPATHLEN);
+ l = snprintf(fpath, MAXPATHLEN, "%s%s", data, filename);
+ if (l == -1 || l >= MAXPATHLEN)
+ fatal("cvs_client_remove_entry: overflow");
- if ((ent = cvs_ent_parse(entry)) == NULL)
- fatal("cvs_client_remove_entry: cvs_ent_parse failed");
+ xfree(rpath);
entlist = cvs_ent_open(data);
-
- cvs_ent_remove(entlist, ent->ce_name);
- cvs_ent_free(ent);
+ cvs_ent_remove(entlist, fpath);
cvs_ent_close(entlist, ENT_SYNC);
- xfree(entry);
+ xfree(fpath);
}
void
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c
index 1ae744eb597..bc5d1631b75 100644
--- a/usr.bin/cvs/commit.c
+++ b/usr.bin/cvs/commit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commit.c,v 1.82 2006/12/31 15:11:23 xsa Exp $ */
+/* $OpenBSD: commit.c,v 1.83 2007/01/02 23:55:15 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -186,7 +186,7 @@ cvs_commit_local(struct cvs_file *cf)
int l, openflags, rcsflags;
char *d, *f, rbuf[24], nbuf[24];
CVSENTRIES *entlist;
- char *attic, *repo, *rcsfile;
+ char *attic, *repo, *rcsfile, *p;
cvs_log(LP_TRACE, "cvs_commit_local(%s)", cf->file_path);
cvs_file_classify(cf, NULL, 0);
@@ -366,6 +366,20 @@ cvs_commit_local(struct cvs_file *cf)
cvs_log(LP_NOTICE, "checking in '%s'; revision %s -> %s",
cf->file_path, rbuf, nbuf);
}
+
+ if (cvs_server_active == 1) {
+ if ((p = strrchr(cf->file_rpath, ',')) != NULL)
+ *p = '\0';
+
+ if (cf->file_status == FILE_REMOVED) {
+ cvs_server_send_response("Remove-entry %s/",
+ cf->file_wd);
+ cvs_remote_output(cf->file_rpath);
+ }
+
+ if (p != NULL)
+ *p = ',';
+ }
}
static char *