=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/checkout.c,v retrieving revision 1.77 retrieving revision 1.78 diff -c -r1.77 -r1.78 *** src/usr.bin/cvs/checkout.c 2007/01/16 08:17:27 1.77 --- src/usr.bin/cvs/checkout.c 2007/01/16 08:33:46 1.78 *************** *** 1,4 **** ! /* $OpenBSD: checkout.c,v 1.77 2007/01/16 08:17:27 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink * --- 1,4 ---- ! /* $OpenBSD: checkout.c,v 1.78 2007/01/16 08:33:46 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink * *************** *** 32,37 **** --- 32,39 ---- extern int build_dirs; extern int reset_stickies; + static int flags = CR_REPO | CR_RECURSE_DIRS; + struct cvs_cmd cvs_cmd_checkout = { CVS_OP_CHECKOUT, 0, "checkout", { "co", "get" }, *************** *** 56,65 **** int cvs_checkout(int argc, char **argv) { ! int ch, flags; - flags = CR_RECURSE_DIRS; - while ((ch = getopt(argc, argv, cvs_cmd_checkout.cmd_opts)) != -1) { switch (ch) { case 'A': --- 58,65 ---- int cvs_checkout(int argc, char **argv) { ! int ch; while ((ch = getopt(argc, argv, cvs_cmd_checkout.cmd_opts)) != -1) { switch (ch) { case 'A': *************** *** 92,101 **** int cvs_export(int argc, char **argv) { ! int ch, flags; prune_dirs = 1; - flags = CR_RECURSE_DIRS; while ((ch = getopt(argc, argv, cvs_cmd_export.cmd_opts)) != -1) { switch (ch) { --- 92,100 ---- int cvs_export(int argc, char **argv) { ! int ch; prune_dirs = 1; while ((ch = getopt(argc, argv, cvs_cmd_export.cmd_opts)) != -1) { switch (ch) { *************** *** 157,163 **** cr.enterdir = cvs_update_enterdir; cr.leavedir = cvs_update_leavedir; cr.fileproc = cvs_update_local; ! cr.flags = CR_REPO | CR_RECURSE_DIRS; cvs_repository_lock(repobase); cvs_repository_getdir(repobase, wdbase, &fl, &dl, 1); --- 156,162 ---- cr.enterdir = cvs_update_enterdir; cr.leavedir = cvs_update_leavedir; cr.fileproc = cvs_update_local; ! cr.flags = flags; cvs_repository_lock(repobase); cvs_repository_getdir(repobase, wdbase, &fl, &dl, 1); *************** *** 172,178 **** } void ! cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, int flags) { int l, oflags, exists; time_t rcstime; --- 171,177 ---- } void ! cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, int co_flags) { int l, oflags, exists; time_t rcstime; *************** *** 184,193 **** rcsnum_tostr(rnum, rev, sizeof(rev)); cvs_log(LP_TRACE, "cvs_checkout_file(%s, %s, %d) -> %s", ! cf->file_path, rev, flags, (cvs_server_active) ? "to client" : "to disk"); ! if (flags & CO_DUMP) { if (cvs_server_active) { cvs_printf("dump file %s to client\n", cf->file_path); } else { --- 183,192 ---- rcsnum_tostr(rnum, rev, sizeof(rev)); cvs_log(LP_TRACE, "cvs_checkout_file(%s, %s, %d) -> %s", ! cf->file_path, rev, co_flags, (cvs_server_active) ? "to client" : "to disk"); ! if (co_flags & CO_DUMP) { if (cvs_server_active) { cvs_printf("dump file %s to client\n", cf->file_path); } else { *************** *** 240,246 **** if (tbuf[strlen(tbuf) - 1] == '\n') tbuf[strlen(tbuf) - 1] = '\0'; ! if (flags & CO_MERGE) { l = snprintf(timebuf, sizeof(timebuf), "Result of merge+%s", tbuf); if (l == -1 || l >= (int)sizeof(timebuf)) --- 239,245 ---- if (tbuf[strlen(tbuf) - 1] == '\n') tbuf[strlen(tbuf) - 1] = '\0'; ! if (co_flags & CO_MERGE) { l = snprintf(timebuf, sizeof(timebuf), "Result of merge+%s", tbuf); if (l == -1 || l >= (int)sizeof(timebuf)) *************** *** 249,255 **** strlcpy(timebuf, tbuf, sizeof(timebuf)); } ! if (flags & CO_SETSTICKY) { l = snprintf(stickytag, sizeof(stickytag), "T%s", rev); if (l == -1 || l >= (int)sizeof(stickytag)) fatal("cvs_checkout_file: overflow"); --- 248,254 ---- strlcpy(timebuf, tbuf, sizeof(timebuf)); } ! if (co_flags & CO_SETSTICKY) { l = snprintf(stickytag, sizeof(stickytag), "T%s", rev); if (l == -1 || l >= (int)sizeof(stickytag)) fatal("cvs_checkout_file: overflow"); *************** *** 269,282 **** if ((p = strrchr(cf->file_rpath, ',')) != NULL) *p = '\0'; ! if (flags & CO_COMMIT) cvs_server_update_entry("Checked-in", cf); else cvs_server_update_entry("Updated", cf); cvs_remote_output(entry); ! if (!(flags & CO_COMMIT)) { (void)xasprintf(&template, "%s/checkout.XXXXXXXXXX", cvs_tmpdir); --- 268,281 ---- if ((p = strrchr(cf->file_rpath, ',')) != NULL) *p = '\0'; ! if (co_flags & CO_COMMIT) cvs_server_update_entry("Checked-in", cf); else cvs_server_update_entry("Updated", cf); cvs_remote_output(entry); ! if (!(co_flags & CO_COMMIT)) { (void)xasprintf(&template, "%s/checkout.XXXXXXXXXX", cvs_tmpdir);