diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-09-06 17:08:06 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-09-06 17:08:06 +0000 |
commit | ab73f601f34265683fd38b71ce9f68d4c0ce38ce (patch) | |
tree | 81d88cbf5e7390f5c92dcfe231ecdc5d4dbd1903 /usr.bin/cvs | |
parent | bb474de8d627894a20375dca839c37e39813c787 (diff) |
more bits for the local remove command support; OK joris@.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/entries.c | 10 | ||||
-rw-r--r-- | usr.bin/cvs/file.c | 3 | ||||
-rw-r--r-- | usr.bin/cvs/remove.c | 9 |
3 files changed, 13 insertions, 9 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index 97d4dc66215..8966fc26b1e 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.48 2005/09/06 15:29:33 joris Exp $ */ +/* $OpenBSD: entries.c,v 1.49 2005/09/06 17:08:05 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -448,9 +448,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 && - (ent->ce_status != CVS_ENT_ADDED)) || - ent->ce_status == CVS_ENT_REMOVED) + if ((ent->ce_mtime == CVS_DATE_DMSEC) && + (ent->ce_status != CVS_ENT_ADDED)) strlcpy(timebuf, CVS_DATE_DUMMY, sizeof(timebuf)); else if (ent->ce_status == CVS_ENT_ADDED) { @@ -473,7 +472,8 @@ cvs_ent_write(CVSENTRIES *ef) fprintf(fp, "/%s/%s%s/%s/%s/%s\n", ent->ce_name, (ent->ce_status == CVS_ENT_REMOVED) ? "-" : "", revbuf, - timebuf, "", ""); + timebuf, (ent->ce_opts != NULL) ? ent->ce_opts : "", + (ent->ce_tag != NULL) ? ent->ce_tag : ""); } /* terminating line */ diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index c11ccc21e28..24a05c41213 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.117 2005/09/06 15:29:33 joris Exp $ */ +/* $OpenBSD: file.c,v 1.118 2005/09/06 17:08:05 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -1256,7 +1256,6 @@ cvs_file_lget(const char *path, int flags, CVSFILE *parent, CVSENTRIES *pent, if (ent != NULL) { /* steal the RCSNUM */ cfp->cf_lrev = ent->ce_rev; - ent->ce_rev = NULL; if (ent->ce_type == CVS_ENT_FILE) { if (ent->ce_tag[0] != '\0') { diff --git a/usr.bin/cvs/remove.c b/usr.bin/cvs/remove.c index 3e4b8540679..108fd28ff03 100644 --- a/usr.bin/cvs/remove.c +++ b/usr.bin/cvs/remove.c @@ -1,4 +1,4 @@ -/* $OpenBSD: remove.c,v 1.35 2005/08/22 11:17:26 xsa Exp $ */ +/* $OpenBSD: remove.c,v 1.36 2005/09/06 17:08:05 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2004, 2005 Xavier Santolaria <xsa@openbsd.org> @@ -150,6 +150,7 @@ cvs_remove_local(CVSFILE *cf, void *arg) int existing, l, removed; char buf[MAXPATHLEN], fpath[MAXPATHLEN]; CVSENTRIES *entf; + struct cvs_ent *ent; existing = removed = 0; entf = (CVSENTRIES *)cf->cf_entry; @@ -202,8 +203,12 @@ cvs_remove_local(CVSFILE *cf, void *arg) cf->cf_name); return (0); } else { + if ((ent = cvs_ent_get(entf, cf->cf_name)) == NULL) + return (CVS_EX_DATA); - /* XXX prefix file version with the `-' char in CVS/Entries */ + /* Prefix revision with `-' */ + ent->ce_status = CVS_ENT_REMOVED; + entf->cef_flags &= ~CVS_ENTF_SYNC; if (verbosity > 1) cvs_log(LP_NOTICE, "scheduling file `%s' for removal", |