« blib/lib/VCS/LibCVS/Slice.pm
↑ Summary
blib/lib/VCS/LibCVS/Client/Request/ArgumentUsingRequests.pm »
| 1 | # | ||
| 2 | # Copyright (c) 2003,2004,2005 Alexander Taler (dissent@0--0.org) | ||
| 3 | # | ||
| 4 | # All rights reserved. This program is free software; you can redistribute it | ||
| 5 | # and/or modify it under the same terms as Perl itself. | ||
| 6 | # | ||
| 7 | |||
| 8 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | =head1 NAME | ||
| 11 | |||
| 12 | VCS::LibCVS::Client::Response::Responses - Classes for many Responses | ||
| 13 | |||
| 14 | =head1 SYNOPSIS | ||
| 15 | |||
| 16 | my @responses = Client::Response->read_from_server($server_conn); | ||
| 17 | |||
| 18 | =head1 DESCRIPTION | ||
| 19 | |||
| 20 | Each response of the CVS client protocol has its own class. Many of them are | ||
| 21 | here. | ||
| 22 | |||
| 23 | Each response comes with a predetermined set of data, which is listed here for | ||
| 24 | each response. | ||
| 25 | |||
| 26 | =head1 SUPERCLASS | ||
| 27 | |||
| 28 | VCS::LibCVS::Client::Response | ||
| 29 | |||
| 30 | =cut | ||
| 31 | |||
| 32 | # Each response has a BEGIN block where it pushes its name onto the list of | ||
| 33 | # valide responses. This is so that the Valid-responses request knows what it | ||
| 34 | # can report as valid responses. | ||
| 35 | |||
| 36 | 1 | $VCS::LibCVS::Client::Response::Responses::REVISION = '$Header: /cvsroot/libcvs-perl/libcvs-perl/VCS/LibCVS/Client/Response/Responses.pm,v 1.16 2005/10/10 12:52:11 dissent Exp $ '; | |
| 37 | |||
| 38 | ############################################################################### | ||
| 39 | # ok | ||
| 40 | ############################################################################### | ||
| 41 | |||
| 42 | =head1 CLASSES | ||
| 43 | |||
| 44 | =head2 VCS::LibCVS::Client::Response::ok | ||
| 45 | |||
| 46 | Last response in the group indicating success. | ||
| 47 | |||
| 48 | No args are expected. | ||
| 49 | |||
| 50 | =cut | ||
| 51 | |||
| 52 | package VCS::LibCVS::Client::Response::ok; | ||
| 53 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 54 | 1 | @ISA =("VCS::LibCVS::Client::Response"); | |
| 55 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Response::Valid_responses, "ok"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 56 | 0 | ▶ | sub terminal { return 1; } |
|
Subroutine
terminal: not called CC=1 SCAR=6.9
| |||
| 57 | 0 | ▶ | sub included_data { return (); } |
|
Subroutine
included_data: not called CC=1 SCAR=6.9
| |||
| 58 | |||
| 59 | ############################################################################### | ||
| 60 | # error | ||
| 61 | ############################################################################### | ||
| 62 | |||
| 63 | =head2 VCS::LibCVS::Client::Response::error | ||
| 64 | |||
| 65 | Last response in a group indicating failure. | ||
| 66 | |||
| 67 | "String": error message | ||
| 68 | |||
| 69 | =cut | ||
| 70 | |||
| 71 | package VCS::LibCVS::Client::Response::error; | ||
| 72 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 73 | 1 | @ISA =("VCS::LibCVS::Client::Response"); | |
| 74 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Response::Valid_responses, "error"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 75 | 0 | ▶ | sub terminal { return 1; } |
|
Subroutine
terminal: not called CC=1 SCAR=6.9
| |||
| 76 | |||
| 77 | ############################################################################### | ||
| 78 | # Valid-requests | ||
| 79 | ############################################################################### | ||
| 80 | |||
| 81 | =head2 VCS::LibCVS::Client::Response::Valid_requests | ||
| 82 | |||
| 83 | List of requests which the server supports. Client provides an interface to | ||
| 84 | check the results. | ||
| 85 | |||
| 86 | "String": space delimited list of request names. | ||
| 87 | |||
| 88 | =cut | ||
| 89 | |||
| 90 | package VCS::LibCVS::Client::Response::Valid_requests; | ||
| 91 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 92 | 1 | @ISA =("VCS::LibCVS::Client::Response"); | |
| 93 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Response::Valid_responses, "Valid-requests"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 94 | |||
| 95 | ############################################################################### | ||
| 96 | # E | ||
| 97 | ############################################################################### | ||
| 98 | |||
| 99 | =head2 VCS::LibCVS::Client::Response::E | ||
| 100 | |||
| 101 | A message to be printed on stderr | ||
| 102 | |||
| 103 | "String": the message | ||
| 104 | |||
| 105 | =cut | ||
| 106 | |||
| 107 | package VCS::LibCVS::Client::Response::E; | ||
| 108 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 109 | 1 | @ISA =("VCS::LibCVS::Client::Response"); | |
| 110 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Response::Valid_responses, "E"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 111 | 0 | ▶ | sub get_errors { return shift->{Args}[0]{Text}; } |
|
Subroutine
get_errors: not called CC=1 SCAR=6.9
| |||
| 112 | |||
| 113 | ############################################################################### | ||
| 114 | # M | ||
| 115 | ############################################################################### | ||
| 116 | |||
| 117 | =head2 VCS::LibCVS::Client::Response::M | ||
| 118 | |||
| 119 | A message to be printed on stdout | ||
| 120 | |||
| 121 | "String": the message | ||
| 122 | |||
| 123 | =cut | ||
| 124 | |||
| 125 | package VCS::LibCVS::Client::Response::M; | ||
| 126 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 127 | 1 | @ISA =("VCS::LibCVS::Client::Response"); | |
| 128 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Response::Valid_responses, "M"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 129 | 0 | ▶ | sub get_errors { return shift->{Args}[0]{Text}; } |
|
Subroutine
get_errors: not called CC=1 SCAR=6.9
| |||
| 130 | 0 | ▶ | sub get_message { return shift->{Args}[0]{Text}; } |
|
Subroutine
get_message: not called CC=1 SCAR=6.9
| |||
| 131 | |||
| 132 | ############################################################################### | ||
| 133 | # Mbinary | ||
| 134 | ############################################################################### | ||
| 135 | |||
| 136 | =head2 VCS::LibCVS::Client::Response::Mbinary | ||
| 137 | |||
| 138 | A binary message to be printed on stdout | ||
| 139 | |||
| 140 | "String": the message | ||
| 141 | |||
| 142 | =cut | ||
| 143 | |||
| 144 | package VCS::LibCVS::Client::Response::Mbinary; | ||
| 145 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 146 | 1 | @ISA =("VCS::LibCVS::Client::Response"); | |
| 147 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Response::Valid_responses, "Mbinary"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 148 | 0 | ▶ | sub get_errors { return shift->{Args}[0]{Text}; } |
|
Subroutine
get_errors: not called CC=1 SCAR=6.9
| |||
| 149 | 0 | ▶ | sub get_message { return shift->{Args}[0]{Text}; } |
|
Subroutine
get_message: not called CC=1 SCAR=6.9
| |||
| 150 | |||
| 151 | ############################################################################### | ||
| 152 | # Copy-file | ||
| 153 | ############################################################################### | ||
| 154 | |||
| 155 | =head2 VCS::LibCVS::Client::Response::Copy_file | ||
| 156 | |||
| 157 | Instructions to make a backup copy of a file | ||
| 158 | |||
| 159 | "PathName": original file | ||
| 160 | "FileName": new name of file | ||
| 161 | |||
| 162 | =cut | ||
| 163 | |||
| 164 | package VCS::LibCVS::Client::Response::Copy_file; | ||
| 165 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 166 | 1 | @ISA =("VCS::LibCVS::Client::Response"); | |
| 167 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Response::Valid_responses, "Copy-file"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 168 | 0 | ▶ | sub included_data { return ("PathName", "FileName"); } |
|
Subroutine
included_data: not called CC=1 SCAR=6.9
| |||
| 169 | |||
| 170 | ############################################################################### | ||
| 171 | # Set-sticky | ||
| 172 | ############################################################################### | ||
| 173 | |||
| 174 | =head2 VCS::LibCVS::Client::Response::Set_sticky | ||
| 175 | |||
| 176 | Record a sticky tag for a file | ||
| 177 | |||
| 178 | "PathName": the file | ||
| 179 | "TagSpec": the sticky tag | ||
| 180 | |||
| 181 | =cut | ||
| 182 | |||
| 183 | package VCS::LibCVS::Client::Response::Set_sticky; | ||
| 184 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 185 | 1 | @ISA =("VCS::LibCVS::Client::Response"); | |
| 186 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Response::Valid_responses, "Set-sticky"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 187 | 0 | ▶ | sub included_data { return ("PathName", "TagSpec"); } |
|
Subroutine
included_data: not called CC=1 SCAR=6.9
| |||
| 188 | |||
| 189 | ############################################################################### | ||
| 190 | # Clear-sticky | ||
| 191 | ############################################################################### | ||
| 192 | |||
| 193 | =head2 VCS::LibCVS::Client::Response::Clear_sticky | ||
| 194 | |||
| 195 | Remove a sticky tag from a file. | ||
| 196 | |||
| 197 | "PathName": the file | ||
| 198 | |||
| 199 | =cut | ||
| 200 | |||
| 201 | package VCS::LibCVS::Client::Response::Clear_sticky; | ||
| 202 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 203 | 1 | @ISA =("VCS::LibCVS::Client::Response"); | |
| 204 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Response::Valid_responses, "Clear-sticky"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 205 | 0 | ▶ | sub included_data { return ("PathName"); } |
|
Subroutine
included_data: not called CC=1 SCAR=6.9
| |||
| 206 | |||
| 207 | =head1 SEE ALSO | ||
| 208 | |||
| 209 | VCS::LibCVS::Client | ||
| 210 | VCS::LibCVS::Client::Response | ||
| 211 | |||
| 212 | =cut | ||
| 213 | |||
| 214 | 1 | 1; | |