diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2007-01-03 20:48:27 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2007-01-03 20:48:27 +0000 |
commit | fa177b4ef88b2396fdb22ed401357905b5463ce7 (patch) | |
tree | b1974b9da91abd734df6f613b96519c6d4e0e441 | |
parent | 29a07ac0edcebf2bef1f74f7d630561df94f5aeb (diff) |
if we are commiting a file, do not let the server resend it
with an 'Updated' response, seeing as the client will already have the
latest version. Instead, send the correct 'Checked-in' response.
-rw-r--r-- | usr.bin/cvs/checkout.c | 25 | ||||
-rw-r--r-- | usr.bin/cvs/commit.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.h | 3 |
3 files changed, 21 insertions, 11 deletions
diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c index 27e39a11900..1d0cd273148 100644 --- a/usr.bin/cvs/checkout.c +++ b/usr.bin/cvs/checkout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: checkout.c,v 1.67 2006/12/22 11:51:50 xsa Exp $ */ +/* $OpenBSD: checkout.c,v 1.68 2007/01/03 20:48:26 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -263,17 +263,26 @@ cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, BUF *bp, int flags) if ((p = strrchr(cf->file_rpath, ',')) != NULL) *p = '\0'; - cvs_server_send_response("Updated %s/", cf->file_wd); + if (flags & CO_COMMIT) { + cvs_server_send_response("Checked-in %s/", + cf->file_wd); + } else { + cvs_server_send_response("Updated %s/", cf->file_wd); + } + cvs_remote_output(cf->file_rpath); cvs_remote_output(entry); - cvs_remote_output("u=rw,g=rw,o=rw"); - /* XXX */ - printf("%ld\n", cvs_buf_len(nbp)); + if (!(flags & CO_COMMIT)) { + cvs_remote_output("u=rw,g=rw,o=rw"); - if (cvs_buf_write_fd(nbp, STDOUT_FILENO) == -1) - fatal("cvs_checkout_file: failed to send file"); - cvs_buf_free(nbp); + /* XXX */ + printf("%ld\n", cvs_buf_len(nbp)); + + if (cvs_buf_write_fd(nbp, STDOUT_FILENO) == -1) + fatal("cvs_checkout_file: failed to send file"); + cvs_buf_free(nbp); + } if (p != NULL) *p = ','; diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index bc5d1631b75..c11902e7415 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.83 2007/01/02 23:55:15 joris Exp $ */ +/* $OpenBSD: commit.c,v 1.84 2007/01/03 20:48:26 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -330,7 +330,7 @@ cvs_commit_local(struct cvs_file *cf) if (b == NULL) fatal("cvs_commit_local: failed to get HEAD"); - cvs_checkout_file(cf, cf->file_rcs->rf_head, b, 0); + cvs_checkout_file(cf, cf->file_rcs->rf_head, b, CO_COMMIT); } else { entlist = cvs_ent_open(cf->file_wd); cvs_ent_remove(entlist, cf->file_name); diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index ba3b77f98ce..6b0cca10679 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.124 2006/12/11 07:59:18 xsa Exp $ */ +/* $OpenBSD: cvs.h,v 1.125 2007/01/03 20:48:26 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -362,6 +362,7 @@ int update_has_conflict_markers(struct cvs_file *); #define CO_MERGE 0x01 #define CO_SETSTICKY 0x02 #define CO_DUMP 0x04 +#define CO_COMMIT 0x08 /* commands */ int cvs_add(int, char **); |