diff options
Diffstat (limited to 'lib/puppet/provider/vcsrepo')
-rw-r--r-- | lib/puppet/provider/vcsrepo/hg.rb | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/puppet/provider/vcsrepo/hg.rb b/lib/puppet/provider/vcsrepo/hg.rb index 0a2e5b7..0212d50 100644 --- a/lib/puppet/provider/vcsrepo/hg.rb +++ b/lib/puppet/provider/vcsrepo/hg.rb @@ -48,21 +48,16 @@ Puppet::Type.type(:vcsrepo).provide(:hg, :parent => Puppet::Provider::Vcsrepo) d at_path do current = hg('parents')[/^changeset:\s+(?:-?\d+):(\S+)/m, 1] desired = @resource.value(:revision) - if current == desired - current - else + if desired + # Return the tag name if it maps to the current nodeid mapped = hg('tags')[/^#{Regexp.quote(desired)}\s+\d+:(\S+)/m, 1] - if mapped - # A tag, return that tag if it maps to the current nodeid - if current == mapped - desired - else - current - end + if current == mapped + desired else - # Use the current nodeid current end + else + current end end end |