Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/chgserver.py @ 33881:3cfc9070245f
demandimport: disable if chg is being used
In chg's case, making modules lazily loaded could actually slow down things
since chg pre-imports them. Therefore disable demandimport if chg is being
used.
This is not done by setting `HGDEMANDIMPORT` chg client-side because that
has side-effects on child processes (hooks, etc).
Differential Revision: https://phab.mercurial-scm.org/D351
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 16 Aug 2017 10:44:06 -0700 |
parents | 0407a51b9d8c |
children | 37b7581e5737 |
comparison
equal
deleted
inserted
replaced
33880:8fb5212652ec | 33881:3cfc9070245f |
---|---|
563 def createcmdserver(self, repo, conn, fin, fout): | 563 def createcmdserver(self, repo, conn, fin, fout): |
564 return chgcmdserver(self.ui, repo, fin, fout, conn, | 564 return chgcmdserver(self.ui, repo, fin, fout, conn, |
565 self._hashstate, self._baseaddress) | 565 self._hashstate, self._baseaddress) |
566 | 566 |
567 def chgunixservice(ui, repo, opts): | 567 def chgunixservice(ui, repo, opts): |
568 # CHGINTERNALMARK is temporarily set by chg client to detect if chg will | 568 # CHGINTERNALMARK is set by chg client. It is an indication of things are |
569 # start another chg. drop it to avoid possible side effects. | 569 # started by chg so other code can do things accordingly, like disabling |
570 # demandimport or detecting chg client started by chg client. When executed | |
571 # here, CHGINTERNALMARK is no longer useful and hence dropped to make | |
572 # environ cleaner. | |
570 if 'CHGINTERNALMARK' in encoding.environ: | 573 if 'CHGINTERNALMARK' in encoding.environ: |
571 del encoding.environ['CHGINTERNALMARK'] | 574 del encoding.environ['CHGINTERNALMARK'] |
572 | 575 |
573 if repo: | 576 if repo: |
574 # one chgserver can serve multiple repos. drop repo information | 577 # one chgserver can serve multiple repos. drop repo information |