summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-12-21 18:32:11 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-12-21 18:32:11 +0000
commit3d46960173efa81ae236b33be993ba399a6f0b38 (patch)
treec8fa65755dfd55440f0bb987516df0f4937e1f0b /usr.bin
parente356bb43f71c5fa2e2b0ee887e8527dd992ba45a (diff)
modify the directory handling portion to behave like the one in add.c,
which does not attempt to send data when running on a local repository. This will be needed to support local repository access
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/annotate.c17
-rw-r--r--usr.bin/cvs/commit.c16
-rw-r--r--usr.bin/cvs/getlog.c17
-rw-r--r--usr.bin/cvs/status.c15
-rw-r--r--usr.bin/cvs/update.c17
5 files changed, 49 insertions, 33 deletions
diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c
index 68923aa07ad..755b4b0f3fd 100644
--- a/usr.bin/cvs/annotate.c
+++ b/usr.bin/cvs/annotate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: annotate.c,v 1.2 2004/12/14 22:30:47 jfb Exp $ */
+/* $OpenBSD: annotate.c,v 1.3 2004/12/21 18:32:09 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -150,12 +150,15 @@ cvs_annotate_file(CVSFILE *cf, void *arg)
ret = 0;
root = CVS_DIR_ROOT(cf);
- if ((root->cr_method != CVS_METHOD_LOCAL) && (cf->cf_type == DT_DIR)) {
- if (cf->cf_cvstat == CVS_FST_UNKNOWN)
- ret = cvs_sendreq(root, CVS_REQ_QUESTIONABLE,
- CVS_FILE_NAME(cf));
- else
- ret = cvs_senddir(root, cf);
+ if (cf->cf_type == DT_DIR) {
+ if (root->cr_method != CVS_METHOD_LOCAL) {
+ if (cf->cf_cvstat == CVS_FST_UNKNOWN)
+ ret = cvs_sendreq(root, CVS_REQ_QUESTIONABLE,
+ CVS_FILE_NAME(cf));
+ else
+ ret = cvs_senddir(root, cf);
+ }
+
return (ret);
}
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c
index b41243c0aac..34f99a63a50 100644
--- a/usr.bin/cvs/commit.c
+++ b/usr.bin/cvs/commit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commit.c,v 1.12 2004/12/14 22:30:48 jfb Exp $ */
+/* $OpenBSD: commit.c,v 1.13 2004/12/21 18:32:10 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -178,26 +178,24 @@ cvs_commit_prepare(CVSFILE *cf, void *arg)
int
cvs_commit_file(CVSFILE *cf, void *arg)
{
+ int ret;
char *repo, rcspath[MAXPATHLEN], fpath[MAXPATHLEN];
RCSFILE *rf;
struct cvsroot *root;
struct cvs_ent *entp;
+ ret = 0;
rf = NULL;
repo = NULL;
root = CVS_DIR_ROOT(cf);
if (cf->cf_type == DT_DIR) {
- if (cf->cf_cvstat != CVS_FST_UNKNOWN) {
- if ((cf->cf_parent != NULL) &&
- (root != cf->cf_parent->cf_ddat->cd_root)) {
- cvs_connect(root);
- }
-
- cvs_senddir(root, cf);
+ if (root->cr_method != CVS_METHOD_LOCAL) {
+ if (cf->cf_cvstat != CVS_FST_UNKNOWN)
+ ret = cvs_senddir(root, cf);
}
- return (0);
+ return (ret);
}
cvs_file_getpath(cf, fpath, sizeof(fpath));
diff --git a/usr.bin/cvs/getlog.c b/usr.bin/cvs/getlog.c
index 6e62cf2914c..1fe6ab95afa 100644
--- a/usr.bin/cvs/getlog.c
+++ b/usr.bin/cvs/getlog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getlog.c,v 1.12 2004/12/14 22:30:48 jfb Exp $ */
+/* $OpenBSD: getlog.c,v 1.13 2004/12/21 18:32:10 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -146,12 +146,15 @@ cvs_getlog_file(CVSFILE *cf, void *arg)
root = CVS_DIR_ROOT(cf);
repo = CVS_DIR_REPO(cf);
- if ((root->cr_method != CVS_METHOD_LOCAL) && (cf->cf_type == DT_DIR)) {
- if (cf->cf_cvstat == CVS_FST_UNKNOWN)
- ret = cvs_sendreq(root, CVS_REQ_QUESTIONABLE,
- CVS_FILE_NAME(cf));
- else
- ret = cvs_senddir(root, cf);
+ if (cf->cf_type == DT_DIR) {
+ if (root->cr_method != CVS_METHOD_LOCAL) {
+ if (cf->cf_cvstat == CVS_FST_UNKNOWN)
+ ret = cvs_sendreq(root, CVS_REQ_QUESTIONABLE,
+ CVS_FILE_NAME(cf));
+ else
+ ret = cvs_senddir(root, cf);
+ }
+
return (ret);
}
diff --git a/usr.bin/cvs/status.c b/usr.bin/cvs/status.c
index c517d73443b..6c31f2861b1 100644
--- a/usr.bin/cvs/status.c
+++ b/usr.bin/cvs/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.5 2004/12/14 22:30:48 jfb Exp $ */
+/* $OpenBSD: status.c,v 1.6 2004/12/21 18:32:10 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -133,8 +133,17 @@ cvs_status_file(CVSFILE *cfp, void *arg)
root = CVS_DIR_ROOT(cfp);
repo = CVS_DIR_REPO(cfp);
- if ((root->cr_method != CVS_METHOD_LOCAL) && (cfp->cf_type == DT_DIR))
- return (cvs_senddir(root, cfp));
+ if (cfp->cf_type == DT_DIR) {
+ if (root->cr_method != CVS_METHOD_LOCAL) {
+ if (cfp->cf_cvstat == CVS_FST_UNKNOWN)
+ ret = cvs_sendreq(root, CVS_REQ_QUESTIONABLE,
+ CVS_FILE_NAME(cfp));
+ else
+ ret = cvs_senddir(root, cfp);
+ }
+
+ return (ret);
+ }
cvs_file_getpath(cfp, fpath, sizeof(fpath));
entp = cvs_ent_getent(fpath);
diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c
index 503b507c7ad..4637c0144bf 100644
--- a/usr.bin/cvs/update.c
+++ b/usr.bin/cvs/update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: update.c,v 1.12 2004/12/14 22:30:48 jfb Exp $ */
+/* $OpenBSD: update.c,v 1.13 2004/12/21 18:32:10 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -146,12 +146,15 @@ cvs_update_file(CVSFILE *cf, void *arg)
root = CVS_DIR_ROOT(cf);
repo = CVS_DIR_REPO(cf);
- if ((root->cr_method != CVS_METHOD_LOCAL) && (cf->cf_type == DT_DIR)) {
- if (cf->cf_cvstat == CVS_FST_UNKNOWN)
- ret = cvs_sendreq(root, CVS_REQ_QUESTIONABLE,
- CVS_FILE_NAME(cf));
- else
- ret = cvs_senddir(root, cf);
+ if (cf->cf_type == DT_DIR) {
+ if (root->cr_method != CVS_METHOD_LOCAL) {
+ if (cf->cf_cvstat == CVS_FST_UNKNOWN)
+ ret = cvs_sendreq(root, CVS_REQ_QUESTIONABLE,
+ CVS_FILE_NAME(cf));
+ else
+ ret = cvs_senddir(root, cf);
+ }
+
return (ret);
}