Fixed Bug #9219 - vcsrepo updates too often

If vcsrepo is used with ensure => latest to keep something from a larger repository checked out it will trigger an update every time something changes anywhere in the repository, not just in the part that’s actually checked out.

In combination with a busy development team and a vcsrepo resource with notify => Service[foo] this means frequent restarts of a service for no good reason.

The attached patch solves the issue by looking at the “Last Changed Rev” line from svn info instead of “Revision”.

Patch thanks to: Knut Arne Bjørndal
This commit is contained in:
James Turnbull 2011-08-29 01:15:51 -07:00
parent 18d4cf890c
commit 4a89ed4d3b

View File

@ -55,14 +55,14 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo)
def latest
args = buildargs.push('info', '-r', 'HEAD')
at_path do
svn(*args)[/^Revision:\s+(\d+)/m, 1]
svn(*args)[/^Last Changed Rev:\s+(\d+)/m, 1]
end
end
def revision
args = buildargs.push('info')
at_path do
svn(*args)[/^Revision:\s+(\d+)/m, 1]
svn(*args)[/^Last Changed Rev:\s+(\d+)/m, 1]
end
end