diff options
author | Hartmut Holzgraefe <hartmut@php.net> | 2013-03-23 00:44:06 +0100 |
---|---|---|
committer | Hartmut Holzgraefe <hartmut@php.net> | 2013-03-23 00:44:06 +0100 |
commit | 3a44f30fae68b3660c64aaddc8f226b0dadf2ea4 (patch) | |
tree | d238da76866f457f37a6f1f64797fbc358f3f21f /lib | |
parent | f83f79816e71cbd5c92ef01f6cd26e52fa95e6b2 (diff) | |
download | puppet-vcsrepo-3a44f30fae68b3660c64aaddc8f226b0dadf2ea4.tar.gz puppet-vcsrepo-3a44f30fae68b3660c64aaddc8f226b0dadf2ea4.tar.bz2 |
"ensure => latest" support for bzr
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/provider/vcsrepo/bzr.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/puppet/provider/vcsrepo/bzr.rb b/lib/puppet/provider/vcsrepo/bzr.rb index 6169929..fff25b3 100644 --- a/lib/puppet/provider/vcsrepo/bzr.rb +++ b/lib/puppet/provider/vcsrepo/bzr.rb @@ -45,7 +45,25 @@ Puppet::Type.type(:vcsrepo).provide(:bzr, :parent => Puppet::Provider::Vcsrepo) end def revision=(desired) - bzr('update', '-r', desired, @resource.value(:path)) + at_path do + begin + bzr('update', '-r', desired) + rescue Puppet::ExecutionFailure + bzr('update', '-r', desired, ':parent') + end + end + end + + def latest + at_path do + bzr('version-info', ':parent')[/^revision-id:\s+(\S+)/, 1] + end + end + + def latest? + at_path do + return self.revision == self.latest + end end private |