Mercurial - recognize Google Code repos and support revisions.

This commit is contained in:
Adam Vandenberg 2009-11-22 21:30:30 -08:00 committed by Max Howell
parent 4731add213
commit b3c1e0aba2
2 changed files with 7 additions and 1 deletions

View File

@ -220,7 +220,12 @@ class MercurialDownloadStrategy <AbstractDownloadStrategy
url=@url.sub(%r[^hg://], '') url=@url.sub(%r[^hg://], '')
unless @clone.exist? unless @clone.exist?
safe_system 'hg', 'clone', url, @clone checkout_args = []
if (@spec == :revision) and @ref
checkout_args << '-r' << @ref
end
checkout_args << url << @clone
safe_system 'hg', 'clone', *checkout_args
else else
# TODO hg pull? # TODO hg pull?
puts "Repository already cloned" puts "Repository already cloned"

View File

@ -165,6 +165,7 @@ class Formula
when %r[^svn://] then SubversionDownloadStrategy when %r[^svn://] then SubversionDownloadStrategy
when %r[^svn+http://] then SubversionDownloadStrategy when %r[^svn+http://] then SubversionDownloadStrategy
when %r[^git://] then GitDownloadStrategy when %r[^git://] then GitDownloadStrategy
when %r[^https?://(.+?\.)?googlecode\.com/hg] then MercurialDownloadStrategy
when %r[^http://(.+?\.)?googlecode\.com/svn] then SubversionDownloadStrategy when %r[^http://(.+?\.)?googlecode\.com/svn] then SubversionDownloadStrategy
when %r[^http://(.+?\.)?sourceforge\.net/svnroot/] then SubversionDownloadStrategy when %r[^http://(.+?\.)?sourceforge\.net/svnroot/] then SubversionDownloadStrategy
when %r[^http://svn.apache.org/repos/] then SubversionDownloadStrategy when %r[^http://svn.apache.org/repos/] then SubversionDownloadStrategy