bin/setup-hg-evolve

changeset 839
0beae3c33263
parent 591
2ee456c483b0
child 841
f5eaa175beb4
--- a/bin/setup-hg-evolve
+++ b/bin/setup-hg-evolve
@@ -1,12 +1,14 @@
-#!/bin/sh
-set -eu
+#!/bin/bash
+set -eu -o pipefail
 
-if [ -d ~/.hgext/evolve ]; then
-  hg -R ~/.hgext/evolve fetch
-else
-  hg clone https://www.mercurial-scm.org/repo/evolve ~/.hgext/evolve
-
-  [ -f ~/.hgext/hgrc ] || echo '[extensions]' > ~/.hgext/hgrc
-  echo 'evolve = ~/.hgext/evolve/hgext3rd/evolve' >> ~/.hgext/hgrc
+if ! (command -v pip2 && pip2 -V) &>/dev/null; then
+  curl -fsSL --compressed https://bootstrap.pypa.io/get-pip.py |
+    python2 - --user
 fi
 
+pip2 install --user --upgrade hg-evolve
+
+if ! grep -qsw evolve ~/.hgext/hgrc; then
+  printf '[extensions]\nevolve =\n' >> ~/.hgext/hgrc
+fi
+

mercurial