[Cvs-nserver-commits] CVS: cvs-nserver/src lstags.c,1.1.2.1,1.1.2.2 main.c,1.1.1.6.2.4.2.17,1.1.1.6.
Brought to you by:
tyranny
From: Alexey M. <ty...@us...> - 2002-05-31 06:30:21
|
Update of /cvsroot/cvs-nserver/cvs-nserver/src In directory usw-pr-cvs1:/tmp/cvs-serv5201 Modified Files: Tag: NCLI-1-11-1 lstags.c main.c server.c Log Message: Split 'cvs lstags' to 'cvs lsbranches' and 'cvs lsalltags' Index: lstags.c =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/src/Attic/lstags.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- lstags.c 9 May 2002 18:12:50 -0000 1.1.2.1 +++ lstags.c 31 May 2002 06:30:18 -0000 1.1.2.2 @@ -12,6 +12,18 @@ int retval = 1; struct stringbuf* filename; FILE* nval_tags; + int send_tags = 0; + int send_branches = 0; + + if (strcmp(command_name, "lstags") == 0) { + send_tags = 1; + } else if (strcmp(command_name, "lsbranches") == 0) { + send_branches = 1; + } else if (strcmp(command_name, "lsalltags") == 0) { + send_branches = 1; + send_tags = 1; + } else + error(1, 0, "Internal error: unknown lstags-style command '%s'", command_name); filename = new_stringbuf(current_parsed_root->directory); if (!filename) @@ -29,7 +41,10 @@ } else { char buf[BUFSIZ]; while (fgets(buf, sizeof(buf), nval_tags)) { - cvs_output(buf, 0); + if ((send_tags && (buf[0] == 'T')) || + (send_branches && (buf[0] == 'B'))) { + cvs_output(buf, 0); + } } if (fclose(nval_tags) == EOF) { error(1, errno, "Error closing %s: %s", filename->buf, strerror(errno)); @@ -55,10 +70,11 @@ if (current_parsed_root->isremote) { start_server(); - if (!supported_request ("lstags")) + if (!supported_request (command_name)) error (1, 0, "server does not support tags listing"); - send_to_server("lstags\012", 0); + send_to_server(command_name, 0); + send_to_server("\012", 0); return get_responses_and_close(); } Index: main.c =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/src/main.c,v retrieving revision 1.1.1.6.2.4.2.17 retrieving revision 1.1.1.6.2.4.2.18 diff -u -d -r1.1.1.6.2.4.2.17 -r1.1.1.6.2.4.2.18 --- main.c 25 May 2002 15:54:41 -0000 1.1.1.6.2.4.2.17 +++ main.c 31 May 2002 06:30:18 -0000 1.1.1.6.2.4.2.18 @@ -148,6 +148,8 @@ { "lsacl", NULL, NULL, lsacl, 0 }, { "lsmodules",NULL, NULL, lsmodules, 0 }, { "lstags", NULL, NULL, lstags, 0 }, + { "lsbranches", NULL, NULL, lstags, 0 }, + { "lsalltags", NULL, NULL, lstags, 0 }, { "log", "lo", NULL, cvslog, CVS_CMD_USES_WORK_DIR }, #ifdef AUTH_CLIENT_SUPPORT { "login", "logon", "lgn", login, 0 }, @@ -249,6 +251,9 @@ " logout Removes entry in .cvspass for remote repository\n", #endif /* AUTH_CLIENT_SUPPORT */ " ls Lists files and directories in repository\n", + " lstags List tags in repository\n", + " lsbranches List branches in repository\n", + " lsalltags List both tags and branches in repository\n", #if (defined(AUTH_SERVER_SUPPORT) || defined (HAVE_GSSAPI)) && defined(SERVER_SUPPORT) " pserver Password server mode\n", #endif Index: server.c =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/src/server.c,v retrieving revision 1.1.1.7.2.1.2.11 retrieving revision 1.1.1.7.2.1.2.12 diff -u -d -r1.1.1.7.2.1.2.11 -r1.1.1.7.2.1.2.12 --- server.c 25 May 2002 15:54:41 -0000 1.1.1.7.2.1.2.11 +++ server.c 31 May 2002 06:30:18 -0000 1.1.1.7.2.1.2.12 @@ -3629,6 +3629,8 @@ SERVE(lsacl) SERVE(lsmodules) SERVE(lstags) + SERVE_R(lsalltags, lstags) + SERVE_R(lsbranches, lstags) SERVE(passwd) SERVE(racl) SERVE_R(rannotate, annotate) @@ -4670,6 +4672,8 @@ REQ_LINE("lsacl", serve_lsacl, 0), REQ_LINE("lsmodules", serve_lsmodules, 0), REQ_LINE("lstags", serve_lstags, 0), + REQ_LINE("lsalltags", serve_lsalltags, 0), + REQ_LINE("lsbranches", serve_lsbranches, 0), REQ_LINE(NULL, NULL, 0) #undef REQ_LINE |