Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
61 lines (48 sloc) 1.84 KB
# No head build supported; if you need head builds of Mercurial, do so outside
# of Homebrew.
class MercurialPython3 < Formula
desc "Scalable distributed version control system"
homepage ""
url ""
sha256 "29b850792f1f054cece5b8de8e815dbbe266e1d11814c3755290c0879883c0f8"
depends_on "python"
def install
ENV.prepend_path "PATH", Formula["python"].opt_libexec/"bin"
ENV["HGPYTHON3"] = "1"
system "make", "PREFIX=#{prefix}", "install-bin"
# Install chg (see
cd "contrib/chg" do
system "make", "PREFIX=#{prefix}", "HGPATH=#{bin}/hg", \
bin.install "chg"
# Configure a nicer default pager
(buildpath/"hgrc").write <<~EOS
pager = less -FRX
(etc/"mercurial").install "hgrc"
# Install man pages, which come pre-built in source releases
man1.install "doc/hg.1"
man5.install "doc/hgignore.5", "doc/hgrc.5"
# install the completion scripts
bash_completion.install "contrib/bash_completion" => "hg-completion.bash"
zsh_completion.install "contrib/zsh_completion" => "_hg"
def caveats
return unless (opt_bin/"hg").exist?
cacerts_configured = `#{opt_bin}/hg config web.cacerts`.strip
return if cacerts_configured.empty?
Homebrew has detected that Mercurial is configured to use a certificate
bundle file as its trust store for TLS connections instead of using the
default OpenSSL store. If you have trouble connecting to remote
repositories, consider unsetting the `web.cacerts` property. You can
determine where the property is being set by running:
hg config --debug web.cacerts
test do
system "#{bin}/hg", "init"
You can’t perform that action at this time.