aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2009-11-22 21:30:30 -0800
committerMax Howell2009-12-12 16:24:14 +0000
commitb3c1e0aba299c80b0466d86c9a3d1c07ecd03033 (patch)
tree7d24ba52fad56789bc45a1e821518c7003d427d6 /Library
parent4731add213b5bc4b1670b779d2bf9c3952377adb (diff)
downloadbrew-b3c1e0aba299c80b0466d86c9a3d1c07ecd03033.tar.bz2
Mercurial - recognize Google Code repos and support revisions.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb7
-rw-r--r--Library/Homebrew/formula.rb1
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