diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 7 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index a319416bf..766d21c9e 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -220,7 +220,12 @@ class MercurialDownloadStrategy <AbstractDownloadStrategy url=@url.sub(%r[^hg://], '') 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 # TODO hg pull? puts "Repository already cloned" diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 8c4614a3d..d76769bed 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -165,6 +165,7 @@ class Formula when %r[^svn://] then SubversionDownloadStrategy when %r[^svn+http://] then SubversionDownloadStrategy when %r[^git://] then GitDownloadStrategy + when %r[^https?://(.+?\.)?googlecode\.com/hg] then MercurialDownloadStrategy when %r[^http://(.+?\.)?googlecode\.com/svn] then SubversionDownloadStrategy when %r[^http://(.+?\.)?sourceforge\.net/svnroot/] then SubversionDownloadStrategy when %r[^http://svn.apache.org/repos/] then SubversionDownloadStrategy |
