Skip to content

Commit f59c131

Browse files
committed
Merge pull request #83 from sodabrew/issue_8331_svnlook
Add support for master svn repositories
2 parents 1881688 + a2ef96e commit f59c131

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

lib/puppet/provider/vcsrepo/svn.rb

+11-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
desc "Supports Subversion repositories"
55

66
optional_commands :svn => 'svn',
7-
:svnadmin => 'svnadmin'
7+
:svnadmin => 'svnadmin',
8+
:svnlook => 'svnlook'
89

910
has_features :filesystem_types, :reference_tracking, :basic_auth, :configuration
1011

@@ -20,7 +21,13 @@ def create
2021
end
2122

2223
def working_copy_exists?
23-
File.directory?(File.join(@resource.value(:path), '.svn'))
24+
if File.directory?(@resource.value(:path))
25+
# :path is an svn checkout
26+
return true if File.directory?(File.join(@resource.value(:path), '.svn'))
27+
# :path is an svn server
28+
return true if svnlook('uuid', @resource.value(:path))
29+
end
30+
false
2431
end
2532

2633
def exists?
@@ -33,11 +40,7 @@ def destroy
3340

3441
def latest?
3542
at_path do
36-
if self.revision < self.latest then
37-
return false
38-
else
39-
return true
40-
end
43+
self.revision >= self.latest
4144
end
4245
end
4346

@@ -57,7 +60,7 @@ def buildargs
5760
args.push('--config-dir', @resource.value(:configuration))
5861
end
5962

60-
return args
63+
args
6164
end
6265

6366
def latest

spec/unit/puppet/provider/vcsrepo/svn_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
describe "checking existence" do
5151
it "should check for the directory" do
52+
expects_directory?(true, resource.value(:path))
5253
expects_directory?(true, File.join(resource.value(:path), '.svn'))
5354
provider.exists?
5455
end

0 commit comments

Comments
 (0)