« blib/lib/VCS/LibCVS/Client/Response/Responses.pm
↑ Summary
blib/lib/VCS/LibCVS/Client/Response/FileUpdatingResponses.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::Request::ArgumentUsingRequests - Classes for many requests | ||
| 13 | |||
| 14 | =head1 SYNOPSIS | ||
| 15 | |||
| 16 | my $ci_request = VCS::LibCVS::Client::Request::ci->new(); | ||
| 17 | $client->submit_request($ci_request); | ||
| 18 | |||
| 19 | =head1 DESCRIPTION | ||
| 20 | |||
| 21 | In the CVS client protocol, a request whose behaviour is modified by a previous | ||
| 22 | Argument request is called an "Argument Using Request". Those requests have | ||
| 23 | their classes defined here, along with a common superclass. | ||
| 24 | |||
| 25 | As Argument Requests are sent, they are saved for the next Argument Using Request, whose behaviour they modify. Once they've modified an Argument Using Request's behaviour they are forgotten, and will not affect any more requests. | ||
| 26 | |||
| 27 | The Argument Using Requests are recognizable as the familiar CVS commands: co, | ||
| 28 | up, ci, add, etc. | ||
| 29 | |||
| 30 | =head1 SUPERCLASS | ||
| 31 | |||
| 32 | VCS::LibCVS::Client::Request | ||
| 33 | |||
| 34 | =cut | ||
| 35 | |||
| 36 | 1 | $VCS::LibCVS::Client::Request::ArgumentUsingRequests::REVISION = '$Header: /cvsroot/libcvs-perl/libcvs-perl/VCS/LibCVS/Client/Request/ArgumentUsingRequests.pm,v 1.18 2005/10/10 12:52:11 dissent Exp $ '; | |
| 37 | |||
| 38 | ############################################################################### | ||
| 39 | # ArgumentUsingRequest | ||
| 40 | ############################################################################### | ||
| 41 | |||
| 42 | =head1 CLASSES | ||
| 43 | |||
| 44 | =head2 VCS::LibCVS::Client::Request::ArgumentUsingRequest | ||
| 45 | |||
| 46 | A common superclass for all the Argument Using Requests. These requests take | ||
| 47 | no Data, so their constructors do not need any arguments. | ||
| 48 | |||
| 49 | =cut | ||
| 50 | |||
| 51 | package VCS::LibCVS::Client::Request::ArgumentUsingRequest; | ||
| 52 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 53 | 1 | @ISA =("VCS::LibCVS::Client::Request"); | |
| 54 | 0 | ▶ | sub required_data { return () }; |
|
Subroutine
required_data: not called CC=1 SCAR=6.9
| |||
| 55 | |||
| 56 | =head2 B<uses_file_contents()> | ||
| 57 | |||
| 58 | if ($request->uses_file_contents()) | ||
| 59 | |||
| 60 | =over 4 | ||
| 61 | |||
| 62 | =item return type: boolean scalar | ||
| 63 | |||
| 64 | =back | ||
| 65 | |||
| 66 | Returns true if this argument using request needs the contents of local copies | ||
| 67 | of files to be sent to server. "commit" is such a request. | ||
| 68 | |||
| 69 | If this returns true, each local file should have a Modified or equivalent | ||
| 70 | request issued for it, prior to issuing this request. | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | 0 | ▶ | sub uses_file_contents { |
|
Subroutine
uses_file_contents: not called CC=1 SCAR=6.9
| |||
| 75 | 0 | return 0; | |
| 76 | } | ||
| 77 | |||
| 78 | =head2 B<uses_file_entry()> | ||
| 79 | |||
| 80 | if ($request->uses_file_entry()) | ||
| 81 | |||
| 82 | =over 4 | ||
| 83 | |||
| 84 | =item return type: boolean scalar | ||
| 85 | |||
| 86 | =back | ||
| 87 | |||
| 88 | Returns true if this argument using request needs the Entry information for | ||
| 89 | local files to be sent to server. This information includes revision | ||
| 90 | information. "update" is such a request. | ||
| 91 | |||
| 92 | If this returns true, each local file should have an Entry request issued for | ||
| 93 | it, prior to issuing this request. | ||
| 94 | |||
| 95 | This routine and uses_file_contents() are separate because the "tag" request | ||
| 96 | doesn't need the file contents. | ||
| 97 | |||
| 98 | =cut | ||
| 99 | |||
| 100 | 0 | ▶ | sub uses_file_entry { |
|
Subroutine
uses_file_entry: not called CC=1 SCAR=6.9
| |||
| 101 | 0 | return 0; | |
| 102 | } | ||
| 103 | |||
| 104 | ############################################################################### | ||
| 105 | # ci | ||
| 106 | ############################################################################### | ||
| 107 | |||
| 108 | =head2 VCS::LibCVS::Client::Request::ci | ||
| 109 | |||
| 110 | Commit one or more files. | ||
| 111 | |||
| 112 | =cut | ||
| 113 | |||
| 114 | package VCS::LibCVS::Client::Request::ci; | ||
| 115 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 116 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 117 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "ci"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 118 | 0 | ▶ | sub uses_file_contents { return 1; } |
|
Subroutine
uses_file_contents: not called CC=1 SCAR=6.9
| |||
| 119 | 0 | ▶ | sub uses_file_entry { return 1; } |
|
Subroutine
uses_file_entry: not called CC=1 SCAR=6.9
| |||
| 120 | |||
| 121 | ############################################################################### | ||
| 122 | # diff | ||
| 123 | ############################################################################### | ||
| 124 | |||
| 125 | =head2 VCS::LibCVS::Client::Request::diff | ||
| 126 | |||
| 127 | Find differences in one or more files. | ||
| 128 | |||
| 129 | =cut | ||
| 130 | |||
| 131 | package VCS::LibCVS::Client::Request::diff; | ||
| 132 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 133 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 134 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "diff"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 135 | 0 | ▶ | sub uses_file_contents { return 1; } |
|
Subroutine
uses_file_contents: not called CC=1 SCAR=6.9
| |||
| 136 | 0 | ▶ | sub uses_file_entry { return 1; } |
|
Subroutine
uses_file_entry: not called CC=1 SCAR=6.9
| |||
| 137 | |||
| 138 | ############################################################################### | ||
| 139 | # tag | ||
| 140 | ############################################################################### | ||
| 141 | |||
| 142 | =head2 VCS::LibCVS::Client::Request::tag | ||
| 143 | |||
| 144 | Tag one or more files. | ||
| 145 | |||
| 146 | =cut | ||
| 147 | |||
| 148 | package VCS::LibCVS::Client::Request::tag; | ||
| 149 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 150 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 151 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "tag"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 152 | 0 | ▶ | sub uses_file_entry { return 1; } |
|
Subroutine
uses_file_entry: not called CC=1 SCAR=6.9
| |||
| 153 | |||
| 154 | ############################################################################### | ||
| 155 | # status | ||
| 156 | ############################################################################### | ||
| 157 | |||
| 158 | =head2 VCS::LibCVS::Client::Request::status | ||
| 159 | |||
| 160 | Report the status of one or more files. | ||
| 161 | |||
| 162 | =cut | ||
| 163 | |||
| 164 | package VCS::LibCVS::Client::Request::status; | ||
| 165 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 166 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 167 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "status"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 168 | 0 | ▶ | sub uses_file_contents { return 1; } |
|
Subroutine
uses_file_contents: not called CC=1 SCAR=6.9
| |||
| 169 | 0 | ▶ | sub uses_file_entry { return 1; } |
|
Subroutine
uses_file_entry: not called CC=1 SCAR=6.9
| |||
| 170 | |||
| 171 | ############################################################################### | ||
| 172 | # log | ||
| 173 | ############################################################################### | ||
| 174 | |||
| 175 | =head2 VCS::LibCVS::Client::Request::log | ||
| 176 | |||
| 177 | Get the logs of one or more files. | ||
| 178 | |||
| 179 | =cut | ||
| 180 | |||
| 181 | package VCS::LibCVS::Client::Request::log; | ||
| 182 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 183 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 184 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "log"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 185 | |||
| 186 | ############################################################################### | ||
| 187 | # history | ||
| 188 | ############################################################################### | ||
| 189 | |||
| 190 | =head2 VCS::LibCVS::Client::Request::history | ||
| 191 | |||
| 192 | Get the history of one or more files. | ||
| 193 | |||
| 194 | =cut | ||
| 195 | |||
| 196 | package VCS::LibCVS::Client::Request::history; | ||
| 197 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 198 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 199 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "history"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 200 | |||
| 201 | ############################################################################### | ||
| 202 | # annotate | ||
| 203 | ############################################################################### | ||
| 204 | |||
| 205 | =head2 VCS::LibCVS::Client::Request::annotate | ||
| 206 | |||
| 207 | Get annotations of one or more files. | ||
| 208 | |||
| 209 | =cut | ||
| 210 | |||
| 211 | package VCS::LibCVS::Client::Request::annotate; | ||
| 212 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 213 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 214 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "annotate"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 215 | |||
| 216 | ############################################################################### | ||
| 217 | # co | ||
| 218 | ############################################################################### | ||
| 219 | |||
| 220 | =head2 VCS::LibCVS::Client::Request::co | ||
| 221 | |||
| 222 | Checkout one or more files. | ||
| 223 | |||
| 224 | =cut | ||
| 225 | |||
| 226 | package VCS::LibCVS::Client::Request::co; | ||
| 227 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 228 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 229 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "co"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 230 | |||
| 231 | ############################################################################### | ||
| 232 | # export | ||
| 233 | ############################################################################### | ||
| 234 | |||
| 235 | =head2 VCS::LibCVS::Client::Request::export | ||
| 236 | |||
| 237 | Export one or more files. | ||
| 238 | |||
| 239 | =cut | ||
| 240 | |||
| 241 | package VCS::LibCVS::Client::Request::export; | ||
| 242 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 243 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 244 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "export"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 245 | |||
| 246 | ############################################################################### | ||
| 247 | # update | ||
| 248 | ############################################################################### | ||
| 249 | |||
| 250 | =head2 VCS::LibCVS::Client::Request::update | ||
| 251 | |||
| 252 | Update one or more files. | ||
| 253 | |||
| 254 | =cut | ||
| 255 | |||
| 256 | package VCS::LibCVS::Client::Request::update; | ||
| 257 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 258 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 259 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "update"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 260 | 0 | ▶ | sub uses_file_contents { return 1; } |
|
Subroutine
uses_file_contents: not called CC=1 SCAR=6.9
| |||
| 261 | 0 | ▶ | sub uses_file_entry { return 1; } |
|
Subroutine
uses_file_entry: not called CC=1 SCAR=6.9
| |||
| 262 | |||
| 263 | ############################################################################### | ||
| 264 | # add | ||
| 265 | ############################################################################### | ||
| 266 | |||
| 267 | =head2 VCS::LibCVS::Client::Request::add | ||
| 268 | |||
| 269 | Schedule one or more files for addition. | ||
| 270 | |||
| 271 | =cut | ||
| 272 | |||
| 273 | package VCS::LibCVS::Client::Request::add; | ||
| 274 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 275 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 276 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "add"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 277 | |||
| 278 | ############################################################################### | ||
| 279 | # remove | ||
| 280 | ############################################################################### | ||
| 281 | |||
| 282 | =head2 VCS::LibCVS::Client::Request::remove | ||
| 283 | |||
| 284 | Schedule one or more files for removal. | ||
| 285 | |||
| 286 | =cut | ||
| 287 | |||
| 288 | package VCS::LibCVS::Client::Request::remove; | ||
| 289 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 290 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 291 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "remove"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 292 | |||
| 293 | ############################################################################### | ||
| 294 | # rdiff | ||
| 295 | ############################################################################### | ||
| 296 | |||
| 297 | =head2 VCS::LibCVS::Client::Request::rdiff | ||
| 298 | |||
| 299 | Find differences in one or more files, without the need for a working | ||
| 300 | directory. | ||
| 301 | |||
| 302 | =cut | ||
| 303 | |||
| 304 | package VCS::LibCVS::Client::Request::rdiff; | ||
| 305 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 306 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 307 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "rdiff"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 308 | 0 | ▶ | sub uses_file_contents { return 0; } |
|
Subroutine
uses_file_contents: not called CC=1 SCAR=6.9
| |||
| 309 | 0 | ▶ | sub uses_file_entry { return 0; } |
|
Subroutine
uses_file_entry: not called CC=1 SCAR=6.9
| |||
| 310 | |||
| 311 | ############################################################################### | ||
| 312 | # rlog | ||
| 313 | ############################################################################### | ||
| 314 | |||
| 315 | =head2 VCS::LibCVS::Client::Request::rlog | ||
| 316 | |||
| 317 | Get the logs of one or more files. | ||
| 318 | |||
| 319 | =cut | ||
| 320 | |||
| 321 | package VCS::LibCVS::Client::Request::rlog; | ||
| 322 | 1 | ▶ | use vars ('@ISA'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 323 | 1 | @ISA =("VCS::LibCVS::Client::Request::ArgumentUsingRequest"); | |
| 324 | 1 | ▶ | sub BEGIN { push @VCS::LibCVS::Client::Request::Valid_requests, "rlog"; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 325 | |||
| 326 | =head1 SEE ALSO | ||
| 327 | |||
| 328 | VCS::LibCVS::Client | ||
| 329 | VCS::LibCVS::Client::Request | ||
| 330 | |||
| 331 | =cut | ||
| 332 | |||
| 333 | 1 | 1; | |