common/bin/hgforest.sh

changeset 900
ddf76977d04a
parent 889
1378ccca1c79
parent 790
6d7f27953da6
child 902
d832f6171acd
equal deleted inserted replaced
899:96f207364e46 900:ddf76977d04a
45 has_hash_bang="`head -n 1 "${whichhg}" | cut -b 1-2`" 45 has_hash_bang="`head -n 1 "${whichhg}" | cut -b 1-2`"
46 python="" 46 python=""
47 bpython="" 47 bpython=""
48 48
49 if [ "#!" = "$has_hash_bang" ] ; then 49 if [ "#!" = "$has_hash_bang" ] ; then
50 python="`head -n 1 ${whichhg} | cut -b 3-`" 50 python="`head -n 1 ${whichhg} | cut -b 3- | sed -e 's/^[ \t]*//;s/[ \t]*$//'`"
51 bpython="`basename "$python"`" 51 bpython="`basename "$python"`"
52 fi 52 fi
53 53
54 if [ -x "$python" -a ! -d "$python" -a "`${python} -V 2>&1 | cut -f 1 -d ' '`" = "Python" ] ; then 54 if [ -x "$python" -a ! -d "$python" -a "`${python} -V 2>&1 | cut -f 1 -d ' '`" = "Python" ] ; then
55 hg="${python} -u ${whichhg}" 55 hg="${python} -u ${whichhg}"

mercurial