summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2008-02-04 18:23:59 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2008-02-04 18:23:59 +0000
commitbb6fd23cd9ea4d27e10b0e6b40885c7da78c0337 (patch)
treec6677438fe0eaf5d1e27f1bc4a1658913a819ecb /usr.bin
parent397e2a22c43b60e269b2f10956ddcee7dd0ee123 (diff)
Stripped off 'nb', which was (or was supposed to be) used to distinguish
between a named branch and a revision number supplied by -r. This can be done easier in cvs_write_tagfile directly. OK joris@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/add.c4
-rw-r--r--usr.bin/cvs/cvs.h4
-rw-r--r--usr.bin/cvs/entries.c11
-rw-r--r--usr.bin/cvs/file.c4
-rw-r--r--usr.bin/cvs/update.c4
-rw-r--r--usr.bin/cvs/util.c12
-rw-r--r--usr.bin/cvs/util.h5
7 files changed, 24 insertions, 20 deletions
diff --git a/usr.bin/cvs/add.c b/usr.bin/cvs/add.c
index df2f7a78204..a4aaf2f35aa 100644
--- a/usr.bin/cvs/add.c
+++ b/usr.bin/cvs/add.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: add.c,v 1.90 2008/02/04 15:07:32 tobias Exp $ */
+/* $OpenBSD: add.c,v 1.91 2008/02/04 18:23:58 tobias Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -238,7 +238,7 @@ add_directory(struct cvs_file *cf)
repo, cf->file_name);
cvs_mkadmin(cf->file_path, current_cvsroot->cr_dir,
- entry, tag, date, nb);
+ entry, tag, date);
p = xmalloc(CVS_ENT_MAXLINELEN);
(void)xsnprintf(p, CVS_ENT_MAXLINELEN,
diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h
index 1b078ffdaee..bb2a5a89e3b 100644
--- a/usr.bin/cvs/cvs.h
+++ b/usr.bin/cvs/cvs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cvs.h,v 1.153 2008/02/04 15:07:33 tobias Exp $ */
+/* $OpenBSD: cvs.h,v 1.154 2008/02/04 18:23:58 tobias Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -373,7 +373,7 @@ void cvs_ent_remove(CVSENTRIES *, const char *);
void cvs_ent_close(CVSENTRIES *, int);
void cvs_ent_free(struct cvs_ent *);
void cvs_parse_tagfile(char *, char **, char **, int *);
-void cvs_write_tagfile(const char *, char *, char *, int);
+void cvs_write_tagfile(const char *, char *, char *);
/* root.c */
struct cvsroot *cvsroot_get(const char *);
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c
index 3592ac20585..8970996569e 100644
--- a/usr.bin/cvs/entries.c
+++ b/usr.bin/cvs/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.87 2008/02/04 15:08:44 tobias Exp $ */
+/* $OpenBSD: entries.c,v 1.88 2008/02/04 18:23:58 tobias Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -421,13 +421,17 @@ cvs_parse_tagfile(char *dir, char **tagp, char **datep, int *nbp)
}
void
-cvs_write_tagfile(const char *dir, char *tag, char *date, int nb)
+cvs_write_tagfile(const char *dir, char *tag, char *date)
{
FILE *fp;
+ RCSNUM *rev;
char tagpath[MAXPATHLEN];
char sticky[CVS_REV_BUFSZ];
int i;
+ cvs_log(LP_TRACE, "cvs_write_tagfile(%s, %s, %s)", dir,
+ tag != NULL ? tag : "", date != NULL ? date : "");
+
if (cvs_noexec == 1)
return;
@@ -445,9 +449,10 @@ cvs_write_tagfile(const char *dir, char *tag, char *date, int nb)
}
if (tag != NULL) {
- if (nb != 0) {
+ if ((rev = rcsnum_parse(tag)) != NULL) {
(void)xsnprintf(sticky, sizeof(sticky),
"N%s", tag);
+ rcsnum_free(rev);
} else {
(void)xsnprintf(sticky, sizeof(sticky),
"T%s", tag);
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index ae82919f1f6..50ec4dc3e76 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.214 2008/02/03 22:50:28 joris Exp $ */
+/* $OpenBSD: file.c,v 1.215 2008/02/04 18:23:58 tobias Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
@@ -576,7 +576,7 @@ walkrepo:
cr->leavedir(cf);
if (cvs_directory_tag != NULL && cmdp->cmd_flags & CVS_USE_WDIR) {
- cvs_write_tagfile(cf->file_path, cvs_directory_tag, NULL, 0);
+ cvs_write_tagfile(cf->file_path, cvs_directory_tag, NULL);
xfree(cvs_directory_tag);
cvs_directory_tag = NULL;
}
diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c
index 465ca56a5df..0b787a9643c 100644
--- a/usr.bin/cvs/update.c
+++ b/usr.bin/cvs/update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: update.c,v 1.119 2008/02/04 15:07:33 tobias Exp $ */
+/* $OpenBSD: update.c,v 1.120 2008/02/04 18:23:58 tobias Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -193,7 +193,7 @@ cvs_update_enterdir(struct cvs_file *cf)
} else {
if (cvs_specified_tag != NULL)
cvs_write_tagfile(cf->file_path,
- cvs_specified_tag, NULL, 0);
+ cvs_specified_tag, NULL);
}
}
diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c
index d69adfcfc83..646755c0fd7 100644
--- a/usr.bin/cvs/util.c
+++ b/usr.bin/cvs/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.130 2008/02/03 17:20:14 joris Exp $ */
+/* $OpenBSD: util.c,v 1.131 2008/02/04 18:23:58 tobias Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org>
@@ -513,16 +513,16 @@ cvs_get_repository_name(const char *dir, char *dst, size_t len)
void
cvs_mkadmin(const char *path, const char *root, const char *repo,
- char *tag, char *date, int nb)
+ char *tag, char *date)
{
FILE *fp;
struct stat st;
char buf[MAXPATHLEN];
if (cvs_server_active == 0)
- cvs_log(LP_TRACE, "cvs_mkadmin(%s, %s, %s, %s, %s, %d)",
+ cvs_log(LP_TRACE, "cvs_mkadmin(%s, %s, %s, %s, %s)",
path, root, repo, (tag != NULL) ? tag : "",
- (date != NULL) ? date : "", nb);
+ (date != NULL) ? date : "");
(void)xsnprintf(buf, sizeof(buf), "%s/%s", path, CVS_PATH_CVSDIR);
@@ -554,7 +554,7 @@ cvs_mkadmin(const char *path, const char *root, const char *repo,
fatal("cvs_mkadmin: %s: %s", buf, strerror(errno));
(void)fclose(fp);
- cvs_write_tagfile(path, tag, date, nb);
+ cvs_write_tagfile(path, tag, date);
}
void
@@ -623,7 +623,7 @@ cvs_mkpath(const char *path, char *tag)
continue;
cvs_mkadmin(rpath, current_cvsroot->cr_str, repo,
- tag, NULL, 0);
+ tag, NULL);
if (dp != NULL) {
if ((p = strchr(dp, '/')) != NULL)
diff --git a/usr.bin/cvs/util.h b/usr.bin/cvs/util.h
index 1e80fa00bff..e34bdc853ef 100644
--- a/usr.bin/cvs/util.h
+++ b/usr.bin/cvs/util.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.h,v 1.22 2007/09/13 13:10:57 tobias Exp $ */
+/* $OpenBSD: util.h,v 1.23 2008/02/04 18:23:58 tobias Exp $ */
/*
* Copyright (c) 2006 Niall O'Higgins <niallo@openbsd.org>
* All rights reserved.
@@ -31,8 +31,7 @@ void cvs_get_repository_path(const char *, char *, size_t);
void cvs_get_repository_name(const char *, char *, size_t);
void cvs_modetostr(mode_t, char *, size_t);
void cvs_strtomode(const char *, mode_t *);
-void cvs_mkadmin(const char *, const char *, const char *,
- char *, char *, int);
+void cvs_mkadmin(const char *, const char *, const char *, char *, char *);
void cvs_mkpath(const char *, char *);
int cvs_cksum(const char *, char *, size_t);
int cvs_getargv(const char *, char **, int);