#! /bin/sh # pull - Import from the COLA Mercurial repository set -e thisdir=`echo "$0" | sed -e 's%/[^/]*$%%'` test "X$thisdir" = "X$0" && thisdir=. cd "$thisdir" # Find the current patch we're working on current=`hg qtop` || current= if test -n "$current"; then # Unapply all patches echo "Unapplying from $current" hg qpop -a fi # Get the mainline hg pull http://fig.org/ocean/hg.cgi hg update # Get the patches if test -d .hg/patches; then : else echo "Initializing .hg/patches" hg qinit -c fi (cd .hg/patches && \ hg pull http://fig.org/ocean/mq.cgi && hg update) if test -n "$current"; then # Reapply up to the patch we were on echo "Reapplying to $current" hg qgoto $current fi