Patchwork D1161: hghave: make 'on demand import' unsupported when chg is running

login
register
mail settings
Submitter phabricator
Date Oct. 17, 2017, 6:20 p.m.
Message ID <differential-rev-PHID-DREV-hn4mslgqyrhmuygbbeoq-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/25128/
State Superseded
Headers show

Comments

phabricator - Oct. 17, 2017, 6:20 p.m.
singhsrb created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Chg does not support on demand import and therefore, it probably makes
  sense to indicate that the 'on demand import' is unsupported when chg is
  running.

TEST PLAN
  Ran all the tests.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1161

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS




To: singhsrb, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 17, 2017, 6:26 p.m.
quark added inline comments.

INLINE COMMENTS

> hghave.py:604
>  def has_demandimport():
> -    return os.environ.get('HGDEMANDIMPORT') != 'disable'
> +    # chg does not support on demand importing.
> +    return ((not has_chg()) and os.environ.get('HGDEMANDIMPORT') != 'disable')

It's more accurate saying:

  # chg disables demandimport on purpose

chg could support demandimport but chooses to disable it for performance win.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1161

To: singhsrb, #hg-reviewers
Cc: quark, mercurial-devel
phabricator - Oct. 17, 2017, 6:30 p.m.
singhsrb added inline comments.

INLINE COMMENTS

> quark wrote in hghave.py:604
> It's more accurate saying:
> 
>   # chg disables demandimport on purpose
> 
> chg could support demandimport but chooses to disable it for performance win.

Yes, that does looks like a better way to put it. I will update the commit message as well to reflect the same.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1161

To: singhsrb, #hg-reviewers
Cc: quark, mercurial-devel

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -601,7 +601,8 @@ 
 
 @check("demandimport", "demandimport enabled")
 def has_demandimport():
-    return os.environ.get('HGDEMANDIMPORT') != 'disable'
+    # chg does not support on demand importing.
+    return ((not has_chg()) and os.environ.get('HGDEMANDIMPORT') != 'disable')
 
 @check("py3k", "running with Python 3.x")
 def has_py3k():