diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2009-02-21 12:47:20 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2009-02-21 12:47:20 +0000 |
commit | 9e0217ae3f5ccf1b95434dbc221c8edb438a937f (patch) | |
tree | 4708ab56b01b10aca05a8c8dd325666df334bbb6 /usr.bin/cvs | |
parent | dac6585da85ede7d1e8305aac123241d4e15e186 (diff) |
alter cvs_file_get() so it takes flags instead of one set
value for user_supplied. allow us to carry any important file flags
over to cvs_file's later on.
makes it easier for what i have coming.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/file.c | 20 | ||||
-rw-r--r-- | usr.bin/cvs/file.h | 7 | ||||
-rw-r--r-- | usr.bin/cvs/status.c | 4 |
3 files changed, 16 insertions, 15 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index 06b83ceceb3..30bf7734b8b 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.249 2008/06/15 04:38:52 tobias Exp $ */ +/* $OpenBSD: file.c,v 1.250 2009/02/21 12:47:19 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -190,14 +190,14 @@ cvs_file_run(int argc, char **argv, struct cvs_recursion *cr) TAILQ_INIT(&fl); for (i = 0; i < argc; i++) - cvs_file_get(argv[i], 1, &fl); + cvs_file_get(argv[i], FILE_USER_SUPPLIED, &fl); cvs_file_walklist(&fl, cr); cvs_file_freelist(&fl); } struct cvs_filelist * -cvs_file_get(const char *name, int user_supplied, struct cvs_flisthead *fl) +cvs_file_get(const char *name, int flags, struct cvs_flisthead *fl) { const char *p; struct cvs_filelist *l; @@ -211,7 +211,7 @@ cvs_file_get(const char *name, int user_supplied, struct cvs_flisthead *fl) l = (struct cvs_filelist *)xmalloc(sizeof(*l)); l->file_path = xstrdup(p); - l->user_supplied = user_supplied; + l->flags = flags; TAILQ_INSERT_TAIL(fl, l, flist); return (l); @@ -219,7 +219,7 @@ cvs_file_get(const char *name, int user_supplied, struct cvs_flisthead *fl) struct cvs_file * cvs_file_get_cf(const char *d, const char *f, const char *fpath, int fd, - int type, int user_supplied) + int type, int flags) { const char *p; struct cvs_file *cf; @@ -235,8 +235,8 @@ cvs_file_get_cf(const char *d, const char *f, const char *fpath, int fd, cf->fd = fd; cf->repo_fd = -1; cf->file_type = type; - cf->file_status = cf->file_flags = 0; - cf->user_supplied = user_supplied; + cf->file_status = 0; + cf->file_flags = flags; cf->in_attic = 0; cf->file_ent = NULL; @@ -332,11 +332,11 @@ cvs_file_walklist(struct cvs_flisthead *fl, struct cvs_recursion *cr) } cf = cvs_file_get_cf(d, f, l->file_path, - fd, type, l->user_supplied); + fd, type, l->flags); if (cf->file_type == CVS_DIR) { cvs_file_walkdir(cf, cr); } else { - if (l->user_supplied) { + if (l->flags & FILE_USER_SUPPLIED) { cvs_parse_tagfile(cf->file_wd, &cvs_directory_tag, NULL, NULL); @@ -357,7 +357,7 @@ cvs_file_walklist(struct cvs_flisthead *fl, struct cvs_recursion *cr) if (cr->fileproc != NULL) cr->fileproc(cf); - if (l->user_supplied) { + if (l->flags & FILE_USER_SUPPLIED) { if (cmdp->cmd_flags & CVS_LOCK_REPO) cvs_repository_unlock(repo); if (cvs_directory_tag != NULL) { diff --git a/usr.bin/cvs/file.h b/usr.bin/cvs/file.h index d1a4c29c5ce..f220ad593b7 100644 --- a/usr.bin/cvs/file.h +++ b/usr.bin/cvs/file.h @@ -1,4 +1,4 @@ -/* $OpenBSD: file.h,v 1.49 2008/06/13 17:15:13 joris Exp $ */ +/* $OpenBSD: file.h,v 1.50 2009/02/21 12:47:19 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -47,7 +47,6 @@ struct cvs_file { int file_status; int file_flags; int in_attic; - int user_supplied; RCSNUM *file_rcsrev; RCSFILE *file_rcs; @@ -72,10 +71,12 @@ struct cvs_file { #define FILE_SKIP 100 #define FILE_HAS_TAG 0x01 +#define FILE_USER_SUPPLIED 0x02 +#define FILE_INSIDE_ATTIC 0x04 struct cvs_filelist { char *file_path; - int user_supplied; + int flags; TAILQ_ENTRY(cvs_filelist) flist; }; diff --git a/usr.bin/cvs/status.c b/usr.bin/cvs/status.c index 288d6bc6475..a3b67c8dfa2 100644 --- a/usr.bin/cvs/status.c +++ b/usr.bin/cvs/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.89 2009/01/14 00:23:30 joris Exp $ */ +/* $OpenBSD: status.c,v 1.90 2009/02/21 12:47:19 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2005-2008 Xavier Santolaria <xsa@openbsd.org> @@ -135,7 +135,7 @@ cvs_status_local(struct cvs_file *cf) } if (cf->file_status == FILE_UPTODATE && cf->fd == -1 && - cf->user_supplied == 0) + !(cf->file_flags & FILE_USER_SUPPLIED)) return; if (cf->file_rcs != NULL) |