##// END OF EJS Templates
inno: remove w9xpopen.exe...
inno: remove w9xpopen.exe w9xpopen.exe is a utility program shipped with Python <3.4 (https://bugs.python.org/issue14470 tracked its removal). The program was used by subprocess to wrap invoked processes on Windows 95 and 98 or when command.com was used in order to work around a redirect bug. The workaround is only used on ancient Windows versions - versions that we shouldn't see in 2019. While Python 2.7's subprocess module still references w9xpopen.exe, not shipping it shouldn't matter unless we're running an ancient version of Windows. Python will raise an exception if w9xpopen.exe can't be found. It's highly unlikely anyone is using current Mercurial releases on these ancient Windows versions. So remove w9xpopen.exe from the Inno installer. .. bc:: The 32-bit Windows Inno installers no longer distribute w9xpopen.exe. This should only impact people running Mercurial on Windows 95, 98, or ME. Differential Revision: https://phab.mercurial-scm.org/D6068

File last commit:

r26804:61250290 default
r42021:2dbdb9ab default
Show More
editmerge
58 lines | 1.4 KiB | text/plain | TextLexer
#!/usr/bin/env bash
# A simple script for opening merge conflicts in the editor.
# Use the following Mercurial settings to enable it.
#
# [ui]
# merge = editmerge
#
# [merge-tools]
# editmerge.args=$output
# editmerge.check=changed
# editmerge.premerge=keep
FILE="$1"
getlines() {
grep -n "^<<<<<<" "$FILE" | cut -f1 -d:
}
# editor preference loosely based on https://mercurial-scm.org/wiki/editor
# hg showconfig is at the bottom though, since it's slow to run (0.15 seconds)
ED="$HGEDITOR"
if [ "$ED" = "" ] ; then
ED="$VISUAL"
fi
if [ "$ED" = "" ] ; then
ED="$EDITOR"
fi
if [ "$ED" = "" ] ; then
ED="$(hg showconfig ui.editor)"
fi
if [ "$ED" = "" ] ; then
echo "merge failed - unable to find editor"
exit 1
fi
if [ "$ED" = "emacs" ] || [ "$ED" = "nano" ] || [ "$ED" = "vim" ] ; then
FIRSTLINE="$(getlines | head -n 1)"
PREVIOUSLINE=""
# open the editor to the first conflict until there are no more
# or the user stops editing the file
while [ ! "$FIRSTLINE" = "" ] && [ ! "$FIRSTLINE" = "$PREVIOUSLINE" ] ; do
$ED "+$FIRSTLINE" "$FILE"
PREVIOUSLINE="$FIRSTLINE"
FIRSTLINE="$(getlines | head -n 1)"
done
else
$ED "$FILE"
fi
# get the line numbers of the remaining conflicts
CONFLICTS="$(getlines | sed ':a;N;$!ba;s/\n/, /g')"
if [ ! "$CONFLICTS" = "" ] ; then
echo "merge failed - resolve the conflicts (line $CONFLICTS) then use 'hg resolve --mark'"
exit 1
fi
exit 0