=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/update.c,v retrieving revision 1.69 retrieving revision 1.70 diff -c -r1.69 -r1.70 *** src/usr.bin/cvs/update.c 2006/05/31 22:25:59 1.69 --- src/usr.bin/cvs/update.c 2006/06/03 19:07:13 1.70 *************** *** 1,4 **** ! /* $OpenBSD: update.c,v 1.69 2006/05/31 22:25:59 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink * --- 1,4 ---- ! /* $OpenBSD: update.c,v 1.70 2006/06/03 19:07:13 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink * *************** *** 25,30 **** --- 25,32 ---- int cvs_update(int, char **); int prune_dirs = 0; int build_dirs = 0; + int reset_stickies = 0; + static char *tag = NULL; static void update_clear_conflict(struct cvs_file *); *************** *** 52,57 **** --- 54,60 ---- while ((ch = getopt(argc, argv, cvs_cmd_update.cmd_opts)) != -1) { switch (ch) { case 'A': + reset_stickies = 1; break; case 'C': case 'D': *************** *** 81,86 **** --- 84,90 ---- case 'R': break; case 'r': + tag = optarg; break; default: fatal("%s", cvs_cmd_update.cmd_synopsis); *************** *** 238,245 **** void cvs_update_local(struct cvs_file *cf) { - int ret; BUF *bp; CVSENTRIES *entlist; cvs_log(LP_TRACE, "cvs_update_local(%s)", cf->file_path); --- 242,249 ---- void cvs_update_local(struct cvs_file *cf) { BUF *bp; + int ret, flags; CVSENTRIES *entlist; cvs_log(LP_TRACE, "cvs_update_local(%s)", cf->file_path); *************** *** 258,266 **** * the bp buffer will be released inside rcs_kwexp_buf, * which is called from cvs_checkout_file(). */ bp = NULL; ! cvs_file_classify(cf, NULL, 1); switch (cf->file_status) { case FILE_UNKNOWN: cvs_printf("? %s\n", cf->file_path); --- 262,277 ---- * the bp buffer will be released inside rcs_kwexp_buf, * which is called from cvs_checkout_file(). */ + flags = 0; bp = NULL; ! cvs_file_classify(cf, tag, 1); + if (cf->file_status == FILE_UPTODATE && cf->file_ent != NULL && + cf->file_ent->ce_tag != NULL && reset_stickies == 1) { + cf->file_status = FILE_CHECKOUT; + cf->file_rcsrev = rcs_head_get(cf->file_rcs); + } + switch (cf->file_status) { case FILE_UNKNOWN: cvs_printf("? %s\n", cf->file_path); *************** *** 291,297 **** if (bp == NULL) fatal("cvs_update_local: failed to get HEAD"); ! cvs_checkout_file(cf, cf->file_rcsrev, bp, 0); cvs_printf("U %s\n", cf->file_path); break; case FILE_MERGE: --- 302,311 ---- if (bp == NULL) fatal("cvs_update_local: failed to get HEAD"); ! if (tag != NULL) ! flags = CO_SETSTICKY; ! ! cvs_checkout_file(cf, cf->file_rcsrev, bp, flags); cvs_printf("U %s\n", cf->file_path); break; case FILE_MERGE: