Use sensible-editor as default instead of vi.

--- a/doc/hgrc.5.txt
+++ b/doc/hgrc.5.txt
@@ -831,7 +831,8 @@
 ``debug``
     Print debugging information. True or False. Default is False.
 ``editor``
-    The editor to use during a commit. Default is ``$EDITOR`` or ``vi``.
+    The editor to use during a commit. Default is ``$EDITOR`` or
+    ``sensible-editor``.
 ``fallbackencoding``
     Encoding to try if it's not possible to decode the changelog using
     UTF-8. Default is ISO-8859-1.
--- a/hgeditor
+++ b/hgeditor
@@ -7,7 +7,7 @@
 # only for Mercurial, modify this:
 case "${EDITOR}" in
     "")
-        EDITOR="vi"
+        EDITOR="sensible-editor"
         ;;
     emacs)
         EDITOR="$EDITOR -nw"
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1356,8 +1356,8 @@
     editor = ui.geteditor()
     cmdpath = util.find_exe(editor) or util.find_exe(editor.split()[0])
     if not cmdpath:
-        if editor == 'vi':
-            ui.write(_(" No commit editor set and can't find vi in PATH\n"))
+        if editor == 'sensible-editor':
+            ui.write(_(" No commit editor set and can't find sensible-editor in PATH\n"))
             ui.write(_(" (specify a commit editor in your configuration"
                        " file)\n"))
         else:
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -559,7 +559,7 @@
         return (os.environ.get("HGEDITOR") or
                 self.config("ui", "editor") or
                 os.environ.get("VISUAL") or
-                os.environ.get("EDITOR", "vi"))
+                os.environ.get("EDITOR", "sensible-editor"))
 
     def progress(self, topic, pos, item="", unit="", total=None):
         '''show a progress message
--- a/i18n/da.po
+++ b/i18n/da.po
@@ -7103,7 +7103,7 @@
 msgid "Checking commit editor...\n"
 msgstr ""
 
-msgid " No commit editor set and can't find vi in PATH\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
 msgstr ""
 
 msgid " (specify a commit editor in your .hgrc file)\n"
@@ -10199,7 +10199,7 @@
 "    editor it uses is determined by looking at the environment\n"
 "    variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n"
 "    non-empty one is chosen. If all of them are empty, the editor\n"
-"    defaults to 'vi'."
+"    defaults to 'sensible-editor'."
 msgstr ""
 
 msgid ""
--- a/i18n/de.po
+++ b/i18n/de.po
@@ -340,7 +340,7 @@
 "    editor it uses is determined by looking at the environment\n"
 "    variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n"
 "    non-empty one is chosen. If all of them are empty, the editor\n"
-"    defaults to 'vi'."
+"    defaults to 'sensible-editor'."
 msgstr ""
 
 msgid ""
@@ -16177,8 +16177,8 @@
 msgid "Checking commit editor...\n"
 msgstr "Prüfe Editor für Versionsmeldungen...\n"
 
-msgid " No commit editor set and can't find vi in PATH\n"
-msgstr " Kein Editor für Versionsmeldungen angegeben und vi nicht im PATH\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
+msgstr " Kein Editor für Versionsmeldungen angegeben und sensible-editor nicht im PATH\n"
 
 msgid " (specify a commit editor in your .hgrc file)\n"
 msgstr " (Gib einen Editor in der .hgrc Datei an!)\n"
--- a/i18n/el.po
+++ b/i18n/el.po
@@ -274,7 +274,7 @@
 "    editor it uses is determined by looking at the environment\n"
 "    variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n"
 "    non-empty one is chosen. If all of them are empty, the editor\n"
-"    defaults to 'vi'."
+"    defaults to 'sensible-editor'."
 msgstr ""
 
 msgid ""
@@ -11500,7 +11500,7 @@
 msgid "Checking commit editor...\n"
 msgstr ""
 
-msgid " No commit editor set and can't find vi in PATH\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
 msgstr ""
 
 msgid " (specify a commit editor in your .hgrc file)\n"
--- a/i18n/fr.po
+++ b/i18n/fr.po
@@ -299,7 +299,7 @@
 "    editor it uses is determined by looking at the environment\n"
 "    variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n"
 "    non-empty one is chosen. If all of them are empty, the editor\n"
-"    defaults to 'vi'."
+"    defaults to 'sensible-editor'."
 msgstr ""
 
 msgid ""
@@ -8228,7 +8228,7 @@
 msgid "Checking commit editor...\n"
 msgstr ""
 
-msgid " No commit editor set and can't find vi in PATH\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
 msgstr ""
 
 msgid " (specify a commit editor in your .hgrc file)\n"
--- a/i18n/it.po
+++ b/i18n/it.po
@@ -6842,8 +6842,8 @@
 msgid "Checking commit editor...\n"
 msgstr "Sto controllando l'editor per il commit...\n"
 
-msgid " No commit editor set and can't find vi in PATH\n"
-msgstr "Nessun editor per il commit trovato e non trovo vi in PATH\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
+msgstr "Nessun editor per il commit trovato e non trovo sensible-editor in PATH\n"
 
 msgid " (specify a commit editor in your .hgrc file)\n"
 msgstr " (specificare un editore per il commit nel proprio file .hgrc)\n"
@@ -10271,7 +10271,7 @@
 "    editor it uses is determined by looking at the environment\n"
 "    variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n"
 "    non-empty one is chosen. If all of them are empty, the editor\n"
-"    defaults to 'vi'."
+"    defaults to 'sensible-editor'."
 msgstr ""
 
 msgid ""
--- a/i18n/ja.po
+++ b/i18n/ja.po
@@ -7414,8 +7414,8 @@
 msgid "Checking commit editor...\n"
 msgstr "メッセージ入力用エディタの検証中...\n"
 
-msgid " No commit editor set and can't find vi in PATH\n"
-msgstr " エディタが起動できません(vi にも PATH が通っていません)\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
+msgstr " エディタが起動できません(sensible-editor にも PATH が通っていません)\n"
 
 msgid " (specify a commit editor in your configuration file)\n"
 msgstr " (コミットメッセージ用エディタを設定ファイルで設定してください)\n"
@@ -10847,14 +10847,14 @@
 "    editor it uses is determined by looking at the environment\n"
 "    variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n"
 "    non-empty one is chosen. If all of them are empty, the editor\n"
-"    defaults to 'vi'."
+"    defaults to 'sensible-editor'."
 msgstr ""
 "EDITOR\n"
 "    コミット時のメッセージのように、エディタでファイルを開き、ユーザによる\n"
 "    編集を促す状況があります。そこで使用されるエディタは、HGEDITOR、VISUAL\n"
 "    あるいは EDITOR 環境変数に設定されたものを(この順序で)使用します。\n"
 "    最初の空で無い値に設定された環境変数の値を使用します。いずれも未設定\n"
-"    (あるいは空)の場合は、'vi' が使用されます。"
+"    (あるいは空)の場合は、'sensible-editor' が使用されます。"
 
 msgid ""
 "PYTHONPATH\n"
--- a/i18n/pt_BR.po
+++ b/i18n/pt_BR.po
@@ -8236,8 +8236,8 @@
 msgid "Checking commit editor...\n"
 msgstr "Verificando editor para consolidação...\n"
 
-msgid " No commit editor set and can't find vi in PATH\n"
-msgstr " Nenhum editor para consolidação configurado, e não foi possível encontrar 'vi' no PATH\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
+msgstr " Nenhum editor para consolidação configurado, e não foi possível encontrar 'sensible-editor' no PATH\n"
 
 msgid " (specify a commit editor in your configuration file)\n"
 msgstr " (especifique um editor para consolidação em seu arquivo de configuração)\n"
@@ -11716,7 +11716,7 @@
 "    editor it uses is determined by looking at the environment\n"
 "    variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n"
 "    non-empty one is chosen. If all of them are empty, the editor\n"
-"    defaults to 'vi'."
+"    defaults to 'sensible-editor'."
 msgstr ""
 "EDITOR\n"
 "    Algumas vezes o Mercurial precisa abrir em um editor um arquivo\n"
@@ -11724,7 +11724,7 @@
 "    mensagens de consolidação. O editor usado é determinado pela\n"
 "    consulta às variáveis de ambiente HGEDITOR, VISUAL e EDITOR,\n"
 "    nessa ordem. O primeiro valor não vazio é escolhido. Se todos\n"
-"    estiverem vazios, o editor será o 'vi'."
+"    estiverem vazios, o editor será o 'sensible-editor'."
 
 msgid ""
 "PYTHONPATH\n"
--- a/i18n/sv.po
+++ b/i18n/sv.po
@@ -6799,7 +6799,7 @@
 msgid "Checking commit editor...\n"
 msgstr ""
 
-msgid " No commit editor set and can't find vi in PATH\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
 msgstr ""
 
 msgid " (specify a commit editor in your .hgrc file)\n"
@@ -10095,7 +10095,7 @@
 "    editor it uses is determined by looking at the environment\n"
 "    variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n"
 "    non-empty one is chosen. If all of them are empty, the editor\n"
-"    defaults to 'vi'."
+"    defaults to 'sensible-editor'."
 msgstr ""
 
 msgid ""
--- a/i18n/zh_CN.po
+++ b/i18n/zh_CN.po
@@ -5880,7 +5880,7 @@
 msgid "Checking commit editor...\n"
 msgstr ""
 
-msgid " No commit editor set and can't find vi in PATH\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
 msgstr ""
 
 msgid " (specify a commit editor in your .hgrc file)\n"
@@ -8768,7 +8768,7 @@
 "    editor it uses is determined by looking at the environment\n"
 "    variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n"
 "    non-empty one is chosen. If all of them are empty, the editor\n"
-"    defaults to 'vi'."
+"    defaults to 'sensible-editor'."
 msgstr ""
 
 msgid ""
--- a/i18n/zh_TW.po
+++ b/i18n/zh_TW.po
@@ -219,7 +219,7 @@
 "    editor it uses is determined by looking at the environment\n"
 "    variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n"
 "    non-empty one is chosen. If all of them are empty, the editor\n"
-"    defaults to 'vi'."
+"    defaults to 'sensible-editor'."
 msgstr ""
 
 msgid ""
@@ -6828,7 +6828,7 @@
 msgid "Checking commit editor...\n"
 msgstr ""
 
-msgid " No commit editor set and can't find vi in PATH\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
 msgstr ""
 
 msgid " (specify a commit editor in your .hgrc file)\n"
--- a/mercurial/help/environment.txt
+++ b/mercurial/help/environment.txt
@@ -79,7 +79,7 @@
     editor it uses is determined by looking at the environment
     variables HGEDITOR, VISUAL and EDITOR, in that order. The first
     non-empty one is chosen. If all of them are empty, the editor
-    defaults to 'vi'.
+    defaults to 'sensible-editor'.
 
 PYTHONPATH
     This is used by Python to find imported modules and may need to be
