bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new features for local keywords and keyword expansion


From: Mark D. Baushke
Subject: Re: new features for local keywords and keyword expansion
Date: Tue, 10 Jun 2003 10:00:05 -0700

Derek Robert Price <address@hidden> writes:

> Mark D. Baushke wrote:
> 
> >Derek Robert Price <address@hidden> writes:
>
> Okay, that makes sense.  I was thinking along the lines of someone
> forking your distribution, or at least maintaining a variant.  Then
> when you got a bug report you could see the differing repository &
> perhaps even direct people to the correct place to file a bug report.
> Not a big deal, though.  Maybe I'll keep it in mind for a CVSROOT
> keyword, or the like, for later.

If I have imported the FreeBSD repository, then reporting a bug in a file
with a 

$FreeBSD: src/usr.sbin/somedir/somefile.c,v 1.10 2002/12/10 10:20:09 someone 
Exp$

the repository will not matter too much as I know it is the freebsd.org
cvs repository and in what file and version the basic bug may be found.
 
> >"KeywordExpand=i" should disable all keyword expansion. I can add a test
> >for this if you wish.
> >
> 
> Is it likely to break?

No, but sometimes folks learn how cvs works by reading the sanity.sh for
clues about a particular feature (or so I have been told). This
particular configuration of the new feature (disable all keyword
expansions) is not hard to test, so I'll throw it into the test case.

I plan to commit this feature sometime later today after I have a chance
to rerun the 'make check' again now that I have updated sanity.sh.

        Enjoy!
        -- Mark

Index: ChangeLog
===================================================================
RCS file: /cvs/ccvs/ChangeLog,v
retrieving revision 1.755
diff -u -p -r1.755 ChangeLog
--- ChangeLog   9 Jun 2003 20:31:11 -0000       1.755
+++ ChangeLog   10 Jun 2003 16:59:23 -0000
@@ -1,3 +1,7 @@
+2003-06-09  Mark D. Baushke  <address@hidden>
+
+       * NEWS: New LocalKeyword and KeywordExpand options.
+
 2003-06-09  Derek Price  <address@hidden>
 
        * cvsnt.mak: Rename win32.c to woe32.c in accordance with the GNU
Index: NEWS
===================================================================
RCS file: /cvs/ccvs/NEWS,v
retrieving revision 1.132
diff -u -p -r1.132 NEWS
--- NEWS        9 Jun 2003 18:42:30 -0000       1.132
+++ NEWS        10 Jun 2003 16:59:23 -0000
@@ -1,5 +1,10 @@
 Changes since 1.12.1:
 
