summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel DiSisto <ddisisto@gmail.com>2015-03-06 17:01:38 +1100
committerDaniel DiSisto <ddisisto@gmail.com>2015-03-06 17:01:38 +1100
commit7fdfa1b4047e134053f6df95f414cb3fc44796cd (patch)
tree71b70ebadb1e2754a7aea7f45dc8061e42cb34c9 /lib
parent9a955b8746f373a1a3e47ebf67d4186b98e0094f (diff)
(MODULES-1551) Add support for SVN conflict handling
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/vcsrepo/svn.rb7
-rw-r--r--lib/puppet/type/vcsrepo.rb7
2 files changed, 13 insertions, 1 deletions
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 3bf4029..52eace8 100644
--- a/lib/puppet/type/vcsrepo.rb
+++ b/lib/puppet/type/vcsrepo.rb
@@ -46,6 +46,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
@@ -214,6 +217,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