D7481: localrepo: recognize trivial "null" queries in `anyrev`

2019-11-24 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  In D7481#110524 , @yuja wrote:
  
  >> +if specs == [b'null']:
  >> +return revset.baseset([nullrev])
  >
  > This breaks `--config revsetalias.null=`. Nobody would care, but
  > I don't know why we're so hard to optimize `-r null` query.
  
  I woudl says that changing `null` (like changing `.`) is calling for troubles 
and I would not worries.
  
  optimising `null` is a good intermediate steps on the path to optimizing `.`; 
it also seems a possibly common request for automation.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7481/new/

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

To: marmoute, #hg-reviewers, indygreg
Cc: yuja, mjpieters, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7481: localrepo: recognize trivial "null" queries in `anyrev`

2019-11-23 Thread yuja (Yuya Nishihara)
yuja added a comment.


  > +if specs == [b'null']:
  > +return revset.baseset([nullrev])
  
  This breaks `--config revsetalias.null=`. Nobody would care, but
  I don't know why we're so hard to optimize `-r null` query.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7481/new/

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

To: marmoute, #hg-reviewers, indygreg
Cc: yuja, mjpieters, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D7481: localrepo: recognize trivial "null" queries in `anyrev`

2019-11-23 Thread Yuya Nishihara
> +if specs == [b'null']:
> +return revset.baseset([nullrev])

This breaks `--config revsetalias.null=`. Nobody would care, but
I don't know why we're so hard to optimize `-r null` query.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7481: localrepo: recognize trivial "null" queries in `anyrev`

2019-11-23 Thread marmoute (Pierre-Yves David)
marmoute updated this revision to Diff 18348.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7481?vs=18333=18348

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7481/new/

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

AFFECTED FILES
  mercurial/localrepo.py
  tests/test-repo-filters-tiptoe.t

CHANGE DETAILS

diff --git a/tests/test-repo-filters-tiptoe.t b/tests/test-repo-filters-tiptoe.t
--- a/tests/test-repo-filters-tiptoe.t
+++ b/tests/test-repo-filters-tiptoe.t
@@ -47,7 +47,6 @@
 Getting the node of `null`
 
   $ hg log -r null -T "{node}\n"
-  debug.filters: computing revision filter for "visible"
   
 
 Getting basic changeset inforation about `null`
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1652,6 +1652,8 @@
 definitions overriding user aliases, set ``localalias`` to
 ``{name: definitionstring}``.
 '''
+if specs == [b'null']:
+return revset.baseset([nullrev])
 if user:
 m = revset.matchany(
 self.ui,



To: marmoute, #hg-reviewers, indygreg
Cc: mjpieters, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7481: localrepo: recognize trivial "null" queries in `anyrev`

2019-11-22 Thread marmoute (Pierre-Yves David)
Closed by commit rHGc0e04f07a2d4: localrepo: recognize trivial null 
queries in `anyrev` (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7481?vs=18288=18333

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7481/new/

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

AFFECTED FILES
  mercurial/localrepo.py
  tests/test-repo-filters-tiptoe.t

CHANGE DETAILS

diff --git a/tests/test-repo-filters-tiptoe.t b/tests/test-repo-filters-tiptoe.t
--- a/tests/test-repo-filters-tiptoe.t
+++ b/tests/test-repo-filters-tiptoe.t
@@ -49,5 +49,4 @@
   $ hg init test-repo
   $ cd test-repo
   $ hg log -r null -T "{node}\n"
-  debug.filters: computing revision filter for "visible"
   
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1652,6 +1652,8 @@
 definitions overriding user aliases, set ``localalias`` to
 ``{name: definitionstring}``.
 '''
+if specs == [b'null']:
+return revset.baseset([nullrev])
 if user:
 m = revset.matchany(
 self.ui,



To: marmoute, #hg-reviewers, indygreg
Cc: mjpieters, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7481: localrepo: recognize trivial "null" queries in `anyrev`

2019-11-22 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Bypassing the revset logic for trivial "null" queries means we can avoid to
  trigger the filtering logic in some cases.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py
  tests/test-repo-filters-tiptoe.t

CHANGE DETAILS

diff --git a/tests/test-repo-filters-tiptoe.t b/tests/test-repo-filters-tiptoe.t
--- a/tests/test-repo-filters-tiptoe.t
+++ b/tests/test-repo-filters-tiptoe.t
@@ -49,5 +49,4 @@
   $ hg init test-repo
   $ cd test-repo
   $ hg log -r null -T "{node}\n"
-  debug.filters: computing revision filter for "visible"
   
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1652,6 +1652,8 @@
 definitions overriding user aliases, set ``localalias`` to
 ``{name: definitionstring}``.
 '''
+if specs == [b'null']:
+return revset.baseset([nullrev])
 if user:
 m = revset.matchany(
 self.ui,



To: marmoute, #hg-reviewers
Cc: mjpieters, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel