From af921bec4f4a1f61a028d8032af5f3316641778e Mon Sep 17 00:00:00 2001 From: Thorsten Lockert Date: Tue, 8 Jan 2002 08:01:46 +0000 Subject: Allow a CVS tagname to be expanded during checkout, export and update to be specified on the command line; ok niklas@ pval@ --- gnu/usr.bin/cvs/man/cvs.1 | 10 ++++++++++ gnu/usr.bin/cvs/src/checkout.c | 15 +++++++++++---- gnu/usr.bin/cvs/src/rcs.c | 3 ++- gnu/usr.bin/cvs/src/update.c | 10 ++++++++-- 4 files changed, 31 insertions(+), 7 deletions(-) (limited to 'gnu') diff --git a/gnu/usr.bin/cvs/man/cvs.1 b/gnu/usr.bin/cvs/man/cvs.1 index 914d58a2b2e..f7f7f2f3629 100644 --- a/gnu/usr.bin/cvs/man/cvs.1 +++ b/gnu/usr.bin/cvs/man/cvs.1 @@ -607,6 +607,16 @@ option, which you can specify to the of a .B cvs command! +.TP +\fB\-t\fP \fIid\fP +Expand the RCS identifier specified by the +.I id +argument in addition to the default ``Id'' identifier. +.B \-t +is available with the +.BR checkout ", " export ", and " update +commands. If the identifier name is specified as ``-'', no additional +identifiers will be expanded. .SH "CVS COMMANDS" Here (finally) are details on all the .B cvs diff --git a/gnu/usr.bin/cvs/src/checkout.c b/gnu/usr.bin/cvs/src/checkout.c index 86dc9510eb0..380c4f75cf4 100644 --- a/gnu/usr.bin/cvs/src/checkout.c +++ b/gnu/usr.bin/cvs/src/checkout.c @@ -44,7 +44,7 @@ static int checkout_proc PROTO((int argc, char **argv, char *where, static const char *const checkout_usage[] = { - "Usage:\n %s %s [-ANPRcflnps] [-r rev] [-D date] [-d dir]\n", + "Usage:\n %s %s [-ANPRcflnps] [-t id] [-r rev] [-D date] [-d dir]\n", " [-j rev1] [-j rev2] [-k kopt] modules...\n", "\t-A\tReset any sticky tags/date/kopts.\n", "\t-N\tDon't shorten module paths if -d specified.\n", @@ -61,13 +61,14 @@ static const char *const checkout_usage[] = "\t-d dir\tCheck out into dir instead of module name.\n", "\t-k kopt\tUse RCS kopt -k option on checkout. (is sticky)\n", "\t-j rev\tMerge in changes made between current revision and rev.\n", + "\t-t id\tRCS identifier to expand on checkout.\n", "(Specify the --help global option for a list of other help options)\n", NULL }; static const char *const export_usage[] = { - "Usage: %s %s [-NRfln] [-r rev] [-D date] [-d dir] [-k kopt] module...\n", + "Usage: %s %s [-NRfln] [-r rev] [-t id] [-D date] [-d dir] [-k kopt] module...\n", "\t-N\tDon't shorten module paths if -d specified.\n", "\t-f\tForce a head revision match if tag/date not found.\n", "\t-l\tLocal directory only, not recursive\n", @@ -77,6 +78,7 @@ static const char *const export_usage[] = "\t-D date\tExport revisions as of date.\n", "\t-d dir\tExport into dir instead of module name.\n", "\t-k kopt\tUse RCS kopt -k option on checkout.\n", + "\t-t id\tRCS identifier to expand on export.\n", "(Specify the --help global option for a list of other help options)\n", NULL }; @@ -121,13 +123,13 @@ checkout (argc, argv) if (strcmp (command_name, "export") == 0) { m_type = EXPORT; - valid_options = "+Nnk:d:flRQqr:D:"; + valid_options = "+Nnk:d:flRQqr:t:D:"; valid_usage = export_usage; } else { m_type = CHECKOUT; - valid_options = "+ANnk:d:flRpQqcsr:D:j:P"; + valid_options = "+ANnk:d:flRpQqcsr:t:D:j:P"; valid_usage = checkout_usage; } @@ -199,6 +201,11 @@ checkout (argc, argv) tag = optarg; checkout_prune_dirs = 1; break; + case 't': + if (RCS_citag) + free(RCS_citag); + RCS_citag = strdup(optarg); + break; case 'D': date = Make_Date (optarg); checkout_prune_dirs = 1; diff --git a/gnu/usr.bin/cvs/src/rcs.c b/gnu/usr.bin/cvs/src/rcs.c index 52fdb8100e9..6fd2aacd005 100644 --- a/gnu/usr.bin/cvs/src/rcs.c +++ b/gnu/usr.bin/cvs/src/rcs.c @@ -3508,7 +3508,8 @@ expand_keywords (rcs, ver, name, log, loglen, expand, buf, len, retbuf, retlen) return; } - if (RCS_citag != NULL && keywords[KEYWORD_LOCALID].string == NULL) { + if (RCS_citag != NULL && *RCS_citag && *RCS_citag != '-' + && keywords[KEYWORD_LOCALID].string == NULL) { keywords[KEYWORD_LOCALID].string = RCS_citag; keywords[KEYWORD_LOCALID].len = strlen(RCS_citag); } diff --git a/gnu/usr.bin/cvs/src/update.c b/gnu/usr.bin/cvs/src/update.c index ec6e81831bd..8231e6e829d 100644 --- a/gnu/usr.bin/cvs/src/update.c +++ b/gnu/usr.bin/cvs/src/update.c @@ -109,7 +109,7 @@ static time_t last_register_time; static const char *const update_usage[] = { "Usage: %s %s [-APCdflRp] [-k kopt] [-r rev] [-D date] [-j rev]\n", - " [-I ign] [-W spec] [files...]\n", + " [-I ign] [-W spec] [-t id] [files...]\n", "\t-A\tReset any sticky tags/date/kopts.\n", "\t-P\tPrune empty directories.\n", "\t-C\tOverwrite locally modified files with clean repository copies.\n", @@ -124,6 +124,7 @@ static const char *const update_usage[] = "\t-j rev\tMerge in changes made between current revision and rev.\n", "\t-I ign\tMore files to ignore (! to reset).\n", "\t-W spec\tWrappers specification line.\n", + "\t-t id\tRCS identifier to expand on update.\n", "(Specify the --help global option for a list of other help options)\n", NULL }; @@ -148,7 +149,7 @@ update (argc, argv) /* parse the args */ optind = 0; - while ((c = getopt (argc, argv, "+ApCPflRQqduk:r:D:j:I:W:")) != -1) + while ((c = getopt (argc, argv, "+ApCPflRQqduk:r:t:D:j:I:W:")) != -1) { switch (c) { @@ -195,6 +196,11 @@ update (argc, argv) case 'r': tag = optarg; break; + case 't': + if (RCS_citag) + free(RCS_citag); + RCS_citag = strdup(optarg); + break; case 'D': date = Make_Date (optarg); break; -- cgit v1.2.3