diff options
-rw-r--r-- | usr.bin/cvs/cvs.h | 3 | ||||
-rw-r--r-- | usr.bin/cvs/entries.c | 17 | ||||
-rw-r--r-- | usr.bin/cvs/file.c | 7 | ||||
-rw-r--r-- | usr.bin/cvs/remote.h | 7 | ||||
-rw-r--r-- | usr.bin/cvs/server.c | 16 |
5 files changed, 39 insertions, 11 deletions
diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index 1e6474b0e47..ecb027deece 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.174 2009/02/21 14:11:08 joris Exp $ */ +/* $OpenBSD: cvs.h,v 1.175 2009/03/19 09:53:16 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -235,6 +235,7 @@ struct cvsroot { #define CVS_ENT_ADDED 1 #define CVS_ENT_REMOVED 2 #define CVS_ENT_UPTODATE 3 +#define CVS_ENT_UNKNOWN 4 #define CVS_ENT_MAXLINELEN 1024 diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index 8be45085279..a4e2ce7a3f8 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.101 2009/02/23 21:32:08 joris Exp $ */ +/* $OpenBSD: entries.c,v 1.102 2009/03/19 09:53:16 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -156,17 +156,25 @@ cvs_ent_parse(const char *entry) if (*fields[2] == '-') { ent->ce_status = CVS_ENT_REMOVED; sp = fields[2] + 1; + } else if (*fields[2] == CVS_SERVER_QUESTIONABLE) { + sp = NULL; + ent->ce_status = CVS_ENT_UNKNOWN; } else { sp = fields[2]; if (fields[2][0] == '0' && fields[2][1] == '\0') ent->ce_status = CVS_ENT_ADDED; } - if ((ent->ce_rev = rcsnum_parse(sp)) == NULL) - fatal("failed to parse entry revision '%s'", entry); + if (sp != NULL) { + if ((ent->ce_rev = rcsnum_parse(sp)) == NULL) { + fatal("failed to parse entry revision '%s'", + entry); + } + } if (fields[3][0] == '\0' || - strncmp(fields[3], CVS_DATE_DUMMY, sizeof(CVS_DATE_DUMMY) - 1) == 0 || + strncmp(fields[3], CVS_DATE_DUMMY, + sizeof(CVS_DATE_DUMMY) - 1) == 0 || strncmp(fields[3], "Initial ", 8) == 0 || strcmp(fields[3], "Result of merge") == 0) { ent->ce_mtime = CVS_DATE_DMSEC; @@ -182,7 +190,6 @@ cvs_ent_parse(const char *entry) /* Date field can be a '+=' with remote to indicate * conflict. In this case do nothing. */ if (strptime(p, "%a %b %d %T %Y", &t) != NULL) { - t.tm_isdst = -1; /* Figure out DST. */ t.tm_gmtoff = 0; ent->ce_mtime = mktime(&t); diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index c7befdfd74d..49b30cff754 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.253 2009/02/21 18:26:47 joris Exp $ */ +/* $OpenBSD: file.c,v 1.254 2009/03/19 09:53:16 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -930,6 +930,11 @@ cvs_file_classify(struct cvs_file *cf, const char *tag) } } break; + case CVS_ENT_UNKNOWN: + if (cvs_server_active != 1) + fatal("server-side questionable in local mode?"); + cf->file_status = FILE_UNKNOWN; + break; default: break; } diff --git a/usr.bin/cvs/remote.h b/usr.bin/cvs/remote.h index 4b598419f97..6b292bdd0a9 100644 --- a/usr.bin/cvs/remote.h +++ b/usr.bin/cvs/remote.h @@ -1,4 +1,4 @@ -/* $OpenBSD: remote.h,v 1.35 2009/01/02 00:11:01 canacar Exp $ */ +/* $OpenBSD: remote.h,v 1.36 2009/03/19 09:53:16 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -44,8 +44,9 @@ extern int server_response; #define SERVER_OK 0 #define SERVER_ERROR 1 -#define CVS_SERVER_UNCHANGED "d[o.o]b" -#define CVS_SERVER_UPTODATE (time_t)-2 +#define CVS_SERVER_UNCHANGED "d[o.o]b" +#define CVS_SERVER_UPTODATE (time_t)-2 +#define CVS_SERVER_QUESTIONABLE '?' void cvs_client_connect_to_server(void); void cvs_client_disconnect(void); diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index 947138463cc..a563074108f 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.93 2009/02/21 13:39:01 joris Exp $ */ +/* $OpenBSD: server.c,v 1.94 2009/03/19 09:53:16 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -465,6 +465,20 @@ cvs_server_unchanged(char *data) void cvs_server_questionable(char *data) { + int fd; + CVSENTRIES *entlist; + struct cvs_ent *ent; + char entry[CVS_ENT_MAXLINELEN]; + + if (data == NULL) + fatal("Questionable request with no data attached"); + + (void)xsnprintf(entry, sizeof(entry), "/%s/%c///", data, + CVS_SERVER_QUESTIONABLE); + + entlist = cvs_ent_open(server_currentdir); + cvs_ent_add(entlist, entry); + /* sorry, we have to use TMP_DIR */ disable_fast_checkout = 1; } |