summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Siegl <stesie@brokenpipe.de>2005-03-19 18:36:22 +0000
committerStefan Siegl <stesie@brokenpipe.de>2005-03-19 18:36:22 +0000
commit162bbe85bcb3fa32f60c229818bac4e1b0aecb35 (patch)
tree5f93a35de183d25694904f2ae0691d8299d90478
parent6e557dfead959c87dd783b3d026d7dadf405ecbe (diff)
added support for local repository browsing.
-rw-r--r--cvs_connect.c3
-rw-r--r--cvs_ext.c27
-rw-r--r--cvsfs.c16
-rw-r--r--cvsfs.h4
-rw-r--r--cvsfs.texi32
5 files changed, 68 insertions, 14 deletions
diff --git a/cvs_connect.c b/cvs_connect.c
index d0fdafceb..f822fe1c7 100644
--- a/cvs_connect.c
+++ b/cvs_connect.c
@@ -1,7 +1,7 @@
/**********************************************************
* cvs_connect.c
*
- * Copyright 2004, Stefan Siegl <ssiegl@gmx.de>, Germany
+ * Copyright (C) 2004, 2005 by Stefan Siegl <ssiegl@gmx.de>, Germany
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Publice License,
@@ -114,6 +114,7 @@ cvs_connect_fresh(FILE **send, FILE **recv)
break;
case EXT:
+ case LOCAL:
err = cvs_ext_connect(send, recv);
break;
}
diff --git a/cvs_ext.c b/cvs_ext.c
index 3e06f91a5..090ef061c 100644
--- a/cvs_ext.c
+++ b/cvs_ext.c
@@ -1,7 +1,7 @@
/**********************************************************
* cvs_ext.c
*
- * Copyright 2004, Stefan Siegl <ssiegl@gmx.de>, Germany
+ * Copyright (C) 2004, 2005 by Stefan Siegl <ssiegl@gmx.de>, Germany
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Publice License,
@@ -63,13 +63,26 @@ cvs_ext_connect(FILE **send, FILE **recv)
exit(1);
}
- snprintf(port, sizeof(port), "%d",
- config.cvs_port ? config.cvs_port : 22);
+ if(config.cvs_mode == EXT)
+ {
+ snprintf(port, sizeof(port), "%d",
+ config.cvs_port ? config.cvs_port : 22);
+
+ execlp(config.cvs_shell_client, config.cvs_shell_client,
+ "-p", port,
+ "-l", config.cvs_username, config.cvs_hostname,
+ "--", "cvs", "server", NULL);
+ }
+ else if(config.cvs_mode == LOCAL)
+ {
+ execlp("cvs", "cvs", "server", NULL);
+ }
+ else
+ {
+ fprintf(stderr, PACKAGE ": damn, this line was not reached.\n");
+ abort();
+ }
- execlp(config.cvs_shell_client, config.cvs_shell_client,
- "-p", port,
- "-l", config.cvs_username, config.cvs_hostname,
- "--", "cvs", "server", NULL);
exit(1);
}
diff --git a/cvsfs.c b/cvsfs.c
index 5346d2389..67bf2279a 100644
--- a/cvsfs.c
+++ b/cvsfs.c
@@ -57,7 +57,7 @@ static const struct argp_child argp_children[] =
/* documentation, written out when called with either --usage or --help */
const char *argp_program_version = "cvsfs (" PACKAGE ") " VERSION "\n"
"Written by Stefan Siegl\n\n"
-"Copyright (C) 2004,05 Stefan Siegl <ssiegl@gmx.de>, Germany\n"
+"Copyright (C) 2004, 2005 Stefan Siegl <ssiegl@gmx.de>, Germany\n"
"This is free software; see the source for copying conditions. There is NO\n"
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
"\n";
@@ -75,6 +75,7 @@ enum
OPT_USER = 'u',
OPT_HOMEDIR = 'h',
OPT_REMOTE = 'r',
+ OPT_LOCAL = 'l',
OPT_NOSTATS = 'n',
OPT_DEBUG = 'd',
#ifdef HAVE_LIBZ
@@ -92,6 +93,8 @@ static const struct argp_option cvsfs_options[] =
"path of your home directory (= path to .cvspass file)", 0 },
{ "remote", OPT_REMOTE, "CLIENT", OPTION_ARG_OPTIONAL,
"connect through :ext: remote shell client CLIENT to cvs host", 0 },
+ { "local", OPT_LOCAL, 0, 0,
+ "show files from local cvs repository", 0 },
{ "nostats", OPT_NOSTATS, 0, 0,
"do not download revisions to aquire stats information", 0 },
{ "debug", OPT_DEBUG, "FILE", OPTION_ARG_OPTIONAL,
@@ -245,12 +248,21 @@ parse_cvsfs_opt(int key, char *arg, struct argp_state *state)
}
break;
+ case OPT_LOCAL:
+ config.cvs_mode = LOCAL;
+ break;
+
case ARGP_KEY_ARGS:
if(state->argc - state->next != 3)
argp_usage(state);
else
{
- config.cvs_hostname = strdup(state->argv[state->next ++]);
+ if(strcmp(state->argv[state->next], "localhost"))
+ config.cvs_hostname = strdup(state->argv[state->next]);
+ else
+ config.cvs_mode = LOCAL;
+
+ state->next ++;
config.cvs_root = strdup(state->argv[state->next ++]);
config.cvs_module = strdup(state->argv[state->next ++]);
}
diff --git a/cvsfs.h b/cvsfs.h
index 576a27a80..58b403ae3 100644
--- a/cvsfs.h
+++ b/cvsfs.h
@@ -1,5 +1,5 @@
/**********************************************************
- * cvsfs_config.h
+ * cvsfs.h
*
* Copyright (C) 2004, 2005 by Stefan Siegl <ssiegl@gmx.de>, Germany
*
@@ -22,7 +22,7 @@ extern volatile struct mapped_time_value *cvsfs_maptime;
typedef struct {
- enum { PSERVER, EXT } cvs_mode;
+ enum { PSERVER, EXT, LOCAL } cvs_mode;
char *cvs_shell_client; /* program to use for :ext: connection */
char *cvs_hostname;
diff --git a/cvsfs.texi b/cvsfs.texi
index f847fede2..ff9f79de8 100644
--- a/cvsfs.texi
+++ b/cvsfs.texi
@@ -1,5 +1,5 @@
\input texinfo @c -*- texinfo -*-
-@c $Id: cvsfs.texi,v 1.4 2004/10/09 11:42:45 stesie Exp $
+@c $Id: cvsfs.texi,v 1.5 2005/03/19 18:36:22 stesie Exp $
@c %**start of header
@setfilename cvsfs.info
@include version.texi
@@ -10,7 +10,7 @@
@copying
-Copyright @copyright{} 2004 Stefan Siegl, Germany
+Copyright @copyright{} 2004, 2005 by Stefan Siegl, Germany
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -52,6 +52,7 @@ virtual filesystem translator.
* Overview:: On how to get in touch.
* Authentication:: Using username/password to log in.
* Remote Shell Connections:: Using rsh or ssh to connect to the cvs host.
+* Browsing Local Repositories:: Browsing a local cvs repository with cvsfs
* File Status Information:: File's status and access permissions.
* Write Support:: On writing to cvsfs mounted modules.
* Copying This Manual::
@@ -295,6 +296,33 @@ put you straight to the command prompt when calling it something like
create a @code{$HOME/.ssh/authorized_keys} file on the remote host.
@c ---------------------------------------------------------------------------
+@node Browsing Local Repositories
+@chapter Browsing Local Repositories
+@cindex Browsing Local Repositories
+
+Apart from using @sc{cvsfs} to browse remotely located CVS repositories,
+using either pserver protocol or the :ext: method, you may even use it
+to browse CVS repositories which are located on your computer or
+otherwise mounted into your filesystem.
+
+In order to make @sc{cvsfs} behaving this way, either start it with
+@code{localhost} as the @option{HOSTNAME} or specify the
+@option{--local} option. Mind that you must not omit the
+@option{HOSTNAME} argument in any case, even the latter one. The argument is
+just not going to be evaluated if the @option{--local} option is present.
+
+As an exampe, if you would like, to browse the CVSROOT pseudo module
+of your local host's CVS repository (located at
+@code{/var/lib/cvs}) type something like this:
+
+@example
+$ settrans -a test-node/ /sbin/cvsfs --local - /var/lib/cvs CVSROOT
+@end example
+
+You may now enter the directory @code{test-node/}, which allows you to
+browse the CVSROOT module.
+
+@c ---------------------------------------------------------------------------
@node File Status Information
@chapter File Status Information
@cindex File Status Information