[This patch looks basically correct to me. I think it can say "local_specified" instead of "local || local_specified" as do_module already handles the or. Needs a sanity.sh test case. -kingdon, 19 Dec 1997] From: minglis@mpc-data.co.uk Date: Fri, 19 Dec 1997 18:02:02 GMT To: bug-cvs@prep.ai.mit.edu Subject: rtag ignores the -l option in the "modules" file >Submitter-Id: net >Originator: Matthew Inglis >Organization: net >Confidential: no >Synopsis: rtag ignores the -l option in the "modules" file >Severity: non-critical >Priority: low >Category: cvs >Class: sw-bug >Release: cvs-1.9.14 >Environment: CVS Server System: Linux grandmet 2.0.27 #15 Mon Oct 13 19:20:11 BST 1997 i586 unknown CVS Client: Win NT 4, Intel Pentium >Description: When tagging a module using "cvs rtag", the -l (local) option in the "modules" file is not honoured. i.e. files in all subdirectories of the top-level directory are also tagged. Note that I don't mean the -l option of the rtag command, but the -l option of the "modules" file. I know for a simple case you could just specify "cvs rtag -l", but I have a complicated module definition file which has modules made up of many submodules, some of which I want to be recursive, some of which I just want the top-level dir as the module. >How-To-Repeat: Have a repository directory structure like this: maindir (directory) main1.c main2.c subdir1 (directory) sub1.c subdir2 (directory) sub2.c i.e. maindir is a directory containing 2 subdirectories. You then add a module to your "modules" file like this: maindir_only -l maindir Meaning "maindir_only" should not include subdir1 and subdir2. (This is indeed the case if you try "cvs checkout maindir_only"). However, if you then run "cvs rtag test_tag maindir_only" the files in subdir1 and subdir2 (sub1.c and sub2.c) are tagged as well. >Fix: I am unfamiliar with the CVS sources, and there may be a better solution (or indeed this one may not work properly!). I have tested it to some extent, but it requires checking by someone more competent! I have simply altered the rtag callback function to take account of the passed-in flag "local_specified" as well as the "local" command line option. *** rtag.c.sav Tue Jul 1 23:55:46 1997 --- rtag.c Fri Dec 19 09:52:31 1997 *************** *** 303,309 **** if (numtag != NULL && !numtag_validated) { ! tag_check_valid (numtag, *pargc - 1, argv + 1, local, 0, NULL); numtag_validated = 1; } --- 303,310 ---- if (numtag != NULL && !numtag_validated) { ! tag_check_valid (numtag, *pargc - 1, argv + 1, local || local_specified, ! 0, NULL); numtag_validated = 1; } *************** *** 313,320 **** mtlist = getlist(); err = start_recursion (check_fileproc, check_filesdoneproc, (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, ! *pargc - 1, argv + 1, local, which, 0, 1, ! where, 1); if (err) { --- 314,321 ---- mtlist = getlist(); err = start_recursion (check_fileproc, check_filesdoneproc, (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, ! *pargc - 1, argv + 1, local || local_specified, ! which, 0, 1, where, 1); if (err) { *************** *** 324,330 **** /* start the recursion processor */ err = start_recursion (rtag_fileproc, rtag_filesdoneproc, rtag_dirproc, (DIRLEAVEPROC) NULL, NULL, ! *pargc - 1, argv + 1, local, which, 0, 0, where, 1); free (where); dellist(&mtlist); --- 325,331 ---- /* start the recursion processor */ err = start_recursion (rtag_fileproc, rtag_filesdoneproc, rtag_dirproc, (DIRLEAVEPROC) NULL, NULL, ! *pargc - 1, argv + 1, local || local_specified, which, 0, 0, where, 1); free (where); dellist(&mtlist);