Client.pm

filter: Statementstmt 86.6% 13 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 90.0% 18 / 20 CC 1 SCAR 0.6
CC
1
Cov
87%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Utils.pm ↑ Summary
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package SVN::Friendly::Client;
4 my $CLASS = __PACKAGE__;
5  
6 #--------------------------------------------------------------------
7 # Note: this method apparently must return 0 to indicate "no error".
8 # Returning undef results in a "Use of uninitialized value in
9 # subroutine entry" warning.
10  
11 our $SYSTEM_DIR_REGEX= qr((?:^|\/)\.svn$);
12  
13 #--------------------------------------------------------------------
14 1 ▶use Scalar::Util; # looks_like_a_number
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use File::Spec; # curdir, see also addParents
Subroutine BEGIN: called CC=1 SCAR=0.0
16 0 ▶use SVN::Wc; # needed for fs type/notify constants
Subroutine BEGIN: called CC=1 SCAR=2.6
17 use SVN::Client; # needed for SVN::_Client::svn_client_xxx
18  
19 use SVN::Friendly::Utils qw(_shiftBoolean _shiftVisitor);
20 use SVN::Friendly::Dates;
21  
22 use SVN::Friendly::Config;
23 my $CONFIG_CLASS='SVN::Friendly::Config';
24  
25 #--------------------------------------------------------------------
26 use SVN::Friendly::Exceptions qw(makeErrorHandler);
27 my $EXCEPTIONS = 'SVN::Friendly::Exceptions';
28  
29 #--------------------------------------------------------------------
30 # Fill in missing constants
31 #--------------------------------------------------------------------
32  
33 {
34 # this 2 line wierdness is needed to keep Module::Build from adding
35 # this package to the META.yaml provides list
36 package
37 SVN::Friendly::List::Fields;
38 use SVN::Base qw(Core SVN_DIRENT_);
39 #for some reason this didn't make it into the SWIG bindings,
40 #not at least, the version packaged for Debian-Etch.
41 our $ALL=0xFFFFF;
42 }
43  
44 {
45 # this 2 line wierdness is needed to keep Module::Build from adding
46 # this package to the META.yaml provides list
47 package
48 SVN::Wc::Notify::Action;
49 our $locked = $SVN::Wc::notify_locked;
50 our $unlocked = $SVN::Wc::notify_unlocked;
51 our $failed_lock = $SVN::Wc::notify_failed_lock;
52 our $failed_unlock = $SVN::Wc::notify_failed_unlock;
53  
54 # these constants seem not be be defined in the 1.5 bindings
55 # changeliset_set doesn't get defined even in wc
56  
57 our $exists = $SVN::Wc::notify_exists;
58 #print STDERR "exists=$exists\n";
59 #our $changelist_set = $SVN::_Core::svn_notify_changelist_set;
60 our $changelist_set = 26;
61 our $changelist_clear = $SVN::Wc::notify_changelist_clear;
62 our $changelist_moved = $SVN::Wc::notify_changelist_moved;
63 our $merge_begin = $SVN::Wc::notify_merge_begin;
64 our $foreign_merge_begin = $SVN::Wc::notify_foreign_merge_begin;
65 our $update_replace = $SVN::Wc::notify_update_replace;
66 }
67  
68 {
69 # this 2 line wierdness is needed to keep Module::Build from adding
70 # this package to the META.yaml provides list
71 package
72 SVN::_Core;
73 # svn_cmdline.h says that encoding (at least for the command line)
74 # defaults to APR_LOCALE_CHARSET, which Apache Portable Runtime
75 # Library documentation says is 1, to indicate that the current
76 # locale should be used. The apr.i file in the SWIG bindings do
77 # not have a mappig for this and 1 causes exceptions. We're setting
78 # this to 'UTF-8' in lieu of the proper value.
79  
80 #our $svn_locale_charset = 1;
81 our $svn_locale_charset = 'UTF-8';
82 }
83  
84 # These are needed to set defaults, but aren't in the 1.4.6 SWIG
85 # bindings. We define them here because Perl won't compile without
86 # definitions. The values are taken from the C-API header files.
87  
88 # taken from svn_types.h
89 {
90 # this 2 line wierdness is needed to keep Module::Build from adding
91 # this package to the META.yaml provides list
92 package
93 SVN::Depth;
94  
95 our $infinity = 3;
96 our $empty = 0;
97 }
98  
99 #----------------------------------------------------------------
100 # Log messages
101 #----------------------------------------------------------------
102  
103 # this variable is localized with the value of the log message
104 # it should never be set outside of that context
105 # see: configureLogMessage(), commit(), copy(), delete(), import()
106 # mkdir(), propdel(), propset()
107  
108 our $LOG_MESSAGE;
109  
110 #----------------------------------------------------------------
111 # Authentication
112 #----------------------------------------------------------------
113  
114 # Providers that don't need any user interaction, placed in order
115 # of complexity of information needed
116 #
117 # - username_provider = user name only
118 # - simple_provider = name + password
119 # - ssl_server_trust = ssl certificate, server side
120 # - ssl_client_cert = ssl certificate, client side
121 # - ssl_client_cert_pw = ssl certificate, client side + password
122 #
123 # These are all initialized with the global pool
124  
125 our $SILENT_AUTH_BATON
126 = SVN::Core::auth_open(
127 [ SVN::Client::get_username_provider()
128 , SVN::Client::get_simple_provider()
129 , SVN::Client::get_ssl_server_trust_file_provider()
130 , SVN::Client::get_ssl_client_cert_file_provider()
131 , SVN::Client::get_ssl_client_cert_pw_file_provider()
132 ]);
133  
134 use constant {
135 ALL => 0
136 , USERNAME => 0
137 , USERNAME_PW => 1
138 , SIMPLE => 1 # svn api name for USERNAME_PW
139 , SSL_SERVER => 2
140 , SSL_CLIENT => 3
141 , SSL_CLIENT_PW => 4
142 , LAST => 4
143 };
144  
145 my $PROVIDER_FACTS
146 = [[ 'username'
147 ,\&SVN::Client::get_username_provider
148 ,\&SVN::Client::get_username_prompt_provider ]
149 ,['username_pw'
150 ,\&SVN::Client::get_simple_provider
151 ,\&SVN::Client::get_simple_prompt_provider ]
152 ,['ssl_server'
153 ,\&SVN::Client::get_ssl_server_trust_file_provider
154 , \&SVN::Client::get_ssl_server_trust_prompt_provider]
155 ,['ssl_client'
156 ,\&SVN::Client::get_ssl_client_cert_file_provider
157 , \&SVN::Client::get_ssl_client_cert_prompt_provider]
158 ,['ssl_client_pw'
159 ,\&SVN::Client::get_ssl_client_cert_pw_file_provider
160 , \&SVN::Client::get_ssl_client_cert_pw_prompt_provider]
161 ];
162  
163 #----------------------------------------------------------------
164 # Notification
165 #----------------------------------------------------------------
166  
167 our %ACTIONS
168 = ( $SVN::Wc::Notify::Action::add
169 => 'schedule: add'
170 , $SVN::Wc::Notify::Action::copy
171 => 'schedule: copy'
172 , $SVN::Wc::Notify::Action::delete
173 => 'schedule: delete'
174  
175 , $SVN::Wc::Notify::Action::restore
176 => 'revert: deleted file restored'
177 , $SVN::Wc::Notify::Action::revert
178 => 'revert: addition/modification undone'
179 , $SVN::Wc::Notify::Action::failed_revert
180 => 'revert: failed'
181  
182 , $SVN::Wc::Notify::Action::resolved
183 => 'resolved'
184  
185 , $SVN::Wc::Notify::Action::skip
186 => 'log: skip'
187 , $SVN::Wc::Notify::Action::update_add
188 => 'update: add'
189 , $SVN::Wc::Notify::Action::update_update
190 => 'update: update'
191 , $SVN::Wc::Notify::Action::update_delete
192 => 'update: delete'
193 , $SVN::Wc::Notify::Action::update_external
194 => 'update: external'
195 , $SVN::Wc::Notify::Action::update_completed
196 => 'update: completed'
197  
198 , $SVN::Wc::Notify::Action::status_external
199 => 'status: external'
200 , $SVN::Wc::Notify::Action::status_completed
201 => 'status: completed'
202  
203 , $SVN::Wc::Notify::Action::commit_added
204 => 'commit: added'
205 , $SVN::Wc::Notify::Action::commit_modified
206 => 'commit: modified'
207 , $SVN::Wc::Notify::Action::commit_deleted
208 => 'commit: deleted'
209 , $SVN::Wc::Notify::Action::commit_replaced
210 => 'commit: replaced'
211 , $SVN::Wc::Notify::Action::commit_postfix_txdelta
212 => 'commit: transmitting delta'
213  
214 , $SVN::Wc::Notify::Action::blame_revision
215 => 'blame: revision'
216  
217 , $SVN::Wc::Notify::Action::locked
218 => 'locked: suceeded'
219 , $SVN::Wc::Notify::Action::unlocked
220 => 'unlocked: suceeded'
221 , $SVN::Wc::Notify::Action::failed_lock
222 => 'lock: failed'
223 , $SVN::Wc::Notify::Action::failed_unlock
224 => 'unlock: failed'
225 );
226  
227  
228 #print STDERR $SVN::Core::VER_MINOR . "\n";
229 if (1 <= $SVN::Core::VER_MAJOR) {
230 if (5 <= $SVN::Core::VER_MINOR) {
231 $ACTIONS{$SVN::Wc::Notify::Action::exists}
232 = 'schedule: tried to add existing path';
233 $ACTIONS{$SVN::Wc::Notify::Action::changelist_set}
234 = 'schedule: set changelist';
235 $ACTIONS{$SVN::Wc::Notify::Action::changelist_clear}
236 = 'schedule: clear changelist';
237 $ACTIONS{$SVN::Wc::Notify::Action::changelist_moved}
238 = 'schedule: path has moved to new changelist';
239  
240 $ACTIONS{$SVN::Wc::Notify::Action::merge_begin}
241 = 'merge: begin';
242 $ACTIONS{$SVN::Wc::Notify::Action::foreign_merge_begin}
243 = 'merge: begin external';
244  
245 $ACTIONS{$SVN::Wc::Notify::Action::update_replace}
246 = 'update: replace';
247 }
248  
249 if (6 <= $SVN::Core::VER_MINOR) {
250 $ACTIONS{$SVN::Wc::Notify::Action::property_added}
251 = 'schedule: add property';
252 $ACTIONS{$SVN::Wc::Notify::Action::property_modified}
253 = 'schedule: modify property';
254 $ACTIONS{$SVN::Wc::Notify::Action::property_deleted}
255 = 'schedule: delete property';
256 $ACTIONS{$SVN::Wc::Notify::Action::property_deleted_nonexistant}
257 = 'schedule: delete property';
258 $ACTIONS{$SVN::Wc::Notify::Action::merge_completed}
259 = 'merge: completed';
260 }
261 }
262  
263 sub getActionAsString { $ACTIONS{$_[1]}; }
264  
265 #--------------------------------------------------------------------
266 # Additional text equivalents to constants, for testng purposes
267 #--------------------------------------------------------------------
268  
269 my %STATUS =
270 ( $SVN::Wc::Status::none => 'none'
271 , $SVN::Wc::Status::unversioned => 'unversioned'
272 , $SVN::Wc::Status::normal => 'exists'
273 , $SVN::Wc::Status::added => 'added'
274 , $SVN::Wc::Status::missing => 'missing'
275 , $SVN::Wc::Status::deleted => 'deleted'
276 , $SVN::Wc::Status::replaced => 'replaced'
277 , $SVN::Wc::Status::modified => 'modified'
278 , $SVN::Wc::Status::merged => 'merged'
279 , $SVN::Wc::Status::conflicted => 'conflicted'
280 , $SVN::Wc::Status::ignored => 'ignored'
281 , $SVN::Wc::Status::obstructed => 'obstructed'
282 , $SVN::Wc::Status::external => 'external'
283 , $SVN::Wc::Status::incomplete => 'incomplete'
284 );
285 sub getStatusAsString { $STATUS{$_[1]}; }
286  
287 my %STATE =
288 ( $SVN::Wc::notify_state_inapplicable => 'na'
289 , $SVN::Wc::Notify::State::unknown => 'unknown'
290 , $SVN::Wc::Notify::State::unchanged => 'unchanged'
291 , $SVN::Wc::Notify::State::missing => 'missing'
292 , $SVN::Wc::Notify::State::obstructed => 'obstructed'
293 , $SVN::Wc::Notify::State::changed => 'changed'
294 , $SVN::Wc::Notify::State::merged => 'merged'
295 , $SVN::Wc::Notify::State::conflicted => 'conflicted'
296 );
297 sub getStateAsString { $STATE{$_[1]} }
298  
299 my %SCHEDULE =
300 ( $SVN::Wc::Schedule::normal => 'normal'
301 , $SVN::Wc::Schedule::add => 'add'
302 , $SVN::Wc::Schedule::delete => 'delete'
303 , $SVN::Wc::Schedule::replace => 'replace'
304 );
305 sub getScheduledOpAsString { $SCHEDULE{$_[1]} }
306  
307 my %KIND =
308 ( $SVN::Node::none => 'none'
309 , $SVN::Node::file => 'file'
310 , $SVN::Node::dir => 'dir'
311 , $SVN::Node::unknown => 'unknown'
312 );
313 sub getKindAsString { $KIND{$_[1]} }
314  
315 #--------------------------------------------------------------------
316 # Text equivalents to objects
317 #--------------------------------------------------------------------
318  
319 sub getDirEntryString($;$$) {
320 my (undef, $sPath, $oDirEntry, $iPrecision) = @_;
321 return $sPath unless defined($oDirEntry);
322  
323 #long listing
324 my $iKind = $oDirEntry->kind();
325 my $sKind = $iKind == $SVN::Node::file
326 ? 'f' : ($iKind == $SVN::Node::dir ? 'd' : '-');
327 my $sProps = ($oDirEntry->has_props() ? 'p' : '-');
328 my $sTime = SVN::Friendly::Dates::getISO8601Time
329 ($oDirEntry->time(), $iPrecision);
330  
331 return sprintf("%5s %s %8s %8s %s %s\n"
332 , $oDirEntry->created_rev()
333 , $sKind . $sProps
334 , $oDirEntry->last_author()
335 , $oDirEntry->size()
336 , $sTime, $sPath);
337 }
338  
339 #==================================================================
340 # CLASS METHODS
341 #==================================================================
342  
343 sub new {
344 my ($sClass, $xAuth, $xConfig, $xNotify, $crLogMsg, $crCancel
345 , $oPool) = @_;
346 $oPool = new SVN::Pool() unless defined($oPool);
347  
348 my $self = bless({}, $sClass);
349 $self->{ctx} = SVN::_Client::svn_client_create_context ();
350  
351 $self->configureAuthentication($xAuth);
352 $self->setConfig($xConfig);
353 $self->configureNotification($xNotify);
354 $self->configureLogMessage($crLogMsg);
355 $self->configureCancellation($crCancel);
356 $self->setPool($oPool);
357 return $self;
358 }
359  
360 #==================================================================
361 # OBJECT METHODS - non-overridable
362 #==================================================================
363  
364 #----------------------------------------------------------------
365  
366 sub getWorkingCopyRevision {
367 my ($self, $sWc) = @_;
368  
369 my ($iCurrentRev, $iLastChangedRev);
370 my $crInfo = sub {
371 my ($sWc, $oInfo, $oPool) = @_;
372 $iCurrentRev = $oInfo->rev();
373 $iLastChangedRev = $oInfo->last_changed_rev();
374 };
375 $self->info($sWc, $crInfo);
376 return [$iCurrentRev, $iLastChangedRev];
377 }
378  
379 #----------------------------------------------------------------
380  
381 sub getWorkingCopyDirStatus {
382 my ($self, $sWc) = @_;
383 my $iStatus = $SVN::Wc::Status::unversioned;
384 #print STDERR "getWorkingCopyDir: <$sWc>\n";
385  
386 local $SVN::Error::handler = makeErrorHandler
387 (sub {
388 my $iErr = $_[0]->apr_err();
389 #print STDERR "error no: $iErr\n";
390 if ($iErr eq $SVN::Error::RA_ILLEGAL_URL) {
391 #$SVN::Error::RA_ILLEGAL_URL appears to be thrown when
392 #$sWc is added but not committed
393 $iStatus = $SVN::Wc::Status::added;
394 return 1; #don't croak - we know added
395  
396 } elsif ($iErr eq $SVN::Error::ENTRY_MISSING_URL) {
397 #$SVN::Error::ENTRY_MISSING_URL appears to be thrown when
398 #$sWc is not added, but parent of $sWc is added and
399 #committed
400 return 1; #don't croak - we know unversioned
401  
402 } elsif ($iErr eq $SVN::Error::WC_NOT_DIRECTORY) {
403 #$SVN::Error::WC_NOT_DIRECTORY appears to be thrown when
404 #$sWc is not added, and immediate parent of $sWc is not
405 #a working directory
406 return 1; #don't croak - we know unversioned
407  
408 } else {
409 return 0; #croak - don't know what went wrong
410 }
411 });
412  
413 my $crInfo = sub {
414 my ($sWc, $oInfo, $oPool) = @_;
415 $iStatus = $SVN::Wc::Status::normal
416 unless ($oInfo->kind() eq $SVN::Node::unknown);
417 };
418  
419 $self->info($sWc, $crInfo);
420 #print STDERR "getWorkingCopyDir: <$sWc> <$iStatus>\n";
421 return $iStatus;
422 }
423  
424 #----------------------------------------------------------------
425 sub isWorkingCopyPath {
426 #print STDERR "isWorkingCopyPath:<$SVN::Wc::Status::unversioned>\n";
427 return getWorkingCopyDirStatus(@_) eq $SVN::Wc::Status::unversioned
428 ? 0 : 1;
429 }
430  
431 #----------------------------------------------------------------
432  
433 sub printStatus {
434 my ($self, $sWc, $fh) = @_;
435 my $crStatus = sub {
436 my ($sWc, $oStatus) = @_;
437  
438 #Note: only 1.2+ API (status2) supports flag to indicate whether
439 #file is locked in the repository. The locked flag returned by
440 #locked() really should be frozen or interrupted. It refers to
441 #file that are "locked" because their modifications have only
442 #been partially stored in the repository.
443  
444 my $iTextStatus = $oStatus->text_status();
445 my $iPropStatus = $oStatus->prop_status();
446 my $sStatus = sprintf("%-11s %-11s %s\n"
447 , $SVN::Friendly::Client::STATUS{$iTextStatus}
448 , $SVN::Friendly::Client::STATUS{$iPropStatus}
449 , $sWc);
450 print $fh $sStatus;
451 };
452 $self->status($sWc, $crStatus);
453 }
454  
455 #----------------------------------------------------------------
456  
457 sub add1_1 {
458 my $self = shift @_;
459 my $sWc = _shiftWcPath(\@_);
460 my $bRecurse = _shiftRecurse(\@_);
461 my $oPool = $self->_shiftPool(\@_);
462  
463 return SVN::_Client::svn_client_add
464 ($sWc, $bRecurse, $self->{ctx}, $oPool);
465 }
466  
467 sub add1_4 {
468 my $self = shift @_;
469 my $sWc = _shiftWcPath(\@_);
470 my $bRecurse = _shiftRecurse(\@_);
471 my $bForceAdd = _shiftBoolean(\@_);
472 my $bNoIgnore = _shiftBoolean(\@_);
473 my $oPool = $self->_shiftPool(\@_);
474  
475 #bForceAdd - descend into versioned dirs
476 # skip versioned files silently
477  
478 return SVN::_Client::svn_client_add3
479 ($sWc, $bRecurse, $bForceAdd, $bNoIgnore
480 , $self->{ctx}, $oPool);
481 }
482  
483 sub add1_5 {
484 my $self = shift @_;
485 my $sWc = _shiftWcPath(\@_);
486 my $iDepth = _shiftDepth(\@_);
487 my $bForceAdd = _shiftBoolean(\@_);
488 my $bNoIgnore = _shiftBoolean(\@_);
489 my $bAddParents = _shiftBoolean(\@_);
490 my $oPool = $self->_shiftPool(\@_);
491  
492 #bForceAdd - descend into versioned dirs
493 # skip versioned files silently
494  
495 return SVN::_Client::svn_client_add4
496 ($sWc, $iDepth, $bForceAdd, $bNoIgnore, $bAddParents
497 , $self->{ctx}, $oPool);
498 }
499  
500 *add1_6 = *add1_5;
501 *add1_7 = *add1_7;
502 *add = *add1_1;
503  
504 #----------------------------------------------------------------
505  
506 sub blame1_1 {
507 my $self = shift @_;
508 my $xRepos = _shiftTarget(\@_);
509 my ($xStart, $xEnd) = _shiftRange(\@_);
510 my $crVisit = _shiftVisitor(\@_);
511 my $oPool = $self->_shiftPool(\@_);
512  
513 #Despite the fact that the usage string includes a baton,
514 #the actual method expects it to be omitted from the parameter
515 #list
516  
517 return SVN::_Client::svn_client_blame
518 ($xRepos, $xStart, $xEnd, $crVisit, $self->{ctx}, $oPool);
519 }
520  
521 sub blame1_4 {
522 my $self = shift @_;
523 my $xRepos = _shiftTarget(\@_);
524 my $xPeg = _shiftPeg(\@_);
525 my ($xStart, $xEnd) = _shiftRange(\@_, $xPeg);
526 my $oDiffOptions = shift @_;
527 my $bBlameBinary = _shiftBoolean(\@_);
528 my $crVisit = _shiftVisitor(\@_);
529 my $oPool = $self->_shiftPool(\@_);
530  
531 #Despite the fact that the usage string includes a baton,
532 #the actual method expects it to be omitted from the parameter
533 #list
534  
535 $oDiffOptions = SVN::_Core::svn_diff_file_options_create($oPool)
536 unless defined($oDiffOptions);
537  
538 return SVN::_Client::svn_client_blame3
539 ($xRepos, $xPeg, $xStart, $xEnd
540 , $oDiffOptions, $bBlameBinary, $crVisit
541 , $self->{ctx}, $oPool);
542 }
543  
544 sub blame1_5 {
545 my $self = shift @_;
546 my $xRepos = _shiftTarget(\@_);
547 my $xPeg = _shiftPeg(\@_);
548 my ($xStart, $xEnd) = _shiftRange(\@_);
549 my $oDiffOptions = shift @_;
550 my $bBlameBinary = _shiftBoolean(\@_);
551 my $bIncludeMergedRevisions = _shiftBoolean(\@_);
552 my $crVisit = _shiftVisitor(\@_);
553 my $oPool = $self->_shiftPool(\@_);
554  
555 #Despite the fact that the usage string includes a baton,
556 #the actual method expects it to be omitted from the parameter
557 #list
558  
559 $oDiffOptions = SVN::_Core::svn_diff_file_options_create($oPool)
560 unless defined($oDiffOptions);
561  
562 return SVN::_Client::svn_client_blame4
563 ($xRepos, $xPeg, $xStart, $xEnd, $bBlameBinary
564 , $bIncludeMergedRevisions, $crVisit, $self->{ctx}, $oPool);
565 }
566  
567 sub blame1_6 {
568 my $self = shift @_;
569 my $xRepos = _shiftTarget(\@_);
570 my $xPeg = _shiftPeg(\@_);
571 my ($xStart, $xEnd) = _shiftRange(\@_);
572 my $oDiffOptions = shift @_;
573 my $bBlameBinary = _shiftBoolean(\@_);
574 my $bIncludeMergedRevisions = _shiftBoolean(\@_);
575 my $crVisit = _shiftVisitor(\@_);
576 my $oPool = $self->_shiftPool(\@_);
577  
578 #Despite the fact that the usage string includes a baton,
579 #the actual method expects it to be omitted from the parameter
580 #list
581  
582 $oDiffOptions = SVN::_Core::svn_diff_file_options_create($oPool)
583 unless defined($oDiffOptions);
584  
585 return SVN::_Client::svn_client_blame5
586 ($xRepos, $xPeg, $xStart, $xEnd, $bBlameBinary
587 , $bIncludeMergedRevisions, $crVisit, $self->{ctx}, $oPool);
588 }
589  
590 *blame1_7 = *blame1_6;
591 *blame = *blame1_1;
592  
593 #----------------------------------------------------------------
594  
595 sub cat1_1 {
596 my $self = shift @_;
597 my $fh = _shiftOutFile(\@_);
598 my $xRepos = _shiftTarget(\@_);
599 my $xPeg = _shiftPeg(\@_);
600 my $oPool = $self->_shiftPool(\@_);
601  
602 return SVN::_Client::svn_client_cat
603 ($fh, $xRepos, $xPeg, $self->{ctx}, $oPool);
604 }
605  
606 sub cat1_4($;$$$) {
607 my $self = shift @_;
608 my $fh = _shiftOutFile(\@_);
609 my $xRepos = _shiftTarget(\@_);
610 my ($xPeg, $xRev) = _shiftPegRev(\@_);
611 my $oPool = $self->_shiftPool(\@_);
612  
613 return SVN::_Client::svn_client_cat2
614 ($fh, $xRepos, $xPeg, $xRev, $self->{ctx}, $oPool);
615 }
616  
617 *cat1_5 = *cat1_4;
618 *cat1_6 = *cat1_4;
619 *cat1_7 = *cat1_4;
620  
621 sub cat {
622 my $self = shift @_;
623 my $xRepos = _shiftTarget(\@_);
624 my $xPeg = _shiftPeg(\@_);
625 my $fh = _shiftOutFile(\@_);
626 my $oPool = $self->_shiftPool(\@_);
627  
628 return SVN::_Client::svn_client_cat
629 ($fh, $xRepos, $xPeg, $self->{ctx}, $oPool);
630 }
631  
632 #----------------------------------------------------------------
633  
634 sub checkout1_1 {
635 my $self = shift @_;
636 my $xRepos = _shiftTarget(\@_);
637 my $sWc = _shiftWcPath(\@_);
638 my $xPeg = _shiftPeg(\@_);
639 my $bRecurse = _shiftRecurse(\@_);
640 my $oPool = $self->_shiftPool(\@_);
641  
642 return SVN::_Client::svn_client_checkout
643 ($xRepos, $sWc, $xPeg, $bRecurse, $self->{ctx}, $oPool);
644 }
645  
646 sub checkout1_4 {
647 my $self = shift @_;
648 my $xRepos = _shiftTarget(\@_);
649 my $sWc = _shiftWcPath(\@_);
650 my ($xPeg, $xTargetRev) = _shiftPegRev(\@_);
651 my $bRecurse = _shiftRecurse(\@_);
652 my $bSkipExternals = _shiftBoolean(\@_);
653 my $oPool = $self->_shiftPool(\@_);
654  
655 return SVN::_Client::svn_client_checkout2
656 ($xRepos, $sWc, $xPeg, $xTargetRev, $bRecurse, $bSkipExternals
657 , $self->{ctx}, $oPool);
658 }
659  
660 sub checkout1_5 {
661 my $self = shift @_;
662 my $xRepos = _shiftTarget(\@_);
663 my $sWc = _shiftWcPath(\@_);
664 my ($xPeg, $xTargetRev) = _shiftPegRev(\@_);
665 my $iDepth = _shiftDepth(\@_);
666 my $bSkipExternals = _shiftBoolean(\@_);
667 my $bAllowUnversionedObstructions = _shiftBoolean(\@_);
668 my $oPool = $self->_shiftPool(\@_);
669  
670 return SVN::_Client::svn_client_checkout3
671 ($xRepos, $sWc, $xPeg, $xTargetRev, $iDepth, $bSkipExternals
672 , $bAllowUnversionedObstructions, $self->{ctx}, $oPool);
673 }
674  
675 *checkout1_6 = *checkout1_5;
676 *checkout1_7 = *checkout1_5;
677  
678 sub checkout {
679 my $self = shift @_;
680 my $xRepos = _shiftTarget(\@_);
681 my $xPeg = _shiftPeg(\@_);
682 my $sWc = _shiftWcPath(\@_);
683 my $bRecurse = _shiftRecurse(\@_);
684 my $oPool = $self->_shiftPool(\@_);
685  
686 return SVN::_Client::svn_client_checkout
687 ($xRepos, $sWc, $xPeg, $bRecurse, $self->{ctx}, $oPool);
688 }
689  
690 #----------------------------------------------------------------
691  
692 sub cleanup1_1 {
693 my $self = shift @_;
694 my $sWc = _shiftWcPath(\@_);
695 my $oPool = $self->_shiftPool(\@_);
696  
697 return SVN::_Client::svn_client_cleanup
698 ($sWc, $self->{ctx}, $oPool);
699 }
700  
701 *cleanup1_4 = *cleanup1_1;
702 *cleanup1_5 = *cleanup1_1;
703 *cleanup1_6 = *cleanup1_1;
704 *cleanup1_7 = *cleanup1_1;
705 *cleanup = *cleanup1_1;
706  
707 #----------------------------------------------------------------
708  
709 sub commit1_1 {
710 my $self = shift @_;
711 my $aWcs = _shiftWcPaths(\@_);
712 local $LOG_MESSAGE = _shiftString(\@_);
713 my $bNonRecursive = _shiftBoolean(\@_);
714 my $oPool = $self->_shiftPool(\@_);
715  
716 # in the subversion bindings for 1.5, this method returns a
717 # svn_client_commit_info_t object with revision set to -1. In earlier
718 # releases of the subversion bindins it returned undef. To make the
719 # behavior consistent between releases we check the return value.
720  
721 my $xResult = SVN::_Client::svn_client_commit
722 ($aWcs, $bNonRecursive, $self->{ctx}, $oPool);
723 return ref($xResult) && ($xResult->revision >= 0) ? $xResult : undef;
724 }
725  
726 sub commit1_4 {
727 my $self = shift @_;
728 my $aWcs = _shiftWcPaths(\@_);
729 local $LOG_MESSAGE = _shiftString(\@_);
730 my $bRecurse = _shiftRecurse(\@_);
731 my $bKeepLocks = _shiftBoolean(\@_);
732 my $oPool = $self->_shiftPool(\@_);
733  
734 return SVN::_Client::svn_client_commit3
735 ($aWcs, $bRecurse, $bKeepLocks, $self->{ctx}, $oPool);
736 }
737  
738 sub commit1_5 {
739 my $self = shift @_;
740 my $aWcs = _shiftWcPaths(\@_);
741 local $LOG_MESSAGE = _shiftString(\@_);
742 my $iDepth = _shiftDepth(\@_);
743 my $bKeepLocks = _shiftBoolean(\@_);
744 my $bKeepChangelists = _shiftBoolean(\@_);
745 my $aChangeLists = _shiftArray(\@_);
746 my $hRevProps = _shiftHash(\@_);
747 my $oPool = $self->_shiftPool(\@_);
748  
749 return SVN::_Client::svn_client_commit4
750 ($aWcs, $iDepth, $bKeepLocks, $bKeepChangelists, $aChangeLists
751 , $hRevProps, $self->{ctx}, $oPool);
752 }
753  
754 *commit1_6 = *commit1_5;
755  
756 sub commit1_7 {
757 my $self = shift @_;
758 my $aWcs = _shiftWcPaths(\@_);
759 local $LOG_MESSAGE = _shiftString(\@_);
760 my $iDepth = _shiftDepth(\@_);
761 my $bKeepLocks = _shiftBoolean(\@_);
762 my $bKeepChangelists = _shiftBoolean(\@_);
763 my $aChangeLists = _shiftArray(\@_);
764 my $hRevProps = _shiftHash(\@_);
765 my $crCommit = _shiftVisitor(\@_);
766 my $oPool = $self->_shiftPool(\@_);
767  
768 return SVN::_Client::svn_client_commit4
769 ($aWcs, $iDepth, $bKeepLocks, $bKeepChangelists, $aChangeLists
770 , $hRevProps, $crCommit, $self->{ctx}, $oPool);
771 }
772  
773 sub commit {
774 my $self = shift @_;
775 my $aWcs = _shiftWcPaths(\@_);
776 local $LOG_MESSAGE = _shiftString(\@_);
777 my $bRecurse = _shiftRecurse(\@_);
778 my $oPool = $self->_shiftPool(\@_);
779  
780 # in the subversion bindings for 1.5, this method returns a
781 # svn_client_commit_info_t object with revision set to -1. In earlier
782 # releases of the subversion bindins it returned undef. To make the
783 # behavior consistent between releases we check the return value.
784  
785 my $xResult = SVN::_Client::svn_client_commit
786 ($aWcs, $bRecurse?0:1, $self->{ctx}, $oPool);
787 return ref($xResult) && ($xResult->revision >= 0) ? $xResult : undef;
788 }
789  
790 #--------------------------------------------------------------------
791  
792 sub configureAuthentication {
793 my ($self, $oAuthBaton) = @_;
794 my $sRef=ref($oAuthBaton);
795 my $acrPrompters;
796  
797 if (!defined($oAuthBaton)) {
798 $oAuthBaton = $SILENT_AUTH_BATON;
799 $acrPrompters = [];
800 } elsif ($sRef eq '_p_svn_auth_baton_t') {
801 $acrPrompters = [];
802 } elsif ($sRef eq 'ARRAY') {
803 ($oAuthBaton, $acrPrompters)
804 = SVN::Core::auth_open_helper($oAuthBaton);
805  
806 } elsif ($sRef eq 'HASH') {
807 my $hProps = $oAuthBaton;
808 my $oPool = $hProps->{pool};
809 my $iRetries = $hProps->{retries};
810 $iRetries = 3 unless defined($iRetries);
811  
812 my $xProviders = $hProps->{providers};
813 my $aProviders = !defined($xProviders)
814 ? $PROVIDER_FACTS
815 : ref($xProviders)
816 ? [ @$PROVIDER_FACTS[@$xProviders] ]
817 : [ @$PROVIDER_FACTS[$xProviders..LAST]];
818  
819 my $aAuth = [];
820 foreach (@$aProviders) {
821 my ($k, $crSilent, $crPrompt) = @$_;
822  
823 my $aData = exists($hProps->{$k}) ? $hProps->{$k} : undef;
824 if (!defined($aData) && ($k eq 'username_pw')) {
825 # simple is an alias for username_pw
826 $k='simple';
827 $aData = exists($hProps->{$k}) ? $hProps->{$k} : undef;
828 }
829 $aData = [ $aData, undef ] if (ref($aData) eq 'CODE');
830  
831 my ($crCallback, $bNoSilent) = defined($aData) ? @$aData : ();
832  
833 #printf STDERR "k=$k, prompt=%s silent=%s\n"
834 # , (defined($crCallback)?$crCallback:'undef')
835 # , ($bNoSilent ? 0 : 1);
836  
837 push @$aAuth, $crSilent->($oPool) unless $bNoSilent;
838  
839 if (defined($crCallback)) {
840 my $oProvider = $k eq 'ssl_server'
841 ? $crPrompt->($crCallback, $oPool)
842 : $crPrompt->($crCallback, $iRetries, $oPool);
843 push @$aAuth, $oProvider;
844 }
845  
846 }
847 ($oAuthBaton, $acrPrompters)= SVN::Core::auth_open_helper($aAuth);
848 } else {
849 die $EXCEPTIONS->ERR_BAD_ARG
850 ->new(arg => $oAuthBaton, reason=>"Configuration object must "
851 . "be a hash reference, array of providers, "
852 . "authentication baton, or undefined");
853 }
854  
855 # Not sure why the callbacks need to be held onto, perhaps to keep
856 # the reference from being garbage cleaned? In any case,
857 # SVN::Client does this, so we shall too.
858  
859 $self->{ctx}->auth_baton($oAuthBaton);
860 $self->{auth_callbacks} = $acrPrompters;
861 return ($self->{ctx}->auth_baton(), $self->{auth_callbacks});
862 }
863  
864 #--------------------------------------------------------------------
865  
866 sub configureCancellation {
867 my ($self, $crCancel) = @_;
868 if (defined($crCancel) && (ref($crCancel) ne 'CODE')) {
869 die $EXCEPTIONS->ERR_BAD_ARG->new(arg => $crCancel, reason => "Cancel "
870 ."callback must be undefined a code reference");
871 }
872 $self->{cancel} =$self->{ctx}->cancel_baton($crCancel);
873 return $crCancel;
874 }
875  
876 #--------------------------------------------------------------------
877  
878 sub configureLogMessage {
879 my ($self, $crLogMsg) = @_;
880 my $crWrapper;
881  
882 if (defined($crLogMsg)) {
883 if (ref($crLogMsg) eq 'CODE') {
884 $crWrapper = sub {
885 my ($rMsg, $sTmpFile, $aCommit, $oPool) = @_;
886 $$rMsg = $LOG_MESSAGE;
887 return defined($crLogMsg)
888 ? $crLogMsg->($rMsg, $sTmpFile, $aCommit, $oPool) : 0;
889 };
890 } else {
891 die $EXCEPTIONS->ERR_BAD_ARG->new(arg => $crLogMsg, reason => "Log message "
892 . "callback must be undefined, a hash, or a code reference");
893 }
894 } else {
895 $crWrapper = sub {
896 die $EXCEPTIONS->ERR_NO_LOG_MSG->new()
897 unless defined($LOG_MESSAGE);
898 ${$_[0]} = $LOG_MESSAGE;
899 }
900 }
901  
902 # in subversion bindings for 1.4, the method availble is log_msg_baton
903 # subversion bindings for 1.5 appear to have changed the signature so
904 # that the second parameter is *void and it fails. We have to use
905 # log_msg_baton3 instead
906  
907 $self->{log_msg_wrapper}
908 = (($SVN::Core::VER_MAJOR==1) && ($SVN::Core::VER_MINOR < 5))
909 ? $self->{ctx}->log_msg_baton($crWrapper)
910 : $self->{ctx}->log_msg_baton3($crWrapper);
911  
912 $self->{log_msg} = $crLogMsg;
913 return $crLogMsg;
914 }
915  
916 #--------------------------------------------------------------------
917  
918 sub configureNotification {
919 my ($self,$crNotify) = @_;
920 if (defined($crNotify)) {
921 my $sRef = ref($crNotify);
922 if ($sRef eq 'HASH') {
923 my $hActions = $crNotify;
924 $crNotify = sub {
925 #my ($sPath, $iAction, $iKind, $sMime,$iState,$iRevision)=@_;
926 return _notifyFromHash($hActions, @_);
927 };
928 } elsif ($sRef ne 'CODE') {
929 die $EXCEPTIONS->ERR_BAD_ARG->new(arg => $crNotify, reason => "Notification "
930 . "callback must be undefined, a hash, or a code reference");
931 }
932 }
933 $self->{notify} =$self->{ctx}->notify_baton($crNotify);
934 return $crNotify;
935 }
936  
937 #--------------------------------------------------------------------
938 # command line:
939 # - can't copy to an uncommited directory
940 # * not smart enough to add the directory
941 # - can't copy an uncommited file
942 # * not smart enough to convert copy X to Y to add Y
943 # - can't copy over an existing file
944 # * no parameter to force overwrite
945 #
946 # - copying a file to X and deleting X and replacing it with a
947 # dir of the same name before commit will result
948 # in an inconsistent working copy state that can only be fixed
949 # by running "svn update X". even deleting the dir and running
950 # just plain "svn update" will not work
951 #
952 # ==> copy only: file (w/ or w/o mod) to non-existing file
953 # file (w/ or w/o mod) to committed dir
954 #
955 # to copy X to Y and then schedule copy
956 # method A:
957 # - in repository: copy from-HEAD to-HEAD
958 # - rename Y to tmpfile (to avoid can't update complaints)
959 # - update Y (bring copy down from server
960 # - copy tmpfile to Y (restore changes, now viewed as "mod")
961 # - commit change
962 # Notes:
963 # - adding before update doesn't help, still won't update
964 # - committing before update doesn't help, won't commit
965 # - there is no force flag
966 # - why doesn't this just merge or treat as conflict?
967 #
968  
969 sub copy1_1 {
970 my $self = shift @_;
971 my $sTarget = _shiftTarget(\@_);
972 my $xPeg = _shiftPeg(\@_, 1);
973 my $sTo = _shiftTarget(\@_);
974 local $LOG_MESSAGE = _shiftString(\@_);
975 my $oPool = $self->_shiftPool(\@_);
976  
977 #print STDERR "copy: <$sTarget> <$sTo>\n";
978  
979 return SVN::_Client::svn_client_copy
980 ($sTarget, $xPeg, $sTo, $self->{ctx}, $oPool);
981 }
982  
983 sub copy1_4 {
984 my $self = shift @_;
985 my $sTarget = _shiftTarget(\@_);
986 my $xPeg = _shiftPeg(\@_, 1);
987 my $sTo = _shiftTarget(\@_);
988 local $LOG_MESSAGE = _shiftString(\@_);
989 my $oPool = $self->_shiftPool(\@_);
990  
991 return SVN::_Client::svn_client_copy3
992 ($sTarget, $xPeg, $sTo, $self->{ctx}, $oPool);
993 }
994  
995  
996 sub copy1_5 {
997 my $self = shift @_;
998 my $aTargets = _shiftTargets(\@_);
999 my $xPeg = _shiftPeg(\@_, 1);
1000 my $sTo = _shiftTarget(\@_);
1001 local $LOG_MESSAGE = _shiftString(\@_);
1002 my $bCopyAsChild = _shiftBoolean(\@_);
1003 my $bMakeParents = _shiftBoolean(\@_);
1004 my $hRevProps = _shiftHash(\@_);
1005 my $oPool = $self->_shiftPool(\@_);
1006  
1007 return SVN::_Client::svn_client_copy4
1008 ($aTargets, $xPeg, $sTo, $bCopyAsChild, $bMakeParents
1009 , $hRevProps, $self->{ctx}, $oPool);
1010 }
1011  
1012 sub copy1_6 {
1013 my $self = shift @_;
1014 my $aTargets = _shiftTargets(\@_);
1015 my $xPeg = _shiftPeg(\@_, 1);
1016 my $sTo = _shiftTarget(\@_);
1017 local $LOG_MESSAGE = _shiftString(\@_);
1018 my $bCopyAsChild = _shiftBoolean(\@_);
1019 my $bMakeParents = _shiftBoolean(\@_);
1020 my $hRevProps = _shiftHash(\@_);
1021 my $oPool = $self->_shiftPool(\@_);
1022  
1023 return SVN::_Client::svn_client_copy5
1024 ($aTargets, $xPeg, $sTo, $bCopyAsChild, $bMakeParents
1025 , $hRevProps, $self->{ctx}, $oPool);
1026 }
1027  
1028 sub copy1_7 {
1029 my $self = shift @_;
1030 my $aTargets = _shiftTargets(\@_);
1031 my $xPeg = _shiftPeg(\@_, 1);
1032 my $sTo = _shiftTarget(\@_);
1033 local $LOG_MESSAGE = _shiftString(\@_);
1034 my $bCopyAsChild = _shiftBoolean(\@_);
1035 my $bMakeParents = _shiftBoolean(\@_);
1036 my $hRevProps = _shiftHash(\@_);
1037 my $crCommit = _shiftVisitor(\@_);
1038 my $oPool = $self->_shiftPool(\@_);
1039  
1040 return SVN::_Client::svn_client_copy6
1041 ($aTargets, $xPeg, $sTo, $bCopyAsChild, $bMakeParents
1042 , $hRevProps, $crCommit, $self->{ctx}, $oPool);
1043 }
1044  
1045 *copy = *copy1_1;
1046  
1047 #----------------------------------------------------------------
1048 # delete after add - only allowed with force=true
1049 # delete after mod - only allowed with force=true
1050 # delete, then add - fails, won't restore
1051 # delete, then update - fails, won't restore
1052 # delete, then copy from repository to current
1053 # - only way to restore failed delete, marked as replacement
1054  
1055 sub delete1_1 {
1056 my $self = shift @_;
1057 my $xTargets = _shiftTargets(\@_);
1058 local $LOG_MESSAGE = _shiftString(\@_);
1059 my $bForce = _shiftBoolean(\@_);
1060 my $oPool = $self->_shiftPool(\@_);
1061  
1062 return SVN::_Client::svn_client_delete
1063 ($xTargets, $bForce, $self->{ctx}, $oPool);
1064 }
1065  
1066 sub delete1_4 {
1067 my $self = shift @_;
1068 my $xTargets = _shiftTargets(\@_);
1069 local $LOG_MESSAGE = _shiftString(\@_);
1070 my $bForce = _shiftBoolean(\@_);
1071 my $oPool = $self->_shiftPool(\@_);
1072  
1073 return SVN::_Client::svn_client_delete2
1074 ($xTargets, $bForce, $self->{ctx}, $oPool);
1075 }
1076  
1077 sub delete1_5 {
1078 my $self = shift @_;
1079 my $xTargets = _shiftTargets(\@_);
1080 local $LOG_MESSAGE = _shiftString(\@_);
1081 my $bForce = _shiftBoolean(\@_);
1082 my $bKeepLocal = _shiftBoolean(\@_);
1083 my $hRevProps = _shiftHash(\@_);
1084 my $oPool = $self->_shiftPool(\@_);
1085  
1086 return SVN::_Client::svn_client_delete3
1087 ($xTargets, $bForce, $bKeepLocal, $hRevProps, $self->{ctx}
1088 , $oPool);
1089 }
1090  
1091 *delete1_6 = *delete1_5;
1092  
1093 sub delete1_7 {
1094 my $self = shift @_;
1095 my $xTargets = _shiftTargets(\@_);
1096 local $LOG_MESSAGE = _shiftString(\@_);
1097 my $bForce = _shiftBoolean(\@_);
1098 my $bKeepLocal = _shiftBoolean(\@_);
1099 my $hRevProps = _shiftHash(\@_);
1100 my $crCommit = _shiftVisitor(\@_);
1101 my $oPool = $self->_shiftPool(\@_);
1102  
1103 return SVN::_Client::svn_client_delete4
1104 ($xTargets, $bForce, $bKeepLocal, $hRevProps, $crCommit
1105 , $self->{ctx}, $oPool);
1106 }
1107  
1108 *delete = *delete1_1;
1109  
1110 #----------------------------------------------------------------
1111  
1112 sub diff1_1 {
1113 my $self = shift @_;
1114 my $aCmdLineOptions = _shiftArray(\@_);
1115 my ($xTarget1, $xPeg1
1116 , $xTarget2, $xPeg2) = _shiftDiffTargets(\@_);
1117 my $bRecurse = _shiftRecurse(\@_);
1118 my $bIgnoreAncestry = _shiftBoolean(\@_);
1119 my $bIgnoreDeleted = _shiftBoolean(\@_);
1120 my $xOutFile = _shiftOutFile(\@_);
1121 my $xErrFile = _shiftErrFile(\@_);
1122 my $oPool = $self->_shiftPool(\@_);
1123  
1124 return SVN::_Client::svn_client_diff
1125 ($aCmdLineOptions, $xTarget1, $xPeg1, $xTarget2, $xPeg2
1126 , $bRecurse, $bIgnoreAncestry, $bIgnoreDeleted
1127 , $xOutFile, $xErrFile, $self->{ctx}, $oPool);
1128 }
1129  
1130 sub diff1_4 {
1131 my $self = shift @_;
1132 my $aCmdLineOptions = _shiftArray(\@_);
1133 my ($xTarget1, $xPeg1
1134 , $xTarget2, $xPeg2) = _shiftDiffTargets(\@_);
1135 my $bRecurse = _shiftRecurse(\@_);
1136 my $bIgnoreAncestry = _shiftBoolean(\@_);
1137 my $bIgnoreDeleted = _shiftBoolean(\@_);
1138 my $bDiffBinary = _shiftBoolean(\@_);
1139 my $sHeaderEncoding = _shiftOutputEncoding(\@_);
1140 my $xOutFile = _shiftOutFile(\@_);
1141 my $xErrFile = _shiftErrFile(\@_);
1142 my $oPool = $self->_shiftPool(\@_);
1143  
1144 return SVN::_Client::svn_client_diff3
1145 ($aCmdLineOptions, $xTarget1, $xPeg1, $xTarget2, $xPeg2
1146 , $bRecurse, $bIgnoreAncestry, $bIgnoreDeleted
1147 , $bDiffBinary, $sHeaderEncoding
1148 , $xOutFile, $xErrFile, $self->{ctx}, $oPool);
1149 }
1150  
1151 sub diff1_5 {
1152 my $self = shift @_;
1153 my $aCmdLineOptions = _shiftArray(\@_);
1154 my ($xTarget1, $xPeg1
1155 , $xTarget2, $xPeg2) = _shiftDiffTargets(\@_);
1156 my $bRelativeToDir = _shiftBoolean(\@_);
1157 my $iDepth = _shiftDepth(\@_);
1158 my $bIgnoreAncestry = _shiftBoolean(\@_);
1159 my $bIgnoreDeleted = _shiftBoolean(\@_);
1160 my $bDiffBinary = _shiftBoolean(\@_);
1161 my $sHeaderEncoding = _shiftOutputEncoding(\@_);
1162 my $xOutFile = _shiftOutFile(\@_);
1163 my $xErrFile = _shiftErrFile(\@_);
1164 my $aChangeLists = _shiftArray(\@_);
1165 my $oPool = $self->_shiftPool(\@_);
1166  
1167  
1168 return SVN::_Client::svn_client_diff4
1169 ($aCmdLineOptions, $xTarget1, $xPeg1, $xTarget2, $xPeg2
1170 , $bRelativeToDir, $iDepth, $bIgnoreAncestry, $bIgnoreDeleted
1171 , $bDiffBinary, $sHeaderEncoding, $xOutFile, $xErrFile
1172 , $aChangeLists, $self->{ctx}, $oPool);
1173 }
1174  
1175 *diff1_6 = *diff1_5;
1176  
1177 sub diff1_7 {
1178 my $self = shift @_;
1179 my $aCmdLineOptions = _shiftArray(\@_);
1180 my ($xTarget1, $xPeg1
1181 , $xTarget2, $xPeg2) = _shiftDiffTargets(\@_);
1182 my $bRelativeToDir = _shiftBoolean(\@_);
1183 my $iDepth = _shiftDepth(\@_);
1184 my $bIgnoreAncestry = _shiftBoolean(\@_);
1185 my $bIgnoreDeleted = _shiftBoolean(\@_);
1186 my $bShowCopiesAsAdds = _shiftBoolean(\@_);
1187 my $bDiffBinary = _shiftBoolean(\@_);
1188 my $bUseGitDiffFormat = _shiftBoolean(\@_);
1189 my $sHeaderEncoding = _shiftOutputEncoding(\@_);
1190 my $xOutFile = _shiftOutFile(\@_);
1191 my $xErrFile = _shiftErrFile(\@_);
1192 my $aChangeLists = _shiftArray(\@_);
1193 my $oPool = $self->_shiftPool(\@_);
1194  
1195  
1196 return SVN::_Client::svn_client_diff5
1197 ($aCmdLineOptions, $xTarget1, $xPeg1, $xTarget2, $xPeg2
1198 , $bRelativeToDir, $iDepth, $bIgnoreAncestry, $bIgnoreDeleted
1199 , $bShowCopiesAsAdds, $bDiffBinary, $bUseGitDiffFormat
1200 , $sHeaderEncoding, $xOutFile, $xErrFile
1201 , $aChangeLists, $self->{ctx}, $oPool);
1202 }
1203  
1204 sub diff {
1205 my $self = shift @_;
1206 my ($xTarget1, $xPeg1
1207 , $xTarget2, $xPeg2) = _shiftDiffTargets(\@_);
1208 my $bRecurse = _shiftRecurse(\@_);
1209 my $aCmdLineOptions = _shiftArray(\@_);
1210 my $bIgnoreAncestry = _shiftBoolean(\@_);
1211 my $bIgnoreDeleted = _shiftBoolean(\@_);
1212 my $xOutFile = _shiftOutFile(\@_);
1213 my $xErrFile = _shiftErrFile(\@_);
1214 my $oPool = $self->_shiftPool(\@_);
1215  
1216 return SVN::_Client::svn_client_diff
1217 ($aCmdLineOptions, $xTarget1, $xPeg1, $xTarget2, $xPeg2
1218 , $bRecurse, $bIgnoreAncestry, $bIgnoreDeleted
1219 , $xOutFile, $xErrFile, $self->{ctx}, $oPool);
1220 }
1221  
1222 #----------------------------------------------------------------
1223  
1224 sub export1_1 {
1225 my $self = shift @_;
1226 my $xTarget = _shiftTarget(\@_);
1227 my $xToPath = _shiftWcPath(\@_);
1228 my $xPeg = _shiftPeg(\@_, 1);
1229 my $bOverwrite = _shiftBoolean(\@_);
1230 my $sNativeEol = _shiftOutputEol(\@_);
1231 my $oPool = $self->_shiftPool(\@_);
1232  
1233 return SVN::_Client::svn_client_export2
1234 ($xTarget, $xToPath, $xPeg, $bOverwrite, $sNativeEol
1235 , $self->{ctx}, $oPool);
1236 }
1237  
1238 sub export1_4 {
1239 my $self = shift @_;
1240 my $xTarget = _shiftTarget(\@_);
1241 my $xToPath = _shiftWcPath(\@_);
1242 my ($xPeg, $xRev) = _shiftPegRev(\@_, 1);
1243 my $bOverwrite = _shiftBoolean(\@_);
1244 my $bSkipExternals = _shiftBoolean(\@_);
1245 my $bRecurse = _shiftRecurse(\@_);
1246 my $sNativeEol = _shiftOutputEol(\@_);
1247 my $oPool = $self->_shiftPool(\@_);
1248  
1249 return SVN::_Client::svn_client_export3
1250 ($xTarget, $xToPath, $xPeg, $xRev, $bOverwrite, $bSkipExternals
1251 , $bRecurse, $sNativeEol, $self->{ctx}, $oPool);
1252 }
1253  
1254  
1255 sub export1_5 {
1256 my $self = shift @_;
1257 my $xTarget = _shiftTarget(\@_);
1258 my $xToPath = _shiftWcPath(\@_);
1259 my ($xPeg, $xRev) = _shiftPegRev(\@_, 1);
1260 my $bOverwrite = _shiftBoolean(\@_);
1261 my $bSkipExternals = _shiftBoolean(\@_);
1262 my $iDepth = _shiftDepth(\@_);
1263 my $sNativeEol = _shiftOutputEol(\@_);
1264 my $oPool = $self->_shiftPool(\@_);
1265  
1266 return SVN::_Client::svn_client_export4
1267 ($xTarget, $xToPath, $xPeg, $xRev, $bOverwrite, $bSkipExternals
1268 , $iDepth, $sNativeEol, $self->{ctx}, $oPool);
1269 }
1270  
1271 *export1_6=*export1_5;
1272  
1273 sub export1_7 {
1274 my $self = shift @_;
1275 my $xTarget = _shiftTarget(\@_);
1276 my $xToPath = _shiftWcPath(\@_);
1277 my ($xPeg, $xRev) = _shiftPegRev(\@_, 1);
1278 my $bOverwrite = _shiftBoolean(\@_);
1279 my $bSkipExternals = _shiftBoolean(\@_);
1280 my $bIgnoreKeywords = _shiftBoolean(\@_);
1281 my $iDepth = _shiftDepth(\@_);
1282 my $sNativeEol = _shiftOutputEol(\@_);
1283 my $oPool = $self->_shiftPool(\@_);
1284  
1285 return SVN::_Client::svn_client_export5
1286 ($xTarget, $xToPath, $xPeg, $xRev, $bOverwrite, $bSkipExternals
1287 , $bIgnoreKeywords, $iDepth, $sNativeEol, $self->{ctx}, $oPool);
1288 }
1289  
1290 sub export {
1291 my $self = shift @_;
1292 my $xTarget = _shiftTarget(\@_);
1293 my $xPeg = _shiftPeg(\@_, 1);
1294 my $xToPath = _shiftWcPath(\@_);
1295 my $bOverwrite = _shiftBoolean(\@_);
1296 my $sNativeEol = _shiftOutputEol(\@_);
1297 my $oPool = $self->_shiftPool(\@_);
1298  
1299 return SVN::_Client::svn_client_export2
1300 ($xTarget, $xToPath, $xPeg, $bOverwrite, $sNativeEol
1301 , $self->{ctx}, $oPool);
1302 }
1303 #---------------------------------------------------------------------
1304  
1305 sub getAuthentication {
1306 my $self = $_[0];
1307 return ($self->{ctx}->auth_baton(), $self->{auth_callbacks});
1308 }
1309 #---------------------------------------------------------------------
1310  
1311 sub getCancellationCallback {
1312 my $crCancel = $_[0]->{cancel};
1313 return defined($crCancel) ? $$crCancel : undef;
1314 }
1315  
1316 #---------------------------------------------------------------------
1317  
1318 sub getConfig { return $CONFIG_CLASS->new($_[0]->{ctx}->config()); }
1319  
1320 #---------------------------------------------------------------------
1321  
1322 sub getInfo {
1323 my ($self, $sWc, $xPeg, $oPool) = @_;
1324 my $oInfo;
1325 my $crVisit = sub { $oInfo=$_[1] };
1326 $self->info($sWc, $xPeg, $crVisit, 0, $oPool);
1327 return $oInfo;
1328 }
1329  
1330 #---------------------------------------------------------------------
1331  
1332 sub getLogMessageCallback {
1333 return $_[0]->{log_msg};
1334 }
1335  
1336 #---------------------------------------------------------------------
1337  
1338 sub getNotificationCallback {
1339 my $crNotify = $_[0]->{notify};
1340 return defined($crNotify) ? $$crNotify : undef;
1341 }
1342  
1343 #----------------------------------------------------------------
1344  
1345 sub getPathList {
1346 my ($self, $xPath, $xPeg, $bRecurse, $oPool) = @_;
1347 my $hEntries = $self->ls1_1($xPath, $xPeg, $bRecurse, $oPool);
1348 return defined($hEntries) ? [ keys %$hEntries ] : [];
1349 }
1350  
1351 #----------------------------------------------------------------
1352  
1353 sub getPathProperty {
1354 my ($self, $sPath, $sProp, $xPeg) = @_;
1355 my $hProp = $self->propget($sPath, $sProp, $xPeg, 0);
1356 return (values %$hProp)[0];
1357 }
1358  
1359 #----------------------------------------------------------------
1360  
1361 sub getPathProperties {
1362 my ($self, $sPath, $xPeg) = @_;
1363  
1364 my $aNodes = $self->proplist($sPath, $xPeg, 0);
1365 my $oNode = defined($aNodes) && exists($aNodes->[0])
1366 ? $aNodes->[0] : undef;
1367 return defined($oNode) ? $oNode->prop_hash() : {};
1368 }
1369  
1370 #---------------------------------------------------------------------
1371  
1372 sub getPool { $_[0]->{pool} }
1373  
1374 #----------------------------------------------------------------
1375  
1376 sub getRepositoryRootURL {
1377 my ($self, $sWc, $oPool) = @_;
1378 my $sRoot;
1379 my $crVisit = sub { $sRoot = $_[1]->repos_root_URL() };
1380 $self->info($sWc, $crVisit, 0, $oPool);
1381 return $sRoot;
1382 }
1383  
1384 #----------------------------------------------------------------
1385 # returns the equivalent path in the repository
1386  
1387 sub getRepositoryURL {
1388 my ($self, $sWc, $oPool) = @_;
1389  
1390 $oPool = $self->{pool} unless defined($oPool);
1391 return SVN::_Client::svn_client_url_from_path($sWc, $oPool);
1392 }
1393  
1394 #----------------------------------------------------------------
1395  
1396 sub getRepositoryUUID {
1397 my ($self, $sWc, $oPool) = @_;
1398  
1399 $oPool = $self->{pool} unless defined($oPool);
1400  
1401 #try first to get this information locally
1402 #on older versions it may not be available
1403 my $oAdminBaton = SVN::_Wc::svn_wc_adm_probe_open3
1404 (undef, $sWc, 0, 0, undef, undef, $oPool);
1405 if ($oAdminBaton) {
1406 return SVN::_Client::svn_client_uuid_from_path
1407 ($sWc, $oAdminBaton, $self->{ctx}, $oPool);
1408 }
1409  
1410 my $xRepos
1411 = SVN::_Client::svn_client_url_from_path($sWc, $oPool);
1412 return SVN::_Client::svn_client_uuid_from_url
1413 ($xRepos, $self->{ctx}, $oPool);
1414 }
1415  
1416 #----------------------------------------------------------------
1417  
1418 sub getRevisionProperty {
1419 my ($self, $xRepos, $sProp, $xPeg) = @_;
1420 my @aGot = $self->revprop_get($xRepos, $sProp, $xPeg);
1421 return exists($aGot[0]) ? $aGot[0] : undef;
1422 }
1423  
1424 #----------------------------------------------------------------
1425  
1426 sub getRevisionProperties {
1427 my ($self, $xRepos, $xPeg, $sProp) = @_;
1428 my @aGot = $self->revprop_list($xRepos, $xPeg);
1429 return exists($aGot[0])? $aGot[0] : {};
1430 }
1431  
1432 #----------------------------------------------------------------
1433  
1434 sub getStatus {
1435 my ($self, $sWc, $oPool) = @_;
1436 $oPool = $self->{pool} unless defined($oPool);
1437  
1438 my $iErr;
1439 local $SVN::Error::handler = makeErrorHandler
1440 (sub {
1441 $iErr = $_[0]->apr_err();
1442 if ($iErr eq $SVN::Error::WC_NOT_DIRECTORY) {
1443 return 1;
1444 }
1445 return 0;
1446 });
1447  
1448 my $oAdminBaton = SVN::_Wc::svn_wc_adm_probe_open3
1449 (undef, $sWc, 0, 0, undef, undef, $oPool);
1450 return $iErr
1451 ? undef : SVN::_Wc::svn_wc_status($sWc, $oAdminBaton, $oPool);
1452 }
1453  
1454 #----------------------------------------------------------------
1455  
1456 sub import1_1 {
1457 my $self = shift @_;
1458 my $sWc = _shiftWcPath(\@_);
1459 my $xRepos = _shiftTarget(\@_);
1460 local $LOG_MESSAGE = _shiftString(\@_);
1461 my $bNonRecursive = _shiftBoolean(\@_);
1462 my $oPool = $self->_shiftPool(\@_);
1463  
1464 return SVN::_Client::svn_client_import
1465 ($sWc, $xRepos, $bNonRecursive, $self->{ctx}, $oPool);
1466 }
1467  
1468  
1469 sub import1_4 {
1470 my $self = shift @_;
1471 my $sWc = _shiftWcPath(\@_);
1472 my $xRepos = _shiftTarget(\@_);
1473 local $LOG_MESSAGE = _shiftString(\@_);
1474 my $bNonRecursive = _shiftBoolean(\@_);
1475 my $bNoIgnore = _shiftBoolean(\@_);
1476 my $oPool = $self->_shiftPool(\@_);
1477  
1478 return SVN::_Client::svn_client_import2
1479 ($sWc, $xRepos, $bNonRecursive, $bNoIgnore, $self->{ctx}, $oPool);
1480 }
1481  
1482 sub import1_5 {
1483 my $self = shift @_;
1484 my $sWc = _shiftWcPath(\@_);
1485 my $xRepos = _shiftTarget(\@_);
1486 local $LOG_MESSAGE = _shiftString(\@_);
1487 my $iDepth = _shiftDepth(\@_);
1488 my $bNoIgnore = _shiftBoolean(\@_);
1489 my $bIgnoreUnknownNodeTypes = _shiftBoolean(\@_);
1490 my $hRevProps = _shiftHash(\@_);
1491 my $oPool = $self->_shiftPool(\@_);
1492  
1493 return SVN::_Client::svn_client_import3
1494 ($sWc, $xRepos, $iDepth, $bNoIgnore, $bIgnoreUnknownNodeTypes
1495 , $hRevProps, $self->{ctx}, $oPool);
1496 }
1497  
1498 *import1_6 = *import1_5;
1499  
1500  
1501 sub import1_7 {
1502 my $self = shift @_;
1503 my $sWc = _shiftWcPath(\@_);
1504 my $xRepos = _shiftTarget(\@_);
1505 local $LOG_MESSAGE = _shiftString(\@_);
1506 my $iDepth = _shiftDepth(\@_);
1507 my $bNoIgnore = _shiftBoolean(\@_);
1508 my $bIgnoreUnknownNodeTypes = _shiftBoolean(\@_);
1509 my $hRevProps = _shiftHash(\@_);
1510 my $crCommit = _shiftVisitor(@_);
1511 my $oPool = $self->_shiftPool(\@_);
1512  
1513 return SVN::_Client::svn_client_import4
1514 ($sWc, $xRepos, $iDepth, $bNoIgnore, $bIgnoreUnknownNodeTypes
1515 , $hRevProps, $crCommit, $self->{ctx}, $oPool);
1516 }
1517  
1518 sub import {
1519 my $self = shift @_;
1520 return unless ref($self); #play nicely when called by use...
1521  
1522 my $sWc = _shiftWcPath(\@_);
1523 my $xRepos = _shiftTarget(\@_);
1524 local $LOG_MESSAGE = _shiftString(\@_);
1525 my $bRecurse = _shiftRecurse(\@_);
1526 my $oPool = $self->_shiftPool(\@_);
1527  
1528 return SVN::_Client::svn_client_import
1529 ($sWc, $xRepos, $bRecurse?0:1, $self->{ctx}, $oPool);
1530 }
1531  
1532 #----------------------------------------------------------------
1533  
1534 sub info1_1 {
1535 my $self = shift @_;
1536 my $xTarget = _shiftTarget(\@_);
1537 my ($xPeg,$xTargetRev) = _shiftPegRev(\@_,1);
1538 my $crVisit = _shiftVisitor(\@_);
1539 my $bRecurse = _shiftRecurse(\@_);
1540 my $oPool = $self->_shiftPool(\@_);
1541  
1542 #omit the baton - despite it being included in the usage
1543 #statement, svn_client_log expects the $_[5] to be the context
1544 return SVN::_Client::svn_client_info
1545 ($xTarget, $xPeg, $xTargetRev, $crVisit, $bRecurse
1546 , $self->{ctx}, $oPool);
1547 }
1548  
1549 *info1_4=*info1_1;
1550  
1551 sub info1_5 {
1552 my $self = shift @_;
1553 my $xTarget = _shiftTarget(\@_);
1554 my ($xPeg,$xTargetRev) = _shiftPegRev(\@_,1);
1555 my $crVisit = _shiftVisitor(\@_);
1556 my $iDepth = _shiftDepth(\@_);
1557 my $aChangeLists = _shiftArray(\@_);
1558 my $oPool = $self->_shiftPool(\@_);
1559  
1560 #omit the baton - despite it being included in the usage
1561 #statement, svn_client_log expects the $_[5] to be the context
1562 return SVN::_Client::svn_client_info2
1563 ($xTarget, $xPeg, $xTargetRev, $crVisit, $iDepth, $aChangeLists
1564 , $self->{ctx}, $oPool);
1565 }
1566  
1567 *info1_6=*info1_5;
1568  
1569 sub info1_7 {
1570 my $self = shift @_;
1571 my $xTarget = _shiftTarget(\@_);
1572 my ($xPeg,$xTargetRev) = _shiftPegRev(\@_,1);
1573 my $crVisit = _shiftVisitor(\@_);
1574 my $iDepth = _shiftDepth(\@_);
1575 my $aChangeLists = _shiftArray(\@_);
1576 my $oPool = $self->_shiftPool(\@_);
1577  
1578 #omit the baton - despite it being included in the usage
1579 #statement, svn_client_log expects the $_[5] to be the context
1580 return SVN::_Client::svn_client_info3
1581 ($xTarget, $xPeg, $xTargetRev, $crVisit, $iDepth, $aChangeLists
1582 , $self->{ctx}, $oPool);
1583 }
1584  
1585 *info=*info1_1;
1586  
1587 #----------------------------------------------------------------
1588  
1589 sub isLocked {
1590 my ($self, $sWc, $xPeg, $oPool) = @_;
1591 return $self->getInfo($sWc, $xPeg, $oPool)->lock() ? 1 : 0;
1592 }
1593  
1594 #----------------------------------------------------------------
1595  
1596 sub lock1_1 {
1597 my $self = shift @_;
1598 my $xTargets = _shiftTargets(\@_);
1599 my $sComment = _shiftString(\@_);
1600 my $bStealLock = _shiftBoolean(\@_);
1601 my $oPool = $self->_shiftPool(\@_);
1602  
1603 return SVN::_Client::svn_client_lock
1604 ($xTargets, $sComment, $bStealLock, $self->{ctx}, $oPool);
1605 }
1606  
1607 *lock1_4 = *lock1_1;
1608 *lock1_5 = *lock1_1;
1609 *lock1_6 = *lock1_1;
1610 *lock1_7 = *lock1_1;
1611 *lock = *lock1_1;
1612  
1613 #----------------------------------------------------------------
1614  
1615 sub log1_1 {
1616 my $self = shift @_;
1617 my $xTargets = _shiftTargets(\@_);
1618 my ($xStart, $xEnd) = _shiftRange(\@_);
1619 my $bChangedPaths = _shiftBoolean(\@_);
1620 my $bStrictNodeHistory = _shiftBoolean(\@_);
1621 my $crVisit = _shiftVisitor(\@_);
1622 my $oPool = $self->_shiftPool(\@_);
1623  
1624 #omit the baton - despite it being included in the usage
1625 #statement, svn_client_log expects the $_[6] to be the context
1626 return SVN::_Client::svn_client_log
1627 ($xTargets, $xStart, $xEnd, $bChangedPaths
1628 , $bStrictNodeHistory, $crVisit, $self->{ctx}, $oPool);
1629 }
1630  
1631 sub log1_4 {
1632 my $self = shift @_;
1633 my $xTargets = _shiftTargets(\@_);
1634 my $xPeg = _shiftPeg(\@_);
1635 my ($xStart, $xEnd) = _shiftRange(\@_, $xPeg);
1636 my $iVisitLimit = _shiftInt(\@_);
1637 my $bChangedPaths = _shiftBoolean(\@_);
1638 my $bStrictNodeHistory = _shiftBoolean(\@_);
1639 my $crVisit = _shiftVisitor(\@_);
1640 my $oPool = $self->_shiftPool(\@_);
1641  
1642 #omit the baton - despite it being included in the usage
1643 #statement, svn_client_log expects the $_[8] to be the context
1644 return SVN::_Client::svn_client_log3
1645 ($xTargets, $xPeg, $xStart, $xEnd, $iVisitLimit
1646 , $bChangedPaths, $bStrictNodeHistory, $crVisit
1647 , $self->{ctx}, $oPool);
1648 }
1649  
1650 sub log1_5 {
1651 my $self = shift @_;
1652 my $xTargets = _shiftTargets(\@_);
1653 my $xPeg = _shiftPeg(\@_);
1654 my ($xStart, $xEnd) = _shiftRange(\@_, $xPeg);
1655 my $iVisitLimit = _shiftInt(\@_);
1656 my $bChangedPaths = _shiftBoolean(\@_);
1657 my $bStrictNodeHistory = _shiftBoolean(\@_);
1658 my $bIncludeMergedRevisions = _shiftBoolean(\@_);
1659 my $aRevProps = _shiftArray(\@_);
1660 my $crVisit = _shiftVisitor(\@_);
1661 my $oPool = $self->_shiftPool(\@_);
1662  
1663 #omit the baton - despite it being included in the usage
1664 #statement, svn_client_log expects the $_[8] to be the context
1665 return SVN::_Client::svn_client_log4
1666 ($xTargets, $xPeg, $xStart, $xEnd, $iVisitLimit
1667 , $bChangedPaths, $bStrictNodeHistory
1668 , $bIncludeMergedRevisions, $aRevProps, $crVisit
1669 , $self->{ctx}, $oPool);
1670 }
1671  
1672  
1673 sub log1_6 {
1674 my $self = shift @_;
1675 my $xTargets = _shiftTargets(\@_);
1676 my $xPeg = _shiftPeg(\@_);
1677 my $aRevRanges = _shiftArray(\@_);
1678 my $iVisitLimit = _shiftInt(\@_);
1679 my $bChangedPaths = _shiftBoolean(\@_);
1680 my $bStrictNodeHistory = _shiftBoolean(\@_);
1681 my $bIncludeMergedRevisions = _shiftBoolean(\@_);
1682 my $aRevProps = _shiftArray(\@_);
1683 my $crVisit = _shiftVisitor(\@_);
1684 my $oPool = $self->_shiftPool(\@_);
1685  
1686 #omit the baton - despite it being included in the usage
1687 #statement, svn_client_log expects the $_[8] to be the context
1688 return SVN::_Client::svn_client_log5
1689 ($xTargets, $xPeg, $aRevRanges, $iVisitLimit
1690 , $bChangedPaths, $bStrictNodeHistory
1691 , $bIncludeMergedRevisions, $aRevProps
1692 , $crVisit, $self->{ctx}, $oPool);
1693 }
1694  
1695 *log1_7 = *log1_6;
1696  
1697 sub log {
1698 my $self = shift @_;
1699 my $xTargets = _shiftTargets(\@_);
1700 my ($xStart, $xEnd) = _shiftRange(\@_);
1701 my $crVisit = _shiftVisitor(\@_);
1702 my $bChangedPaths = _shiftBoolean(\@_);
1703 my $bStrictNodeHistory = _shiftBoolean(\@_);
1704 my $oPool = $self->_shiftPool(\@_);
1705  
1706 #omit the baton - despite it being included in the usage
1707 #statement, svn_client_log expects the $_[6] to be the context
1708 return SVN::_Client::svn_client_log
1709 ($xTargets, $xStart, $xEnd, $bChangedPaths
1710 , $bStrictNodeHistory, $crVisit, $self->{ctx}, $oPool);
1711 }
1712  
1713 #----------------------------------------------------------------
1714  
1715 sub ls1_1 {
1716 my $self = shift @_;
1717 my $xTarget = _shiftTarget(\@_);
1718 my $xPeg = _shiftPeg(\@_);
1719 my $bRecurse = _shiftRecurse(\@_);
1720 my $oPool = $self->_shiftPool(\@_);
1721  
1722 SVN::_Client::svn_client_ls
1723 ($xTarget, $xPeg, $bRecurse, $self->{ctx}, $oPool);
1724 }
1725  
1726 sub list1_1 {
1727 my $self = shift @_;
1728 my $xTarget = _shiftTarget(\@_);
1729 my $xPeg = _shiftPeg(\@_);
1730 my $bRecurse = _shiftRecurse(\@_);
1731 my $crVisit = _shiftVisitor(\@_);
1732 my $oPool = $self->_shiftPool(\@_);
1733  
1734 # Note: there is no equivalent to list in the 1.1 API so fake it
1735  
1736 my $hList = SVN::_Client::svn_client_ls
1737 ($xTarget, $xPeg, $bRecurse, $self->{ctx}, $oPool);
1738 return unless ref($hList);
1739  
1740 while (my ($k,$v) = each (%$hList)) {
1741 my $sFullPath = File::Spec->rel2abs($k,$xTarget);
1742 $crVisit->($k, $v, $sFullPath, $oPool);
1743 }
1744 }
1745  
1746 sub list1_4 {
1747 my $self = shift @_;
1748 my $xTarget = _shiftTarget(\@_);
1749 my ($xPeg,$xRev) = _shiftPegRev(\@_);
1750 my $bRecurse = _shiftRecurse(\@_);
1751 my $iFields = _shiftListFieldMask(\@_);
1752 my $bFetchLocks = _shiftBoolean(\@_);
1753 my $crVisit = _shiftVisitor(\@_);
1754 my $oPool = $self->_shiftPool(\@_);
1755  
1756 # Note: the 2007 release complains about "TypeError in method
1757 # 'svn_client_list', argument 7 of type 'svn_client_list_func_t'
1758 # Is this an error in the SWIG bindings?
1759 # Adding a baton parameter doesn't help.
1760  
1761 return SVN::_Client::svn_client_list
1762 ($xTarget, $xPeg, $xRev, $bRecurse, $iFields
1763 , $bFetchLocks, $crVisit, $self->{ctx}, $oPool);
1764 }
1765  
1766 sub list1_5 {
1767 my $self = shift @_;
1768 my $xTarget = _shiftTarget(\@_);
1769 my ($xPeg,$xRev) = _shiftPegRev(\@_);
1770 my $iDepth = _shiftDepth(\@_);
1771 my $iFields = _shiftListFieldMask(\@_);
1772 my $bFetchLocks = _shiftBoolean(\@_);
1773 my $crVisit = _shiftVisitor(\@_);
1774 my $oPool = $self->_shiftPool(\@_);
1775  
1776 # Note: the 2007 release complains about "TypeError in method
1777 # 'svn_client_list', argument 7 of type 'svn_client_list_func_t'
1778 # Is this an error in the SWIG bindings?
1779 # Adding a baton parameter doesn't help.
1780  
1781 return SVN::_Client::svn_client_list2
1782 ($xTarget, $xPeg, $xRev, $iDepth, $iFields
1783 , $bFetchLocks, $crVisit, $self->{ctx}, $oPool);
1784 }
1785  
1786 *list1_6 = *list1_5;
1787 *list1_7 = *list1_5;
1788  
1789 sub list {
1790 my ($self, $xTarget, $xPeg, $crVisit, $bRecurse) = @_;
1791 return $self->list1_1($xTarget, $xPeg, $bRecurse, $crVisit);
1792 }
1793  
1794 #----------------------------------------------------------------
1795  
1796 sub merge1_1 {
1797 my $self = shift @_;
1798 my ($xTarget1, $xPeg1
1799 , $xTarget2, $xPeg2) = _shiftDiffTargets(\@_, 1);
1800 my $sWc = _shiftWcPath(\@_);
1801 my $bRecurse = _shiftRecurse(\@_);
1802 my $bIgnoreAncestry = _shiftBoolean(\@_);
1803 my $bForce = _shiftBoolean(\@_);
1804 my $bDryRun = _shiftBoolean(\@_);
1805 my $oPool = $self->_shiftPool(\@_);
1806  
1807 #print STDERR "t1=<", $xTarget1, "> peg=<$xPeg1> status="
1808 # , $self->getStatusAsString($self->getStatus($xTarget1)->text_status())
1809 # , "\n";
1810 #print STDERR "t2=<", $xTarget2, "> peg=<$xPeg2> status="
1811 # , $self->getStatusAsString($self->getStatus($xTarget2)->text_status())
1812 # , "\n";
1813 #print STDERR "wc=<", $sWc, "> status="
1814 # , $self->getStatusAsString($self->getStatus($sWc)->text_status())
1815 # , "\n";
1816  
1817 return SVN::_Client::svn_client_merge
1818 ($xTarget1, $xPeg1, $xTarget2, $xPeg2, $sWc
1819 , $bRecurse, $bIgnoreAncestry, $bForce, $bDryRun
1820 , $self->{ctx}, $oPool);
1821 }
1822  
1823 sub merge1_4 {
1824 my $self = shift @_;
1825 my ($xTarget1, $xPeg1
1826 , $xTarget2, $xPeg2) = _shiftDiffTargets(\@_,1);
1827 my $sWc = _shiftWcPath(\@_);
1828 my $bRecurse = _shiftRecurse(\@_);
1829 my $bIgnoreAncestry = _shiftBoolean(\@_);
1830 my $bForce = _shiftBoolean(\@_);
1831 my $bDryRun = _shiftBoolean(\@_);
1832 my $aMergeOptions = _shiftArray(\@_);
1833 my $oPool = $self->_shiftPool(\@_);
1834  
1835 # 1.4.6 release complains about illegal parameter if
1836 # an array is passed in. We can work around this by
1837 # passing undef in place of an empty array, but other
1838 # parameters will fail.
1839  
1840 $aMergeOptions=undef if ! scalar(@$aMergeOptions);
1841  
1842 return SVN::_Client::svn_client_merge2
1843 ($xTarget1, $xPeg1, $xTarget2, $xPeg2, $sWc
1844 , $bRecurse, $bIgnoreAncestry, $bForce, $bDryRun
1845 , $aMergeOptions, $self->{ctx}, $oPool);
1846 }
1847  
1848  
1849 sub merge1_5 {
1850 my $self = shift @_;
1851 my ($xTarget1, $xPeg1
1852 , $xTarget2, $xPeg2) = _shiftDiffTargets(\@_,1);
1853 my $sWc = _shiftWcPath(\@_);
1854 my $iDepth = _shiftDepth(\@_);
1855 my $bIgnoreAncestry = _shiftBoolean(\@_);
1856 my $bForce = _shiftBoolean(\@_);
1857 my $bRecordOnly = _shiftBoolean(\@_);
1858 my $bDryRun = _shiftBoolean(\@_);
1859 my $aMergeOptions = _shiftArray(\@_);
1860 my $oPool = $self->_shiftPool(\@_);
1861  
1862 return SVN::_Client::svn_client_merge3
1863 ($xTarget1, $xPeg1, $xTarget2, $xPeg2, $sWc
1864 , $iDepth, $bIgnoreAncestry, $bForce, $bRecordOnly, $bDryRun
1865 , $aMergeOptions, $self->{ctx}, $oPool);
1866 }
1867  
1868 *merge1_6 = *merge1_5;
1869  
1870 sub merge1_7 {
1871 my $self = shift @_;
1872 my ($xTarget1, $xPeg1
1873 , $xTarget2, $xPeg2) = _shiftDiffTargets(\@_,1);
1874 my $sWc = _shiftWcPath(\@_);
1875 my $iDepth = _shiftDepth(\@_);
1876 my $bIgnoreAncestry = _shiftBoolean(\@_);
1877 my $bForce = _shiftBoolean(\@_);
1878 my $bRecordOnly = _shiftBoolean(\@_);
1879 my $bDryRun = _shiftBoolean(\@_);
1880 my $bAllowMixedRev = _shiftBoolean(\@_);
1881 my $aMergeOptions = _shiftArray(\@_);
1882 my $oPool = $self->_shiftPool(\@_);
1883  
1884 return SVN::_Client::svn_client_merge3
1885 ($xTarget1, $xPeg1, $xTarget2, $xPeg2, $sWc
1886 , $iDepth, $bIgnoreAncestry, $bForce, $bRecordOnly, $bDryRun
1887 , $bAllowMixedRev, $aMergeOptions, $self->{ctx}, $oPool);
1888 }
1889  
1890 *merge = *merge1_1;
1891  
1892 #----------------------------------------------------------------
1893  
1894 sub mkdir1_1 {
1895 my $self = shift @_;
1896 my $xTargets = _shiftTargets(\@_);
1897 local $LOG_MESSAGE = _shiftString(\@_);
1898 my $oPool = $self->_shiftPool(\@_);
1899  
1900 return SVN::_Client::svn_client_mkdir
1901 ($xTargets, $self->{ctx}, $oPool);
1902 }
1903  
1904 sub mkdir1_4 {
1905 my $self = shift @_;
1906 my $xTargets = _shiftTargets(\@_);
1907 local $LOG_MESSAGE = _shiftString(\@_);
1908 my $oPool = $self->_shiftPool(\@_);
1909  
1910 return SVN::_Client::svn_client_mkdir2
1911 ($xTargets, $self->{ctx}, $oPool);
1912 }
1913  
1914 sub mkdir1_5 {
1915 my $self = shift @_;
1916 my $xTargets = _shiftTargets(\@_);
1917 local $LOG_MESSAGE = _shiftString(\@_);
1918 my $bMakeParents = _shiftBoolean(\@_);
1919 my $hRevProps = _shiftHash(\@_);
1920 my $oPool = $self->_shiftPool(\@_);
1921  
1922 return SVN::_Client::svn_client_mkdir3
1923 ($xTargets, $bMakeParents, $hRevProps, $self->{ctx}, $oPool);
1924 }
1925  
1926 *mkdir1_6 = *mkdir1_5;
1927  
1928 sub mkdir1_7 {
1929 my $self = shift @_;
1930 my $xTargets = _shiftTargets(\@_);
1931 local $LOG_MESSAGE = _shiftString(\@_);
1932 my $bMakeParents = _shiftBoolean(\@_);
1933 my $hRevProps = _shiftHash(\@_);
1934 my $crCommit = _shiftVisitor(\@_);
1935 my $oPool = $self->_shiftPool(\@_);
1936  
1937 return SVN::_Client::svn_client_mkdir4
1938 ($xTargets, $bMakeParents, $hRevProps, $crCommit, $self->{ctx}
1939 , $oPool);
1940 }
1941  
1942 *mkdir=*mkdir1_1;
1943  
1944 #----------------------------------------------------------------
1945 # mod then move - requires force flag in 1.4 but not 1.5
1946 # -see http://svn.haxx.se/users/archive-2008-07/0893.shtml
1947  
1948 sub move1_1 {
1949 #note: the $xPeg parameter is ignored according to the SVN C/C++
1950 #API documentation
1951  
1952 my $self = shift @_;
1953 my $xTarget = _shiftTarget(\@_);
1954 my $xPeg = shift @_;
1955 my $xTo = _shiftTarget(\@_);
1956 my $bForce = _shiftBoolean(\@_);
1957 my $oPool = $self->_shiftPool(\@_);
1958  
1959 return SVN::_Client::svn_client_move
1960 ($xTarget, $xPeg, $xTo, $bForce, $self->{ctx}, $oPool);
1961 }
1962  
1963 sub move1_4 {
1964 my $self = shift @_;
1965 my $xTarget = _shiftTarget(\@_);
1966 my $sTo = _shiftTarget(\@_);
1967 my $bForce = _shiftBoolean(\@_);
1968 my $oPool = $self->_shiftPool(\@_);
1969  
1970 return SVN::_Client::svn_client_move4
1971 ($xTarget, $sTo, $bForce, $self->{ctx}, $oPool);
1972 }
1973  
1974 sub move1_5 {
1975 my $self = shift @_;
1976 my $aTargets = _shiftTargets(\@_);
1977 my $sTo = _shiftTarget(\@_);
1978 my $bForce = _shiftBoolean(\@_);
1979 my $bMoveAsChild = _shiftBoolean(\@_);
1980 my $bMakeParents = _shiftBoolean(\@_);
1981 my $hRevProps = _shiftHash(\@_);
1982 my $oPool = $self->_shiftPool(\@_);
1983  
1984 return SVN::_Client::svn_client_move5
1985 ($aTargets, $sTo, $bForce, $bMoveAsChild, $bMakeParents,
1986 $hRevProps, $self->{ctx}, $oPool);
1987 }
1988  
1989 *move1_6 = *move1_5;
1990  
1991 sub move1_7 {
1992 my $self = shift @_;
1993 my $aTargets = _shiftTargets(\@_);
1994 my $sTo = _shiftTarget(\@_);
1995 my $bMoveAsChild = _shiftBoolean(\@_);
1996 my $bMakeParents = _shiftBoolean(\@_);
1997 my $hRevProps = _shiftHash(\@_);
1998 my $crCommit = _shiftVisitor(\@_);
1999 my $oPool = $self->_shiftPool(\@_);
2000  
2001 return SVN::_Client::svn_client_move6
2002 ($aTargets, $sTo, $bMoveAsChild, $bMakeParents,
2003 $hRevProps, $crCommit, $self->{ctx}, $oPool);
2004 }
2005  
2006 sub move {
2007 my $self = shift @_;
2008 my $sFrom = _shiftTarget(\@_);
2009 my $sTo = _shiftTarget(\@_);
2010 my $bForce = _shiftBoolean(\@_);
2011 my $oPool = $self->_shiftPool(\@_);
2012  
2013 #note: the $xPeg parameter is ignored according to the SVN C/C++
2014 #API documentation
2015  
2016 return SVN::_Client::svn_client_move
2017 ($sFrom, undef, $sTo, $bForce, $self->{ctx}, $oPool);
2018 }
2019  
2020 #----------------------------------------------------------------
2021  
2022 sub propdel1_1 {
2023 my $self = shift @_;
2024 my $sProp = shift @_;
2025 my $xTarget = _shiftTarget(\@_);
2026 my $bRecurse = _shiftRecurse(\@_);
2027 my $oPool = $self->_shiftPool(\@_);
2028  
2029 return SVN::_Client::svn_client_propset
2030 ($sProp, undef, $xTarget, $bRecurse, $oPool);
2031 }
2032  
2033 sub propdel1_4 {
2034 my $self = shift @_;
2035 my $sProp = shift @_;
2036 my $xTarget = _shiftTarget(\@_);
2037 my $bRecurse = _shiftRecurse(\@_);
2038 my $bSkipChecks = _shiftBoolean(\@_);
2039 my $oPool = $self->_shiftPool(\@_);
2040  
2041 return SVN::_Client::svn_client_propset2
2042 ($sProp, undef, $xTarget, $bRecurse, $bSkipChecks
2043 , $self->{ctx}, $oPool);
2044 }
2045  
2046 sub propde1_5 {
2047 my $self = shift @_;
2048 my $sProp = shift @_;
2049 my $xTarget = _shiftTarget(\@_);
2050 my $iDepth = _shiftDepth(\@_);
2051 my $bSkipChecks = _shiftBoolean(\@_);
2052 my $xBaseRev = _shiftPeg(\@_,1);
2053 my $aChangeLists = _shiftArray(\@_);
2054 my $hRevProps = _shiftHash(\@_);
2055 my $oPool = $self->_shiftPool(\@_);
2056  
2057 return SVN::_Client::svn_client_propset3
2058 ($sProp, undef, $xTarget, $iDepth, $bSkipChecks, $xBaseRev
2059 , $aChangeLists, $hRevProps, $self->{ctx}, $oPool);
2060 }
2061  
2062 *propdel1_6 = *propdel1_1;
2063  
2064 sub propdel1_7 {
2065 my $self = shift @_;
2066 my $sProp = shift @_;
2067 my $xTarget = _shiftTarget(\@_);
2068 my $iDepth = _shiftDepth(\@_);
2069 my $bSkipChecks = _shiftBoolean(\@_);
2070 my $xBaseRev = _shiftPeg(\@_,1);
2071 my $aChangeLists = _shiftArray(\@_);
2072 my $hRevProps = _shiftHash(\@_);
2073 my $crCommit = _shiftVisitor(\@_);
2074 my $oPool = $self->_shiftPool(\@_);
2075  
2076 return SVN::_Client::svn_client_propset3
2077 ($sProp, undef, $xTarget, $iDepth, $bSkipChecks, $xBaseRev
2078 , $aChangeLists, $hRevProps, $crCommit, $self->{ctx}, $oPool);
2079 }
2080  
2081 sub propdel {
2082 my $self = shift @_;
2083 my $xTarget = _shiftTarget(\@_);
2084 my $sProp = shift @_;
2085 my $bRecurse = _shiftRecurse(\@_);
2086 my $oPool = $self->_shiftPool(\@_);
2087  
2088 return SVN::_Client::svn_client_propset
2089 ($sProp, undef, $xTarget, $bRecurse, $oPool);
2090 }
2091  
2092 #----------------------------------------------------------------
2093  
2094 sub propget1_1 {
2095 my $self = shift @_;
2096 my $sProp = shift @_;
2097 my $xTarget = _shiftTarget(\@_);
2098 my $xPeg = _shiftPeg(\@_, 1);
2099 my $bRecurse = _shiftRecurse(\@_);
2100 my $oPool = $self->_shiftPool(\@_);
2101  
2102 return SVN::_Client::svn_client_propget
2103 ($sProp, $xTarget, $xPeg, $bRecurse, $self->{ctx}, $oPool);
2104 }
2105  
2106 sub propget1_4 {
2107 my $self = shift @_;
2108 my $sProp = shift @_;
2109 my $xTarget = _shiftTarget(\@_);
2110 my ($xPeg,$xRev) = _shiftPegRev(\@_, 1);
2111 my $bRecurse = _shiftRecurse(\@_);
2112 my $oPool = $self->_shiftPool(\@_);
2113  
2114 return SVN::_Client::svn_client_propget2
2115 ($sProp, $xTarget, $xPeg, $xRev, $bRecurse
2116 , $self->{ctx}, $oPool);
2117 }
2118  
2119 sub propget1_5 {
2120 my $self = shift @_;
2121 my $sProp = shift @_;
2122 my $xTarget = _shiftTarget(\@_);
2123 my ($xPeg,$xRev) = _shiftPegRev(\@_, 1);
2124 my $iDepth = _shiftDepth(\@_);
2125 my $aChangeLists = _shiftArray(\@_);
2126 my $oPool = $self->_shiftPool(\@_);
2127  
2128 return SVN::_Client::svn_client_propget2
2129 ($sProp, $xTarget, $xPeg, $xRev, $iDepth, $aChangeLists
2130 , $self->{ctx}, $oPool);
2131 }
2132  
2133 *propget1_6 = *propget1_5;
2134 *propget1_7 = *propget1_5;
2135  
2136 sub propget {
2137 my $self = shift @_;
2138 my $xTarget = _shiftTarget(\@_);
2139 my $sProp = shift @_;
2140 my $xPeg = _shiftPeg(\@_, 1);
2141 my $bRecurse = _shiftRecurse(\@_);
2142 my $oPool = $self->_shiftPool(\@_);
2143  
2144 return SVN::_Client::svn_client_propget
2145 ($sProp, $xTarget, $xPeg, $bRecurse, $self->{ctx}, $oPool);
2146 }
2147  
2148 #----------------------------------------------------------------
2149  
2150 sub proplist1_1 {
2151 my $self = shift @_;
2152 my $xTarget = _shiftTarget(\@_);
2153 my $xPeg = _shiftPeg(\@_, 1);
2154 my $bRecurse = _shiftRecurse(\@_);
2155 my $oPool = $self->_shiftPool(\@_);
2156  
2157 return SVN::_Client::svn_client_proplist
2158 ($xTarget, $xPeg, $bRecurse, $self->{ctx}, $oPool);
2159 }
2160  
2161 sub proplist1_4 {
2162 my $self = shift @_;
2163 my $xTarget = _shiftTarget(\@_);
2164 my ($xPeg,$xRev) = _shiftPegRev(\@_, 1);
2165 my $bRecurse = _shiftRecurse(\@_);
2166 my $oPool = $self->_shiftPool(\@_);
2167  
2168 return SVN::_Client::svn_client_proplist2
2169 ($xTarget, $xPeg, $xRev, $bRecurse, $self->{ctx}, $oPool);
2170 }
2171  
2172 sub proplist1_5 {
2173 my $self = shift @_;
2174 my $xTarget = _shiftTarget(\@_);
2175 my ($xPeg,$xRev) = _shiftPegRev(\@_, 1);
2176 my $iDepth = _shiftDepth(\@_);
2177 my $aChangeLists = _shiftArray(\@_);
2178 my $crVisit = _shiftVisitor(\@_);
2179 my $oPool = $self->_shiftPool(\@_);
2180  
2181 return SVN::_Client::svn_client_proplist2
2182 ($xTarget, $xPeg, $xRev, $iDepth, $aChangeLists, $crVisit
2183 , $self->{ctx}, $oPool);
2184 }
2185  
2186 *proplist1_6 = *proplist1_5;
2187 *proplist1_7 = *proplist1_5;
2188 *proplist = *proplist1_1;
2189  
2190 #----------------------------------------------------------------
2191  
2192 sub propset1_1 {
2193 my $self = shift @_;
2194 my $sProp = shift @_;
2195 my $sValue = _shiftString(\@_);
2196 my $xTarget = _shiftTarget(\@_);
2197 my $bRecurse = _shiftRecurse(\@_);
2198 my $oPool = $self->_shiftPool(\@_);
2199  
2200 return SVN::_Client::svn_client_propset
2201 ($sProp, $sValue, $xTarget, $bRecurse, $oPool);
2202 }
2203  
2204 sub propset1_4 {
2205 my $self = shift @_;
2206 my $sProp = shift @_;
2207 my $sValue = _shiftString(\@_);
2208 my $xTarget = _shiftTarget(\@_);
2209 my $bRecurse = _shiftRecurse(\@_);
2210 my $bSkipChecks = _shiftBoolean(\@_);
2211 my $oPool = $self->_shiftPool(\@_);
2212  
2213 return SVN::_Client::svn_client_propset2
2214 ($sProp, $sValue, $xTarget, $bRecurse, $bSkipChecks
2215 , $self->{ctx}, $oPool);
2216 }
2217  
2218 sub propset1_5 {
2219 my $self = shift @_;
2220 my $sProp = shift @_;
2221 my $sValue = _shiftString(\@_);
2222 my $xTarget = _shiftTarget(\@_);
2223 my $iDepth = _shiftDepth(\@_);
2224 my $bSkipChecks = _shiftBoolean(\@_);
2225 my $xBaseRev = _shiftPeg(\@_,1);
2226 my $aChangeLists = _shiftArray(\@_);
2227 my $hRevProps = _shiftHash(\@_);
2228 my $oPool = $self->_shiftPool(\@_);
2229  
2230 return SVN::_Client::svn_client_propset3
2231 ($sProp, $sValue, $xTarget, $iDepth, $bSkipChecks, $xBaseRev
2232 , $aChangeLists, $hRevProps, $self->{ctx}, $oPool);
2233 }
2234  
2235 *propset1_6 = *propset1_5;
2236  
2237 sub propset1_7 {
2238 my $self = shift @_;
2239 my $sProp = shift @_;
2240 my $sValue = _shiftString(\@_);
2241 my $xTarget = _shiftTarget(\@_);
2242 my $iDepth = _shiftDepth(\@_);
2243 my $bSkipChecks = _shiftBoolean(\@_);
2244 my $xBaseRev = _shiftPeg(\@_,1);
2245 my $aChangeLists = _shiftArray(\@_);
2246 my $hRevProps = _shiftHash(\@_);
2247 my $crCommit = _shiftVisitor(\@_);
2248 my $oPool = $self->_shiftPool(\@_);
2249  
2250 return SVN::_Client::svn_client_propset3
2251 ($sProp, $sValue, $xTarget, $iDepth, $bSkipChecks, $xBaseRev
2252 , $aChangeLists, $hRevProps, $crCommit, $self->{ctx}, $oPool);
2253 }
2254  
2255 sub propset {
2256 my $self = shift @_;
2257 my $xTarget = _shiftTarget(\@_);
2258 my $sProp = shift @_;
2259 my $sValue = _shiftString(\@_);
2260 my $bRecurse = _shiftRecurse(\@_);
2261 my $oPool = $self->_shiftPool(\@_);
2262  
2263 return SVN::_Client::svn_client_propset
2264 ($sProp, $sValue, $xTarget, $bRecurse, $oPool);
2265 }
2266  
2267 #----------------------------------------------------------------
2268  
2269 sub relocate1_1 {
2270 my $self = shift @_;
2271 my $sWc = _shiftWcPath(\@_);
2272 my $xFromRepos = _shiftTarget(\@_);
2273 my $xToRepos = _shiftTarget(\@_);
2274 my $bRecurse = _shiftRecurse(\@_);
2275 my $oPool = $self->_shiftPool(\@_);
2276  
2277 return SVN::_Client::svn_client_relocate
2278 ($sWc, $xFromRepos, $xToRepos, $bRecurse, $self->{ctx}, $oPool);
2279 }
2280  
2281 *relocate1_4 = *relocate1_1;
2282 *relocate1_5 = *relocate1_1;
2283 *relocate1_6 = *relocate1_1;
2284  
2285 sub relocate1_7 {
2286 my $self = shift @_;
2287 my $sWc = _shiftWcPath(\@_);
2288 my $xFromRepos = _shiftTarget(\@_);
2289 my $xToRepos = _shiftTarget(\@_);
2290 my $bIgnoreExternals = _shiftBoolean(\@_);
2291 my $oPool = $self->_shiftPool(\@_);
2292  
2293 return SVN::_Client::svn_client_relocate2
2294 ($sWc, $xFromRepos, $xToRepos, $bIgnoreExternals
2295 , $self->{ctx}, $oPool);
2296 }
2297  
2298 *relocate = *relocate1_1;
2299  
2300 #----------------------------------------------------------------
2301  
2302 sub resolved1_1 {
2303 my $self = shift @_;
2304 my $sWc = _shiftWcPath(\@_);
2305 my $bRecurse = _shiftRecurse(\@_);
2306 my $oPool = $self->_shiftPool(\@_);
2307  
2308 return SVN::_Client::svn_client_resolved
2309 ($sWc, $bRecurse, $self->{ctx}, $oPool);
2310 }
2311  
2312 *resolved1_4 = *resolved1_1;
2313 *resolved1_5 = *resolved1_1;
2314 *resolved1_6 = *resolved1_1;
2315 *resolved1_7 = *resolved1_1;
2316 *resolved = *resolved1_1;
2317  
2318 #----------------------------------------------------------------
2319  
2320 sub revert1_1 {
2321 my $self = shift @_;
2322 my $aWcs = _shiftWcPaths(\@_);
2323 my $bRecurse = _shiftRecurse(\@_);
2324 my $oPool = $self->_shiftPool(\@_);
2325  
2326 return SVN::_Client::svn_client_revert
2327 ($aWcs, $bRecurse, $self->{ctx}, $oPool);
2328 }
2329  
2330 *revert1_4 = *revert1_1;
2331  
2332 sub revert1_5 {
2333 my $self = shift @_;
2334 my $aWcs = _shiftWcPaths(\@_);
2335 my $iDepth = _shiftDepth(\@_);
2336 my $aChangeLists = _shiftArray(\@_);
2337 my $oPool = $self->_shiftPool(\@_);
2338  
2339 return SVN::_Client::svn_client_revert2
2340 ($aWcs, $iDepth, $aChangeLists, $self->{ctx}, $oPool);
2341 }
2342  
2343 *revert1_6 = *revert1_5;
2344 *revert1_7 = *revert1_5;
2345 *revert = *revert1_1;
2346  
2347 #----------------------------------------------------------------
2348  
2349 sub revprop_delete1_1 {
2350 my $self = shift @_;
2351 my $sProp = shift @_;
2352 my $xRepos = _shiftTarget(\@_);
2353 my $xPeg = _shiftPeg(\@_);
2354 my $bSkipChecks = _shiftBoolean(\@_);
2355 my $oPool = $self->_shiftPool(\@_);
2356  
2357 return SVN::_Client::svn_client_revprop_set
2358 ($sProp, undef, $xRepos, $xPeg, $bSkipChecks
2359 , $self->{ctx}, $oPool);
2360 }
2361  
2362 *revprop_delete1_4 = *revprop_delete1_1;
2363 *revprop_delete1_5 = *revprop_delete1_1;
2364  
2365 sub revprop_delete1_6 {
2366 my $self = shift @_;
2367 my $sProp = shift @_;
2368 my $sOldValue = shift @_;
2369 my $xRepos = _shiftTarget(\@_);
2370 my $xPeg = _shiftPeg(\@_);
2371 my $bSkipChecks = _shiftBoolean(\@_);
2372 my $oPool = $self->_shiftPool(\@_);
2373  
2374 return SVN::_Client::svn_client_revprop_set2
2375 ($sProp, undef, $sOldValue, $xRepos, $xPeg, $bSkipChecks
2376 , $self->{ctx}, $oPool);
2377 }
2378  
2379 *revprop_delete1_7 = *revprop_delete1_6;
2380  
2381  
2382 sub revprop_delete {
2383 my $self = shift @_;
2384 my $xRepos = _shiftTarget(\@_);
2385 my $sProp = shift @_;
2386 my $xPeg = _shiftPeg(\@_);
2387 my $bSkipChecks = _shiftBoolean(\@_);
2388 my $oPool = $self->_shiftPool(\@_);
2389  
2390 return SVN::_Client::svn_client_revprop_set
2391 ($sProp, undef, $xRepos, $xPeg, $bSkipChecks
2392 , $self->{ctx}, $oPool);
2393 }
2394  
2395 #----------------------------------------------------------------
2396  
2397 sub revprop_get1_1 {
2398 my $self = shift @_;
2399 my $sProp = shift @_;
2400 my $xRepos = _shiftTarget(\@_);
2401 my $xPeg = _shiftPeg(\@_);
2402 my $oPool = $self->_shiftPool(\@_);
2403  
2404 #the swig wrapper handles returning the value
2405 return SVN::_Client::svn_client_revprop_get
2406 ($sProp, $xRepos, $xPeg, $self->{ctx}, $oPool);
2407 }
2408  
2409 *revprop_get1_4 = *revprop_get1_1;
2410 *revprop_get1_5 = *revprop_get1_1;
2411 *revprop_get1_6 = *revprop_get1_1;
2412 *revprop_get1_7 = *revprop_get1_1;
2413  
2414 sub revprop_get {
2415 my $self = shift @_;
2416 my $xRepos = _shiftTarget(\@_);
2417 my $sProp = shift @_;
2418 my $xPeg = _shiftPeg(\@_);
2419 my $oPool = $self->_shiftPool(\@_);
2420  
2421 #the swig wrapper handles returning the value
2422 return SVN::_Client::svn_client_revprop_get
2423 ($sProp, $xRepos, $xPeg, $self->{ctx}, $oPool);
2424  
2425 }
2426  
2427 #----------------------------------------------------------------
2428  
2429 sub revprop_list1_1 {
2430 my $self = shift @_;
2431 my $xRepos = _shiftTarget(\@_);
2432 my $xPeg = _shiftPeg(\@_);
2433 my $oPool = $self->_shiftPool(\@_);
2434  
2435 #the swig wrapper handles returning the value
2436 return SVN::_Client::svn_client_revprop_list
2437 ($xRepos, $xPeg, $self->{ctx}, $oPool);
2438 }
2439  
2440 *revprop_list1_4 = *revprop_list1_1;
2441 *revprop_list1_5 = *revprop_list1_1;
2442 *revprop_list1_6 = *revprop_list1_1;
2443 *revprop_list1_7 = *revprop_list1_1;
2444 *revprop_list = *revprop_list1_1;
2445  
2446  
2447 #----------------------------------------------------------------
2448  
2449 sub revprop_set1_1 {
2450 my $self = shift @_;
2451 my $sProp = shift @_;
2452 my $sValue = shift @_;
2453 my $xRepos = _shiftTarget(\@_);
2454 my $xPeg = _shiftPeg(\@_);
2455 my $bSkipChecks = _shiftBoolean(\@_);
2456 my $oPool = $self->_shiftPool(\@_);
2457  
2458 return SVN::_Client::svn_client_revprop_set
2459 ($sProp, $sValue, $xRepos, $xPeg, $bSkipChecks
2460 , $self->{ctx}, $oPool);
2461 }
2462  
2463 *revprop_set1_4 = *revprop_set1_1;
2464 *revprop_set1_5 = *revprop_set1_1;
2465  
2466 sub revprop_set1_6 {
2467 my $self = shift @_;
2468 my $sProp = shift @_;
2469 my $sValue = shift @_;
2470 my $sOldValue = shift @_;
2471 my $xRepos = _shiftTarget(\@_);
2472 my $xPeg = _shiftPeg(\@_);
2473 my $bSkipChecks = _shiftBoolean(\@_);
2474 my $oPool = $self->_shiftPool(\@_);
2475  
2476 return SVN::_Client::svn_client_revprop_set2
2477 ($sProp, $sValue, $sOldValue, $xRepos, $xPeg, $bSkipChecks
2478 , $self->{ctx}, $oPool);
2479 }
2480  
2481 *revprop_set1_7 = *revprop_set1_6;
2482  
2483  
2484 sub revprop_set {
2485 my $self = shift @_;
2486 my $xRepos = _shiftTarget(\@_);
2487 my $sProp = shift @_;
2488 my $xPeg = _shiftPeg(\@_);
2489 my $sValue = shift @_;
2490 my $bSkipChecks = _shiftBoolean(\@_);
2491 my $oPool = $self->_shiftPool(\@_);
2492  
2493 return SVN::_Client::svn_client_revprop_set
2494 ($sProp, $sValue, $xRepos, $xPeg, $bSkipChecks
2495 , $self->{ctx}, $oPool);
2496 }
2497  
2498 #--------------------------------------------------------------------
2499  
2500 sub setConfig {
2501 my ($self, $xConfig) = @_;
2502 $xConfig = $CONFIG_CLASS->new($xConfig);
2503 return $self->{ctx}->config($xConfig->getCategoryHash());
2504 }
2505  
2506 #----------------------------------------------------------------
2507  
2508 sub setPool {
2509 my ($self, $oPool) = @_;
2510 if (ref($oPool) !~ m{^_p_apr_pool_t|SVN::Pool$}) {
2511 die $EXCEPTIONS->ERR_BAD_ARG
2512 ->new(arg => $oPool, reason => "Pool must be undefined or "
2513 . "an SVN::Pool or _p_apr_pool_t object");
2514 }
2515 return $self->{pool} = $oPool;
2516 }
2517  
2518  
2519 #----------------------------------------------------------------
2520  
2521 sub status1_1 {
2522 my $self = shift @_;
2523 my $sWc = _shiftWcPath(\@_);
2524 my $xPeg = _shiftPeg(\@_);
2525 my $crVisit = _shiftVisitor(\@_);
2526 my $bRecurse = _shiftRecurse(\@_);
2527 my $bAll = _shiftBoolean(\@_);
2528 my $bUpdate = _shiftBoolean(\@_);
2529 my $bNoIgnore = _shiftBoolean(\@_);
2530 my $oPool = $self->_shiftPool(\@_);
2531  
2532 #Despite the fact that the usage string includes a status
2533 #baton, the actual method expects it to be omitted from the
2534 #parameter list
2535  
2536 return SVN::_Client::svn_client_status
2537 ($sWc, $xPeg, $crVisit, $bRecurse, $bAll
2538 , $bUpdate, $bNoIgnore, $self->{ctx}, $oPool);
2539 }
2540  
2541 sub status1_4 {
2542 my $self = shift @_;
2543 my $sWc = _shiftWcPath(\@_);
2544 my $xPeg = _shiftPeg(\@_);
2545 my $crVisit = _shiftVisitor(\@_);
2546 my $bRecurse = _shiftRecurse(\@_);
2547 my $bAll = _shiftBoolean(\@_);
2548 my $bUpdate = _shiftBoolean(\@_);
2549 my $bNoIgnore = _shiftBoolean(\@_);
2550 my $bSkipExternals = _shiftBoolean(\@_);
2551 my $oPool = $self->_shiftPool(\@_);
2552  
2553 return SVN::_Client::svn_client_status2
2554 ($sWc, $xPeg, $crVisit, $bRecurse, $bAll, $bUpdate
2555 , $bNoIgnore, $bSkipExternals, $self->{ctx}, $oPool);
2556 }
2557  
2558 sub status1_5 {
2559 my $self = shift @_;
2560 my $sWc = _shiftWcPath(\@_);
2561 my $xPeg = _shiftPeg(\@_);
2562 my $crVisit = _shiftVisitor(\@_);
2563 my $iDepth = _shiftDepth(\@_);
2564 my $bAll = _shiftBoolean(\@_);
2565 my $bUpdate = _shiftBoolean(\@_);
2566 my $bNoIgnore = _shiftBoolean(\@_);
2567 my $bSkipExternals = _shiftBoolean(\@_);
2568 my $aChangeLists = _shiftArray(\@_);
2569 my $oPool = $self->_shiftPool(\@_);
2570  
2571 return SVN::_Client::svn_client_status3
2572 ($sWc, $xPeg, $crVisit, $iDepth, $bAll, $bUpdate
2573 , $bNoIgnore, $bSkipExternals, $aChangeLists
2574 , $self->{ctx}, $oPool);
2575 }
2576  
2577 sub status1_6 {
2578 my $self = shift @_;
2579 my $sWc = _shiftWcPath(\@_);
2580 my $xPeg = _shiftPeg(\@_);
2581 my $crVisit = _shiftVisitor(\@_);
2582 my $iDepth = _shiftDepth(\@_);
2583 my $bAll = _shiftBoolean(\@_);
2584 my $bUpdate = _shiftBoolean(\@_);
2585 my $bNoIgnore = _shiftBoolean(\@_);
2586 my $bSkipExternals = _shiftBoolean(\@_);
2587 my $aChangeLists = _shiftArray(\@_);
2588 my $oPool = $self->_shiftPool(\@_);
2589  
2590 return SVN::_Client::svn_client_status4
2591 ($sWc, $xPeg, $crVisit, $iDepth, $bAll, $bUpdate
2592 , $bNoIgnore, $bSkipExternals, $aChangeLists
2593 , $self->{ctx}, $oPool);
2594 }
2595  
2596 sub status1_7 {
2597 my $self = shift @_;
2598 my $sWc = _shiftWcPath(\@_);
2599 my $xPeg = _shiftPeg(\@_);
2600 my $iDepth = _shiftDepth(\@_);
2601 my $bAll = _shiftBoolean(\@_);
2602 my $bUpdate = _shiftBoolean(\@_);
2603 my $bNoIgnore = _shiftBoolean(\@_);
2604 my $bSkipExternals = _shiftBoolean(\@_);
2605 my $aChangeLists = _shiftArray(\@_);
2606 my $crVisit = _shiftVisitor(\@_);
2607 my $oPool = $self->_shiftPool(\@_);
2608  
2609 return SVN::_Client::svn_client_status5
2610 ($sWc, $xPeg, $iDepth, $bAll, $bUpdate
2611 , $bNoIgnore, $bSkipExternals, $aChangeLists
2612 , $crVisit, $self->{ctx}, $oPool);
2613 }
2614  
2615 sub status {
2616 my $self = shift @_;
2617 my $sWc = _shiftWcPath(\@_);
2618 my $crVisit = _shiftVisitor(\@_);
2619 my $bRecurse = _shiftRecurse(\@_);
2620 my $bUpdate = _shiftBoolean(\@_);
2621 my $xPeg = _shiftPeg(\@_);
2622 my $bAll = _shiftBoolean(\@_);
2623 my $bNoIgnore = _shiftBoolean(\@_);
2624 my $oPool = $self->_shiftPool(\@_);
2625  
2626 return SVN::_Client::svn_client_status
2627 ($sWc, $xPeg, $crVisit, $bRecurse, $bAll
2628 , $bUpdate, $bNoIgnore, $self->{ctx}, $oPool);
2629 }
2630  
2631 #----------------------------------------------------------------
2632  
2633 sub switch1_1 {
2634 my $self = shift @_;
2635 my $sWc = _shiftWcPath(\@_);
2636 my $xRepos = _shiftTarget(\@_);
2637 my $xPeg = _shiftPeg(\@_);
2638 my $bRecurse = _shiftRecurse(\@_);
2639 my $oPool = $self->_shiftPool(\@_);
2640  
2641 return SVN::_Client::svn_client_switch
2642 ($sWc, $xRepos, $xPeg, $bRecurse, $self->{ctx}, $oPool);
2643 }
2644  
2645 *switch1_4 = *switch1_1;
2646  
2647 sub switch1_5 {
2648 my $self = shift @_;
2649 my $sWc = _shiftWcPath(\@_);
2650 my $xRepos = _shiftTarget(\@_);
2651 my ($xPeg, $xRev) = _shiftPegRev(\@_);
2652 my $iDepth = _shiftDepth(\@_);
2653 my $bDepthIsSticky = _shiftBoolean(\@_);
2654 my $bSkipExternals = _shiftBoolean(\@_);
2655 my $bAllowUnversionedObstructions = _shiftBoolean(\@_);
2656 my $oPool = $self->_shiftPool(\@_);
2657  
2658 return SVN::_Client::svn_client_switch
2659 ($sWc, $xRepos, $xPeg, $iDepth, $bDepthIsSticky, $bSkipExternals
2660 , $bAllowUnversionedObstructions, $self->{ctx}, $oPool);
2661 }
2662  
2663 *switch1_6 = *switch1_5;
2664 *switch1_7 = *switch1_5;
2665 *switch = *switch1_1;
2666  
2667 #----------------------------------------------------------------
2668  
2669 sub unlock1_1 {
2670 my $self = shift @_;
2671 my $xTargets = _shiftTargets(\@_);
2672 my $bBreakLock = _shiftBoolean(\@_);
2673 my $oPool = $self->_shiftPool(\@_);
2674  
2675 return SVN::_Client::svn_client_unlock
2676 ($xTargets, $bBreakLock, $self->{ctx}, $oPool);
2677 }
2678  
2679 *unlock1_4 = *unlock1_1;
2680 *unlock1_5 = *unlock1_1;
2681 *unlock1_6 = *unlock1_1;
2682 *unlock1_7 = *unlock1_1;
2683 *unlock = *unlock1_1;
2684  
2685 #----------------------------------------------------------------
2686  
2687 sub update1_1 {
2688 my $self = shift @_;
2689 my $sWc = _shiftWcPath(\@_);
2690 my $xPeg = _shiftPeg(\@_);
2691 my $bRecurse = _shiftRecurse(\@_);
2692 my $oPool = $self->_shiftPool(\@_);
2693  
2694 return SVN::_Client::svn_client_update
2695 ($sWc, $xPeg, $bRecurse, $self->{ctx}, $oPool);
2696 }
2697  
2698 sub update1_4 {
2699 my $self = shift @_;
2700 my $aWcs = _shiftWcPaths(\@_);
2701 my $xPeg = _shiftPeg(\@_);
2702 my $bRecurse = _shiftRecurse(\@_);
2703 my $bSkipExternals = _shiftBoolean(\@_);
2704 my $oPool = $self->_shiftPool(\@_);
2705  
2706 return SVN::_Client::svn_client_update2
2707 ($aWcs, $xPeg, $bRecurse, $bSkipExternals
2708 , $self->{ctx}, $oPool);
2709 }
2710  
2711 sub update1_5 {
2712 my $self = shift @_;
2713 my $aWcs = _shiftWcPaths(\@_);
2714 my $xPeg = _shiftPeg(\@_);
2715 my $iDepth = _shiftDepth(\@_);
2716 my $bDepthIsSticky = _shiftBoolean(\@_);
2717 my $bSkipExternals = _shiftBoolean(\@_);
2718 my $bAllowUnversionedObstructions = _shiftBoolean(\@_);
2719 my $oPool = $self->_shiftPool(\@_);
2720  
2721 return SVN::_Client::svn_client_update3
2722 ($aWcs, $xPeg, $iDepth, $bDepthIsSticky
2723 , $bSkipExternals, $bAllowUnversionedObstructions
2724 , $self->{ctx}, $oPool);
2725 }
2726  
2727 *update1_6 = *update1_5;
2728  
2729 sub update1_7 {
2730 my $self = shift @_;
2731 my $aWcs = _shiftWcPaths(\@_);
2732 my $xPeg = _shiftPeg(\@_);
2733 my $iDepth = _shiftDepth(\@_);
2734 my $bDepthIsSticky = _shiftBoolean(\@_);
2735 my $bSkipExternals = _shiftBoolean(\@_);
2736 my $bAllowUnversionedObstructions = _shiftBoolean(\@_);
2737 my $bMakeParents = _shiftBoolean(\@_);
2738 my $oPool = $self->_shiftPool(\@_);
2739  
2740 return SVN::_Client::svn_client_update4
2741 ($aWcs, $xPeg, $iDepth, $bDepthIsSticky
2742 , $bSkipExternals, $bAllowUnversionedObstructions
2743 , $bMakeParents, $self->{ctx}, $oPool);
2744 }
2745  
2746 *update = *update1_1;
2747  
2748 #----------------------------------------------------------------
2749  
2750 #redefined here to make sure context is passed correctly:
2751 #SVN::Client uses ref not isa when trying to decide whether it is
2752 #being called as a function or as a method.
2753  
2754 sub url_from_path {
2755 my ($self, $sWc, $oPool) = @_;
2756  
2757 $oPool = $self->{pool} unless defined($oPool);
2758 return SVN::_Client::svn_client_url_from_path($sWc, $oPool);
2759 }
2760  
2761 #----------------------------------------------------------------
2762  
2763 #redefined here to make sure context is passed correctly:
2764 #SVN::Client uses ref not isa when trying to decide whether it is
2765 #being called as a function or as a method.
2766  
2767 sub uuid_from_path {
2768 my ($self, $sWc, $oAdminAccess, $oPool) = @_;
2769  
2770 $oPool = $self->{pool} unless defined($oPool);
2771 unless ($oAdminAccess) {
2772 $oAdminAccess = SVN::_Wc::svn_wc_adm_probe_open3
2773 (undef, $sWc, 0, 0, undef, undef, $oPool);
2774 }
2775  
2776 return SVN::_Client::svn_client_uuid_from_path
2777 ($sWc, $oAdminAccess, $self->{ctx}, $oPool);
2778 }
2779  
2780 #----------------------------------------------------------------
2781  
2782 #redefined here to make sure context is passed correctly:
2783 #SVN::Client uses ref+eq not isa when trying to decide whether it is
2784 #being called as a function or as a method.
2785  
2786 sub uuid_from_url {
2787 my ($self, $xRepos, $oPool) = @_;
2788  
2789 $oPool = $self->{pool} unless defined($oPool);
2790  
2791 # quote repos name to force any "" override to convert an object
2792 # to a string
2793 return SVN::_Client::svn_client_uuid_from_url
2794 ("$xRepos", $self->{ctx}, $oPool);
2795 }
2796  
2797 #==================================================================
2798 # PRIVATE OBJECT METHODS
2799 #==================================================================
2800  
2801 sub _shiftPool {
2802 my $self = shift @_;
2803 die "Not a $CLASS" unless $self->isa($CLASS);
2804  
2805 my $oPool = shift @{shift @_};
2806 return defined($oPool) ? $oPool : $self->{pool};
2807 }
2808  
2809 #==================================================================
2810 # PRIVATE FUNCTIONS
2811 #==================================================================
2812  
2813 #sub _makeConfigActions($) {
2814 # my $hActions = shift @_;
2815 # my ($crNotify, $crLogMsg, $bLogMsgChange);
2816  
2817 # my $xCommit = $hActions->{commit};
2818 # if (ref($xCommit) eq 'HASH') {
2819 # if (exists($xCommit->{log_msg})) {
2820 # $bLogMsgChange = 1;
2821 # $crLogMsg = $xCommit->{log_msg};
2822 # }
2823 # $hActions->{commit} = $xCommit->{notify};
2824 # }
2825 # $crNotify = sub {
2826 # #my ($sPath, $iAction, $iKind, $sMime, $iState, $iRevision) = @_;
2827 # return _notifyFromHash($hActions, @_);
2828 # };
2829 # return ($crNotify, $crLogMsg, $bLogMsgChange);
2830 #}
2831  
2832 #----------------------------------------------------------------
2833  
2834 sub _notifyAction($$@) {
2835 my $hNotify = shift @_;
2836 my $sKey = shift @_;
2837 my $sPath = shift @_;
2838 my $iAction = shift @_;
2839 my $crDefault = shift @_;
2840  
2841 my $xAction = exists($hNotify->{$sKey})
2842 ? $hNotify->{$sKey} : undef;
2843  
2844 my $sRef = ref($xAction);
2845 if ($sRef eq 'HASH') {
2846 my $crAction = exists($xAction->{$iAction})
2847 ? $xAction->{$iAction} : undef;
2848  
2849 return defined($crAction)
2850 ? $crAction->($sPath, $iAction, @_)
2851 : defined($crDefault)
2852 ? $crDefault->($sKey, $sPath, $iAction, @_)
2853 : undef;
2854  
2855 } elsif ($sRef eq 'CODE') {
2856 return $xAction->($sPath, $iAction, @_);
2857 } elsif (defined($crDefault)) {
2858 $crDefault->($sKey, $sPath, $iAction, @_);
2859 } else {
2860 return undef;
2861 }
2862 }
2863  
2864 #----------------------------------------------------------------
2865  
2866 sub _notifyFromHash($@) {
2867 my $hNotify = shift @_;
2868 my $sPath = shift @_;
2869 my $iAction = shift @_;
2870 my $crDefault;
2871  
2872 if (exists($hNotify->{default})) {
2873 $crDefault = $hNotify->{default};
2874 unshift @_, $crDefault;
2875 } else {
2876 unshift @_, undef;
2877 }
2878  
2879 #scheduled actions
2880 if ($iAction eq $SVN::Wc::Notify::Action::add) {
2881 return _notifyAction($hNotify, 'schedule', $sPath, $iAction, @_);
2882 } elsif ($iAction eq $SVN::Wc::Notify::Action::copy) {
2883 return _notifyAction($hNotify, 'schedule', $sPath, $iAction, @_);
2884 } elsif ($iAction eq $SVN::Wc::Notify::Action::delete) {
2885 return _notifyAction($hNotify, 'schedule', $sPath, $iAction, @_);
2886 }
2887  
2888 #revert actions
2889 if ($iAction eq $SVN::Wc::Notify::Action::restore) {
2890 return _notifyAction($hNotify, 'revert', $sPath, $iAction, @_);
2891 } elsif ($iAction eq $SVN::Wc::Notify::Action::revert) {
2892 return _notifyAction($hNotify, 'revert', $sPath, $iAction, @_);
2893 } elsif ($iAction eq $SVN::Wc::Notify::Action::failed_revert) {
2894 return _notifyAction($hNotify, 'revert', $sPath, $iAction, @_);
2895 }
2896  
2897 #resolved action
2898 if ($iAction eq $SVN::Wc::Notify::Action::resolved) {
2899 return _notifyAction($hNotify, 'resolved', $sPath, $iAction, @_);
2900 }
2901  
2902 #update actions
2903 if ($iAction eq $SVN::Wc::Notify::Action::skip) {
2904 return _notifyAction($hNotify, 'update', $sPath, $iAction, @_);
2905 } elsif ($iAction eq $SVN::Wc::Notify::Action::update_add) {
2906 return _notifyAction($hNotify, 'update', $sPath, $iAction, @_);
2907 } elsif ($iAction eq $SVN::Wc::Notify::Action::update_delete) {
2908 return _notifyAction($hNotify, 'update', $sPath, $iAction, @_);
2909 } elsif ($iAction eq $SVN::Wc::Notify::Action::update_update) {
2910 return _notifyAction($hNotify, 'update', $sPath, $iAction, @_);
2911 } elsif ($iAction eq $SVN::Wc::Notify::Action::update_external) {
2912 return _notifyAction($hNotify, 'update', $sPath, $iAction, @_);
2913 } elsif ($iAction eq $SVN::Wc::Notify::Action::update_completed) {
2914 return _notifyAction($hNotify, 'update', $sPath, $iAction, @_);
2915 }
2916  
2917 #follow
2918 if ($iAction eq $SVN::Wc::Notify::Action::status_external) {
2919 return _notifyAction($hNotify, 'follow', $sPath, $iAction, @_);
2920 } elsif ($iAction eq $SVN::Wc::Notify::Action::status_completed) {
2921 return _notifyAction($hNotify, 'follow', $sPath, $iAction, @_);
2922 }
2923  
2924 #commit actions
2925 if ($iAction eq $SVN::Wc::Notify::Action::commit_added) {
2926 return _notifyAction($hNotify, 'commit', $sPath, $iAction, @_);
2927 } elsif ($iAction eq $SVN::Wc::Notify::Action::commit_modified) {
2928 return _notifyAction($hNotify, 'commit', $sPath, $iAction, @_);
2929 } elsif ($iAction eq $SVN::Wc::Notify::Action::commit_deleted) {
2930 return _notifyAction($hNotify, 'commit', $sPath, $iAction, @_);
2931 } elsif ($iAction eq $SVN::Wc::Notify::Action::commit_replaced) {
2932 return _notifyAction($hNotify, 'commit', $sPath, $iAction, @_);
2933 } elsif ($iAction
2934 eq $SVN::Wc::Notify::Action::commit_postfix_txdelta) {
2935 return _notifyAction($hNotify, 'commit', $sPath, $iAction, @_);
2936 }
2937  
2938 #locking
2939 if ($iAction eq $SVN::Wc::Notify::Action::locked) {
2940 return _notifyAction($hNotify, 'lock', $sPath, $iAction, @_);
2941 } elsif ($iAction eq $SVN::Wc::Notify::Action::unlocked) {
2942 return _notifyAction($hNotify, 'lock', $sPath, $iAction, @_);
2943 } elsif ($iAction eq $SVN::Wc::Notify::Action::failed_lock) {
2944 return _notifyAction($hNotify, 'lock', $sPath, $iAction, @_);
2945 } elsif ($iAction eq $SVN::Wc::Notify::Action::failed_unlock) {
2946 return _notifyAction($hNotify, 'lock', $sPath, $iAction, @_);
2947 }
2948  
2949 #blame
2950 if ($iAction eq $SVN::Wc::Notify::Action::blame_revision) {
2951 return _notifyAction($hNotify, 'blame', $sPath, $iAction, @_);
2952 }
2953  
2954  
2955 if (1 <= $SVN::Core::VER_MAJOR) {
2956 if (5 <= $SVN::Core::VER_MINOR) {
2957 if ($iAction eq $SVN::Wc::Notify::Action::exists) {
2958 return _notifyAction($hNotify, 'schedule',$sPath,$iAction,@_);
2959 } elsif ($iAction
2960 eq $SVN::Wc::Notify::Action::changelist_set) {
2961 return _notifyAction($hNotify, 'schedule',$sPath,$iAction,@_);
2962 } elsif ($iAction
2963 eq $SVN::Wc::Notify::Action::changelist_clear) {
2964 return _notifyAction($hNotify, 'schedule',$sPath,$iAction,@_);
2965 } elsif ($iAction
2966 eq $SVN::Wc::Notify::Action::changelist_moved) {
2967 return _notifyAction($hNotify, 'schedule',$sPath,$iAction,@_);
2968 } elsif ($iAction eq $SVN::Wc::Notify::Action::merge_begin) {
2969 return _notifyAction($hNotify, 'merge', $sPath, $iAction, @_);
2970 } elsif ($iAction
2971 eq $SVN::Wc::Notify::Action::foreign_merge_begin) {
2972 return _notifyAction($hNotify, 'merge', $sPath, $iAction, @_);
2973 } elsif ($iAction eq $SVN::Wc::Notify::Action::update_replace) {
2974 return _notifyAction($hNotify, 'update', $sPath, $iAction,@_);
2975 }
2976 }
2977  
2978 if (6 <= $SVN::Core::VER_MINOR) {
2979 if ($iAction eq $SVN::Wc::Notify::Action::property_added) {
2980 return _notifyAction($hNotify, 'schedule',$sPath,$iAction,@_);
2981 } elsif ($iAction
2982 eq $SVN::Wc::Notify::Action::property_modified) {
2983 return _notifyAction($hNotify, 'schedule',$sPath,$iAction,@_);
2984 } elsif ($iAction
2985 eq $SVN::Wc::Notify::Action::property_deleted) {
2986 return _notifyAction($hNotify, 'schedule',$sPath,$iAction,@_);
2987 } elsif ($iAction
2988 eq $SVN::Wc::Notify::Action::property_deleted_nonexistant) {
2989 return _notifyAction($hNotify, 'schedule',$sPath,$iAction,@_);
2990 } elsif ($iAction eq $SVN::Wc::Notify::Action::revprop_set) {
2991 return _notifyAction($hNotify, 'revprop',$sPath,$iAction,@_);
2992 } elsif ($iAction
2993 eq $SVN::Wc::Notify::Action::revprop_deleted) {
2994 return _notifyAction($hNotify, 'revprop',$sPath,$iAction,@_);
2995 } elsif ($iAction eq $SVN::Wc::Notify::Action::tree_conflict) {
2996 return _notifyAction($hNotify, 'update',$sPath,$iAction,@_);
2997 } elsif ($iAction eq $SVN::Wc::Notify::Action::merge_completed){
2998 return _notifyAction($hNotify, 'merge',$sPath,$iAction,@_);
2999 } elsif ($iAction eq $SVN::Wc::Notify::Action::failed_external){
3000 return _notifyAction($hNotify, 'follow',$sPath,$iAction,@_);
3001 }
3002 }
3003  
3004 if (7 <= $SVN::Core::VER_MINOR) {
3005 if ($iAction eq $SVN::Wc::Notify::Action::update_started) {
3006 return _notifyAction($hNotify, 'update',$sPath,$iAction,@_);
3007 } elsif ($iAction
3008 eq $SVN::Wc::Notify::Action::update_obstruction) {
3009 return _notifyAction($hNotify, 'update',$sPath,$iAction,@_);
3010 } elsif ($iAction
3011 eq $SVN::Wc::Notify::Action::update_external_removed) {
3012 return _notifyAction($hNotify, 'update',$sPath,$iAction,@_);
3013 } elsif ($iAction
3014 eq $SVN::Wc::Notify::Action::update_add_deleted) {
3015 return _notifyAction($hNotify, 'update',$sPath,$iAction,@_);
3016 } elsif ($iAction
3017 eq $SVN::Wc::Notify::Action::update_update_deleted) {
3018 return _notifyAction($hNotify, 'update',$sPath,$iAction,@_);
3019 } elsif ($iAction
3020 eq $SVN::Wc::Notify::Action::upgraded_path) {
3021 return _notifyAction($hNotify, 'update',$sPath,$iAction,@_);
3022 } elsif ($iAction
3023 eq $SVN::Wc::Notify::Action::merge_record_info) {
3024 return _notifyAction($hNotify, 'merge',$sPath,$iAction,@_);
3025 } elsif ($iAction
3026 eq $SVN::Wc::Notify::Action::merge_record_info_begin) {
3027 return _notifyAction($hNotify, 'merge',$sPath,$iAction,@_);
3028 } elsif ($iAction
3029 eq $SVN::Wc::Notify::Action::merge_elide_info) {
3030 return _notifyAction($hNotify, 'merge',$sPath,$iAction,@_);
3031 } elsif ($iAction
3032 eq $SVN::Wc::Notify::Action::patch) {
3033 return _notifyAction($hNotify, 'patch',$sPath,$iAction,@_);
3034 } elsif ($iAction
3035 eq $SVN::Wc::Notify::Action::patch_applied_hunk) {
3036 return _notifyAction($hNotify, 'patch',$sPath,$iAction,@_);
3037 } elsif ($iAction
3038 eq $SVN::Wc::Notify::Action::patch_rejected_hunk) {
3039 return _notifyAction($hNotify, 'patch',$sPath,$iAction,@_);
3040 } elsif ($iAction
3041 eq $SVN::Wc::Notify::Action::patch_hunk_already_applied) {
3042 return _notifyAction($hNotify, 'patch',$sPath,$iAction,@_);
3043 } elsif ($iAction eq $SVN::Wc::Notify::Action::url_redirect) {
3044 return _notifyAction($hNotify, 'follow',$sPath,$iAction,@_);
3045 }
3046 }
3047 }
3048  
3049 if (defined($crDefault)) {
3050 shift @_; #get rid of $crDefault at the front
3051 return $crDefault->(undef, $sPath, $iAction, @_);
3052 } else {
3053 return undef;
3054 }
3055 }
3056  
3057 #----------------------------------------------------------------
3058  
3059 sub _shiftArray {
3060 my $xArg = shift @{shift @_};
3061 return defined($xArg) ? $xArg : [];
3062 }
3063  
3064 #----------------------------------------------------------------
3065  
3066 sub _shiftDiffTargets($) {
3067 my ($aArgs, $bRepository) = @_;
3068 my $xTarget1 = shift @$aArgs;
3069 my $xPeg1 = shift @$aArgs;
3070 my $xTarget2 = shift @$aArgs;
3071 my $xPeg2 = shift @$aArgs;
3072  
3073 if (defined($xTarget1)) {
3074 $xTarget1 = "$xTarget1"; #force use of "" override
3075 } else {
3076 $xTarget1 = File::Spec->curdir();
3077 }
3078 $xTarget2 = defined($xTarget2) ? "$xTarget2" : $xTarget1;
3079  
3080 if ($xTarget1 ne $xTarget2) {
3081 if (defined($xPeg1)) {
3082 $xPeg2 = $xPeg1 unless defined($xPeg2);
3083 } elsif (defined($xPeg2)) {
3084 $xPeg1 = $xPeg2 unless defined($xPeg1);
3085 } else {
3086 $xPeg1 = $xPeg2 = ($bRepository ? 'HEAD' : 'BASE');
3087 }
3088 } elsif (defined($xPeg1)) {
3089 if (Scalar::Util::looks_like_number($xPeg1)) {
3090 $xPeg2 = $xPeg1 + 1;
3091 } elsif ($xPeg1 eq 'PREV') {
3092 $xPeg2 = 'COMMITTED';
3093 } elsif ($xPeg1 =~ qr{BASE|HEAD|COMMITTED}) {
3094 $xPeg2 = ($bRepository ? 'HEAD' : 'WORKING');
3095 } else {
3096 $xPeg2 = $xPeg1;
3097 }
3098 } elsif (defined($xPeg2)) {
3099 if (Scalar::Util::looks_like_number($xPeg2)) {
3100 $xPeg1 = $xPeg2 - 1;
3101 } elsif ($xPeg2 eq 'COMMITTED') {
3102 $xPeg1 = 'PREV';
3103 } elsif ($xPeg2 eq 'WORKING') {
3104 $xPeg1 = 'BASE';
3105 } else {
3106 $xPeg1 = $xPeg2;
3107 }
3108 } elsif ($bRepository) {
3109 $xPeg1 = 'PREV';
3110 $xPeg2 = 'COMMITTED';
3111 } else {
3112 $xPeg1 = 'BASE';
3113 $xPeg2 = 'WORKING';
3114 }
3115  
3116 # WORKING isn't listed in SVN documentation nor in the C code for
3117 # converting strings to svn_opt_revision_t instances. It seems to
3118 # be SWIG's way of representing svn_opt_revision_t without having
3119 # to create a whole struct for it. SWIG auto-translates this to
3120 # the right sort of object instance - see line 1172 in
3121 # http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/include/svn_types.swg
3122  
3123 #print STDERR "<$xTarget1> <$xPeg1> <$xTarget2> <$xPeg2>\n";
3124  
3125 return ($xTarget1, $xPeg1, $xTarget2, $xPeg2);
3126 }
3127  
3128 #----------------------------------------------------------------
3129  
3130 sub _shiftErrFile($) {
3131 my $xArg = shift @{shift @_};
3132 return defined($xArg) ? $xArg : \*STDERR;
3133 }
3134  
3135 #----------------------------------------------------------------
3136  
3137 sub _shiftDepth {
3138 my $xArg = shift @{shift @_};
3139 return defined($xArg) ? $xArg : $SVN::Depth::infinity;
3140 }
3141  
3142 #----------------------------------------------------------------
3143  
3144 sub _shiftHash {
3145 my $xArg = shift @{shift @_};
3146 return defined($xArg) ? $xArg : {};
3147 }
3148  
3149 #----------------------------------------------------------------
3150  
3151 sub _shiftInt {
3152 my $xArg = shift @{shift @_};
3153 return defined($xArg) ? $xArg : 0;
3154 }
3155  
3156 #----------------------------------------------------------------
3157  
3158 sub _shiftListFieldMask($) {
3159 my $xArg = shift @{shift @_};
3160 return defined($xArg) ? $xArg : $SVN::Friendly::List::Fields::ALL;
3161 }
3162  
3163 #----------------------------------------------------------------
3164  
3165 sub _shiftOutFile {
3166 my $xArg = shift @{shift @_};
3167 return defined($xArg) ? $xArg : \*STDOUT;
3168 }
3169  
3170 #----------------------------------------------------------------
3171  
3172 sub _shiftOutputEncoding {
3173 my $xArg = shift @{shift @_};
3174 if (defined($xArg)) {
3175 return $xArg;
3176 } else {
3177 return defined($xArg) ? $xArg : $SVN::_Core::svn_locale_charset;
3178 }
3179 }
3180  
3181 #----------------------------------------------------------------
3182  
3183 sub _shiftOutputEol($) {
3184 # $sNativeEol may be 'CR', 'LF', 'CRLF', undef
3185 # undef is platform EOL
3186  
3187 my $xArg = shift @{shift @_};
3188 return $xArg;
3189 }
3190  
3191 #----------------------------------------------------------------
3192  
3193 sub _shiftPegRev {
3194 my ($aArgs, $bUndefIsWorking) = @_;
3195 my ($xPeg, $xRev);
3196 unless (ref($aArgs->[0])) {
3197 $xPeg = shift @$aArgs;
3198 $xRev = shift(@$aArgs) unless (ref($aArgs->[0]));
3199 }
3200  
3201 if (!defined($xPeg)) {
3202 $xPeg = $bUndefIsWorking ? 'WORKING' : 'HEAD';
3203 }
3204 $xRev = $xPeg unless defined($xRev);
3205 return ($xPeg, $xRev);
3206 }
3207  
3208 #----------------------------------------------------------------
3209  
3210 sub _shiftPeg {
3211 my ($aArgs, $bUndefIsWorking) = @_;
3212 my $xPeg = shift(@$aArgs) unless (ref($aArgs->[0]));
3213 if (!defined($xPeg) || ($xPeg eq '')) {
3214 $xPeg = $bUndefIsWorking ? 'WORKING' : 'HEAD';
3215 }
3216 return $xPeg;
3217 }
3218  
3219 #----------------------------------------------------------------
3220  
3221 sub _shiftRecurse {
3222 my $xArg = shift @{shift @_};
3223 return defined($xArg) ? $xArg : 1;
3224 }
3225  
3226 #----------------------------------------------------------------
3227  
3228 sub _shiftRange {
3229 my ($aArgs, $xMax) = @_;
3230 $xMax = 'HEAD' unless defined($xMax);
3231  
3232 my ($xStart, $xEnd);
3233 unless (ref($aArgs->[0])) {
3234 $xStart = shift @$aArgs;
3235 $xEnd = shift(@$aArgs) unless (ref($aArgs->[0]));
3236 }
3237 $xStart = 0 unless defined($xStart);
3238 $xEnd = $xMax unless defined($xEnd);
3239 return ($xStart, $xEnd);
3240 }
3241  
3242 #----------------------------------------------------------------
3243  
3244 sub _shiftTarget {
3245 my $xArg = shift @{shift @_};
3246  
3247 # quote the value to force any overridden "" operator to
3248 # convert this into a string
3249 return defined($xArg) ? "$xArg" : undef;
3250 }
3251  
3252 #----------------------------------------------------------------
3253  
3254 sub _shiftTargets {
3255 my $xTargets = shift @{shift @_};
3256  
3257 my $sRef = ref($xTargets);
3258 #print STDERR "_shiftTargets: <$xTargets> <$sRef>\n";
3259  
3260 if ($sRef eq 'ARRAY') {
3261 foreach (@$xTargets) { $_ = "$_"; }
3262 } elsif (defined($xTargets)) {
3263 $xTargets = [ "$xTargets" ]; #force overridden ""
3264 } else {
3265 return [];
3266 }
3267 return $xTargets;
3268 }
3269  
3270 #----------------------------------------------------------------
3271  
3272 sub _shiftString {
3273 my $xArg = shift @{shift @_};
3274 return defined($xArg) ? $xArg : '';
3275 }
3276  
3277 #----------------------------------------------------------------
3278  
3279 sub _shiftTrue {
3280 my $xArg = shift @{shift @_};
3281 return defined($xArg) ? $xArg : 1;
3282 }
3283  
3284 ##----------------------------------------------------------------
3285 ## Most likely not needed - if thunk is defined, no need for baton,
3286 ## if thunk is not defined, there is nothing we can do to make it
3287 ## work without changing the source code and recompiling the
3288 ## C-Bindings.
3289  
3290 #sub _shiftVisitorBaton {
3291 # my ($aArgs) = @_;
3292  
3293 # my $crVisit = _shiftVisitor($aArgs);
3294 # my $xBaton = shift @$aArgs;
3295 # return ($crVisit, $xBaton);
3296 #}
3297  
3298 #----------------------------------------------------------------
3299  
3300 sub _shiftWcPath {
3301 my $xArg = shift @{shift @_};
3302 #return defined($xArg) ? $xArg : $SYSTEM->cwd();
3303 return defined($xArg) ? $xArg : File::Spec->curdir();
3304 }
3305  
3306 #----------------------------------------------------------------
3307  
3308 sub _shiftWcPaths($) {
3309 my $aWcs = shift @{shift @_};
3310 return [] unless defined($aWcs);
3311 return ref($aWcs) ? $aWcs : [ $aWcs ];
3312 }
3313  
3314 #==================================================================
3315 # MODULE INITIALIZATION
3316 #==================================================================
3317  
3318 1;
« Utils.pm ↑ Summary