Use sensible-editor as default instead of vi.

--- mercurial.orig/hgeditor
+++ mercurial/hgeditor
@@ -7,7 +7,7 @@
 # only for Mercurial, modify this:
 case "${EDITOR}" in
     "")
-        EDITOR="vi"
+        EDITOR="sensible-editor"
         ;;
     emacs)
         EDITOR="$EDITOR -nw"
--- mercurial.orig/mercurial/ui.py
+++ mercurial/mercurial/ui.py
@@ -1592,7 +1592,7 @@ class ui(object):
             # avoid confusion.
             editor = 'E'
         else:
-            editor = 'vi'
+            editor = 'sensible-editor'
         return (encoding.environ.get("HGEDITOR") or
                 self.config("ui", "editor", editor))
 
--- mercurial.orig/i18n/da.po
+++ mercurial/i18n/da.po
@@ -8752,7 +8752,7 @@ msgstr ""
 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 configuration file)\n"
@@ -13521,7 +13521,8 @@ msgstr ""
 
 msgid ""
 "``editor``\n"
-"    The editor to use during a commit. Default is ``$EDITOR`` or ``vi``."
+"    The editor to use during a commit. Default is ``$EDITOR`` or\n"
+"    ``sensible-editor``."
 msgstr ""
 
 msgid ""
@@ -14194,7 +14195,7 @@ msgid ""
 "    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 ""
--- mercurial.orig/i18n/de.po
+++ mercurial/i18n/de.po
@@ -11606,8 +11606,8 @@ msgstr " (Vorlagen scheinen falsch insta
 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 configuration file)\n"
 msgstr " (Gib einen Editor in der .hgrc Datei an!)\n"
@@ -17165,7 +17165,8 @@ msgstr ""
 
 msgid ""
 "``editor``\n"
-"    The editor to use during a commit. Default is ``$EDITOR`` or ``vi``."
+"    The editor to use during a commit. Default is ``$EDITOR`` or\n"
+"    ``sensible-editor``."
 msgstr ""
 
 msgid ""
@@ -18043,7 +18044,7 @@ msgid ""
 "    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"
 "    Manchmal muss Mercurial eine Textdatei in einem Editor öffnen, damit\n"
@@ -18052,7 +18053,7 @@ msgstr ""
 "    variablen HGEDITOR, VISUAL und EDITOR (in dieser Reihenfolge) "
 "ermittelt.\n"
 "    Der erste nicht-leere wird verwendet. Wenn alle Angaben leer sind,\n"
-"    wird die Voreinstellung 'vi' verwendet."
+"    wird die Voreinstellung 'sensible-editor' verwendet."
 
 msgid ""
 "PYTHONPATH\n"
--- mercurial.orig/i18n/el.po
+++ mercurial/i18n/el.po
@@ -274,7 +274,7 @@ msgid ""
 "    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 ""
@@ -6364,7 +6364,7 @@ msgstr ""
 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"
--- mercurial.orig/i18n/fr.po
+++ mercurial/i18n/fr.po
@@ -299,7 +299,7 @@ msgid ""
 "    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 ""
@@ -8201,7 +8201,7 @@ msgstr ""
 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"
--- mercurial.orig/i18n/it.po
+++ mercurial/i18n/it.po
@@ -7156,8 +7156,8 @@ msgstr ""
 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 configuration file)\n"
 msgstr ""
@@ -10461,7 +10461,7 @@ msgid ""
 "    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 ""
--- mercurial.orig/i18n/ja.po
+++ mercurial/i18n/ja.po
@@ -27204,10 +27204,12 @@ msgstr ""
 
 msgid ""
 "``editor``\n"
-"    The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)"
+"    The editor to use during a commit. (default: ``$EDITOR`` or\n"
+"    ``sensible-editor``)"
 msgstr ""
 "``editor``\n"
-"    コミットログ入力用エディタ。 (デフォルト値: ``$EDITOR`` または ``vi``)"
+"    コミットログ入力用エディタ。 (デフォルト値: ``$EDITOR`` または\n"
+"    ``sensible-editor``)"
 
 msgid ""
 "``fallbackencoding``\n"