+* New LocalKeyword and KeywordExpand options to CVSROOT/config which
+FreeBSD, OpenBSD, and NetBSD users may find familiar as the "tag" and
+"tagexpand" options used for many years. The CVSHeader keyword has
+also been added to the mixture.
+
 * A bug with short patches (`rdiff -s') which caused rdiff to sometimes report
 differences that did not exist has been fixed.
 
Index: doc/ChangeLog
===================================================================
RCS file: /cvs/ccvs/doc/ChangeLog,v
retrieving revision 1.761
diff -u -p -r1.761 ChangeLog
--- doc/ChangeLog       27 May 2003 16:46:01 -0000      1.761
+++ doc/ChangeLog       10 Jun 2003 16:59:23 -0000
@@ -1,3 +1,15 @@
+2003-06-09  Mark D. Baushke  <address@hidden>
+
+       * cvs.texinfo (Keyword substitution): New menu entry for
+       "Configuring keyword expansion."
+       (Keyword list): New "CVSHeader" keyword. New Local keyword
+       controlled by new LocalKeyword option in CVSROOT/config.
+       (Avoiding substitution): Mention the new KeywordExpansion option
+       in CVSROOT/config.
+       (Configuring keyword expansion): Document the new KeywordExpansion
+       option in CVSROOT/config.
+       (Invoking CVS): New example of CVSHeader keyword expansion.
+
 2003-05-27  Derek Price  <address@hidden>
 
        * cvs.texinfo: Consolidate copyright notices into a single macro that
Index: doc/cvs.texinfo
===================================================================
RCS file: /cvs/ccvs/doc/cvs.texinfo,v
retrieving revision 1.568
diff -u -p -r1.568 cvs.texinfo
--- doc/cvs.texinfo     27 May 2003 16:46:01 -0000      1.568
+++ doc/cvs.texinfo     10 Jun 2003 16:59:24 -0000
@@ -6830,11 +6830,12 @@ with strings of the form
 a new revision of the file.
 
 @menu
-* Keyword list::                Keywords
-* Using keywords::              Using keywords
-* Avoiding substitution::       Avoiding substitution
-* Substitution modes::          Substitution modes
-* Log keyword::                 Problems with the address@hidden keyword.
+* Keyword list::                   Keywords
+* Using keywords::                 Using keywords
+* Avoiding substitution::          Avoiding substitution
+* Substitution modes::             Substitution modes
+* Configuring keyword expansion::  Configuring keyword expansion
+* Log keyword::                    Problems with the address@hidden keyword.
 @end menu
 
 @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -6855,6 +6856,23 @@ This is a list of the keywords:
 @item address@hidden
 The login name of the user who checked in the revision.
 
address@hidden CVSHeader keyword
address@hidden address@hidden
+A standard header (similar to address@hidden, but with
+the CVS root stripped off). It contains the relative
+pathname of the @sc{rcs} file to the CVS root, the
+revision number, the date (UTC), the author, the state,
+and the locker (if locked). Files will normally never
+be locked when you use @sc{cvs}.
+
+Note that this keyword has only been recently
+introduced to @sc{cvs} and may cause problems with
+existing installations if address@hidden is already
+in the files for a different purpose. This keyword may
+be excluded using the @code{KeywordExpansion=eCVSHeader}
+in the @file{CVSROOT/config} file. 
+See @ref{Configuring keyword expansion} for more details.
+
 @cindex Date keyword
 @item address@hidden
 The date and time (UTC) the revision was checked in.
@@ -6932,6 +6950,53 @@ The full pathname of the RCS file.
 The state assigned to the revision.  States can be
 assigned with @code{cvs admin -s}---see @ref{admin options}.
 
address@hidden Local keyword
address@hidden Local keyword
+The @code{LocalKeyword} option in the @file{CVSROOT/config} file
+may be used to specify a local keyword which is to be
+used as an alias for one of the other keywords. For
+example, if the @file{CVSROOT/config} file contains
+a line with @code{LocalKeyword=MYBSD=CVSHeader}, then a
+file with the local keyword address@hidden will be
+expanded as if it were a address@hidden keyword. If
+the src/frob.c file contained this keyword, it might
+look something like this:
+
address@hidden
+  /*
+   * address@hidden: src/frob.c,v 1.1 2003/05/04 09:27:45 john Exp $ 
+   */
address@hidden example
+
+Many repositories make use of a such a ``local
+keyword'' feature. An old patch to @sc{cvs} provided
+the @code{LocalKeyword} feature using a @code{tag=}
+option and called this the ``custom tag'' or ``local
+tag'' feature. It was used in conjunction with the
+what they called the @code{tagexpand=} option. In
address@hidden this other option is known as the
address@hidden option. 
+See @ref{Configuring Keyword Expansion} for more
+details.
+
+Examples from popular projects include:
address@hidden, address@hidden, address@hidden,
address@hidden, address@hidden
+
+The advantage of this is that you can include your
+local version information in a file using this local
+keyword without disrupting the upstream version
+information (which may be a different local keyword or
+a standard keyword). Allowing bug reports and the like
+to more properly identify the source of the original
+bug to the third-party and reducing the number of
+conflicts that arise during an import of a new version.
+
+All keyword expansion except the local keyword may be
+disabled using the @code{KeywordExpansion} option in
+the @file{CVSROOT/config} file---see 
address@hidden keyword expansion} for more details.
+
 @end table
 
 @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -7013,6 +7078,14 @@ contains @samp{$@@address@hidden@}Author$} whene
 and @code{troff} you can embed the null-character
 @code{\&} inside the keyword for a similar effect.
 
+It is also possible to specify an explicit list of
+keywords to include or exclude using the
address@hidden option in the
address@hidden/config} file--see @ref{Configuring keyword expansion}
+for more details. This feature is intended primarily
+for use with the @code{LocalKeyword} option--see
address@hidden keyword}.
+
 @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 @node Substitution modes
 @section Substitution modes
@@ -7103,6 +7176,98 @@ handle an export containing binary files
 @end table
 
 @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
address@hidden Configuring keyword expansion
address@hidden Configuring Keyord Expansion
address@hidden Configuring keyword expansion
+
+In a repository that includes third-party software on
+vendor branches, it is sometimes helpful to configure
+CVS to use a local keyword instead of the standard
address@hidden or address@hidden keywords. Examples from
+real projects includ, address@hidden, address@hidden,
address@hidden, address@hidden, address@hidden,
+and even address@hidden The advantage of this is that
+you can include your local version information in a
+file using this local keyword (sometimes called a
+``custom tag'' or a ``local tag'') without disrupting
+the upstream version information (which may be a
+different local keyword or a standard keyword). In
+these cases, it is typically desirable to disable the
+expansion of all keywords except the configured local
+keyword.
+
+The @code{KeywordExpansion} option in the
address@hidden/config} file is intended to allow for the
+either the explicit exclusion of a keyword or list of
+keywords, or for the explicit inclusion of a keyword or
+a list of keywords. This list may include the
address@hidden that has been configured.
+
+The @code{KeywordExpansion} option is followed by
address@hidden and the next character may either be @code{i}
+to start an inclusion list or @code{e} to start an
+exclusion list. If the following lines were added to
+the @file{CVSROOT/config} file:
+
address@hidden
+        # Add a "MyBSD" keyword and restrict keyword
+        # expansion
+        LocalKeyword=MyBSD=CVSHeader
+        KeywordExpand=iMyBSD
address@hidden example
+
+then only the address@hidden keyword would be expanded.
+A list may be used. The this example:
+
address@hidden
+        # Add a "MyBSD" keyword and restrict keyword
+        # expansion to the MyBSD, Name and Date keywords.
+        LocalKeyword=MyBSD=CVSHeader
+        KeywordExpand=iMyBSD,Name,Date
address@hidden example
+
+would allow address@hidden, address@hidden, and
address@hidden to be expanded.
+
+It is also possible to configure an exclusion list
+using the following:
+
address@hidden
+        # Do not expand the non-RCS keyword CVSHeader
+        KeywordExpand=eCVSHeader
address@hidden example
+
+This allows @sc{cvs} to ignore the recently introduced
address@hidden keyword and retain all of the
+others. The exclusion entry could also contain the
+standard RCS keyword list, but this could be confusing
+to users that expect RCS keywords to be expanded, so
+ycare should be taken to properly set user expectations
+for a repository that is configured in that manner.
+
+If there is a desire to not have any RCS keywords
+expanded and not use the @code{-ko} flags everywhere,
+an administrator may disable all keyword expansion
+using the @file{CVSROOT/config} line:
+
address@hidden
+       # Do not expand any RCS keywords
+       KeywordExpand=i
address@hidden example
+
+this could be confusing to users that expect RCS
+keywords like address@hidden to be expanded properly,
+so care should be taken to properly set user
+expectations for a repository so configured.
+
+It should be noted that a patch to provide both the
address@hidden and @code{LocalKeyword} features
+has been around a long time. However, that patch
+implemented these features using @code{tag=} and
address@hidden keywords and those keywords are NOT
+recognized.
+
address@hidden - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- -
 @node Log keyword
 @section Problems with the address@hidden keyword.
 
@@ -11002,6 +11167,7 @@ Keywords (@pxref{Keyword list}):
 @example
 address@hidden: joe $
 address@hidden: 1993/12/09 03:21:13 $
address@hidden: files/file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $
 address@hidden: /home/files/file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $
 address@hidden: file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $
 address@hidden: harry $
Index: src/ChangeLog
===================================================================
RCS file: /cvs/ccvs/src/ChangeLog,v
retrieving revision 1.2462
diff -u -p -r1.2462 ChangeLog
--- src/ChangeLog       9 Jun 2003 20:31:12 -0000       1.2462
+++ src/ChangeLog       10 Jun 2003 16:59:24 -0000
@@ -1,3 +1,16 @@
+2003-06-09  Mark D. Baushke  <address@hidden>
+
+       * rcs.c (RCS_setlocalid,RCS_setincexc): New functions to support
+       LocalKeyword and KeywordExpand config keywords.
+
+       * rcs.h (RCS_setlocalid,RCS_setincexc): New prototypes.
+
+       * parseinfo.c (parse_config): Added LocalKeyword
+       and KeywordExpand keywords.
+
+       * sanity.sh (keywordexpand): New CVSROOT/config tests for
+       LocalKeyword and KeywordExpand options.
+
 2003-06-09  Derek Price  <address@hidden>
 
        * rcs.c (RCS_delete_revs): Reference WOE32 rather than WIN32 in
Index: src/parseinfo.c
===================================================================
RCS file: /cvs/ccvs/src/parseinfo.c,v
retrieving revision 1.43
diff -u -p -r1.43 parseinfo.c
--- src/parseinfo.c     22 May 2003 18:03:28 -0000      1.43
+++ src/parseinfo.c     10 Jun 2003 16:59:24 -0000
@@ -340,6 +340,16 @@ parse_config (cvsroot)
                goto error_return;
            }
        }
+       else if (strcmp (line, "LocalKeyword") == 0)
+       {
+           RCS_setlocalid(p);
+               
+       }
+       else if (strcmp (line, "KeywordExpand") == 0)
+       {
+           RCS_setincexc(p);
+               
+       }
        else if (strcmp (line, "PreservePermissions") == 0)
        {
            if (strcmp (p, "no") == 0)
Index: src/rcs.c
===================================================================
RCS file: /cvs/ccvs/src/rcs.c,v
retrieving revision 1.275
diff -u -p -r1.275 rcs.c
--- src/rcs.c   9 Jun 2003 20:31:12 -0000       1.275
+++ src/rcs.c   10 Jun 2003 16:59:24 -0000
@@ -133,6 +133,8 @@ static char *rcs_lockfilename PROTO ((ch
    evaluates its arguments multiple times.  */
 #define STREQ(a, b) ((a)[0] == (b)[0] && strcmp ((a), (b)) == 0)
 
+static char * getfullCVSname PROTO ((char *, char **));
+
 /*
  * We don't want to use isspace() from the C library because:
  *
@@ -3404,27 +3406,31 @@ struct rcs_keyword
 {
     const char *string;
     size_t len;
+    int expandit;
 };
 #define KEYWORD_INIT(s) (s), sizeof (s) - 1
-static const struct rcs_keyword keywords[] =
+static struct rcs_keyword keywords[] =
 {
-    { KEYWORD_INIT ("Author") },
-    { KEYWORD_INIT ("Date") },
-    { KEYWORD_INIT ("Header") },
-    { KEYWORD_INIT ("Id") },
-    { KEYWORD_INIT ("Locker") },
-    { KEYWORD_INIT ("Log") },
-    { KEYWORD_INIT ("Name") },
-    { KEYWORD_INIT ("RCSfile") },
-    { KEYWORD_INIT ("Revision") },
-    { KEYWORD_INIT ("Source") },
-    { KEYWORD_INIT ("State") },
-    { NULL, 0 }
+    { KEYWORD_INIT ("Author"), 1 },
+    { KEYWORD_INIT ("Date"), 1 },
+    { KEYWORD_INIT ("CVSHeader"), 1 },
+    { KEYWORD_INIT ("Header"), 1 },
+    { KEYWORD_INIT ("Id"), 1 },
+    { KEYWORD_INIT ("Locker"), 1 },
+    { KEYWORD_INIT ("Log"), 1 },
+    { KEYWORD_INIT ("Name"), 1 },
+    { KEYWORD_INIT ("RCSfile"), 1 },
+    { KEYWORD_INIT ("Revision"), 1 },
+    { KEYWORD_INIT ("Source"), 1 },
+    { KEYWORD_INIT ("State"), 1 },
+    { NULL, 0, 0 },            /* localid */
+    { NULL, 0, 0 }
 };
 enum keyword
 {
     KEYWORD_AUTHOR = 0,
     KEYWORD_DATE,
+    KEYWORD_CVSHEADER,
     KEYWORD_HEADER,
     KEYWORD_ID,
     KEYWORD_LOCKER,
@@ -3433,8 +3439,10 @@ enum keyword
     KEYWORD_RCSFILE,
     KEYWORD_REVISION,
     KEYWORD_SOURCE,
-    KEYWORD_STATE
+    KEYWORD_STATE,
+    KEYWORD_LOCALID
 };
+enum keyword keyword_local = KEYWORD_ID;
 
 /* Convert an RCS date string into a readable string.  This is like
    the RCS date2str function.  */
@@ -3612,7 +3620,8 @@ expand_keywords (rcs, ver, name, log, lo
        slen = s - srch;
        for (keyword = keywords; keyword->string != NULL; keyword++)
        {
-           if (keyword->len == slen
+           if (keyword->expandit
+               && keyword->len == slen
                && strncmp (keyword->string, srch, slen) == 0)
            {
                break;
@@ -3659,15 +3668,25 @@ expand_keywords (rcs, ver, name, log, lo
                free_value = 1;
                break;
 
+           case KEYWORD_CVSHEADER:
            case KEYWORD_HEADER:
            case KEYWORD_ID:
+           case KEYWORD_LOCALID:
                {
                    char *path;
                    int free_path;
                    char *date;
+                   char *old_path;
 
-                   if (kw == KEYWORD_HEADER)
+                   old_path = NULL;
+                   if (kw == KEYWORD_HEADER ||
+                           (kw == KEYWORD_LOCALID &&
+                            keyword_local == KEYWORD_HEADER))
                        path = rcs->path;
+                   else if (kw == KEYWORD_CVSHEADER ||
+                            (kw == KEYWORD_LOCALID &&
+                             keyword_local == KEYWORD_CVSHEADER))
+                       path = getfullCVSname(rcs->path, &old_path);
                    else
                        path = last_component (rcs->path);
                    path = escape_keyword_value (path, &free_path);
@@ -3687,6 +3706,8 @@ expand_keywords (rcs, ver, name, log, lo
                             locker != NULL ? locker : "");
                    if (free_path)
                        free (path);
+                   if (old_path)
+                       free (old_path);
                    free (date);
                    free_value = 1;
                }
@@ -8529,7 +8550,107 @@ make_file_label (path, rev, rcs)
     return label;
 }
 
+void
+RCS_setlocalid (arg)
+    const char *arg;
+{
+    char *copy, *next, *key;
+
+    copy = xstrdup(arg);
+    next = copy;
+    key = strtok(next, "=");
+
+    keywords[KEYWORD_LOCALID].string = xstrdup(key);
+    keywords[KEYWORD_LOCALID].len = strlen(key);
+    keywords[KEYWORD_LOCALID].expandit = 1;
+
+    /* options? */
+    while (key = strtok(NULL, ",")) {
+       if (!strcmp(key, keywords[KEYWORD_ID].string))
+           keyword_local = KEYWORD_ID;
+       else if (!strcmp(key, keywords[KEYWORD_HEADER].string))
+           keyword_local = KEYWORD_HEADER;
+       else if (!strcmp(key, keywords[KEYWORD_CVSHEADER].string))
+           keyword_local = KEYWORD_CVSHEADER;
+       else
+           error(1, 0, "Unknown LocalId mode: %s", key);
+    }
+    free(copy);
+}
 
+void
+RCS_setincexc (arg)
+    const char *arg;
+{
+    char *key;
+    char *copy, *next;
+    int include = 0;
+    struct rcs_keyword *keyword;
+
+    copy = xstrdup(arg);
+    next = copy;
+    switch (*next++) {
+       case 'e':
+           include = 0;
+           break;
+       case 'i':
+           include = 1;
+           break;
+       default:
+           free(copy);
+           return;
+    }
+
+    if (include)
+       for (keyword = keywords; keyword->string != NULL; keyword++)
+       {
+           keyword->expandit = 0;
+       }
+
+    key = strtok(next, ",");
+    while (key) {
+       for (keyword = keywords; keyword->string != NULL; keyword++) {
+           if (strcmp (keyword->string, key) == 0)
+               keyword->expandit = include;
+       }
+       key = strtok(NULL, ",");
+    }
+    free(copy);
+    return;
+}
+
+#define ATTIC "/" CVSATTIC
+static char *
+getfullCVSname(CVSname, pathstore)
+    char *CVSname, **pathstore;
+{
+    if (current_parsed_root->directory) {
+       int rootlen;
+       char *c = NULL;
+       int alen = sizeof(ATTIC) - 1;
+
+       *pathstore = xstrdup(CVSname);
+       if ((c = strrchr(*pathstore, '/')) != NULL) {
+           if (c - *pathstore >= alen) {
+               if (!strncmp(c - alen, ATTIC, alen)) {
+                   while (*c != '\0') {
+                       *(c - alen) = *c;
+                       c++;
+                   }
+                   *(c - alen) = '\0';
+               }
+           }
+       }
+
+       rootlen = strlen(current_parsed_root->directory);
+       if (!strncmp(*pathstore, current_parsed_root->directory, rootlen) &&
+           (*pathstore)[rootlen] == '/')
+           CVSname = (*pathstore + rootlen + 1);
+       else
+           CVSname = (*pathstore);
+    }
+    return CVSname;
+}
 
 /*
  * char *
Index: src/rcs.h
===================================================================
RCS file: /cvs/ccvs/src/rcs.h,v
retrieving revision 1.61
diff -u -p -r1.61 rcs.h
--- src/rcs.h   4 Jun 2003 20:37:57 -0000       1.61
+++ src/rcs.h   10 Jun 2003 16:59:24 -0000
@@ -241,6 +241,8 @@ int rcs_change_text PROTO ((const char *
 void RCS_deltas PROTO ((RCSNode *, FILE *, struct rcsbuffer *, char *,
                        enum rcs_delta_op, char **, size_t *,
                        char **, size_t *));
+void RCS_setincexc PROTO ((const char *arg));
+void RCS_setlocalid PROTO ((const char *arg));
 char *make_file_label PROTO ((char *, char *, RCSNode *));
 char *locate_rcs PROTO (( const char *repository,
                           const char *file,
Index: src/sanity.sh
===================================================================
RCS file: /cvs/ccvs/src/sanity.sh,v
retrieving revision 1.802
diff -u -p -r1.802 sanity.sh
--- src/sanity.sh       9 Jun 2003 18:42:31 -0000       1.802
+++ src/sanity.sh       10 Jun 2003 16:59:27 -0000
@@ -914,6 +914,7 @@ if test x"$*" = x; then
        tests="${tests} join-admin join-admin-2"
        tests="${tests} new newb conflicts conflicts2 conflicts3"
        tests="${tests} clean"
+       tests="${tests} keywordexpand"
        # Checking out various places (modules, checkout -d, &c)
        tests="${tests} modules modules2 modules3 modules4 modules5 modules6"
        tests="${tests} mkmodules-temp-file-removal"
@@ -9709,6 +9710,117 @@ fish"
          cd ../..
           rm -rf 1
          rm -rf ${CVSROOT_DIRNAME}/first-dir
+         ;;
+
+       keywordexpand)
+         # Tests of the original *BSD tag= and keywordexpand= features
+         # are done via the LocalKeyword= and KeywordExpand features.
+         mkdir keywordexpand; cd keywordexpand
+
+         dotest keywordexpand-1 "${testcvs} -q co CVSROOT" \
+'U CVSROOT/checkoutlist
+U CVSROOT/commitinfo
+U CVSROOT/config
+U CVSROOT/cvswrappers
+U CVSROOT/editinfo
+U CVSROOT/loginfo
+U CVSROOT/modules
+U CVSROOT/notify
+U CVSROOT/rcsinfo
+U CVSROOT/taginfo
+U CVSROOT/verifymsg'
+         cd CVSROOT
+         echo LocalKeyword=MyBSD=CVSHeader >> config
+         # First do not expand any keywords
+         echo KeywordExpand=i >> config
+         dotest keywordexpand-2 "${testcvs} -Q ci -mkeywordexpand config" \
+"Checking in config;
+${CVSROOT_DIRNAME}/CVSROOT/config,v  <--  config
+new revision: 1\.2; previous revision: 1\.1
+done
+${PROG} [a-z]*: Rebuilding administrative file database"
+
+         cd ..
+
+         mkdir testimport; cd testimport
+         echo '$''Author$' > file1
+         echo '$''Date$' >> file1
+         echo '$''CVSHeader$' >> file1
+         echo '$''Header$' >> file1
+         echo '$''Id$' >> file1
+         echo '$''Locker$' >> file1
+         echo '$''Log$' >> file1
+         echo '$''Name$' >> file1
+         echo '$''RCSfile$' >> file1
+         echo '$''Revision$' >> file1
+         echo '$''Source$' >> file1
+         echo '$''State$' >> file1
+         echo '$''MyBSD$' >> file1
+         dotest keywordexpand-3 \
+"${testcvs} -Q import -I ! -m test-import-with-bsd-keyword keywordexpand 
vendor v1" \
+''
+         cd ..
+
+         dotest keywordexpand-4 "${testcvs} -Q checkout keywordexpand" ''
+         cd keywordexpand
+         dotest keywordexpand-5 "cat file1" \
+"\$""Author\$
+\$""Date\$
+\$""CVSHeader\$
+\$""Header\$
+\$""Id\$
+\$""Locker\$
+\$""Log\$
+\$""Name\$
+\$""RCSfile\$
+\$""Revision\$
+\$""Source\$
+\$""State\$
+\$MyBSD\$"
+         cd ../CVSROOT
+         # Now expand just the MyBSD and Id keywords
+         mv config config.old
+         sed -e 's/KeywordExpand=i/KeywordExpand=iMyBSD,Id/' < config.old > 
config
+         rm -f config.old
+         dotest keywordexpand-6 "${testcvs} -Q ci -mkeywordexpand config" \
+"Checking in config;
+${CVSROOT_DIRNAME}/CVSROOT/config,v  <--  config
+new revision: 1\.3; previous revision: 1\.2
+done
+${PROG} [a-z]*: Rebuilding administrative file database"
+         cd ../keywordexpand
+         echo 'a change' >> file1
+         dotest keywordexpand-7 "${testcvs} -Q ci -madd" \
+"Checking in file1;
+${CVSROOT_DIRNAME}/keywordexpand/file1,v  <--  file1
+new revision: 1\.2; previous revision: 1\.1
+done"
+         dotest keywordexpand-8 "cat file1" \
+"\$""Author\$
+\$""Date\$
+\$""CVSHeader\$
+\$""Header\$
+\$""Id: file1,v 1\.2 [0-9/]* [0-9:]* ${username} Exp \$
+\$""Locker\$
+\$""Log\$
+\$""Name\$
+\$""RCSfile\$
+\$""Revision\$
+\$""Source\$
+\$""State\$
+\$MyBSD: keywordexpand/file1,v 1\.2 [0-9/]* [0-9:]* ${username} Exp \$
+a change"
+         cd ..
+
+         dokeep
+
+         # Done. Clean up.
+         cd ..
+         rm -rf ${TESTDIR}/keywordexpand \
+                ${CVSROOT_DIRNAME}/keywordexpand
+         rm -f ${CVSROOT_DIRNAME}/CVSROOT/config,v \
+                ${CVSROOT_DIRNAME}/CVSROOT/config
+         dotest keywordexpand-cleanup-1 "${testcvs} init" ''
          ;;
 
        modules)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]