Don't compile LOCALID into the client, make it a repository specific

variable. The LOCALID is now set in the repository's CVSROOT/config file,
with a line
	tag=something
(in our case 'tag=NetBSD').
Taken from OpenBSD.
This commit is contained in:
wiz 2000-10-21 12:40:23 +00:00
parent 5e9e3fbf13
commit 5d76b1c7a2
5 changed files with 20 additions and 4 deletions

View File

@ -363,6 +363,7 @@ extern int really_quiet, quiet;
extern int use_editor;
extern int cvswrite;
extern mode_t cvsumask;
extern char *RCS_citag;
/* Access method specified in CVSroot. */
typedef enum {

View File

@ -50,6 +50,7 @@ int logoff = 0;
int top_level_admin = 0;
mode_t cvsumask = UMASK_DFLT;
char *RCS_citag = NULL;
char *CurDir;

View File

@ -288,6 +288,9 @@ static const char *const config_contents[] = {
"# level of the new working directory when using the `cvs checkout'\n",
"# command.\n",
"#TopLevelAdmin=no\n",
"\n",
"# Set this to the name of a local tag to use in addition to Id\n",
"#tag=OurTag\n",
NULL
};

View File

@ -326,6 +326,14 @@ parse_config (cvsroot)
goto error_return;
}
}
else if (strcmp (line, "tag") == 0) {
RCS_citag = strdup(p);
if (RCS_citag == NULL) {
error (0, 0, "%s: no memory for local tag '%s'",
infopath, p);
goto error_return;
}
}
else if (strcmp (line, "PreservePermissions") == 0)
{
if (strcmp (p, "no") == 0)

View File

@ -3707,7 +3707,7 @@ struct rcs_keyword
size_t len;
};
#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") },
@ -3720,9 +3720,7 @@ static const struct rcs_keyword keywords[] =
{ KEYWORD_INIT ("Revision") },
{ KEYWORD_INIT ("Source") },
{ KEYWORD_INIT ("State") },
#ifdef LOCALID
{ KEYWORD_INIT (LOCALID) },
#endif
{ NULL, 0 },
{ NULL, 0 }
};
enum keyword
@ -3875,6 +3873,11 @@ expand_keywords (rcs, ver, name, log, loglen, expand, buf, len, retbuf, retlen)
return;
}
if (RCS_citag != NULL) {
keywords[KEYWORD_LOCALID].string = RCS_citag;
keywords[KEYWORD_LOCALID].len = strlen(RCS_citag);
}
/* If we are using -kkvl, dig out the locker information if any. */
locker = NULL;
if (expand == KFLAG_KVL)