diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/provider/vcsrepo/git.rb | 3 | ||||
-rw-r--r-- | lib/puppet/provider/vcsrepo/svn.rb | 7 | ||||
-rw-r--r-- | lib/puppet/type/vcsrepo.rb | 7 |
3 files changed, 15 insertions, 2 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index 8a8c12f..8101253 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -142,7 +142,8 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) # we loop around the hash. Otherwise, we assume single url specified # in source property if @resource.value(:source).is_a?(Hash) - @resource.value(:source).each do |remote_name, remote_url| + @resource.value(:source).keys.sort.each do |remote_name| + remote_url = @resource.value(:source)[remote_name] at_path { do_update |= update_remote_url(remote_name, remote_url) } end else diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb index a1b1714..905d5ad 100644 --- a/lib/puppet/provider/vcsrepo/svn.rb +++ b/lib/puppet/provider/vcsrepo/svn.rb @@ -7,7 +7,7 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) :svnadmin => 'svnadmin', :svnlook => 'svnlook' - has_features :filesystem_types, :reference_tracking, :basic_auth, :configuration + has_features :filesystem_types, :reference_tracking, :basic_auth, :configuration, :conflict def create if !@resource.value(:source) @@ -92,6 +92,11 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) else buildargs.push('update', '-r', desired) end + + if @resource.value(:conflict) + args.push('--accept', @resource.value(:conflict)) + end + at_path do svn(*args) end diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb index fdcf9ab..e5dfbb5 100644 --- a/lib/puppet/type/vcsrepo.rb +++ b/lib/puppet/type/vcsrepo.rb @@ -49,6 +49,9 @@ Puppet::Type.newtype(:vcsrepo) do feature :submodules, "The repository contains submodules which can be optionally initialized" + feature :conflict, + "The provider supports automatic conflict resolution" + ensurable do attr_accessor :latest @@ -221,6 +224,10 @@ Puppet::Type.newtype(:vcsrepo) do defaultto true end + newparam :conflict do + desc "The action to take if conflicts exist between repository and working copy" + end + autorequire(:package) do ['git', 'git-core'] end |