@@ -28746,7 +28748,7 @@ msgid ""
 "    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"
@@ -28754,7 +28756,7 @@ msgstr ""
 "    そこで使用されるエディタは、 HGEDITOR、 VISUAL\n"
 "    あるいは EDITOR 環境変数に設定されたものを(この順序で)使用します。\n"
 "    最初の空で無い値に設定された環境変数の値を使用します。\n"
-"    いずれも未設定 (あるいは空) の場合は、 'vi' が使用されます。"
+"    いずれも未設定 (あるいは空) の場合は、 'sensible-editor' が使用されます。"
 
 msgid ""
 "PYTHONPATH\n"
--- mercurial.orig/i18n/pt_BR.po
+++ mercurial/i18n/pt_BR.po
@@ -28125,11 +28125,12 @@ msgstr ""
 
 msgid ""
 "``editor``\n"
-"    The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)"
+"    The editor to use during a commit. (default: ``$EDITOR`` or\n"
+"    ``sensible-editor``)"
 msgstr ""
 "``editor``\n"
 "    O editor usado durante um commit.\n"
-"    (padrão: ``$EDITOR`` ou ``vi``)"
+"    (padrão: ``$EDITOR`` ou ``sensible-editor``)"
 
 msgid ""
 "``fallbackencoding``\n"
@@ -29769,7 +29770,7 @@ msgid ""
 "    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"
@@ -29777,7 +29778,7 @@ msgstr ""
 "    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"
@@ -42087,10 +42088,10 @@ msgstr "falha ao matar threads trabalhad
 #~ msgid " (check that you compiled the extensions)\n"
 #~ msgstr " (verifique se você compilou as extensões)\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 " Can't find editor '%s' in PATH\n"
 #~ msgstr " Não é possível localizar editor '%s' no PATH\n"
--- mercurial.orig/i18n/sv.po
+++ mercurial/i18n/sv.po
@@ -9509,8 +9509,8 @@ msgstr " (mallar verkar vara inkorrekt i
 msgid "checking commit editor...\n"
 msgstr "kontrollerar arkiveringseditor...\n"
 
-msgid " No commit editor set and can't find vi in PATH\n"
-msgstr " Ingen arkiveringseditor satt och kan inte hitta vi i PATH\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
+msgstr " Ingen arkiveringseditor satt och kan inte hitta sensible-editor i PATH\n"
 
 msgid " (specify a commit editor in your configuration file)\n"
 msgstr " (specificera en arkiveringseditor i din konfigurationsfil)\n"
@@ -14851,7 +14851,8 @@ msgstr ""
 
 msgid ""
 "``editor``\n"
-"    The editor to use during a commit. Default is ``$EDITOR`` or ``vi``."
+"    The editor to use during a commit. Default is ``$EDITOR`` or\n"
+"    ``sensible-editor``."
 msgstr ""
 
 msgid ""
@@ -15563,7 +15564,7 @@ msgid ""
 "    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 ""
--- mercurial.orig/i18n/zh_CN.po
+++ mercurial/i18n/zh_CN.po
@@ -5778,7 +5778,7 @@ msgstr ""
 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"
@@ -8666,7 +8666,7 @@ msgid ""
 "    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 ""
--- mercurial.orig/i18n/zh_TW.po
+++ mercurial/i18n/zh_TW.po
@@ -6759,8 +6759,8 @@ msgstr ""
 msgid "Checking commit editor...\n"
 msgstr "檢查提交訊息編輯器...\n"
 
-msgid " No commit editor set and can't find vi in PATH\n"
-msgstr " 沒有設定提交訊息編輯器,然後在PATH中也沒有vi\n"
+msgid " No commit editor set and can't find sensible-editor in PATH\n"
+msgstr " 沒有設定提交訊息編輯器,然後在PATH中也沒有sensible-editor\n"
 
 msgid " (specify a commit editor in your configuration file)\n"
 msgstr " (在你的設定檔指明一個用來編輯提交訊息的編輯器)\n"
