From 54aff61ef61b90bd77577f02be62b09622c62cb5 Mon Sep 17 00:00:00 2001
From: Max Howell <max@methylblue.com>
Date: Sat, 5 Dec 2009 17:28:01 +0000
Subject: [PATCH] Prompt user to use pip for Hg and Bzr

---
 Library/Homebrew/brew.h.rb | 21 +++++++++++++++++++++
 bin/brew                   |  4 ++++
 2 files changed, 25 insertions(+)

diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index 400602ad41..7ca9ecffbf 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -24,6 +24,27 @@
 FORMULA_META_FILES = %w[README ChangeLog COPYING LICENSE COPYRIGHT AUTHORS]
 PLEASE_REPORT_BUG = "#{Tty.white}Please report this bug at #{Tty.em}http://github.com/mxcl/homebrew/issues#{Tty.reset}"
 
+def check_for_blacklisted_formula names
+  return if ARGV.force?
+
+  names.each do |name|
+    case name
+    when 'bazaar', 'bzr' then abort <<-EOS
+Bazaar can be installed thusly:
+
+    brew install pip && pip install bzr==2.0.1
+
+    EOS
+    when 'mercurial', 'hg' then abort <<-EOS
+Mercurial can be install thusly:
+
+    brew install pip && pip install mercurial
+
+    EOS
+    end
+  end
+end
+
 def __make url, name
   require 'formula'
 
diff --git a/bin/brew b/bin/brew
index f23f10fbb7..ed7a5124ed 100755
--- a/bin/brew
+++ b/bin/brew
@@ -100,6 +100,8 @@ begin
       end
 
     when 'search', '-S'
+      check_for_blacklisted_formula(ARGV.named)
+
       require "formula"
       formulae = Formulary.names with_aliases=true
 
@@ -199,6 +201,8 @@ begin
       end
 
   when 'install'
+    check_for_blacklisted_formula(ARGV.named)
+    
     require 'formula_installer'
     require 'hardware'
 
-- 
GitLab