build: fix build errors caused by chgserver moved to core

Test Plan: `arc diff`

Reviewers: #sourcecontrol, mjpieters

Reviewed By: mjpieters

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4244233

Signature: t1:4244233:1480432440:104d3b082b9affddf1d44bb3cfc5f997eb7e9afa
This commit is contained in:
Jun Wu 2016-11-29 15:14:51 +00:00
parent 240a2db67b
commit 38e3389cbb
2 changed files with 15 additions and 9 deletions

View File

@ -26,7 +26,10 @@ will not load them for you
from mercurial import extensions
from mercurial import error
from hgext import chgserver
try:
from mercurial import chgserver
except ImportError:
from hgext import chgserver
chgserver._configsections.append('extorder')
testedwith = 'internal'

View File

@ -180,15 +180,18 @@ def _patchchgserver():
"""patch chgserver so we can backup tty fds before they are replaced if
chg starts the pager.
"""
chgserver = None
try:
chgserver = extensions.find('chgserver')
except KeyError:
pass
else:
server = getattr(chgserver, 'chgcmdserver', None)
if server and 'attachio' in server.capabilities:
orig = server.attachio
server.capabilities['attachio'] = extensions.bind(_attachio, orig)
from mercurial import chgserver
except ImportError:
try:
chgserver = extensions.find('chgserver')
except KeyError:
pass
server = getattr(chgserver, 'chgcmdserver', None)
if server and 'attachio' in server.capabilities:
orig = server.attachio
server.capabilities['attachio'] = extensions.bind(_attachio, orig)
def uisetup(ui):
# _validaterepo runs ssh and needs to be wrapped