diff options
-rw-r--r-- | usr.bin/cvs/add.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/checkout.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/commit.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.h | 4 | ||||
-rw-r--r-- | usr.bin/cvs/file.c | 5 | ||||
-rw-r--r-- | usr.bin/cvs/update.c | 28 |
6 files changed, 33 insertions, 20 deletions
diff --git a/usr.bin/cvs/add.c b/usr.bin/cvs/add.c index 8c37040319b..6a9a4c8e432 100644 --- a/usr.bin/cvs/add.c +++ b/usr.bin/cvs/add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: add.c,v 1.81 2007/09/22 16:01:22 joris Exp $ */ +/* $OpenBSD: add.c,v 1.82 2007/09/23 11:19:24 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> @@ -278,7 +278,7 @@ add_file(struct cvs_file *cf) /* Restore the file. */ head = rcs_head_get(cf->file_rcs); - cvs_checkout_file(cf, head, 0); + cvs_checkout_file(cf, head, NULL, 0); rcsnum_free(head); cvs_printf("U %s\n", cf->file_path); diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c index d110c6add57..2e814037689 100644 --- a/usr.bin/cvs/checkout.c +++ b/usr.bin/cvs/checkout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: checkout.c,v 1.104 2007/09/22 16:01:22 joris Exp $ */ +/* $OpenBSD: checkout.c,v 1.105 2007/09/23 11:19:24 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -249,7 +249,7 @@ checkout_repository(const char *repobase, const char *wdbase) } void -cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, int co_flags) +cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, char *tag, int co_flags) { int kflag, oflags, exists; time_t rcstime; @@ -326,9 +326,9 @@ cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, int co_flags) } if (co_flags & CO_SETSTICKY) - if (cvs_directory_tag != NULL) + if (tag != NULL) (void)xsnprintf(stickytag, sizeof(stickytag), "T%s", - cvs_directory_tag); + tag); else (void)xsnprintf(stickytag, sizeof(stickytag), "T%s", rev); diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index 7406c863307..877a6284d71 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.110 2007/09/22 16:01:22 joris Exp $ */ +/* $OpenBSD: commit.c,v 1.111 2007/09/23 11:19:24 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -359,7 +359,7 @@ cvs_commit_local(struct cvs_file *cf) cf->fd = -1; if (cf->file_status != FILE_REMOVED) { - cvs_checkout_file(cf, cf->file_rcs->rf_head, CO_COMMIT); + cvs_checkout_file(cf, cf->file_rcs->rf_head, NULL, CO_COMMIT); } else { entlist = cvs_ent_open(cf->file_wd); cvs_ent_remove(entlist, cf->file_name); diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index b062f0d82cf..ea8168528d3 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.146 2007/09/22 16:01:22 joris Exp $ */ +/* $OpenBSD: cvs.h,v 1.147 2007/09/23 11:19:24 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -378,7 +378,7 @@ char * cvs_logmsg_create(struct cvs_flisthead *, struct cvs_flisthead *, void cvs_update_local(struct cvs_file *); void cvs_update_enterdir(struct cvs_file *); void cvs_update_leavedir(struct cvs_file *); -void cvs_checkout_file(struct cvs_file *, RCSNUM *, int); +void cvs_checkout_file(struct cvs_file *, RCSNUM *, char *, int); int update_has_conflict_markers(struct cvs_file *); #define CO_MERGE 0x01 diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index 4f8bef981e2..112e1f3cc2a 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.200 2007/09/23 10:49:49 joris Exp $ */ +/* $OpenBSD: file.c,v 1.201 2007/09/23 11:19:24 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -617,6 +617,9 @@ cvs_file_classify(struct cvs_file *cf, const char *tag) cf->file_type != CVS_FILE) fatal("%s is supposed to be a file, but it is not", cf->file_path); + + if (cf->file_ent->ce_tag != NULL) + tag = cf->file_ent->ce_tag; } if (cf->file_type == CVS_DIR) { diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c index fe4f3f674f3..9d4bdf31d18 100644 --- a/usr.bin/cvs/update.c +++ b/usr.bin/cvs/update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: update.c,v 1.111 2007/09/23 10:49:49 joris Exp $ */ +/* $OpenBSD: update.c,v 1.112 2007/09/23 11:19:24 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -287,6 +287,7 @@ cvs_update_leavedir(struct cvs_file *cf) void cvs_update_local(struct cvs_file *cf) { + char *tag; int ret, flags; CVSENTRIES *entlist; char rbuf[CVS_REV_BUFSZ]; @@ -304,7 +305,15 @@ cvs_update_local(struct cvs_file *cf) } flags = 0; - cvs_file_classify(cf, cvs_directory_tag); + if (cvs_specified_tag != NULL) + tag = cvs_specified_tag; + else + tag = cvs_directory_tag; + + cvs_file_classify(cf, tag); + + if (cf->file_ent != NULL && cf->file_ent->ce_tag != NULL) + tag = cf->file_ent->ce_tag; if ((cf->file_status == FILE_UPTODATE || cf->file_status == FILE_MODIFIED) && cf->file_ent != NULL && @@ -330,7 +339,7 @@ cvs_update_local(struct cvs_file *cf) cvs_log(LP_RCS, "VERS: %s", rbuf); cvs_log(LP_RCS, "***************"); } - cvs_checkout_file(cf, cf->file_rcsrev, CO_DUMP); + cvs_checkout_file(cf, cf->file_rcsrev, tag, CO_DUMP); return; } @@ -360,17 +369,17 @@ cvs_update_local(struct cvs_file *cf) case FILE_LOST: case FILE_CHECKOUT: case FILE_PATCH: - if (cvs_directory_tag != NULL || + if ((tag != NULL && reset_stickies != 1) || (((cf->file_ent != NULL) && cf->file_ent->ce_tag != NULL) && (reset_stickies != 1))) flags = CO_SETSTICKY; - cvs_checkout_file(cf, cf->file_rcsrev, flags); + cvs_checkout_file(cf, cf->file_rcsrev, tag, flags); cvs_printf("U %s\n", cf->file_path); cvs_history_add(CVS_HISTORY_UPDATE_CO, cf, NULL); break; case FILE_MERGE: - cvs_checkout_file(cf, cf->file_rcsrev, CO_MERGE); + cvs_checkout_file(cf, cf->file_rcsrev, tag, CO_MERGE); if (diff3_conflicts != 0) { cvs_printf("C %s\n", cf->file_path); @@ -385,7 +394,7 @@ cvs_update_local(struct cvs_file *cf) case FILE_UNLINK: (void)unlink(cf->file_path); if (cvs_server_active == 1) - cvs_checkout_file(cf, cf->file_rcsrev, CO_REMOVE); + cvs_checkout_file(cf, cf->file_rcsrev, tag, CO_REMOVE); case FILE_REMOVE_ENTRY: entlist = cvs_ent_open(cf->file_wd); cvs_ent_remove(entlist, cf->file_name); @@ -396,9 +405,10 @@ cvs_update_local(struct cvs_file *cf) if (cvs_cmdop != CVS_OP_UPDATE) break; - if (cvs_directory_tag != NULL && cf->file_rcs->rf_dead != 1 && + if (tag != NULL && cf->file_rcs->rf_dead != 1 && (cf->file_flags & FILE_HAS_TAG)) - cvs_checkout_file(cf, cf->file_rcsrev, CO_SETSTICKY); + cvs_checkout_file(cf, cf->file_rcsrev, + tag, CO_SETSTICKY); break; default: break; |