Use sensible-editor as default instead of vi.

--- a/doc/hgrc.5.txt
+++ b/doc/hgrc.5.txt
@@ -745,7 +745,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/doc/ja/hg.1.ja.txt
+++ b/doc/ja/hg.1.ja.txt
@@ -813,7 +813,7 @@
 EDITOR::
     これは hgmerge スクリプト中で使われるエディタの名前です。もし
     HGEDITOR が設定されていなければ、コミット時のメッセージに使わ
-    れます。デフォルトは 'vi' です。
+    れます。デフォルトは 'sensible-editor' です。
 
 PYTHONPATH::
     これはインポートされるモジュールを見つけるために Python によっ
--- a/doc/ja/hgrc.5.ja.txt
+++ b/doc/ja/hgrc.5.ja.txt
@@ -119,7 +119,7 @@
     では False です。
   editor;;
     コミット中に使用するエディタです。デフォルトは $EDITOR か
-    "vi" です。
+    "sensible-editor" です。
   interactive;;
     ユーザに対してプロンプトを出すようにします。True か False を取
     ります。デフォルトでは True です。
--- 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
@@ -1019,8 +1019,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 .hgrc file)\n"))
         else:
             ui.write(_(" Can't find editor '%s' in PATH\n") % editor)
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -353,7 +353,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/help/environment.txt
+++ b/help/environment.txt
@@ -69,7 +69,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
--- a/i18n/da.po
+++ b/i18n/da.po
@@ -308,7 +308,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'.\n"
+"    defaults to 'sensible-editor'.\n"
 "\n"
 "PYTHONPATH\n"
 "    This is used by Python to find imported modules and may need to be\n"
@@ -6094,7 +6094,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/de.po
+++ b/i18n/de.po
@@ -314,7 +314,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'.\n"
+"    defaults to 'sensible-editor'.\n"
 "\n"
 "PYTHONPATH\n"
 "    This is used by Python to find imported modules and may need to be\n"
@@ -6749,8 +6749,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
@@ -222,7 +222,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'.\n"
+"    defaults to 'sensible-editor'.\n"
 "\n"
 "PYTHONPATH\n"
 "    This is used by Python to find imported modules and may need to be\n"
@@ -5377,7 +5377,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
@@ -260,7 +260,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'.\n"
+"    defaults to 'sensible-editor'.\n"
 "\n"
 "PYTHONPATH\n"
 "    This is used by Python to find imported modules and may need to be\n"
@@ -5803,7 +5803,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
@@ -181,7 +181,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'.\n"
+"    defaults to 'sensible-editor'.\n"
 "\n"
 "PYTHONPATH\n"
 "    This is used by Python to find imported modules and may need to be\n"
@@ -5553,8 +5553,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"
--- a/i18n/ja.po
+++ b/i18n/ja.po
@@ -415,7 +415,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'.\n"
+"    defaults to 'sensible-editor'.\n"
 "\n"
 "PYTHONPATH\n"
 "    This is used by Python to find imported modules and may need to be\n"
@@ -497,7 +497,7 @@
 "    編集を促す状況があります。そこで使用されるエディタは、HGEDITOR、VISUAL\n"
 "    あるいは EDITOR 環境変数に設定されたものを(この順序で)使用します。\n"
 "    最初の空で無い値に設定された環境変数の値を使用します。いずれも未設定\n"
-"    (あるいは空)の場合は、'vi' が使用されます。\n"
+"    (あるいは空)の場合は、'sensible-editor' が使用されます。\n"
 "\n"
 "PYTHONPATH\n"
 "    Mercurial が当該システムの共有領域にインストールされていない場合、\n"
@@ -6869,8 +6869,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 .hgrc file)\n"
 msgstr " (コミットメッセージ用エディタを設定ファイルで設定してください)\n"
--- a/i18n/pt_BR.po
+++ b/i18n/pt_BR.po
@@ -358,7 +358,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'.\n"
+"    defaults to 'sensible-editor'.\n"
 "\n"
 "PYTHONPATH\n"
 "    This is used by Python to find imported modules and may need to be\n"
@@ -440,7 +440,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'.\n"
+"    estiverem vazios, o editor será o 'sensible-editor'.\n"
 "\n"
 "PYTHONPATH\n"
 "    Isto é usado pelo Python para localizar módulos importados, e\n"
@@ -7850,10 +7850,10 @@
 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"
+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 "
-"'vi' no PATH\n"
+"'sensible-editor' no PATH\n"
 
 msgid " (specify a commit editor in your .hgrc file)\n"
 msgstr " (especifique um editor para consolidação em seu arquivo .hgrc)\n"
--- a/i18n/sv.po
+++ b/i18n/sv.po
@@ -229,7 +229,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'.\n"
+"    defaults to 'sensible-editor'.\n"
 "\n"
 "PYTHONPATH\n"
 "    This is used by Python to find imported modules and may need to be\n"
@@ -5476,7 +5476,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/zh_CN.po
+++ b/i18n/zh_CN.po
@@ -5190,7 +5190,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"
@@ -7565,7 +7565,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'.\n"
+"    defaults to 'sensible-editor'.\n"
 "\n"
 "PYTHONPATH\n"
 "    This is used by Python to find imported modules and may need to be\n"
--- a/i18n/zh_TW.po
+++ b/i18n/zh_TW.po
@@ -182,7 +182,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'.\n"
+"    defaults to 'sensible-editor'.\n"
 "\n"
 "PYTHONPATH\n"
 "    This is used by Python to find imported modules and may need to be\n"
@@ -5501,7 +5501,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"
