[svk-commit] r2628 - in branches/bm: lib/SVK lib/SVK/Command t/bm
nobody at bestpractical.com
nobody at bestpractical.com
Wed Dec 12 23:27:34 EST 2007
Author: clkao
Date: Wed Dec 12 23:27:32 2007
New Revision: 2628
Modified:
branches/bm/ (props changed)
branches/bm/lib/SVK/Command/Branch.pm
branches/bm/lib/SVK/Project.pm
branches/bm/t/bm/prop.t
Log:
r3801 at mtl: clkao | 2007-12-13 09:36:05 +0800
branch from train from hualien
r3802 at mtl: clkao | 2007-12-13 09:38:03 +0800
use path- rather than path_ for props, as most other svn props are in that style.
r3803 at mtl: clkao | 2007-12-13 09:38:59 +0800
look at the root of depot for props.
r3804 at mtl: clkao | 2007-12-13 09:42:16 +0800
load project from prop whenever we can
Modified: branches/bm/lib/SVK/Command/Branch.pm
==============================================================================
--- branches/bm/lib/SVK/Command/Branch.pm (original)
+++ branches/bm/lib/SVK/Command/Branch.pm Wed Dec 12 23:27:32 2007
@@ -94,13 +94,12 @@
my ($self, $target) = @_;
Carp::cluck unless $target->isa('SVK::Path') or $target->isa('SVK::Path::Checkout');
- my $proj = SVK::Project->create_from_prop($target) if $target->isa('SVK::Path');
$target = $target->source if $target->isa('SVK::Path::Checkout');
- $proj = SVK::Project->create_from_path(
- $target->depot,
- $target->path
- ) unless $proj;
-
+ my $proj =
+ SVK::Project->create_from_prop($target) ||
+ SVK::Project->create_from_path(
+ $target->depot,
+ $target->path );
return $proj;
}
Modified: branches/bm/lib/SVK/Project.pm
==============================================================================
--- branches/bm/lib/SVK/Project.pm (original)
+++ branches/bm/lib/SVK/Project.pm Wed Dec 12 23:27:32 2007
@@ -113,8 +113,8 @@
my $fs = $pathobj->depot->repos->fs;
my $root = $fs->revision_root( $fs->youngest_rev );
- my $allprops = $root->node_proplist($pathobj->depot->depotname);
- my ($depotroot) = $pathobj->path =~ m{^(/[^/]+/[^/]+).*$};
+ my $allprops = $root->node_proplist('/');
+ my ($depotroot) = '/';
my @projnames =
# grep { $_ ne $project_name && (($project_name) = $_) }
grep { $_ =~ s/^svk:project:([^:]+):.*$/$1/ }
@@ -125,14 +125,14 @@
my $project_name = $projnames[0];
my %props =
map { $_ => $allprops->{'svk:project:'.$project_name.':'.$_} }
- ('path_trunk', 'path_branches', 'path_tags');
+ ('path-trunk', 'path-branches', 'path-tags');
return SVK::Project->new(
{
name => $project_name,
depot => $pathobj->depot,
- trunk => $props{path_trunk},
- branch_location => $props{path_branches},
- tag_location => $props{path_tags},
+ trunk => $props{'path-trunk'},
+ branch_location => $props{'path-branches'},
+ tag_location => $props{'path-tags'},
local_root => "/local/${project_name}",
});
}
Modified: branches/bm/t/bm/prop.t
==============================================================================
--- branches/bm/t/bm/prop.t (original)
+++ branches/bm/t/bm/prop.t Wed Dec 12 23:27:32 2007
@@ -31,12 +31,12 @@
'hooks' => '/mirror/MyProject/hooks',
};
-$svk->propset('-m', "- project trunk path set", 'svk:project:MyProject:path_trunk',
+$svk->propset('-m', "- project trunk path set", 'svk:project:MyProject:path-trunk',
$proppath->{trunk}, "//");
-$svk->propset('-m', "- project branches path set", 'svk:project:MyProject:path_branches',
+$svk->propset('-m', "- project branches path set", 'svk:project:MyProject:path-branches',
$proppath->{branches}, "//");
-$svk->propset('-m', "- project tags path set", 'svk:project:MyProject:path_tags',
+$svk->propset('-m', "- project tags path set", 'svk:project:MyProject:path-tags',
$proppath->{tags}, "//");
-is_output ($svk, 'propget', ['svk:project:MyProject:path_trunk', '//'], [$proppath->{trunk}]);
+is_output ($svk, 'propget', ['svk:project:MyProject:path-trunk', '//'], [$proppath->{trunk}]);
is_output ($svk, 'branch', ['--list','//mirror/MyProject'], ['Foo']);
More information about the svk-commit
mailing list