undo: disallow interactive undo on Windows

Summary: `interactiveui` depends on `termios`, which is POSIX-only.

Reviewed By: farnz

Differential Revision: D8418018

fbshipit-source-id: f3d36c8a2e1fae11c37e29d87a44f3e31ab02a53
This commit is contained in:
Kostia Balytskyi 2018-06-14 04:50:35 -07:00 committed by Facebook Github Bot
parent 6fd3772316
commit 4a0a71fd5e

View File

@ -23,6 +23,7 @@ from mercurial import (
obsolete,
obsutil,
phases,
pycompat,
registrar,
revlog,
revset,
@ -36,7 +37,10 @@ from mercurial import (
from mercurial.i18n import _
from mercurial.node import bin, hex, nullid
from . import interactiveui
if not pycompat.iswindows:
from . import interactiveui
else:
interactiveui = None
cmdtable = {}
@ -780,6 +784,8 @@ def undo(ui, repo, *args, **opts):
branch = opts.get("branch")
preview = opts.get("preview")
interactive = opts.get("interactive")
if interactive and interactiveui is None:
raise error.Abort(_("interactive ui is not supported on Windows"))
if interactive:
preview = True