diff options
author | Aaron Stone <aaron@serendipity.cx> | 2013-07-13 15:12:32 -0700 |
---|---|---|
committer | Aaron Stone <aaron@serendipity.cx> | 2013-07-13 15:12:32 -0700 |
commit | 1c8413e4fc88f84d813199100379d68c66a85a0e (patch) | |
tree | 17453c0d31043e47618f550873eb3a181b417bb4 /lib/puppet/provider/vcsrepo | |
parent | 19ef11eeaaefe654db6f324b30a7c955a0bb72fa (diff) | |
parent | 3a44f30fae68b3660c64aaddc8f226b0dadf2ea4 (diff) | |
download | puppet-vcsrepo-1c8413e4fc88f84d813199100379d68c66a85a0e.tar.gz puppet-vcsrepo-1c8413e4fc88f84d813199100379d68c66a85a0e.tar.bz2 |
Merge pull request #61 from hholzgra/master
"ensure => latest" support for bzr
Diffstat (limited to 'lib/puppet/provider/vcsrepo')
-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 |