@@ -9709,7 +9709,7 @@ msgid ""
 "    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 ""
--- mercurial.orig/mercurial/help/environment.txt
+++ mercurial/mercurial/help/environment.txt
@@ -114,7 +114,7 @@ EDITOR
     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
--- mercurial.orig/mercurial/help/config.txt
+++ mercurial/mercurial/help/config.txt
@@ -2178,7 +2178,8 @@ User interface controls.
     Print debugging information. (default: False)
 
 ``editor``
-    The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
+    The editor to use during a commit. (default: ``$EDITOR`` or
+    ``sensible-editor``)
 
 ``fallbackencoding``
     Encoding to try if it's not possible to decode the changelog using
--- mercurial.orig/i18n/ro.po
+++ mercurial/i18n/ro.po
@@ -7722,7 +7722,7 @@ msgstr ""
 msgid "Checking commit editor...\n"
 msgstr "Se verifică editorul pentru commit...\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 ""
 
 msgid " (specify a commit editor in your configuration file)\n"
@@ -11925,7 +11925,8 @@ msgstr ""
 
 msgid ""
 "``editor``\n"
-"    The editor to use during a commit. Default is ``$EDITOR`` or ``vi``."
+"    The editor to use during a commit. Default is ``$EDITOR`` or\n"
+"    ``sensible-editor``."
 msgstr ""
 
 msgid ""
@@ -12570,7 +12571,7 @@ msgid ""
 "    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 ""
--- mercurial.orig/i18n/ru.po
+++ mercurial/i18n/ru.po
@@ -12451,8 +12451,8 @@ msgstr " (шаблоны, похоже,
 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"
@@ -19448,10 +19448,12 @@ msgstr ""
 
 msgid ""
 "``editor``\n"
-"    The editor to use during a commit. Default is ``$EDITOR`` or ``vi``."
+"    The editor to use during a commit. Default is ``$EDITOR`` or\n"
+"    ``sensible-editor``."
 msgstr ""
 "``editor``\n"
-"    Редактор, вызываемый при фиксации. По умолчанию ``$EDITOR`` or ``vi``."
+"    Редактор, вызываемый при фиксации. По умолчанию ``$EDITOR`` or\n"
+"    ``sensible-editor``."
 
 msgid ""
 "``fallbackencoding``\n"
@@ -20669,14 +20671,14 @@ msgid ""
 "    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"
 "    внести изменения, например для написания сообщения фиксации.\n"
 "    Используемый редактор определяется переменными среды HGEDITOR,\n"
 "    VISUAL и EDITOR, именно в таком порядке. Выбирается первая\n"
-"    непустая переменная. Если они все пусты, используется 'vi'."
+"    непустая переменная. Если они все пусты, используется 'sensible-editor'."
 
 msgid ""
 "PYTHONPATH\n"
--- mercurial.orig/mercurial/debugcommands.py
+++ mercurial/mercurial/debugcommands.py
@@ -1313,15 +1313,15 @@ def debuginstall(ui, **opts):
     editorbin = procutil.shellsplit(editor)[0]
     fm.write('editor', _("checking commit editor... (%s)\n"), editorbin)
     cmdpath = procutil.findexe(editorbin)
-    fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound',
+    fm.condwrite(not cmdpath and editor == 'sensible-editor', 'vinotfound',
                  _(" No commit editor set and can't find %s in PATH\n"
                    " (specify a commit editor in your configuration"
-                   " file)\n"), not cmdpath and editor == 'vi' and editorbin)
-    fm.condwrite(not cmdpath and editor != 'vi', 'editornotfound',
+                   " file)\n"), not cmdpath and editor == 'sensible-editor' and editorbin)
+    fm.condwrite(not cmdpath and editor != 'sensible-editor', 'editornotfound',
                  _(" Can't find editor '%s' in PATH\n"
                    " (specify a commit editor in your configuration"
                    " file)\n"), not cmdpath and editorbin)
-    if not cmdpath and editor != 'vi':
+    if not cmdpath and editor != 'sensible-editor':
         problems += 1
 
     # check username
