[svk-commit] r2197 - in trunk: t
mndrix at bestpractical.com
mndrix at bestpractical.com
Wed Nov 22 11:37:17 EST 2006
Author: mndrix
Date: Wed Nov 22 11:37:17 2006
New Revision: 2197
Modified:
trunk/lib/SVK/Command/Info.pm
trunk/t/28info.t
Log:
Implement 'Last Changed Date' for the info command.
Modified: trunk/lib/SVK/Command/Info.pm
==============================================================================
--- trunk/lib/SVK/Command/Info.pm (original)
+++ trunk/lib/SVK/Command/Info.pm Wed Nov 22 11:37:17 2006
@@ -58,6 +58,7 @@
use SVK::Merge;
use SVK::I18N;
use YAML::Syck;
+use autouse 'SVK::Util' => qw( reformat_svn_date );
# XXX: provide -r which walks peg to the specified revision based on
# the root.
@@ -96,9 +97,14 @@
if $target->isa('SVK::Path::Checkout');
print loc("Depot Path: %1\n", $target->depotpath);
print loc("Revision: %1\n", $target->revision);
- if (defined (my $lastchanged = $target->root->node_created_rev($target->path))) {
- print loc("Last Changed Rev.: %1\n", $lastchanged);
- # XXX: last changed date
+ if (defined( my $lastchanged = $target->root->node_created_rev( $target->path ))) {
+ print loc( "Last Changed Rev.: %1\n", $lastchanged );
+ my $date
+ = $target->root->fs->revision_prop( $lastchanged, 'svn:date' );
+ print loc(
+ "Last Changed Date: %1\n",
+ reformat_svn_date( "%F", $date )
+ );
}
print loc("Mirrored From: %1, Rev. %2\n",$m->url, $m->fromrev)
Modified: trunk/t/28info.t
==============================================================================
--- trunk/t/28info.t (original)
+++ trunk/t/28info.t Wed Nov 22 11:37:17 2006
@@ -12,7 +12,7 @@
ok ($svk->info () > 0);
chdir ($copath);
-my @depot_info = ("Depot Path: //info-root", "Revision: 1", "Last Changed Rev.: 1", "");
+my @depot_info = ("Depot Path: //info-root", "Revision: 1", "Last Changed Rev.: 1", qr{\ALast Changed Date: \d+-\d+-\d+\z}, "");
my @co_info = ("Checkout Path: $corpath", @depot_info);
ok ($svk->info () == 0);
More information about the svk-commit
mailing list