Index: subversion/bindings/swig/perl/native/t/9wc.t
===================================================================
--- subversion/bindings/swig/perl/native/t/9wc.t	(revision 1446079)
+++ subversion/bindings/swig/perl/native/t/9wc.t	(working copy)
@@ -21,8 +21,9 @@
 #
 
 use strict;
-use Test::More tests => 17;
+use Test::More tests => 23;
 use Scalar::Util;
+use File::Temp qw(tempdir);
 
 # shut up about variables that are only used once.
 # these come from constants and variables used
@@ -33,10 +34,16 @@
 use_ok('SVN::Core');
 # TEST
 use_ok('SVN::Wc');
+# TEST
+use_ok('SVN::Repos');
+# TEST
+use_ok('SVN::Delta');
+# TEST
+use_ok('SVN::Client');
 
-my $external_desc = <<END;
+my $external_desc = <<'END';
 http://svn.example.com/repos/project1 project1
-^/repos/project2 "Project 2"
+^/repos/project2@3 "Project 2"
 END
 
 # Run parse_externals_description3()
@@ -61,6 +68,8 @@
 # TEST
 is($externals->[0]->peg_revision()->kind(),
    $SVN::Core::opt_revision_head);
+# save this _p_svn_opt_revision_t for later tests
+my $opt_revision_head = $externals->[0]->peg_revision; 
 
 # Check the second member
 # TEST
@@ -72,10 +81,53 @@
 # TEST
 isa_ok($externals->[1]->revision(), '_p_svn_opt_revision_t');
 # TEST
-is($externals->[1]->revision()->kind(), $SVN::Core::opt_revision_head);
+is($externals->[1]->revision()->kind(), 
+   $SVN::Core::opt_revision_number);
 # TEST
 isa_ok($externals->[1]->peg_revision(), '_p_svn_opt_revision_t');
 # TEST
 is($externals->[1]->peg_revision()->kind(),
-   $SVN::Core::opt_revision_head);
+   $SVN::Core::opt_revision_number);
+# TEST
+is($externals->[1]->peg_revision()->value()->number(), 3);
+# save this _p_svn_opt_revision_t for later tests
+my $opt_revision_number = $externals->[1]->peg_revision; 
 
+
+# create a repo with three revisions in it
+my $repospath = tempdir('svn-perl-test-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $reposurl = "file://$repospath";
+{
+    my $repos = SVN::Repos::create("$repospath", undef, undef, undef, undef);
+    foreach (qw( trunk tags branches ))
+    {
+        my $editor = SVN::Delta::Editor->
+            new(SVN::Repos::get_commit_editor($repos, $reposurl,
+                                              '/', 'root', "mkdir $_", 
+                                              sub { }));
+        my $rootbaton = $editor->open_root(0);
+        my $dirbaton = $editor->add_directory($_, $rootbaton, undef, 0);
+        $editor->close_edit();
+    }
+}
+
+# use the two _p_svn_opt_revision_t's from above as the "end" revision
+# parameter in SVN::Client::log2 and compare the result to using equivalent
+# literal values
+my $client = SVN::Client->new();
+# TEST
+is_deeply(get_log2($opt_revision_head),      # got
+          get_log2("HEAD"));                 # expected
+# TEST
+is_deeply(get_log2($opt_revision_number),    # got
+          get_log2(3));                      # expected
+
+sub get_log2 {
+    my ($end) = @_;
+    my @log;
+    $client->log2($reposurl, 1, $end, 99, 0, 0, sub { 
+        my (undef, $revision, $author, $date, $msg, undef) = @_; 
+        push @log, [ $revision, $author, $date, $msg ];
+    });
+    return \@log;
+}
