diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-06-28 18:52:06 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-06-28 18:52:06 +0000 |
commit | 77648fc491e6ad0b4668ef412d101c9bf3ee51ef (patch) | |
tree | c3e3fa1e8547f3244697a62080f78fad28dfd3e3 /usr.bin/cvs | |
parent | ab5ab91b3fe68abd4e79cf39a5dfa2fe55821273 (diff) |
print less verbose messages for cvs commit and add if the -q/-Q flag
has been specified.
ok joris@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/add.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/commit.c | 31 |
2 files changed, 21 insertions, 14 deletions
diff --git a/usr.bin/cvs/add.c b/usr.bin/cvs/add.c index 813cad1216a..33097e3cb9c 100644 --- a/usr.bin/cvs/add.c +++ b/usr.bin/cvs/add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: add.c,v 1.58 2006/06/19 05:05:17 joris Exp $ */ +/* $OpenBSD: add.c,v 1.59 2006/06/28 18:52:05 reyk Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> @@ -270,7 +270,7 @@ add_file(struct cvs_file *cf) add_entry(cf); if (added != 0) { - if (verbosity > 0) + if (verbosity > 1) cvs_log(LP_NOTICE, "use '%s commit' to add %s " "permanently", __progname, (added == 1) ? "this file" : "these files"); diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index fd065e4de09..e9dbea34d19 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.76 2006/06/28 17:59:06 joris Exp $ */ +/* $OpenBSD: commit.c,v 1.77 2006/06/28 18:52:05 reyk Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -160,7 +160,7 @@ cvs_commit_local(struct cvs_file *cf) BUF *b; int isnew; int l, openflags, rcsflags; - char *d, *f, rbuf[24]; + char *d, *f, rbuf[24], nbuf[24]; CVSENTRIES *entlist; char *attic, *repo, *rcsfile; @@ -231,9 +231,11 @@ cvs_commit_local(struct cvs_file *cf) commit_desc_set(cf); } - cvs_printf("Checking in %s:\n", cf->file_path); - cvs_printf("%s <- %s\n", cf->file_rpath, cf->file_path); - cvs_printf("old revision: %s; ", rbuf); + if (verbosity > 1) { + cvs_printf("Checking in %s:\n", cf->file_path); + cvs_printf("%s <- %s\n", cf->file_rpath, cf->file_path); + cvs_printf("old revision: %s; ", rbuf); + } if (isnew == 0) d = commit_diff_file(cf); @@ -281,18 +283,19 @@ cvs_commit_local(struct cvs_file *cf) rcs_write(cf->file_rcs); if (cf->file_status == FILE_REMOVED) { - strlcpy(rbuf, "Removed", sizeof(rbuf)); + strlcpy(nbuf, "Removed", sizeof(nbuf)); } else if (cf->file_status == FILE_ADDED) { if (cf->file_rcs->rf_dead == 1) - strlcpy(rbuf, "Initial Revision", sizeof(rbuf)); + strlcpy(nbuf, "Initial Revision", sizeof(nbuf)); else rcsnum_tostr(cf->file_rcs->rf_head, - rbuf, sizeof(rbuf)); + nbuf, sizeof(nbuf)); } else if (cf->file_status == FILE_MODIFIED) { - rcsnum_tostr(cf->file_rcs->rf_head, rbuf, sizeof(rbuf)); + rcsnum_tostr(cf->file_rcs->rf_head, nbuf, sizeof(nbuf)); } - cvs_printf("new revision: %s\n", rbuf); + if (verbosity > 1) + cvs_printf("new revision: %s\n", nbuf); (void)unlink(cf->file_path); (void)close(cf->fd); @@ -333,8 +336,12 @@ cvs_commit_local(struct cvs_file *cf) xfree(attic); } - cvs_printf("done\n"); - + if (verbosity > 1) + cvs_printf("done\n"); + else { + cvs_log(LP_NOTICE, "checking in '%s'; revision %s -> %s", + cf->file_path, rbuf, nbuf); + } } static char * |