File tree 2 files changed +12
-8
lines changed
lib/puppet/provider/vcsrepo
spec/unit/puppet/provider/vcsrepo
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 4
4
desc "Supports Subversion repositories"
5
5
6
6
optional_commands :svn => 'svn' ,
7
- :svnadmin => 'svnadmin'
7
+ :svnadmin => 'svnadmin' ,
8
+ :svnlook => 'svnlook'
8
9
9
10
has_features :filesystem_types , :reference_tracking , :basic_auth , :configuration
10
11
@@ -20,7 +21,13 @@ def create
20
21
end
21
22
22
23
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
24
31
end
25
32
26
33
def exists?
@@ -33,11 +40,7 @@ def destroy
33
40
34
41
def latest?
35
42
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
41
44
end
42
45
end
43
46
@@ -57,7 +60,7 @@ def buildargs
57
60
args . push ( '--config-dir' , @resource . value ( :configuration ) )
58
61
end
59
62
60
- return args
63
+ args
61
64
end
62
65
63
66
def latest
Original file line number Diff line number Diff line change 49
49
50
50
describe "checking existence" do
51
51
it "should check for the directory" do
52
+ expects_directory? ( true , resource . value ( :path ) )
52
53
expects_directory? ( true , File . join ( resource . value ( :path ) , '.svn' ) )
53
54
provider . exists?
54
55
end
You can’t perform that action at this time.
0 commit comments