switch to pip-based install

Thu, 19 Dec 2019 04:45:15 +0000

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 19 Dec 2019 04:45:15 +0000
changeset 839
0beae3c33263
parent 838
8ffc265b413a
child 840
77fce3af6e0c

switch to pip-based install

bin/setup-hg-evolve file | annotate | diff | comparison | revisions
bin/setup-hg-git file | annotate | diff | comparison | revisions
--- 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
+
--- a/bin/setup-hg-git
+++ b/bin/setup-hg-git
@@ -1,12 +1,13 @@
-#!/bin/sh
-set -eu
+#!/bin/bash
+set -eu -o pipefail
 
-if [ -d ~/.hgext/hg-git ]; then
-  hg -R ~/.hgext/hg-git fetch
-else
-  hg clone https://bitbucket.org/durin42/hg-git ~/.hgext/hg-git
-
-  [ -f ~/.hgext/hgrc ] || echo '[extensions]' > ~/.hgext/hgrc
-  echo 'hggit = ~/.hgext/hg-git/hggit' >> ~/.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-git
+
+if ! grep -qsw hggit ~/.hgext/hgrc; then
+  printf '[extensions]\nhggit =\n' >> ~/.hgext/hgrc
+fi

mercurial