diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-04-22 15:16:16 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-04-22 15:16:16 +0000 |
commit | 5ad8cbefa6249a5ed8118c2644ced5eb5f270bbb (patch) | |
tree | d48fec531d0792cfabb1c4695dc0289cf141fb4d | |
parent | 0afc834b1d2567cc5153e3492874e195e65cd1ff (diff) |
finish support for the '-' token in the Entry file, this allows
us to mark files as removed, and lets the remove command work
completely.
tested and ok xsa@, jfb@
-rw-r--r-- | usr.bin/cvs/entries.c | 10 | ||||
-rw-r--r-- | usr.bin/cvs/file.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/proto.c | 5 |
3 files changed, 15 insertions, 8 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index 17ed953199e..cf8350682d5 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.26 2005/04/15 14:34:15 xsa Exp $ */ +/* $OpenBSD: entries.c,v 1.27 2005/04/22 15:16:15 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -473,7 +473,8 @@ cvs_ent_write(CVSENTRIES *ef) revbuf[0] = '\0'; } else { rcsnum_tostr(ent->ce_rev, revbuf, sizeof(revbuf)); - if (ent->ce_mtime == CVS_DATE_DMSEC) + if (ent->ce_mtime == CVS_DATE_DMSEC || + ent->ce_status == CVS_ENT_REMOVED) strlcpy(timebuf, CVS_DATE_DUMMY, sizeof(timebuf)); else { @@ -484,8 +485,9 @@ cvs_ent_write(CVSENTRIES *ef) } } - fprintf(ef->cef_file, "/%s/%s/%s/%s/%s\n", ent->ce_name, - revbuf, timebuf, "", ""); + fprintf(ef->cef_file, "/%s/%s%s/%s/%s/%s\n", ent->ce_name, + (ent->ce_status == CVS_ENT_REMOVED) ? "-" : "", revbuf, + timebuf, "", ""); } /* terminating line */ diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index c92cca3abc8..bf3b037efcd 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.66 2005/04/19 00:32:55 joris Exp $ */ +/* $OpenBSD: file.c,v 1.67 2005/04/22 15:16:15 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -927,7 +927,11 @@ cvs_file_lget(const char *path, int flags, CVSFILE *parent, struct cvs_ent *ent) else cvs_log(LP_WARN, "unknown ce_type %d", ent->ce_type); - cfp->cf_cvstat = CVS_FST_LOST; + + if (ent->ce_status == CVS_ENT_REMOVED) + cfp->cf_cvstat = CVS_FST_REMOVED; + else + cfp->cf_cvstat = CVS_FST_LOST; } } diff --git a/usr.bin/cvs/proto.c b/usr.bin/cvs/proto.c index a82d951373a..b42abc9d9f6 100644 --- a/usr.bin/cvs/proto.c +++ b/usr.bin/cvs/proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proto.c,v 1.48 2005/04/18 23:56:19 joris Exp $ */ +/* $OpenBSD: proto.c,v 1.49 2005/04/22 15:16:15 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -1018,7 +1018,8 @@ cvs_sendentry(struct cvsroot *root, const CVSFILE *file) if (file->cf_cvstat == CVS_FST_UNKNOWN) return (0); - snprintf(ebuf, sizeof(ebuf), "/%s/%s///", file->cf_name, + snprintf(ebuf, sizeof(ebuf), "/%s/%s%s///", file->cf_name, + (file->cf_cvstat == CVS_FST_REMOVED) ? "-" : "", rcsnum_tostr(file->cf_lrev, numbuf, sizeof(numbuf))); return cvs_sendreq(root, CVS_REQ_ENTRY, ebuf); |