[svk-commit] r2977 - in trunk: lib/SVK t/bm

nobody at bestpractical.com nobody at bestpractical.com
Mon Jul 7 04:37:26 EDT 2008


Author: clsung
Date: Mon Jul  7 04:37:26 2008
New Revision: 2977

Modified:
   trunk/lib/SVK/Command/Branch.pm
   trunk/lib/SVK/Command/Info.pm
   trunk/lib/SVK/Project.pm
   trunk/t/bm/create-nocheckout.t
   trunk/t/bm/create.t

Log:
- svk info should show branch info if we have it
  - ref: http://task.hm/FR74

Modified: trunk/lib/SVK/Command/Branch.pm
==============================================================================
--- trunk/lib/SVK/Command/Branch.pm	(original)
+++ trunk/lib/SVK/Command/Branch.pm	Mon Jul  7 04:37:26 2008
@@ -99,7 +99,7 @@
     my ( $self, $proj, $target, @options ) = @_;
 
     if ($proj) {
-        $proj->info($target);
+        $proj->info($target, 1);
     } else {
         $target->root->check_path($target->path)
             or die loc("Path %1 does not exist.\n", $target->depotpath);

Modified: trunk/lib/SVK/Command/Info.pm
==============================================================================
--- trunk/lib/SVK/Command/Info.pm	(original)
+++ trunk/lib/SVK/Command/Info.pm	Mon Jul  7 04:37:26 2008
@@ -59,6 +59,7 @@
 use SVK::I18N;
 use YAML::Syck;
 use SVK::Logger;
+use SVK::Project;
 use autouse 'SVK::Util' => qw( reformat_svn_date );
 
 # XXX: provide -r which walks peg to the specified revision based on
@@ -94,9 +95,13 @@
 
     my ($m, $mpath) = $target->is_mirrored;
 
+    my ($proj) = SVK::Project->create_from_path(
+	         $target->depot, $target->path );
+
     $logger->info( loc("Checkout Path: %1\n",$target->copath))
 	if $target->isa('SVK::Path::Checkout');
     $logger->info( loc("Depot Path: %1\n", $target->depotpath));
+    $proj->info($target) if $proj;
     $logger->info( loc("Revision: %1\n", $target->revision));
     if (defined( my $lastchanged = $target->root->node_created_rev( $target->path ))) {
         $logger->info( loc( "Last Changed Rev.: %1\n", $lastchanged ));

Modified: trunk/lib/SVK/Project.pm
==============================================================================
--- trunk/lib/SVK/Project.pm	(original)
+++ trunk/lib/SVK/Project.pm	Mon Jul  7 04:37:26 2008
@@ -357,7 +357,7 @@
 }
 
 sub info {
-    my ($self, $target) = @_;
+    my ($self, $target, $verbose) = @_;
 
     $logger->info ( loc("Project name: %1\n", $self->name));
     if ($target->isa('SVK::Path::Checkout')) {
@@ -376,6 +376,7 @@
 
 	if ($where) {
 	    $logger->info ( loc("Branch: %1 (%2)\n", $bname, $where ));
+	    return unless $verbose;
 	    $logger->info ( loc("Repository path: %1\n", $target->depotpath ));
 	    if ($where ne 'trunk') { # project trunk should not have Copied info
 		if (my $copy_ancestor = ($target->copy_ancestors)[0]) {

Modified: trunk/t/bm/create-nocheckout.t
==============================================================================
--- trunk/t/bm/create-nocheckout.t	(original)
+++ trunk/t/bm/create-nocheckout.t	Mon Jul  7 04:37:26 2008
@@ -40,6 +40,7 @@
 
 is_output ($svk, 'info',['//mirror/MyProject/branches/feature/foobar'],
     ["Depot Path: //mirror/MyProject/branches/feature/foobar",
+     "Project name: MyProject",
      "Revision: 8", "Last Changed Rev.: 8",
      qr/Last Changed Date: \d{4}-\d{2}-\d{2}/,
      "Mirrored From: $uri, Rev. 7",

Modified: trunk/t/bm/create.t
==============================================================================
--- trunk/t/bm/create.t	(original)
+++ trunk/t/bm/create.t	Mon Jul  7 04:37:26 2008
@@ -54,6 +54,7 @@
 
 is_output ($svk, 'info',['//mirror/MyProject/branches/feature/foobar'],
     ["Depot Path: //mirror/MyProject/branches/feature/foobar",
+     "Project name: MyProject",
      "Revision: 12", "Last Changed Rev.: 12",
      qr/Last Changed Date: \d{4}-\d{2}-\d{2}/,
      "Mirrored From: $uri, Rev. 9",
@@ -92,6 +93,7 @@
 #$svk->br("--info", "bug-in-release-10"
 is_output ($svk, 'info',['//mirror/MyProject/branches/bug-in-release-1'],
     ["Depot Path: //mirror/MyProject/branches/bug-in-release-1",
+     "Project name: MyProject",
      "Revision: 15", "Last Changed Rev.: 15",
      qr/Last Changed Date: \d{4}-\d{2}-\d{2}/,
      "Mirrored From: $uri, Rev. 12",


More information about the svk-commit mailing list