D7503: rust-dirs: address failing tests for `dirs` impl with a temporary fix

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


  Many unhandled results:
  
warning: unused `std::result::Result` that must be used
  --> hg-core/src/dirstate/dirs_multiset.rs:42:21
   |
42 | multiset.add_path(filename);
   | 
   |
   = note: #[warn(unused_must_use)] on by default
   = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `std::result::Result` that must be used
  --> hg-core/src/dirstate/dirs_multiset.rs:45:17
   |
45 | multiset.add_path(filename);
   | 
   |
   = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `std::result::Result` that must be used
  --> hg-core/src/dirstate/dirs_multiset.rs:59:13
   |
59 | multiset.add_path(filename);
   | 
   |
   = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `std::result::Result` that must be used
   --> hg-core/src/dirstate/dirstate_map.rs:129:17
|
129 | all_dirs.add_path(filename);
| 
|
= note: this `Result` may be an `Err` variant, which should be handled
  
  Might be better to do `path.check_state()` in cpython layer, and insert
  `debug_assert` to hg-core.

REPOSITORY
  rHG Mercurial

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

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

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


Re: D7503: rust-dirs: address failing tests for `dirs` impl with a temporary fix

2019-11-22 Thread Yuya Nishihara
Many unhandled results:

```
warning: unused `std::result::Result` that must be used
  --> hg-core/src/dirstate/dirs_multiset.rs:42:21
   |
42 | multiset.add_path(filename);
   | 
   |
   = note: #[warn(unused_must_use)] on by default
   = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `std::result::Result` that must be used
  --> hg-core/src/dirstate/dirs_multiset.rs:45:17
   |
45 | multiset.add_path(filename);
   | 
   |
   = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `std::result::Result` that must be used
  --> hg-core/src/dirstate/dirs_multiset.rs:59:13
   |
59 | multiset.add_path(filename);
   | 
   |
   = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `std::result::Result` that must be used
   --> hg-core/src/dirstate/dirstate_map.rs:129:17
|
129 | all_dirs.add_path(filename);
| 
|
= note: this `Result` may be an `Err` variant, which should be handled
```

Might be better to do `path.check_state()` in cpython layer, and insert
`debug_assert` to hg-core.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7510: windows: suppress pytype warnings for Windows imports and functions

2019-11-22 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  I'm not sure if there are plans to vendor *.pyi files.  Maybe that could be 
used to backfill platform specific modules instead of doing this.  But for now 
is seems better to get the error count and blacklist length reduced.

REPOSITORY
  rHG Mercurial

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

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

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


D7512: exchange: guard against method invocation on `b2caps=None` args

2019-11-22 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I couldn't figure out how these are called, but the value is pretty obviously
  set at least for the cases that have tests.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/exchange.py

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -2474,7 +2474,7 @@
 **kwargs
 ):
 """add a changegroup part to the requested bundle"""
-if not kwargs.get('cg', True):
+if not kwargs.get('cg', True) or not b2caps:
 return
 
 version = b'01'
@@ -2536,7 +2536,7 @@
 """add a bookmark part to the requested bundle"""
 if not kwargs.get('bookmarks', False):
 return
-if b'bookmarks' not in b2caps:
+if not b2caps or b'bookmarks' not in b2caps:
 raise error.Abort(_(b'no common bookmarks exchange method'))
 books = bookmod.listbinbookmarks(repo)
 data = bookmod.binaryencode(books)
@@ -2577,7 +2577,7 @@
 ):
 """add phase heads part to the requested bundle"""
 if kwargs.get('phases', False):
-if not b'heads' in b2caps.get(b'phases'):
+if not b2caps or not b'heads' in b2caps.get(b'phases'):
 raise error.Abort(_(b'no common phases exchange method'))
 if heads is None:
 heads = repo.heads()
@@ -2641,7 +2641,7 @@
 # Don't send unless:
 # - changeset are being exchanged,
 # - the client supports it.
-if not (kwargs.get('cg', True) and b'hgtagsfnodes' in b2caps):
+if not b2caps or not (kwargs.get('cg', True) and b'hgtagsfnodes' in 
b2caps):
 return
 
 outgoing = _computeoutgoing(repo, heads, common)
@@ -2675,6 +2675,7 @@
 # - narrow bundle isn't in play (not currently compatible).
 if (
 not kwargs.get('cg', True)
+or not b2caps
 or b'rev-branch-cache' not in b2caps
 or kwargs.get('narrow', False)
 or repo.ui.has_section(_NARROWACL_SECTION)



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


D7511: exchange: eliminate some bytes.format() calls

2019-11-22 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/exchange.py

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -2181,9 +2181,8 @@
 )
 if not user_includes:
 raise error.Abort(
-_(b"{} configuration for user {} is empty").format(
-_NARROWACL_SECTION, username
-)
+_(b"%s configuration for user %s is empty")
+% (_NARROWACL_SECTION, username)
 )
 
 user_includes = [
@@ -2202,9 +2201,8 @@
 
 if invalid_includes:
 raise error.Abort(
-_(b"The following includes are not accessible for {}: {}").format(
-username, invalid_includes
-)
+_(b"The following includes are not accessible for %s: %s")
+% (username, invalid_includes)
 )
 
 new_args = {}



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


D7510: windows: suppress pytype warnings for Windows imports and functions

2019-11-22 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This should allow the modules to not be excluded, and not generate complaints 
on
  non Windows platforms.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/pycompat.py
  mercurial/scmwindows.py
  mercurial/windows.py

CHANGE DETAILS

diff --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -26,11 +26,12 @@
 )
 
 try:
-import _winreg as winreg
+import _winreg as winreg  # pytype: disable=import-error
 
 winreg.CloseKey
 except ImportError:
-import winreg
+# py2 only
+import winreg  # pytype: disable=import-error
 
 osutil = policy.importmod('osutil')
 
@@ -282,7 +283,7 @@
 # fileno(), usually set to -1.
 fno = getattr(fd, 'fileno', None)
 if fno is not None and fno() >= 0:
-msvcrt.setmode(fno(), os.O_BINARY)
+msvcrt.setmode(fno(), os.O_BINARY)  # pytype: disable=module-attr
 
 
 def pconvert(path):
diff --git a/mercurial/scmwindows.py b/mercurial/scmwindows.py
--- a/mercurial/scmwindows.py
+++ b/mercurial/scmwindows.py
@@ -10,11 +10,12 @@
 )
 
 try:
-import _winreg as winreg
+import _winreg as winreg  # pytype: disable=import-error
 
 winreg.CloseKey
 except ImportError:
-import winreg
+# py2 only
+import winreg  # pytype: disable=import-error
 
 # MS-DOS 'more' is the only pager available by default on Windows.
 fallbackpager = b'more'
diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -99,7 +99,7 @@
 # Otherwise non-ASCII filenames in existing repositories would be
 # corrupted.
 # This must be set once prior to any fsencode/fsdecode calls.
-sys._enablelegacywindowsfsencoding()
+sys._enablelegacywindowsfsencoding()  # pytype: disable=module-attr
 
 fsencode = os.fsencode
 fsdecode = os.fsdecode



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


mercurial@43736: new changeset

2019-11-22 Thread Mercurial Commits
New changeset in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/640bae94f2f3
changeset:   43736:640bae94f2f3
bookmark:@
tag: tip
user:Augie Fackler 
date:Thu Nov 21 23:35:29 2019 -0500
summary: cleanup: update references to /help/ that should now be /helptext/

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  In D7506#110288 , @mharbison72 
wrote:
  
  > I'm not sure why, but this version seems to also show obsolete revisions.  
I've got a bunch of `x` and `*` nodes in hg-committed right now.  I didn't see 
that before, although that was on a different clone that I don't have access to 
now.
  
  After further review, the obsolete revisions have unstable children going way 
back, so that's why they show.  But I'm super confused by the output.  This 
isn't the whole output, but the middle or so that corresponds to the latest(!) 
commits:
  
: : : : | | : | | : : | o  d77be1 filemerge: fix a missing attribute usage
: : : : | | : | | : : | |  https://phab.mercurial-scm.org/D7465 Needs Review
: : : : | | : | | : : | | o  ef1696 makefile: use Python 3 by default (BC)
: : : : | | : | | : : | |/   https://phab.mercurial-scm.org/D7258 Accepted
+-+-+---+---+-+---o  640bae cleanup: update references to /help/ 
that should now be /helptext/
: : : : | | : | | : : | |https://phab.mercurial-scm.org/D7472 Closed
: : : : | | : | | : : | | o  20a3bf rust-dirs: address failing tests for 
`dirs` impl with a temporary fix
: : : : | | : | | : : | | |  https://phab.mercurial-scm.org/D7503 Closed
: : : : | | : | | : : | | | o  e8373b (@) windows: further build fixes for 
the WiX installer
: : : : | | : | | : : | | | |  https://phab.mercurial-scm.org/D7509 Closed
: : : : | | : | | : : | | | | o  347b42 logcmdutil: call _exthook() in 
changesettemplater
: : : : | | : | | : : | | | | |  https://phab.mercurial-scm.org/D7505 Needs 
Review
: : : : | | : | | : : | | | | | o  4b1de5 phabricator: add a "phabstatus" 
show view
: : : : | | : | | : : | | | | | |  https://phab.mercurial-scm.org/D7506 
Needs Review
: : : : | | : | | : : | | | | | | @  f6920a phabricator: add a "phabstatus" 
template keyword
: : : : | | : | | : : | | | | | | |  https://phab.mercurial-scm.org/D7507 
Needs Review
+-+-+---o---+---+ | | | | | | |  ce20b8 format: format commands.py, 
which recently regressed
: : : : | |  / / / / / / / / / / /   https://phab.mercurial-scm.org/D7064 
Closed
  
  Show work looks like (truncated to latest):
  
$ hg show work
@  f6920a phabricator: add a "phabstatus" template keyword
o  4b1de5 phabricator: add a "phabstatus" show view
o  347b42 logcmdutil: call _exthook() in changesettemplater
o  e8373b (@) windows: further build fixes for the WiX installer
o  20a3bf rust-dirs: address failing tests for `dirs` impl with a temporary 
fix
o  640bae cleanup: update references to /help/ that should now be /helptext/
o7eb701 merge with stable
|\
| o88a306 (stable) singlehead: making config item a bool again
| :\
| : \
| : :\
| : : : o  06aac2 xxx-pytype: annotate various things flagged for future 
examination
+---o  6c9c22 webutil: drop an extra parameter on `join()`
| : : : o  ef1696 makefile: use Python 3 by default (BC)
| : : : | o  d77be1 filemerge: fix a missing attribute usage
| : : : |/
+---o  538726 filemerge: drop a default argument to appease pytype
  
  And show stack looks like:
  
$ hg show stack
  @  f6920 phabricator: add a "phabstatus" template keyword
  o  4b1de phabricator: add a "phabstatus" show view
  o  347b4 logcmdutil: call _exthook() in changesettemplater
  o  e8373 (@) windows: further build fixes for the WiX installer
  o  20a3b rust-dirs: address failing tests for `dirs` impl with a 
temporary fix
  o  640ba cleanup: update references to /help/ that should now be 
/helptext/
 /   (stack base)
o  7eb70 merge with stable
  
  Is the goal to limit to the current stack, or all non public commits?  I can 
see a use case for both.

REPOSITORY
  rHG Mercurial

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

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

To: dlax, #hg-reviewers
Cc: mharbison72, mjpieters, Kwan, 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


D7480: localrepo: also fastpath `nullrev` in __getitem__

2019-11-22 Thread marmoute (Pierre-Yves David)
Closed by commit rHG099e96103085: localrepo: also fastpath `nullrev` in 
__getitem__ (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/D7480?vs=18287=18332

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

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1531,7 +1531,7 @@
 ]
 
 # dealing with some special values
-if changeid == b'null':
+if changeid == b'null' or changeid == nullrev:
 return context.changectx(self, nullrev, nullid)
 if changeid == b'tip':
 node = self.changelog.tip()



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


D7482: repoview: add a test that access actual changeset data of `null`

2019-11-22 Thread marmoute (Pierre-Yves David)
Closed by commit rHGf612a044a5ab: repoview: add a test that  access actual 
changeset data of `null` (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/D7482?vs=18289=18334

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

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

AFFECTED FILES
  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
@@ -50,3 +50,10 @@
   $ cd test-repo
   $ hg log -r null -T "{node}\n"
   
+
+Getting basic changeset inforation about `null`
+
+  $ hg log -r null -T "{node}\n{date}\n"
+  debug.filters: computing revision filter for "visible"
+  
+  0.00



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


D7477: util: add an optional `prefix` argument to debugstacktrace

2019-11-22 Thread marmoute (Pierre-Yves David)
Closed by commit rHG6301ea7a26b6: util: add an optional `prefix` argument to 
debugstacktrace (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/D7477?vs=18284=18329

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

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

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -3466,6 +3466,7 @@
 f=procutil.stderr,
 otherf=procutil.stdout,
 depth=0,
+prefix=b'',
 ):
 '''Writes a message to f (stderr) with a nicely formatted stacktrace.
 Skips the 'skip' entries closest to the call, then show 'depth' entries.
@@ -3475,9 +3476,9 @@
 '''
 if otherf:
 otherf.flush()
-f.write(b'%s at:\n' % msg.rstrip())
+f.write(b'%s%s at:\n' % (prefix, msg.rstrip()))
 for line in getstackframes(skip + 1, depth=depth):
-f.write(line)
+f.write(prefix + line)
 f.flush()
 
 



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


D7479: repoview: add a test to track operation not supposed to trigger filtering

2019-11-22 Thread marmoute (Pierre-Yves David)
Closed by commit rHGa7a4b3b28c52: repoview: add a test to track operation not 
supposed to trigger filtering (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/D7479?vs=18286=18331

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

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

AFFECTED FILES
  tests/test-repo-filters-tiptoe.t

CHANGE DETAILS

diff --git a/tests/test-repo-filters-tiptoe.t b/tests/test-repo-filters-tiptoe.t
new file mode 100644
--- /dev/null
+++ b/tests/test-repo-filters-tiptoe.t
@@ -0,0 +1,53 @@
+===
+Test repository filtering avoidance
+===
+
+This test file is a bit special as he does not check feature, but performance 
related internal code path.
+
+Right now, filtering a repository comes with a cost that might be significant.
+Until this get better, ther are various operation that try hard not to trigger
+a filtering computation. This test file make sure we don't reintroduce code 
that trigger the filtering for these operation:
+
+Setup
+-
+  $ hg init test-repo
+  $ cd test-repo
+  $ echo "some line" > z
+  $ echo a > a
+  $ hg commit -Am a
+  adding a
+  adding z
+  $ echo "in a" >> z
+  $ echo b > b
+  $ hg commit -Am b
+  adding b
+  $ echo "file" >> z
+  $ echo c > c
+  $ hg commit -Am c
+  adding c
+  $ hg rm a
+  $ echo c1 > c
+  $ hg add c
+  c already tracked!
+  $ echo d > d
+  $ hg add d
+  $ rm b
+
+  $ cat << EOF >> $HGRCPATH
+  > [devel]
+  > debug.repo-filters = yes
+  > [ui]
+  > debug = yes
+  > EOF
+
+
+tests
+-
+
+Getting the node of `null`
+
+  $ hg init test-repo
+  $ cd test-repo
+  $ hg log -r null -T "{node}\n"
+  debug.filters: computing revision filter for "visible"
+  



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


D7478: repoview: display stack trace along side the debug message

2019-11-22 Thread marmoute (Pierre-Yves David)
Closed by commit rHGb9e4226ff1db: repoview: display stack trace along side the 
debug message (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/D7478?vs=18285=18330

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

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

AFFECTED FILES
  mercurial/repoview.py

CHANGE DETAILS

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -218,8 +218,18 @@
 cache it's result"""
 if filtername not in repo.filteredrevcache:
 if repo.ui.configbool(b'devel', b'debug.repo-filters'):
-msg = b'debug.filters: computing revision filter for "%s"\n'
-repo.ui.debug(msg % filtername)
+msg = b'computing revision filter for "%s"'
+msg %= filtername
+if repo.ui.tracebackflag and repo.ui.debugflag:
+# XXX use ui.write_err
+util.debugstacktrace(
+msg,
+f=repo.ui._fout,
+otherf=repo.ui._ferr,
+prefix=b'debug.filters: ',
+)
+else:
+repo.ui.debug(b'debug.filters: %s\n' % msg)
 func = filtertable[filtername]
 if visibilityexceptions:
 return func(repo.unfiltered, visibilityexceptions)



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


D7475: localrepo: extract handling of some special value in __getitem__

2019-11-22 Thread marmoute (Pierre-Yves David)
Closed by commit rHG8e2df30694de: localrepo: extract handling of some special 
value in __getitem__ (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/D7475?vs=18282=18327

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

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1533,14 +1533,16 @@
 # dealing with some special values
 if changeid == b'null':
 return context.changectx(self, nullrev, nullid)
+if changeid == b'tip':
+node = self.changelog.tip()
+rev = self.changelog.rev(node)
+return context.changectx(self, rev, node)
+
 # dealing with arbitrary values
 try:
 if isinstance(changeid, int):
 node = self.changelog.node(changeid)
 rev = changeid
-elif changeid == b'tip':
-node = self.changelog.tip()
-rev = self.changelog.rev(node)
 elif changeid == b'.':
 # this is a hack to delay/avoid loading obsmarkers
 # when we know that '.' won't be hidden



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


D7474: localrepo: extract handling of some special value in __getitem__

2019-11-22 Thread marmoute (Pierre-Yves David)
Closed by commit rHGb7d0aa525435: localrepo: extract handling of some special 
value in __getitem__ (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/D7474?vs=18281=18326

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

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1530,14 +1530,14 @@
 if i not in self.changelog.filteredrevs
 ]
 
+# dealing with some special values
+if changeid == b'null':
+return context.changectx(self, nullrev, nullid)
 # dealing with arbitrary values
 try:
 if isinstance(changeid, int):
 node = self.changelog.node(changeid)
 rev = changeid
-elif changeid == b'null':
-node = nullid
-rev = nullrev
 elif changeid == b'tip':
 node = self.changelog.tip()
 rev = self.changelog.rev(node)



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


D7476: repoview: add a 'devel.debug.repo-filter' option

2019-11-22 Thread marmoute (Pierre-Yves David)
Closed by commit rHG0ddd97e45cc6: repoview: add a 
devel.debug.repo-filter option (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/D7476?vs=18283=18328

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

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

AFFECTED FILES
  mercurial/configitems.py
  mercurial/repoview.py

CHANGE DETAILS

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -217,6 +217,9 @@
 hidden-state and must be visible. They are dynamic and hence we should not
 cache it's result"""
 if filtername not in repo.filteredrevcache:
+if repo.ui.configbool(b'devel', b'debug.repo-filters'):
+msg = b'debug.filters: computing revision filter for "%s"\n'
+repo.ui.debug(msg % filtername)
 func = filtertable[filtername]
 if visibilityexceptions:
 return func(repo.unfiltered, visibilityexceptions)
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -433,6 +433,9 @@
 b'devel', b'debug.extensions', default=False,
 )
 coreconfigitem(
+b'devel', b'debug.repo-filters', default=False,
+)
+coreconfigitem(
 b'devel', b'debug.peer-request', default=False,
 )
 coreconfigitem(



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


D7473: localrepo: add some basic comment for block in __getitem__

2019-11-22 Thread marmoute (Pierre-Yves David)
Closed by commit rHG7d6465eda585: localrepo: add some basic comment for block 
in __getitem__ (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/D7473?vs=18280=18325

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

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1515,10 +1515,13 @@
 self.invalidate(clearfilecache=True)
 
 def __getitem__(self, changeid):
+# dealing with special cases
 if changeid is None:
 return context.workingctx(self)
 if isinstance(changeid, context.basectx):
 return changeid
+
+# dealing with multiple revisions
 if isinstance(changeid, slice):
 # wdirrev isn't contiguous so the slice shouldn't include it
 return [
@@ -1526,6 +1529,8 @@
 for i in pycompat.xrange(*changeid.indices(len(self)))
 if i not in self.changelog.filteredrevs
 ]
+
+# dealing with arbitrary values
 try:
 if isinstance(changeid, int):
 node = self.changelog.node(changeid)



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


D7483: changectx: add a "maybe filtered" filtered attribute

2019-11-22 Thread indygreg (Gregory Szorc)
indygreg added inline comments.

INLINE COMMENTS

> context.py:503
> +repo = self._repo.unfiltered()
> +return repo.changelog.changelogrevision(self.rev())
>  

Before I accept more of this series, I'd like others to think about the 
potential alternative solution of passing in or storing a reference to the 
changelog on `basectx`/`changectx`. The reason is that a lot of methods are 
calling `repo.changelog` and this can be expensive. I suspect we'd get a 
handful of random performance wins if we cached the changelog instance on each 
`basectx`. We also wouldn't need to litter the code with a bunch of conditional 
`repo.unfiltered()` calls since we'd already have an appropriate changelog 
instance stored in the instance.

Thoughts?

REPOSITORY
  rHG Mercurial

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

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

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


D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  I'm not sure why, but this version seems to also show obsolete revisions.  
I've got a bunch of `x` and `*` nodes in hg-committed right now.  I didn't see 
that before, although that was on a different clone that I don't have access to 
now.

REPOSITORY
  rHG Mercurial

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

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

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


[Bug 6228] New: "/help" link for config _command_ goes to help for config _topic_

2019-11-22 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6228

Bug ID: 6228
   Summary: "/help" link for config _command_ goes to help for
config _topic_
   Product: Mercurial
   Version: 5.2
  Hardware: PC
   URL: https://www.mercurial-scm.org/repo/hg/help
OS: Linux
Status: UNCONFIRMED
  Severity: bug
  Priority: normal
 Component: hgweb
  Assignee: bugzi...@mercurial-scm.org
  Reporter: 4586274...@munyer.com
CC: mercurial-devel@mercurial-scm.org
Python Version: 2.7

hgweb's "/help" page has two links named "config", one meant to be for the
configuration topic and one meant to be for the "hg config" command, but both
of those links actually go to the help page for the configuration topic.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7500: repoview: add a test for changelog filtering trigger for `hg annotate`

2019-11-22 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In D7500#110252 , @marmoute 
wrote:
  
  > Yes we could.
  
  Please do if you don't mind. Thanks.
  
  > (right now, the test are introduced right before the series of change 
fixing it (or right after the last chngeset in that series)
  
  Yes, I noticed.

REPOSITORY
  rHG Mercurial

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

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

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


D7509: windows: further build fixes for the WiX installer

2019-11-22 Thread durin42 (Augie Fackler)
Closed by commit rHGe8373b215a67: windows: further build fixes for the WiX 
installer (authored by durin42).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs 
Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7509?vs=18323=18324

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

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

AFFECTED FILES
  contrib/packaging/hgpackaging/py2exe.py
  contrib/packaging/wix/mercurial.wxs
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -935,7 +935,7 @@
 # This logic is duplicated in doc/Makefile.
 sources = set(
 f
-for f in os.listdir('mercurial/help')
+for f in os.listdir('mercurial/helptext')
 if re.search(r'[0-9]\.txt$', f)
 )
 
diff --git a/contrib/packaging/wix/mercurial.wxs 
b/contrib/packaging/wix/mercurial.wxs
--- a/contrib/packaging/wix/mercurial.wxs
+++ b/contrib/packaging/wix/mercurial.wxs
@@ -100,7 +100,7 @@
 
 
 
-
+
 
 
 
diff --git a/contrib/packaging/hgpackaging/py2exe.py 
b/contrib/packaging/hgpackaging/py2exe.py
--- a/contrib/packaging/hgpackaging/py2exe.py
+++ b/contrib/packaging/hgpackaging/py2exe.py
@@ -45,7 +45,7 @@
 ('doc/*.html', 'doc/'),
 ('doc/style.css', 'doc/'),
 ('mercurial/helptext/**/*.txt', 'helptext/'),
-('mercurial/default.d/*.rc', 'hgrc.d/'),
+('mercurial/defaultrc/*.rc', 'hgrc.d/'),
 ('mercurial/locale/**/*', 'locale/'),
 ('mercurial/templates/**/*', 'Templates/'),
 ('COPYING', 'Copying.txt'),



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


D7509: windows: further build fixes for the WiX installer

2019-11-22 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  With these fixes in place, the .msi actually builds for me again.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/packaging/hgpackaging/py2exe.py
  contrib/packaging/wix/mercurial.wxs
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -935,7 +935,7 @@
 # This logic is duplicated in doc/Makefile.
 sources = set(
 f
-for f in os.listdir('mercurial/help')
+for f in os.listdir('mercurial/helptext')
 if re.search(r'[0-9]\.txt$', f)
 )
 
diff --git a/contrib/packaging/wix/mercurial.wxs 
b/contrib/packaging/wix/mercurial.wxs
--- a/contrib/packaging/wix/mercurial.wxs
+++ b/contrib/packaging/wix/mercurial.wxs
@@ -100,7 +100,7 @@
 
 
 
-
+
 
 
 
diff --git a/contrib/packaging/hgpackaging/py2exe.py 
b/contrib/packaging/hgpackaging/py2exe.py
--- a/contrib/packaging/hgpackaging/py2exe.py
+++ b/contrib/packaging/hgpackaging/py2exe.py
@@ -45,7 +45,7 @@
 ('doc/*.html', 'doc/'),
 ('doc/style.css', 'doc/'),
 ('mercurial/helptext/**/*.txt', 'helptext/'),
-('mercurial/default.d/*.rc', 'hgrc.d/'),
+('mercurial/defaultrc/*.rc', 'hgrc.d/'),
 ('mercurial/locale/**/*', 'locale/'),
 ('mercurial/templates/**/*', 'Templates/'),
 ('COPYING', 'Copying.txt'),



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


D7508: relnotes: add note about changes to match.{explicit, reverse}dir

2019-11-22 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 18322.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7508?vs=18319=18322

BRANCH
  default

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

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

AFFECTED FILES
  relnotes/next

CHANGE DETAILS

diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -15,3 +15,9 @@
 
 == Internal API Changes ==
 
+ * Matcher instances no longer have a `explicitdir` property. Consider
+   rewriting your code to use `repo.wvfs.isdir()` and/or
+   `ctx.hasdir()` instead. Also, the `traversedir` property is now
+   also called when only `explicitdir` used to be called. That may
+   mean that you can simply remove the use of `explicitdir` if you
+   were already using `traversedir`.



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


D7295: pytype: add a (very slow) test that executes pytype

2019-11-22 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  In D7295#107482 , @indygreg 
wrote:
  
  > Since type checking is slow (but there are state files we can reuse to 
speed things up), we'll need to figure out how to make this work in CI. But I 
have no doubt we can figure something out. Out of curiosity, how long does 
pytype take to run in a clean source directory, without any state files?
  
  It takes 15-20 minutes on a 2018 Mac mini.  In addition to the disabled files 
here, I've disabled:
  
mercurial/httppeer.py
mercurial/repoview.py
mercurial/localrepo.py
mercurial/revlog.py
mercurial/merge.py
mercurial/testing/storage.py
  
  But I've also added back these, and sprinkled various disable comments around:
  
mercurial/bundlerepo.py
mercurial/error.py
mercurial/exchange.py
mercurial/policy.py
mercurial/pycompat.py
mercurial/scmwindows.py
mercurial/windows.py
mercurial/wireprotoframing.py
  
  Even with the state files, it seems to take 10-15 minutes or so.

REPOSITORY
  rHG Mercurial

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

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

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


D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  In D7506#110249 , @dlax wrote:
  
  > In D7506#110225 , @mharbison72 
wrote:
  >
  >> I'm also interested in coloring the status value, but I can tinker with 
that after it's landed, unless you already have plans.
  >
  > You mean having a different color depending on status value, or a fixed 
one? I have no plan anyways, so if you have good ideas, I'll leave this up to 
you.
  
  Something like green for accepted/closed, red for needs revision, neutral-ish 
for needs review, strikethrough for abandoned.

REPOSITORY
  rHG Mercurial

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

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

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


D7500: repoview: add a test for changelog filtering trigger for `hg annotate`

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


  Yes we could. (right now, the test are introduced right before the series of 
change fixing it (or right after the last chngeset in that series)

REPOSITORY
  rHG Mercurial

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

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

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


D7507: phabricator: add a "phabstatus" template keyword

2019-11-22 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18321.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7507?vs=18316=18321

BRANCH
  default

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

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -1684,6 +1684,28 @@
 return None
 
 
+@eh.templatekeyword(b'phabstatus', requires={b'ctx', b'repo', b'ui'})
+def template_status(context, mapping):
+""":phabstatus: String. Status of Phabricator differential.
+"""
+ctx = context.resource(mapping, b'ctx')
+repo = context.resource(mapping, b'repo')
+ui = context.resource(mapping, b'ui')
+
+rev = ctx.rev()
+try:
+drevid = getdrevmap(repo, [rev])[rev]
+except KeyError:
+return None
+drevs = callconduit(ui, b'differential.query', {b'ids': [drevid]})
+for drev in drevs:
+if int(drev[b'id']) == drevid:
+return templateutil.hybriddict(
+{b'url': drev[b'uri'], b'status': drev[b'statusName'],}
+)
+return None
+
+
 @showview(b'phabstatus', csettopic=b'work')
 def phabstatusshowview(ui, repo, displayer):
 """Phabricator differiential status"""



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


D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18320.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7506?vs=18315=18320

BRANCH
  default

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

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -11,6 +11,10 @@
 revisions in a format suitable for :hg:`import`, and a ``phabupdate`` command
 to update statuses in batch.
 
+A "phabstatus" view for :hg:`show` is also provided; it displays status
+information of Phabricator differentials associated with unfinished
+changesets.
+
 By default, Phabricator requires ``Test Plan`` which might prevent some
 changeset from being sent. The requirement could be disabled by changing
 ``differential.require-test-plan-field`` config server side.
@@ -60,9 +64,11 @@
 encoding,
 error,
 exthelper,
+graphmod,
 httpconnection as httpconnectionmod,
 match,
 mdiff,
+logcmdutil,
 obsutil,
 parser,
 patch,
@@ -80,6 +86,11 @@
 procutil,
 stringutil,
 )
+from hgext.show import (
+longestshortest,
+showview,
+)
+
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' 
for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
@@ -462,6 +473,29 @@
 return result
 
 
+def getdrevmap(repo, revs):
+"""Return a dict mapping each rev in `revs` to their Differential
+Revision ID.
+"""
+result = {}
+for rev in revs:
+result[rev] = None
+ctx = repo[rev]
+# Check commit message
+m = _differentialrevisiondescre.search(ctx.description())
+if m:
+result[rev] = int(m.group('id'))
+continue
+# Check tags
+for tag in repo.nodetags(ctx.node()):
+m = _differentialrevisiontagre.match(tag)
+if m:
+result[rev] = int(m.group(1))
+break
+
+return result
+
+
 def getdiff(ctx, diffopts):
 """plain-text diff without header (user, commit message, etc)"""
 output = util.stringio()
@@ -1648,3 +1682,41 @@
 
 return templateutil.hybriddict({b'url': url, b'id': t,})
 return None
+
+
+@showview(b'phabstatus', csettopic=b'work')
+def phabstatusshowview(ui, repo, displayer):
+"""Phabricator differiential status"""
+revs = repo.revs('sort(_underway(), topo)')
+drevmap = getdrevmap(repo, revs)
+revs, drevids, revsbydrevid = [], set([]), {}
+for rev, drevid in pycompat.iteritems(drevmap):
+if drevid is not None:
+revs.append(rev)
+drevids.add(drevid)
+revsbydrevid.setdefault(drevid, set([])).add(rev)
+
+drevs = callconduit(ui, b'differential.query', {b'ids': list(drevids)})
+drevsbyrev = {}
+for drev in drevs:
+for rev in revsbydrevid[int(drev[b'id'])]:
+drevsbyrev[rev] = drev
+
+def phabstatus(ctx):
+drev = drevsbyrev[ctx.rev()]
+ui.write(b"\n%(uri)s %(statusName)s\n" % drev)
+
+revs = smartset.baseset(revs)
+revdag = graphmod.dagwalker(repo, revs)
+
+ui.setconfig(b'experimental', b'graphshorten', True)
+displayer._exthook = phabstatus
+nodelen = longestshortest(repo, revs)
+logcmdutil.displaygraph(
+ui,
+repo,
+revdag,
+displayer,
+graphmod.asciiedges,
+props={b'nodelen': nodelen},
+)



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


D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread dlax (Denis Laxalde)
dlax added a comment.
dlax planned changes to this revision.


  In D7506#110225 , @mharbison72 
wrote:
  
  > I like it.
  
  Thanks!
  
  > Any idea why the changeset isn't colored, unlike `hg show stack`?  It might 
also be a little more readable if the URI and status line were tabbed in, but 
maybe colored cset hashes would make that unnecessary?
  
  Yes, I messed up with adding a custom template whereas I can actually reuse 
"hg show"'s one. Will fix (along with another issue in the algorithm I just 
found out.)
  
  > I'm also interested in coloring the status value, but I can tinker with 
that after it's landed, unless you already have plans.
  
  You mean having a different color depending on status value, or a fixed one? 
I have no plan anyways, so if you have good ideas, I'll leave this up to you.

REPOSITORY
  rHG Mercurial

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

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

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


D7508: relnotes: add note about changes to match.{explicit, reverse}dir

2019-11-22 Thread dlax (Denis Laxalde)
dlax added inline comments.

INLINE COMMENTS

> next:22
> +   also called when only `explicitdir` used to be called. That may
> +   mean that you can simple remove the use of `explicitdir` if you
> +   were already using `traversedir`.

simple -> simply?

REPOSITORY
  rHG Mercurial

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

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

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


D7500: repoview: add a test for changelog filtering trigger for `hg annotate`

2019-11-22 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  Could we just add all these tests from the beginning? It seems they would 
look almost the same if added early in the series, just with some extra 
"getting filtered repo" lines (or whatever they say). If the tests were added 
earlier, it would be clearer which changes affected which tests.

REPOSITORY
  rHG Mercurial

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

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

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


D7508: relnotes: add note about changes to match.{explicit, reverse}dir

2019-11-22 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  relnotes/next

CHANGE DETAILS

diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -15,3 +15,9 @@
 
 == Internal API Changes ==
 
+ * Matcher instances no longer have a `explicitdir` property. Consider
+   rewriting your code to use `repo.wvfs.isdir()` and/or
+   `ctx.hasdir()` instead. Also, the `traversedir` property is now
+   also called when only `explicitdir` used to be called. That may
+   mean that you can simple remove the use of `explicitdir` if you
+   were already using `traversedir`.



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


mercurial@43735: 11 new changesets (1 on stable)

2019-11-22 Thread Mercurial Commits
11 new changesets (1 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/71dbd6f6fcb8
changeset:   43725:71dbd6f6fcb8
parent:  43718:d155bf11cf22
user:Denis Laxalde 
date:Thu Nov 21 09:25:50 2019 +0100
summary: import: add a --secret option

https://www.mercurial-scm.org/repo/hg/rev/6c6d67fc45cb
changeset:   43726:6c6d67fc45cb
user:Matt Harbison 
date:Tue Nov 19 14:04:09 2019 -0500
summary: revset: add an assertion to help pytype

https://www.mercurial-scm.org/repo/hg/rev/5b90a050082b
changeset:   43727:5b90a050082b
user:Matt Harbison 
date:Tue Nov 19 14:13:04 2019 -0500
summary: scmutil: add assertions to help pytype

https://www.mercurial-scm.org/repo/hg/rev/4330851947fb
changeset:   43728:4330851947fb
user:Denis Laxalde 
date:Wed Nov 20 08:55:24 2019 +0100
summary: tests: add more tests for "hg shelve --delete"

https://www.mercurial-scm.org/repo/hg/rev/1d1232c0726f
changeset:   43729:1d1232c0726f
user:Matt Harbison 
date:Wed Nov 20 09:55:59 2019 -0500
summary: wireprotov1server: capture Abort type before accessing the `hint` 
attribute

https://www.mercurial-scm.org/repo/hg/rev/d18cf63e1dbd
changeset:   43730:d18cf63e1dbd
user:Matt Harbison 
date:Thu Nov 21 15:31:33 2019 -0500
summary: phases: make `allphases` a list on py3 also

https://www.mercurial-scm.org/repo/hg/rev/6c8ba31405d9
changeset:   43731:6c8ba31405d9
user:Matt Harbison 
date:Thu Nov 21 15:38:23 2019 -0500
summary: profiling: disable the import-error warning for the flamegraph 
module

https://www.mercurial-scm.org/repo/hg/rev/882e633ac92c
changeset:   43732:882e633ac92c
user:Matt Harbison 
date:Thu Nov 21 15:39:03 2019 -0500
summary: profiling: add a missing argument to the ProgrammingError 
constructor

https://www.mercurial-scm.org/repo/hg/rev/8ca92bcb3083
changeset:   43733:8ca92bcb3083
user:Matt Harbison 
date:Thu Nov 21 15:46:35 2019 -0500
summary: tests: byteify a few more things in simplestorerepo.py

https://www.mercurial-scm.org/repo/hg/rev/88a306478556
changeset:   43734:88a306478556
branch:  stable
parent:  43724:5be128f669d4
user:Georges Racinet 
date:Wed Nov 20 19:07:02 2019 +0100
summary: singlehead: making config item a bool again

https://www.mercurial-scm.org/repo/hg/rev/7eb701e355bd
changeset:   43735:7eb701e355bd
bookmark:@
tag: tip
parent:  43733:8ca92bcb3083
parent:  43734:88a306478556
user:Yuya Nishihara 
date:Fri Nov 22 21:42:04 2019 +0900
summary: merge with stable

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7503: rust-dirs: address failing tests for `dirs` impl with a temporary fix

2019-11-22 Thread marmoute (Pierre-Yves David)
marmoute added inline comments.

INLINE COMMENTS

> Alphare wrote in lib.rs:117
> This patch is a minimal effort to stick to the C and Python implementations 
> until a decision is reached. Should we decide to keep this code, I would be 
> for having the path included in the error.

This seems fine.

REPOSITORY
  rHG Mercurial

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

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

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


D7503: rust-dirs: address failing tests for `dirs` impl with a temporary fix

2019-11-22 Thread RaphaĆ«l GomĆØs
Alphare added inline comments.

INLINE COMMENTS

> marmoute wrote in lib.rs:117
> Should we also have the path included in that error ?

This patch is a minimal effort to stick to the C and Python implementations 
until a decision is reached. Should we decide to keep this code, I would be for 
having the path included in the error.

REPOSITORY
  rHG Mercurial

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

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

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


D7503: rust-dirs: address failing tests for `dirs` impl with a temporary fix

2019-11-22 Thread RaphaĆ«l GomĆØs
Closed by commit rHG20a3bf5e71d6: rust-dirs: address failing tests for `dirs` 
impl with a temporary fix (authored by Alphare).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs 
Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7503?vs=18310=18318

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

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

AFFECTED FILES
  rust/hg-core/src/dirstate/dirs_multiset.rs
  rust/hg-core/src/dirstate/dirstate_map.rs
  rust/hg-core/src/lib.rs
  rust/hg-cpython/src/dirstate/dirs_multiset.rs
  rust/hg-cpython/src/dirstate/dirstate_map.rs

CHANGE DETAILS

diff --git a/rust/hg-cpython/src/dirstate/dirstate_map.rs 
b/rust/hg-cpython/src/dirstate/dirstate_map.rs
--- a/rust/hg-cpython/src/dirstate/dirstate_map.rs
+++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs
@@ -25,8 +25,8 @@
 use hg::{
 utils::hg_path::{HgPath, HgPathBuf},
 DirsMultiset, DirstateEntry, DirstateMap as RustDirstateMap,
-DirstateParents, DirstateParseError, EntryState, StateMapIter,
-PARENT_SIZE,
+DirstateMapError, DirstateParents, DirstateParseError, EntryState,
+StateMapIter, PARENT_SIZE,
 };
 
 // TODO
@@ -97,8 +97,9 @@
 size: size.extract(py)?,
 mtime: mtime.extract(py)?,
 },
-);
-Ok(py.None())
+).and(Ok(py.None())).or_else(|e: DirstateMapError| {
+Err(PyErr::new::(py, e.to_string()))
+})
 }
 
 def removefile(
diff --git a/rust/hg-cpython/src/dirstate/dirs_multiset.rs 
b/rust/hg-cpython/src/dirstate/dirs_multiset.rs
--- a/rust/hg-cpython/src/dirstate/dirs_multiset.rs
+++ b/rust/hg-cpython/src/dirstate/dirs_multiset.rs
@@ -68,8 +68,19 @@
 def addpath(, path: PyObject) -> PyResult {
 self.inner_shared(py).borrow_mut()?.add_path(
 HgPath::new(path.extract::(py)?.data(py)),
-);
-Ok(py.None())
+).and(Ok(py.None())).or_else(|e| {
+match e {
+DirstateMapError::EmptyPath => {
+Ok(py.None())
+},
+e => {
+Err(PyErr::new::(
+py,
+e.to_string(),
+))
+}
+}
+})
 }
 
 def delpath(, path: PyObject) -> PyResult {
@@ -79,15 +90,15 @@
 .and(Ok(py.None()))
 .or_else(|e| {
 match e {
-DirstateMapError::PathNotFound(_p) => {
+DirstateMapError::EmptyPath => {
+Ok(py.None())
+},
+e => {
 Err(PyErr::new::(
 py,
-"expected a value, found none".to_string(),
+e.to_string(),
 ))
 }
-DirstateMapError::EmptyPath => {
-Ok(py.None())
-}
 }
 })
 }
diff --git a/rust/hg-core/src/lib.rs b/rust/hg-core/src/lib.rs
--- a/rust/hg-core/src/lib.rs
+++ b/rust/hg-core/src/lib.rs
@@ -101,6 +101,20 @@
 pub enum DirstateMapError {
 PathNotFound(HgPathBuf),
 EmptyPath,
+ConsecutiveSlashes,
+}
+
+impl ToString for DirstateMapError {
+fn to_string() -> String {
+use crate::DirstateMapError::*;
+match self {
+PathNotFound(_) => "expected a value, found none".to_string(),
+EmptyPath => "Overflow in dirstate.".to_string(),
+ConsecutiveSlashes => {
+"found invalid consecutive slashes in path".to_string()
+}
+}
+}
 }
 
 pub enum DirstateError {
diff --git a/rust/hg-core/src/dirstate/dirstate_map.rs 
b/rust/hg-core/src/dirstate/dirstate_map.rs
--- a/rust/hg-core/src/dirstate/dirstate_map.rs
+++ b/rust/hg-core/src/dirstate/dirstate_map.rs
@@ -83,16 +83,16 @@
 filename: ,
 old_state: EntryState,
 entry: DirstateEntry,
-) {
+) -> Result<(), DirstateMapError> {
 if old_state == EntryState::Unknown || old_state == EntryState::Removed
 {
 if let Some(ref mut dirs) = self.dirs {
-dirs.add_path(filename)
+dirs.add_path(filename)?;
 }
 }
 if old_state == EntryState::Unknown {
 if let Some(ref mut all_dirs) = self.all_dirs {
-all_dirs.add_path(filename)
+all_dirs.add_path(filename)?;
 }
 }
 self.state_map.insert(filename.to_owned(), entry.to_owned());
@@ -104,6 +104,7 @@
 if entry.size == SIZE_FROM_OTHER_PARENT {
 self.other_parent_set.insert(filename.to_owned());
 }
+Ok(())
 }
 
 /// Mark a file as removed 

D7472: cleanup: update references to /help/ that should now be /helptext/

2019-11-22 Thread durin42 (Augie Fackler)
Closed by commit rHG640bae94f2f3: cleanup: update references to /help/ that 
should now be /helptext/ (authored by durin42).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs 
Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7472?vs=18279=18317

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

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

AFFECTED FILES
  Makefile
  contrib/packaging/hgpackaging/py2exe.py
  doc/Makefile
  mercurial/linelog.py

CHANGE DETAILS

diff --git a/mercurial/linelog.py b/mercurial/linelog.py
--- a/mercurial/linelog.py
+++ b/mercurial/linelog.py
@@ -8,7 +8,7 @@
 
 SCCS Weaves are an implementation of
 https://en.wikipedia.org/wiki/Interleaved_deltas. See
-mercurial/help/internals/linelog.txt for an exploration of SCCS weaves
+mercurial/helptext/internals/linelog.txt for an exploration of SCCS weaves
 and how linelog works in detail.
 
 Here's a hacker's summary: a linelog is a program which is executed in
diff --git a/doc/Makefile b/doc/Makefile
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,8 +1,8 @@
-SOURCES=$(notdir $(wildcard ../mercurial/help/*.[0-9].txt))
+SOURCES=$(notdir $(wildcard ../mercurial/helptext/*.[0-9].txt))
 MAN=$(SOURCES:%.txt=%)
 HTML=$(SOURCES:%.txt=%.html)
 GENDOC=gendoc.py ../mercurial/commands.py ../mercurial/help.py \
-   ../mercurial/help/*.txt ../hgext/*.py ../hgext/*/__init__.py
+   ../mercurial/helptext/*.txt ../hgext/*.py ../hgext/*/__init__.py
 PREFIX=/usr/local
 MANDIR=$(PREFIX)/share/man
 INSTALL=install -c -m 644
diff --git a/contrib/packaging/hgpackaging/py2exe.py 
b/contrib/packaging/hgpackaging/py2exe.py
--- a/contrib/packaging/hgpackaging/py2exe.py
+++ b/contrib/packaging/hgpackaging/py2exe.py
@@ -44,7 +44,7 @@
 ('dist/python*.dll', './'),
 ('doc/*.html', 'doc/'),
 ('doc/style.css', 'doc/'),
-('mercurial/help/**/*.txt', 'help/'),
+('mercurial/helptext/**/*.txt', 'helptext/'),
 ('mercurial/default.d/*.rc', 'hgrc.d/'),
 ('mercurial/locale/**/*', 'locale/'),
 ('mercurial/templates/**/*', 'Templates/'),
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@
 PURE=
 PYFILESCMD=find mercurial hgext doc -name '*.py'
 PYFILES:=$(shell $(PYFILESCMD))
-DOCFILES=mercurial/help/*.txt
+DOCFILES=mercurial/helptext/*.txt
 export LANGUAGE=C
 export LC_ALL=C
 TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)



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


D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  I like it.
  
  Any idea why the changeset isn't colored, unlike `hg show stack`?  It might 
also be a little more readable if the URI and status line were tabbed in, but 
maybe colored cset hashes would make that unnecessary?
  
  I'm also interested in coloring the status value, but I can tinker with that 
after it's landed, unless you already have plans.

REPOSITORY
  rHG Mercurial

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

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

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


D7503: rust-dirs: address failing tests for `dirs` impl with a temporary fix

2019-11-22 Thread marmoute (Pierre-Yves David)
marmoute added inline comments.

INLINE COMMENTS

> lib.rs:117
> +}
> +}
>  }

Should we also have the path included in that error ?

REPOSITORY
  rHG Mercurial

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

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

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


D7507: phabricator: add a "phabstatus" template keyword

2019-11-22 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18316.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7507?vs=18314=18316

BRANCH
  default

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

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -1682,6 +1682,28 @@
 return None
 
 
+@eh.templatekeyword(b'phabstatus', requires={b'ctx', b'repo', b'ui'})
+def template_status(context, mapping):
+""":phabstatus: String. Status of Phabricator differential.
+"""
+ctx = context.resource(mapping, b'ctx')
+repo = context.resource(mapping, b'repo')
+ui = context.resource(mapping, b'ui')
+
+rev = ctx.rev()
+try:
+drevid = getdrevmap(repo, [rev])[rev]
+except KeyError:
+return None
+drevs = callconduit(ui, b'differential.query', {b'ids': [drevid]})
+for drev in drevs:
+if int(drev[b'id']) == drevid:
+return templateutil.hybriddict(
+{b'url': drev[b'uri'], b'status': drev[b'statusName'],}
+)
+return None
+
+
 phabstatus_tmpl = (
 b'{label("changeset.{phase}{if(troubles, \' changeset.troubled\')}", '
 b'shortest(node, 5))} '



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


D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18315.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7506?vs=18313=18315

BRANCH
  default

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

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -11,6 +11,10 @@
 revisions in a format suitable for :hg:`import`, and a ``phabupdate`` command
 to update statuses in batch.
 
+A "phabstatus" view for :hg:`show` is also provided; it displays status
+information of Phabricator differentials associated with unfinished
+changesets.
+
 By default, Phabricator requires ``Test Plan`` which might prevent some
 changeset from being sent. The requirement could be disabled by changing
 ``differential.require-test-plan-field`` config server side.
@@ -60,9 +64,12 @@
 encoding,
 error,
 exthelper,
+formatter,
+graphmod,
 httpconnection as httpconnectionmod,
 match,
 mdiff,
+logcmdutil,
 obsutil,
 parser,
 patch,
@@ -80,6 +87,8 @@
 procutil,
 stringutil,
 )
+from hgext.show import showview
+
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' 
for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
@@ -462,6 +471,29 @@
 return result
 
 
+def getdrevmap(repo, nodelist):
+"""Return a dict mapping each node in `nodelist` to their Differential
+Revision ID.
+"""
+result = {}
+for node in nodelist:
+result[node] = None
+ctx = repo[node]
+# Check commit message
+m = _differentialrevisiondescre.search(ctx.description())
+if m:
+result[node] = int(m.group('id'))
+continue
+# Check tags
+for tag in repo.nodetags(node):
+m = _differentialrevisiontagre.match(tag)
+if m:
+result[node] = int(m.group(1))
+break
+
+return result
+
+
 def getdiff(ctx, diffopts):
 """plain-text diff without header (user, commit message, etc)"""
 output = util.stringio()
@@ -1648,3 +1680,41 @@
 
 return templateutil.hybriddict({b'url': url, b'id': t,})
 return None
+
+
+phabstatus_tmpl = (
+b'{label("changeset.{phase}{if(troubles, \' changeset.troubled\')}", '
+b'shortest(node, 5))} '
+b'[{label("log.branch", branch)}] '
+b'{label("log.description", desc|firstline)} '
+b'({label("log.user", author|user)})\n'
+)
+
+
+@showview(b'phabstatus')
+def phabstatusshowview(ui, repo):
+"""Phabricator differiential status"""
+revs = repo.revs('sort(_underway(), topo)')
+drevmap = getdrevmap(repo, [repo[r].node() for r in revs])
+revs, drevids, revsbydrevid = [], [], {}
+for node, drevid in pycompat.iteritems(drevmap):
+if drevid is not None:
+revs.append(repo[node].rev())
+drevids.append(drevid)
+revsbydrevid[drevid] = repo[node].rev()
+
+revs = smartset.baseset(revs)
+drevs = callconduit(ui, b'differential.query', {b'ids': drevids})
+drevsbyrev = {revsbydrevid[int(drev[b'id'])]: drev for drev in drevs}
+
+def phabstatus(ctx):
+drev = drevsbyrev[ctx.rev()]
+ui.write(b"%(uri)s %(statusName)s\n" % drev)
+
+revdag = graphmod.dagwalker(repo, revs)
+
+ui.setconfig(b'experimental', b'graphshorten', True)
+spec = formatter.lookuptemplate(ui, None, phabstatus_tmpl)
+displayer = logcmdutil.changesettemplater(ui, repo, spec, buffered=True)
+displayer._exthook = phabstatus
+logcmdutil.displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges)



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


D7507: phabricator: add a "phabstatus" template keyword

2019-11-22 Thread dlax (Denis Laxalde)
dlax created this revision.
Herald added subscribers: mercurial-devel, Kwan.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We add a "phabstatus" template keyword, returning an object with "url"
  and "status" keys. This is quite similar to "phabreview" template
  keyword, but it queries phabricator for each specified revision so it's
  going to be slow (as compared to the "phabstatus" show view from
  previous changeset).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -1682,6 +1682,28 @@
 return None
 
 
+@eh.templatekeyword(b'phabstatus', requires={b'ctx', b'repo', b'ui'})
+def template_status(context, mapping):
+""":phabstatus: String. Status of Phabricator differential.
+"""
+ctx = context.resource(mapping, b'ctx')
+repo = context.resource(mapping, b'repo')
+ui = context.resource(mapping, b'ui')
+
+rev = ctx.rev()
+try:
+drevid = getdrevmap(repo, [rev])[rev]
+except KeyError:
+return None
+drevs = callconduit(ui, b'differential.query', {b'ids': [drevid]})
+for drev in drevs:
+if int(drev[b'id']) == drevid:
+return templateutil.hybriddict(
+{b'url': drev[b'uri'], b'status': drev[b'statusName'],}
+)
+return None
+
+
 phabstatus_tmpl = (
 b'{label("changeset.{phase}{if(troubles, \' changeset.troubled\')}", '
 b'shortest(node, 5))} '



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


D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread dlax (Denis Laxalde)
dlax created this revision.
Herald added subscribers: mercurial-devel, Kwan, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We add a "phabstatus" show view (called as "hg show phabstatus") which
  renders a dag with underway revisions associated with a differential
  revision and displays their status.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -11,6 +11,10 @@
 revisions in a format suitable for :hg:`import`, and a ``phabupdate`` command
 to update statuses in batch.
 
+A "phabstatus" view for :hg:`show` is also provided; it displays status
+information of Phabricator differentials associated with unfinished
+changesets.
+
 By default, Phabricator requires ``Test Plan`` which might prevent some
 changeset from being sent. The requirement could be disabled by changing
 ``differential.require-test-plan-field`` config server side.
@@ -60,9 +64,12 @@
 encoding,
 error,
 exthelper,
+formatter,
+graphmod,
 httpconnection as httpconnectionmod,
 match,
 mdiff,
+logcmdutil,
 obsutil,
 parser,
 patch,
@@ -80,6 +87,8 @@
 procutil,
 stringutil,
 )
+from hgext.show import showview
+
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' 
for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
@@ -462,6 +471,29 @@
 return result
 
 
+def getdrevmap(repo, nodelist):
+"""Return a dict mapping each node in `nodelist` to their Differential
+Revision ID (or None).
+"""
+result = {}
+for node in nodelist:
+result[node] = None
+ctx = repo[node]
+# Check commit message
+m = _differentialrevisiondescre.search(ctx.description())
+if m:
+result[node] = int(m.group('id'))
+continue
+# Check tags
+for tag in repo.nodetags(node):
+m = _differentialrevisiontagre.match(tag)
+if m:
+result[node] = int(m.group(1))
+break
+
+return result
+
+
 def getdiff(ctx, diffopts):
 """plain-text diff without header (user, commit message, etc)"""
 output = util.stringio()
@@ -1648,3 +1680,41 @@
 
 return templateutil.hybriddict({b'url': url, b'id': t,})
 return None
+
+
+phabstatus_tmpl = (
+b'{label("changeset.{phase}{if(troubles, \' changeset.troubled\')}", '
+b'shortest(node, 5))} '
+b'[{label("log.branch", branch)}] '
+b'{label("log.description", desc|firstline)} '
+b'({label("log.user", author|user)})\n'
+)
+
+
+@showview(b'phabstatus')
+def phabstatusshowview(ui, repo):
+"""Phabricator differiential status"""
+revs = repo.revs('sort(_underway(), topo)')
+drevmap = getdrevmap(repo, [repo[r].node() for r in revs])
+revs, drevids, revsbydrevid = [], [], {}
+for node, drevid in pycompat.iteritems(drevmap):
+if drevid is not None:
+revs.append(repo[node].rev())
+drevids.append(drevid)
+revsbydrevid[drevid] = repo[node].rev()
+
+revs = smartset.baseset(revs)
+drevs = callconduit(ui, b'differential.query', {b'ids': drevids})
+drevsbyrev = {revsbydrevid[int(drev[b'id'])]: drev for drev in drevs}
+
+def phabstatus(ctx):
+drev = drevsbyrev[ctx.rev()]
+ui.write(b"%(uri)s %(statusName)s\n" % drev)
+
+revdag = graphmod.dagwalker(repo, revs)
+
+ui.setconfig(b'experimental', b'graphshorten', True)
+spec = formatter.lookuptemplate(ui, None, phabstatus_tmpl)
+displayer = logcmdutil.changesettemplater(ui, repo, spec, buffered=True)
+displayer._exthook = phabstatus
+logcmdutil.displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges)



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


D7505: logcmdutil: call _exthook() in changesettemplater

2019-11-22 Thread dlax (Denis Laxalde)
dlax created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Class changesetprinter has an _exthook() method that is called in
  _show() before the patch is displayed. Call the method as well in
  changesettemplater._show().

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/logcmdutil.py

CHANGE DETAILS

diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py
+++ b/mercurial/logcmdutil.py
@@ -597,6 +597,7 @@
 # write changeset metadata, then patch if requested
 key = self._parts[self._tref]
 self.ui.write(self.t.render(key, props))
+self._exthook(ctx)
 self._showpatch(ctx, graphwidth)
 
 if self._parts[b'footer']:



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


D7504: py3: replace %s by %r on binary format string when needed

2019-11-22 Thread matclab (Mathieu Clabaut)
matclab added a comment.
matclab abandoned this revision.




INLINE COMMENTS

> dlax wrote in localrepo.py:1571
> The first `%s` was correct I think because `changeid` can be a bytes.
> 
> For the second one, if `%r` is the way to go (I'm not sure), maybe we can 
> drop `pycompat.sysstr()`?

I'm really dumbā€¦ 
I encountered the problem in mercurial 5.2 and did the change in mercurial 
devel without checking that the problem still occurred. I guess that 
`pycompat.sysstr()` already solves the problem. 
In my opinion `%r` is shorter and cleaner, but I  don't think we need to bother.

Sorry for the noise. I will close the request.

REPOSITORY
  rHG Mercurial

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

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

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


mercurial@43724: 3 new changesets (3 on stable)

2019-11-22 Thread Mercurial Commits
3 new changesets (3 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/aff3f6e407a1
changeset:   43722:aff3f6e407a1
branch:  stable
user:Martin von Zweigbergk 
date:Wed Nov 20 08:11:21 2019 -0800
summary: py3: wrap a __func__ in sysbytes() before logging as bytes

https://www.mercurial-scm.org/repo/hg/rev/eab0b7383cd3
changeset:   43723:eab0b7383cd3
branch:  stable
user:Matt Harbison 
date:Thu Nov 21 14:28:28 2019 -0500
summary: patch: fix a str + bytes issue in an exception handler

https://www.mercurial-scm.org/repo/hg/rev/5be128f669d4
changeset:   43724:5be128f669d4
branch:  stable
tag: tip
user:Matt Harbison 
date:Thu Nov 21 17:25:24 2019 -0500
summary: util: convert an exception to bytes when passing to Abort()

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7504: py3: replace %s by %r on binary format string when needed

2019-11-22 Thread dlax (Denis Laxalde)
This revision now requires changes to proceed.
dlax added a comment.
dlax requested changes to this revision.


  nit: the actual PEP is pep-0461 (https://www.python.org/dev/peps/pep-0461/)

INLINE COMMENTS

> localrepo.py:1571
> +b"unsupported changeid '%r' of type %r"
>  % (changeid, pycompat.sysstr(type(changeid)))
>  )

The first `%s` was correct I think because `changeid` can be a bytes.

For the second one, if `%r` is the way to go (I'm not sure), maybe we can drop 
`pycompat.sysstr()`?

REPOSITORY
  rHG Mercurial

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

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

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


Re: [PATCH STABLE V2] singlehead: making config item a bool again

2019-11-22 Thread Yuya Nishihara
On Thu, 21 Nov 2019 14:43:15 +0100, Georges Racinet wrote:
> # HG changeset patch
> # User Georges Racinet 
> # Date 1574273222 -3600
> #  Wed Nov 20 19:07:02 2019 +0100
> # Branch stable
> # Node ID 0509d93280bfd9df473ad4ee5b00d0d1d1e8e291
> # Parent  ca3dca416f8d5863ca6f5a4a6a6bb835dcd5feeb
> # EXP-Topic single_head_is_boolean
> singlehead: making config item a bool again

Queued for stable, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7504: py3: replace %s by %r on binary format string when needed

2019-11-22 Thread matclab (Mathieu Clabaut)
matclab created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  For some error, mercurial displays the type of a variable. However the
  formatting string used was "%s" which is not compatible with `type` and lead
  to an excpetion `TypeError: %b requires a bytes-like object, or an object that
  implements __bytes__, not 'type'`.
  
  Per pep-046, we replace "%s" with "%r" which stay compatible with python2 and
  python3.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/perf.py
  mercurial/bundlerepo.py
  mercurial/localrepo.py
  mercurial/scmutil.py
  mercurial/utils/cborutil.py

CHANGE DETAILS

diff --git a/mercurial/utils/cborutil.py b/mercurial/utils/cborutil.py
--- a/mercurial/utils/cborutil.py
+++ b/mercurial/utils/cborutil.py
@@ -241,7 +241,7 @@
 break
 
 if not fn:
-raise ValueError(b'do not know how to encode %s' % type(v))
+raise ValueError(b'do not know how to encode %r' % type(v))
 
 return fn(v)
 
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -597,7 +597,7 @@
 """
 if not isinstance(symbol, bytes):
 msg = (
-b"symbol (%s of type %s) was not a string, did you mean "
+b"symbol (%r of type %r) was not a string, did you mean "
 b"repo[symbol]?" % (symbol, type(symbol))
 )
 raise error.ProgrammingError(msg)
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1567,7 +1567,7 @@
 rev = self.changelog.rev(node)
 else:
 raise error.ProgrammingError(
-b"unsupported changeid '%s' of type %s"
+b"unsupported changeid '%r' of type %r"
 % (changeid, pycompat.sysstr(type(changeid)))
 )
 
diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -295,7 +295,7 @@
 self._cgunpacker = bundle
 else:
 raise error.Abort(
-_(b'bundle type %s cannot be read') % type(bundle)
+_(b'bundle type %r cannot be read') % type(bundle)
 )
 
 # dict with the mapping 'filename' -> position in the changegroup.
diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -1058,7 +1058,7 @@
 elif isinstance(bundle, streamclone.streamcloneapplier):
 raise error.Abort(b'stream clone bundles not supported')
 else:
-raise error.Abort(b'unhandled bundle type: %s' % type(bundle))
+raise error.Abort(b'unhandled bundle type: %r' % type(bundle))
 
 for fn, title in benches:
 timer, fm = gettimer(ui, opts)



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


D7051: phabricator: remove tests and all recordings

2019-11-22 Thread dlax (Denis Laxalde)
dlax added a comment.


  > The next commit is going to change the format of conduit API requests so 
none of the VCR recordings will match and all the tests will fail.
  
  @Kwan, it seems to me that there is no longer any recording data nor actual 
test from this changeset. Did you plan to add them back? (At the moment, it 
seems to me that test-phabricator.t tests nothing.)

REPOSITORY
  rHG Mercurial

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

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

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


D7503: rust-dirs: address failing tests for `dirs` impl with a temporary fix

2019-11-22 Thread RaphaĆ«l GomĆØs
Alphare created this revision.
Herald added subscribers: mercurial-devel, kevincox, durin42.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  https://phab.mercurial-scm.org/D7252 
(5d40317d42b7083b49467502549e25f144888cb3 
)
  introduced a regression in Rust tests.
  
  This is a temporary fix that replicates the behavior of the C and Python impl,
  pending the resolution of the discussion (in the phabricator link) about how
  we actually want to solve this problem.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/dirstate/dirs_multiset.rs
  rust/hg-core/src/dirstate/dirstate_map.rs
  rust/hg-core/src/lib.rs
  rust/hg-cpython/src/dirstate/dirs_multiset.rs
  rust/hg-cpython/src/dirstate/dirstate_map.rs

CHANGE DETAILS

diff --git a/rust/hg-cpython/src/dirstate/dirstate_map.rs 
b/rust/hg-cpython/src/dirstate/dirstate_map.rs
--- a/rust/hg-cpython/src/dirstate/dirstate_map.rs
+++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs
@@ -25,8 +25,8 @@
 use hg::{
 utils::hg_path::{HgPath, HgPathBuf},
 DirsMultiset, DirstateEntry, DirstateMap as RustDirstateMap,
-DirstateParents, DirstateParseError, EntryState, StateMapIter,
-PARENT_SIZE,
+DirstateMapError, DirstateParents, DirstateParseError, EntryState,
+StateMapIter, PARENT_SIZE,
 };
 
 // TODO
@@ -97,8 +97,9 @@
 size: size.extract(py)?,
 mtime: mtime.extract(py)?,
 },
-);
-Ok(py.None())
+).and(Ok(py.None())).or_else(|e: DirstateMapError| {
+Err(PyErr::new::(py, e.to_string()))
+})
 }
 
 def removefile(
diff --git a/rust/hg-cpython/src/dirstate/dirs_multiset.rs 
b/rust/hg-cpython/src/dirstate/dirs_multiset.rs
--- a/rust/hg-cpython/src/dirstate/dirs_multiset.rs
+++ b/rust/hg-cpython/src/dirstate/dirs_multiset.rs
@@ -68,8 +68,19 @@
 def addpath(, path: PyObject) -> PyResult {
 self.inner_shared(py).borrow_mut()?.add_path(
 HgPath::new(path.extract::(py)?.data(py)),
-);
-Ok(py.None())
+).and(Ok(py.None())).or_else(|e| {
+match e {
+DirstateMapError::EmptyPath => {
+Ok(py.None())
+},
+e => {
+Err(PyErr::new::(
+py,
+e.to_string(),
+))
+}
+}
+})
 }
 
 def delpath(, path: PyObject) -> PyResult {
@@ -79,15 +90,15 @@
 .and(Ok(py.None()))
 .or_else(|e| {
 match e {
-DirstateMapError::PathNotFound(_p) => {
+DirstateMapError::EmptyPath => {
+Ok(py.None())
+},
+e => {
 Err(PyErr::new::(
 py,
-"expected a value, found none".to_string(),
+e.to_string(),
 ))
 }
-DirstateMapError::EmptyPath => {
-Ok(py.None())
-}
 }
 })
 }
diff --git a/rust/hg-core/src/lib.rs b/rust/hg-core/src/lib.rs
--- a/rust/hg-core/src/lib.rs
+++ b/rust/hg-core/src/lib.rs
@@ -101,6 +101,20 @@
 pub enum DirstateMapError {
 PathNotFound(HgPathBuf),
 EmptyPath,
+ConsecutiveSlashes,
+}
+
+impl ToString for DirstateMapError {
+fn to_string() -> String {
+use crate::DirstateMapError::*;
+match self {
+PathNotFound(_) => "expected a value, found none".to_string(),
+EmptyPath => "Overflow in dirstate.".to_string(),
+ConsecutiveSlashes => {
+"found invalid consecutive slashes in path".to_string()
+}
+}
+}
 }
 
 pub enum DirstateError {
diff --git a/rust/hg-core/src/dirstate/dirstate_map.rs 
b/rust/hg-core/src/dirstate/dirstate_map.rs
--- a/rust/hg-core/src/dirstate/dirstate_map.rs
+++ b/rust/hg-core/src/dirstate/dirstate_map.rs
@@ -83,16 +83,16 @@
 filename: ,
 old_state: EntryState,
 entry: DirstateEntry,
-) {
+) -> Result<(), DirstateMapError> {
 if old_state == EntryState::Unknown || old_state == EntryState::Removed
 {
 if let Some(ref mut dirs) = self.dirs {
-dirs.add_path(filename)
+dirs.add_path(filename)?;
 }
 }
 if old_state == EntryState::Unknown {
 if let Some(ref mut all_dirs) = self.all_dirs {
-all_dirs.add_path(filename)
+all_dirs.add_path(filename)?;
 }
 }
 self.state_map.insert(filename.to_owned(), entry.to_owned());
@@ -104,6 +104,7 @@
 if entry.size == 

D7501: changectx: use unfiltered changelog to walk ancestors in annotate

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

REVISION SUMMARY
  Since we are only walking ancestors, it is safe to use an unfiltered 
repository.
  (Because if the original rev is not filtered, none of its ancestors will be).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.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
@@ -136,13 +136,11 @@
 - file with a single change
 
   $ hg annotate a
-  debug.filters: computing revision filter for "visible"
   0: a
 
 - file with multiple change
 
   $ hg annotate z
-  debug.filters: computing revision filter for "visible"
   0: some line
   1: in a
   2: file
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1152,7 +1152,9 @@
 # use linkrev to find the first changeset where self appeared
 base = self.introfilectx()
 if getattr(base, '_ancestrycontext', None) is None:
-cl = self._repo.changelog
+# it is safe to use an unfiltered repository here because we are
+# walking ancestors only.
+cl = self._repo.unfiltered().changelog
 if base.rev() is None:
 # wctx is not inclusive, but works because _ancestrycontext
 # is used to test filelog revisions



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


D7502: changectx: mark parent of changesets as non filtered

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

REVISION SUMMARY
  If a node is not filtered, its parents cannot be filtered.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -524,8 +524,11 @@
 
 p1, p2 = cl.parentrevs(self._rev)
 if p2 == nullrev:
-return [repo[p1]]
-return [repo[p1], repo[p2]]
+return [changectx(repo, p1, cl.node(p1), maybe_filtered=False)]
+return [
+changectx(repo, p1, cl.node(p1), maybe_filtered=False),
+changectx(repo, p2, cl.node(p2), maybe_filtered=False),
+]
 
 def changeset(self):
 c = self._changeset



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


D7492: localrepo: also fastpath access to working copy parents when possible

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

REVISION SUMMARY
  If the filter level garantee that the workig copy parents will be visible, we
  allow fast path access to them. With this change multiple commands can now run
  without triggering filtering.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py
  mercurial/localrepo.py
  mercurial/scmutil.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
@@ -62,7 +62,6 @@
 Getting status of working copy
 
   $ hg status
-  debug.filters: computing revision filter for "visible"
   M c
   A d
   R a
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1463,6 +1463,7 @@
 if src not in newctx or dst in newctx or ds[dst] != b'a':
 src = None
 ds.copy(src, dst)
+repo._quick_access_changeid_invalidate()
 
 
 def writerequires(opener, requirements):
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1514,18 +1514,51 @@
 narrowspec.save(self, newincludes, newexcludes)
 self.invalidate(clearfilecache=True)
 
-@util.propertycache
+@unfilteredpropertycache
+def _quick_access_changeid_null(self):
+return {
+b'null': (nullrev, nullid),
+nullrev: (nullrev, nullid),
+nullid: (nullrev, nullid),
+}
+
+@unfilteredpropertycache
+def _quick_access_changeid_wc(self):
+# also fast path access to the working copy parents
+# however, only do it for filter that ensure wc is visible.
+quick = {}
+cl = self.unfiltered().changelog
+for node in self.dirstate.parents():
+if node == nullid:
+continue
+rev = cl.index.get_rev(node)
+if rev is None:
+# unknown working copy parent case:
+#
+#   skip the fast path and let higher code deal with it
+continue
+pair = (rev, node)
+quick[rev] = pair
+quick[node] = pair
+return quick
+
+@unfilteredmethod
+def _quick_access_changeid_invalidate(self):
+if '_quick_access_changeid_wc' in vars(self):
+del self.__dict__['_quick_access_changeid_wc']
+
+@property
 def _quick_access_changeid(self):
 """an helper dictionnary for __getitem__ calls
 
 This contains a list of symbol we can recognise right away without
 further processing.
 """
-return {
-b'null': (nullrev, nullid),
-nullrev: (nullrev, nullid),
-nullid: (nullrev, nullid),
-}
+mapping = self._quick_access_changeid_null
+if self.filtername in repoview.filter_has_wc:
+mapping = mapping.copy()
+mapping.update(self._quick_access_changeid_wc)
+return mapping
 
 def __getitem__(self, changeid):
 # dealing with special cases
@@ -1897,6 +1930,7 @@
 for f, s in sorted(self.dirstate.copies().items()):
 if f not in pctx and s not in pctx:
 self.dirstate.copy(None, f)
+self._quick_access_changeid_invalidate()
 
 def filectx(self, path, changeid=None, fileid=None, changectx=None):
 """changeid must be a changeset revision, if specified.
@@ -2495,6 +2529,7 @@
 def invalidatevolatilesets(self):
 self.filteredrevcache.clear()
 obsolete.clearobscaches(self)
+self._quick_access_changeid_invalidate()
 
 def invalidatedirstate(self):
 '''Invalidates the dirstate, causing the next call to dirstate
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1957,6 +1957,7 @@
 for f in self.removed():
 self._repo.dirstate.drop(f)
 self._repo.dirstate.setparents(node)
+self._repo._quick_access_changeid_invalidate()
 
 # write changes out explicitly, because nesting wlock at
 # runtime may prevent 'wlock.release()' in 'repo.commit()'



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


D7498: localrepo: also fast past the parents of working copies parents

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

REVISION SUMMARY
  There are a descent odds that their will be needed too. So we also cache and
  fastpath them.

REPOSITORY
  rHG Mercurial

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

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
@@ -93,7 +93,6 @@
   @@ -0,0 +1,1 @@
   +d
   $ hg diff --change .
-  debug.filters: computing revision filter for "visible"
   diff -r 05293e5dd8d1ae4f84a8520a11c6f97cad26deca -r 
c2932ca7786be30b67154d541a8764fae5532261 c
   --- /dev/nullThu Jan 01 00:00:00 1970 +
   +++ b/c  Thu Jan 01 00:00:00 1970 +
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1540,6 +1540,14 @@
 pair = (rev, node)
 quick[rev] = pair
 quick[node] = pair
+# also add the parents of the parents
+for r in cl.parentrevs(rev):
+if r == nullrev:
+continue
+n = cl.node(r)
+pair = (r, n)
+quick[r] = pair
+quick[n] = pair
 p1node = self.dirstate.p1()
 if p1node != nullid:
 quick[b'.'] = quick[p1node]



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


D7500: repoview: add a test for changelog filtering trigger for `hg annotate`

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

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  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
@@ -130,3 +130,19 @@
some line
in a
   +file
+
+using annotate
+
+- file with a single change
+
+  $ hg annotate a
+  debug.filters: computing revision filter for "visible"
+  0: a
+
+- file with multiple change
+
+  $ hg annotate z
+  debug.filters: computing revision filter for "visible"
+  0: some line
+  1: in a
+  2: file



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


D7495: localrepo: recognize trivial request for '.'

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
  Same logic as for `null`, this is a command request and skipping the revset
  logic can avoid triggering the changelog filtering logic.

REPOSITORY
  rHG Mercurial

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

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
@@ -70,6 +70,5 @@
 Getting data about the working copy parent
 
   $ hg log -r '.' -T "{node}\n{date}\n"
-  debug.filters: computing revision filter for "visible"
   c2932ca7786be30b67154d541a8764fae5532261
   0.00
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1705,6 +1705,10 @@
 '''
 if specs == [b'null']:
 return revset.baseset([nullrev])
+if specs == [b'.']:
+quick_data = self._quick_access_changeid.get(b'.')
+if quick_data is not None:
+return revset.baseset([quick_data[0]])
 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


D7499: repoview: test triggering of filter computation for `hg export`

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

REVISION SUMMARY
  This already skips changelog filtering.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  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
@@ -105,3 +105,28 @@
some line
in a
   +file
+
+exporting the current changeset
+
+  $ hg export
+  exporting patch:
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  #  Thu Jan 01 00:00:00 1970 +
+  # Node ID c2932ca7786be30b67154d541a8764fae5532261
+  # Parent  05293e5dd8d1ae4f84a8520a11c6f97cad26deca
+  c
+  
+  diff -r 05293e5dd8d1ae4f84a8520a11c6f97cad26deca -r 
c2932ca7786be30b67154d541a8764fae5532261 c
+  --- /dev/nullThu Jan 01 00:00:00 1970 +
+  +++ b/c  Thu Jan 01 00:00:00 1970 +
+  @@ -0,0 +1,1 @@
+  +c
+  diff -r 05293e5dd8d1ae4f84a8520a11c6f97cad26deca -r 
c2932ca7786be30b67154d541a8764fae5532261 z
+  --- a/z  Thu Jan 01 00:00:00 1970 +
+  +++ b/z  Thu Jan 01 00:00:00 1970 +
+  @@ -1,2 +1,3 @@
+   some line
+   in a
+  +file



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


D7497: repoview: add a test for filtering computation for `hg diff --change`

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

REVISION SUMMARY
  That one still trigger the filtering. We will fix this in later changesets.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  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
@@ -92,3 +92,17 @@
   +++ b/d  Thu Jan 01 00:00:00 1970 +
   @@ -0,0 +1,1 @@
   +d
+  $ hg diff --change .
+  debug.filters: computing revision filter for "visible"
+  diff -r 05293e5dd8d1ae4f84a8520a11c6f97cad26deca -r 
c2932ca7786be30b67154d541a8764fae5532261 c
+  --- /dev/nullThu Jan 01 00:00:00 1970 +
+  +++ b/c  Thu Jan 01 00:00:00 1970 +
+  @@ -0,0 +1,1 @@
+  +c
+  diff -r 05293e5dd8d1ae4f84a8520a11c6f97cad26deca -r 
c2932ca7786be30b67154d541a8764fae5532261 z
+  --- a/z  Thu Jan 01 00:00:00 1970 +
+  +++ b/z  Thu Jan 01 00:00:00 1970 +
+  @@ -1,2 +1,3 @@
+   some line
+   in a
+  +file



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


D7494: localrepo: fastpath access to "."

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

REVISION SUMMARY
  "." is just an aliast for `p1(wdir()`, let us handle it that way.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1540,6 +1540,9 @@
 pair = (rev, node)
 quick[rev] = pair
 quick[node] = pair
+p1node = self.dirstate.p1()
+if p1node != nullid:
+quick[b'.'] = quick[p1node]
 return quick
 
 @unfilteredmethod



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


D7496: repoview: add a test for filtering computation for `hg diff`

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

REVISION SUMMARY
  The recent works means it is -already- not triggering filtering computation 
:-)

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  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
@@ -72,3 +72,23 @@
   $ hg log -r '.' -T "{node}\n{date}\n"
   c2932ca7786be30b67154d541a8764fae5532261
   0.00
+
+Getting working copy diff
+
+  $ hg diff
+  diff -r c2932ca7786be30b67154d541a8764fae5532261 a
+  --- a/a  Thu Jan 01 00:00:00 1970 +
+  +++ /dev/nullThu Jan 01 00:00:00 1970 +
+  @@ -1,1 +0,0 @@
+  -a
+  diff -r c2932ca7786be30b67154d541a8764fae5532261 c
+  --- a/c  Thu Jan 01 00:00:00 1970 +
+  +++ b/c  Thu Jan 01 00:00:00 1970 +
+  @@ -1,1 +1,1 @@
+  -c
+  +c1
+  diff -r c2932ca7786be30b67154d541a8764fae5532261 d
+  --- /dev/nullThu Jan 01 00:00:00 1970 +
+  +++ b/d  Thu Jan 01 00:00:00 1970 +
+  @@ -0,0 +1,1 @@
+  +d



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


D7491: changectx: mark the parents of the working copy as non filtered

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

REVISION SUMMARY
  If we successfully accessed the working copy, its parents are not filtered.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1512,7 +1512,9 @@
 p = p[:-1]
 # use unfiltered repo to delay/avoid loading obsmarkers
 unfi = self._repo.unfiltered()
-return [changectx(self._repo, unfi.changelog.rev(n), n) for n in p]
+return [
+changectx(self._repo, unfi.changelog.rev(n), n, False) for n in p
+]
 
 def _fileinfo(self, path):
 # populate __dict__['_manifest'] as workingctx has no _manifestdelta



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


D7493: repoview: test changelog filtering triggered by a lookup to '.'

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

REVISION SUMMARY
  This is a commonly used value, we should deal with it properly.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  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
@@ -66,3 +66,10 @@
   A d
   R a
   ! b
+
+Getting data about the working copy parent
+
+  $ hg log -r '.' -T "{node}\n{date}\n"
+  debug.filters: computing revision filter for "visible"
+  c2932ca7786be30b67154d541a8764fae5532261
+  0.00



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


D7488: localrepo: introduce a `_quick_access_changeid` property

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

REVISION SUMMARY
  Having faster access to `null` is cuteā€¦ but limited. We want to speedup access
  to more useful revision, like `.`. We start with turning the fast path for
  `null` into something more generic.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1514,6 +1514,19 @@
 narrowspec.save(self, newincludes, newexcludes)
 self.invalidate(clearfilecache=True)
 
+@util.propertycache
+def _quick_access_changeid(self):
+"""an helper dictionnary for __getitem__ calls
+
+This contains a list of symbol we can recognise right away without
+further processing.
+"""
+return {
+b'null': (nullrev, nullid),
+nullrev: (nullrev, nullid),
+nullid: (nullrev, nullid),
+}
+
 def __getitem__(self, changeid):
 # dealing with special cases
 if changeid is None:
@@ -1531,8 +1544,10 @@
 ]
 
 # dealing with some special values
-if changeid == b'null' or changeid == nullrev or changeid == nullid:
-return context.changectx(self, nullrev, nullid, False)
+quick_access = self._quick_access_changeid.get(changeid)
+if quick_access is not None:
+rev, node = quick_access
+return context.changectx(self, rev, node, False)
 if changeid == b'tip':
 node = self.changelog.tip()
 rev = self.changelog.rev(node)



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


D7490: repoview: add an explicit set of all filter that show the wc parents

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

REVISION SUMMARY
  The `visible` set will always show the working copy parents. We record this 
in a
  specific set. This will allow to fast path some access.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/repoview.py

CHANGE DETAILS

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -177,6 +177,9 @@
 b'base': computeimpactable,
 }
 
+# set of filter level that will include the working copy parent no matter what.
+filter_has_wc = {b'visible', b'visible-hidden'}
+
 _basefiltername = list(filtertable)
 
 



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


D7487: changectx: use unfiltered changelog to access parents of unfiltered revs

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

REVISION SUMMARY
  If a revision is not filtered, we know that its parents are not either. So we
  can take a shortcut. This shortcut avoid the computation of all filtered revs 
in
  some cases.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.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
@@ -60,4 +60,3 @@
 Getting status of null
 
   $ hg status --change null
-  debug.filters: computing revision filter for "visible"
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -517,7 +517,12 @@
 @propertycache
 def _parents(self):
 repo = self._repo
-p1, p2 = repo.changelog.parentrevs(self._rev)
+if self._maybe_filtered:
+cl = repo.changelog
+else:
+cl = repo.unfiltered().changelog
+
+p1, p2 = cl.parentrevs(self._rev)
 if p2 == nullrev:
 return [repo[p1]]
 return [repo[p1], repo[p2]]



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


D7486: locarepo: also fastpath `nullid` lookup in __getitem__

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

REVISION SUMMARY
  We already use that fastpath for `"null"` and `nullrev`, using it for `nullid`
  is similar.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1531,7 +1531,7 @@
 ]
 
 # dealing with some special values
-if changeid == b'null' or changeid == nullrev:
+if changeid == b'null' or changeid == nullrev or changeid == nullid:
 return context.changectx(self, nullrev, nullid, False)
 if changeid == b'tip':
 node = self.changelog.tip()



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


D7489: repoview: add test for filtering computation when running `hg status`

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

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  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
@@ -46,8 +46,6 @@
 
 Getting the node of `null`
 
-  $ hg init test-repo
-  $ cd test-repo
   $ hg log -r null -T "{node}\n"
   
 
@@ -60,3 +58,12 @@
 Getting status of null
 
   $ hg status --change null
+
+Getting status of working copy
+
+  $ hg status
+  debug.filters: computing revision filter for "visible"
+  M c
+  A d
+  R a
+  ! b



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


D7484: localrepo: mark nullrev has never filtered

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

REVISION SUMMARY
  All repository have a null, and it cannot be filtered.

REPOSITORY
  rHG Mercurial

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

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
@@ -54,6 +54,5 @@
 Getting basic changeset inforation about `null`
 
   $ hg log -r null -T "{node}\n{date}\n"
-  debug.filters: computing revision filter for "visible"
   
   0.00
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1532,7 +1532,7 @@
 
 # dealing with some special values
 if changeid == b'null' or changeid == nullrev:
-return context.changectx(self, nullrev, nullid)
+return context.changectx(self, nullrev, nullid, False)
 if changeid == b'tip':
 node = self.changelog.tip()
 rev = self.changelog.rev(node)



To: marmoute, #hg-reviewers
Cc: 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


D7483: changectx: add a "maybe filtered" filtered attribute

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

REVISION SUMMARY
  There are changeset that we know not to be filtered (eg: `null`). In this 
case,
  we could access some information without triggering changelog filtering. We 
add
  an attribute to changectx that track this property.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -477,10 +477,11 @@
 changeset convenient. It represents a read-only context already present in
 the repo."""
 
-def __init__(self, repo, rev, node):
+def __init__(self, repo, rev, node, maybe_filtered=True):
 super(changectx, self).__init__(repo)
 self._rev = rev
 self._node = node
+self._maybe_filtered = maybe_filtered
 
 def __hash__(self):
 try:
@@ -495,7 +496,11 @@
 
 @propertycache
 def _changeset(self):
-return self._repo.changelog.changelogrevision(self.rev())
+if self._maybe_filtered:
+repo = self._repo
+else:
+repo = self._repo.unfiltered()
+return repo.changelog.changelogrevision(self.rev())
 
 @propertycache
 def _manifest(self):



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


D7485: repoview: test filtered computation on `hg status --change` call

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

REVISION SUMMARY
  One more case to test for.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  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
@@ -56,3 +56,8 @@
   $ hg log -r null -T "{node}\n{date}\n"
   
   0.00
+
+Getting status of null
+
+  $ hg status --change null
+  debug.filters: computing revision filter for "visible"



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


D7480: localrepo: also fastpath `nullrev` in __getitem__

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

REVISION SUMMARY
  As explained earlier, nullrev will exist in all repository, we do not need any
  special checking.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1531,7 +1531,7 @@
 ]
 
 # dealing with some special values
-if changeid == b'null':
+if changeid == b'null' or changeid == nullrev:
 return context.changectx(self, nullrev, nullid)
 if changeid == b'tip':
 node = self.changelog.tip()



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


D7482: repoview: add a test that access actual changeset data of `null`

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

REVISION SUMMARY
  Ideally, we would not trigger filtering here. However some work needs to 
happens
  first.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  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
@@ -50,3 +50,10 @@
   $ cd test-repo
   $ hg log -r null -T "{node}\n"
   
+
+Getting basic changeset inforation about `null`
+
+  $ hg log -r null -T "{node}\n{date}\n"
+  debug.filters: computing revision filter for "visible"
+  
+  0.00



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


D7477: util: add an optional `prefix` argument to debugstacktrace

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

REVISION SUMMARY
  This is useful when using it in a specific context.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -3466,6 +3466,7 @@
 f=procutil.stderr,
 otherf=procutil.stdout,
 depth=0,
+prefix=b'',
 ):
 '''Writes a message to f (stderr) with a nicely formatted stacktrace.
 Skips the 'skip' entries closest to the call, then show 'depth' entries.
@@ -3475,9 +3476,9 @@
 '''
 if otherf:
 otherf.flush()
-f.write(b'%s at:\n' % msg.rstrip())
+f.write(b'%s%s at:\n' % (prefix, msg.rstrip()))
 for line in getstackframes(skip + 1, depth=depth):
-f.write(line)
+f.write(prefix + line)
 f.flush()
 
 



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


D7479: repoview: add a test to track operation not supposed to trigger filtering

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
  This test will be useful to confirm we removed filtering trigger and to 
prevent
  it to come back without us noticing.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-repo-filters-tiptoe.t

CHANGE DETAILS

diff --git a/tests/test-repo-filters-tiptoe.t b/tests/test-repo-filters-tiptoe.t
new file mode 100644
--- /dev/null
+++ b/tests/test-repo-filters-tiptoe.t
@@ -0,0 +1,53 @@
+===
+Test repository filtering avoidance
+===
+
+This test file is a bit special as he does not check feature, but performance 
related internal code path.
+
+Right now, filtering a repository comes with a cost that might be significant.
+Until this get better, ther are various operation that try hard not to trigger
+a filtering computation. This test file make sure we don't reintroduce code 
that trigger the filtering for these operation:
+
+Setup
+-
+  $ hg init test-repo
+  $ cd test-repo
+  $ echo "some line" > z
+  $ echo a > a
+  $ hg commit -Am a
+  adding a
+  adding z
+  $ echo "in a" >> z
+  $ echo b > b
+  $ hg commit -Am b
+  adding b
+  $ echo "file" >> z
+  $ echo c > c
+  $ hg commit -Am c
+  adding c
+  $ hg rm a
+  $ echo c1 > c
+  $ hg add c
+  c already tracked!
+  $ echo d > d
+  $ hg add d
+  $ rm b
+
+  $ cat << EOF >> $HGRCPATH
+  > [devel]
+  > debug.repo-filters = yes
+  > [ui]
+  > debug = yes
+  > EOF
+
+
+tests
+-
+
+Getting the node of `null`
+
+  $ hg init test-repo
+  $ cd test-repo
+  $ hg log -r null -T "{node}\n"
+  debug.filters: computing revision filter for "visible"
+  



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


D7475: localrepo: extract handling of some special value in __getitem__

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

REVISION SUMMARY
  The value "tip" should always be accessible, otherwise there is some 
problematic
  bug in the lower level. So we can access this outside of the general 
try/catch.
  If it fails some wider and actual big is in play.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1533,14 +1533,16 @@
 # dealing with some special values
 if changeid == b'null':
 return context.changectx(self, nullrev, nullid)
+if changeid == b'tip':
+node = self.changelog.tip()
+rev = self.changelog.rev(node)
+return context.changectx(self, rev, node)
+
 # dealing with arbitrary values
 try:
 if isinstance(changeid, int):
 node = self.changelog.node(changeid)
 rev = changeid
-elif changeid == b'tip':
-node = self.changelog.tip()
-rev = self.changelog.rev(node)
 elif changeid == b'.':
 # this is a hack to delay/avoid loading obsmarkers
 # when we know that '.' won't be hidden



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


D7478: repoview: display stack trace along side the debug message

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

REVISION SUMMARY
  When a filter computation is triggered, If --traceback is provided, we will
  display a traceback in addition to the debug message.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/repoview.py

CHANGE DETAILS

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -218,8 +218,18 @@
 cache it's result"""
 if filtername not in repo.filteredrevcache:
 if repo.ui.configbool(b'devel', b'debug.repo-filters'):
-msg = b'debug.filters: computing revision filter for "%s"\n'
-repo.ui.debug(msg % filtername)
+msg = b'computing revision filter for "%s"'
+msg %= filtername
+if repo.ui.tracebackflag and repo.ui.debugflag:
+# XXX use ui.write_err
+util.debugstacktrace(
+msg,
+f=repo.ui._fout,
+otherf=repo.ui._ferr,
+prefix=b'debug.filters: ',
+)
+else:
+repo.ui.debug(b'debug.filters: %s\n' % msg)
 func = filtertable[filtername]
 if visibilityexceptions:
 return func(repo.unfiltered, visibilityexceptions)



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


D7476: repoview: add a 'devel.debug.repo-filter' option

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

REVISION SUMMARY
  If set, there will be debug message when a filter computation is triggered.
  
  This is going to be useful to remove various filtering trigger and to test 
they
  do not get reintroduced.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/configitems.py
  mercurial/repoview.py

CHANGE DETAILS

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -217,6 +217,9 @@
 hidden-state and must be visible. They are dynamic and hence we should not
 cache it's result"""
 if filtername not in repo.filteredrevcache:
+if repo.ui.configbool(b'devel', b'debug.repo-filters'):
+msg = b'debug.filters: computing revision filter for "%s"\n'
+repo.ui.debug(msg % filtername)
 func = filtertable[filtername]
 if visibilityexceptions:
 return func(repo.unfiltered, visibilityexceptions)
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -433,6 +433,9 @@
 b'devel', b'debug.extensions', default=False,
 )
 coreconfigitem(
+b'devel', b'debug.repo-filters', default=False,
+)
+coreconfigitem(
 b'devel', b'debug.peer-request', default=False,
 )
 coreconfigitem(



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


D7474: localrepo: extract handling of some special value in __getitem__

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

REVISION SUMMARY
  The value "null" will always be present in a repository. So this lookup should
  always succeed and do not need to be in the general try/catch.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1530,14 +1530,14 @@
 if i not in self.changelog.filteredrevs
 ]
 
+# dealing with some special values
+if changeid == b'null':
+return context.changectx(self, nullrev, nullid)
 # dealing with arbitrary values
 try:
 if isinstance(changeid, int):
 node = self.changelog.node(changeid)
 rev = changeid
-elif changeid == b'null':
-node = nullid
-rev = nullrev
 elif changeid == b'tip':
 node = self.changelog.tip()
 rev = self.changelog.rev(node)



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


D7473: localrepo: add some basic comment for block in __getitem__

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

REVISION SUMMARY
  There are different early processing before getting to the core of the 
function.
  We highlight that fact.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1515,10 +1515,13 @@
 self.invalidate(clearfilecache=True)
 
 def __getitem__(self, changeid):
+# dealing with special cases
 if changeid is None:
 return context.workingctx(self)
 if isinstance(changeid, context.basectx):
 return changeid
+
+# dealing with multiple revisions
 if isinstance(changeid, slice):
 # wdirrev isn't contiguous so the slice shouldn't include it
 return [
@@ -1526,6 +1529,8 @@
 for i in pycompat.xrange(*changeid.indices(len(self)))
 if i not in self.changelog.filteredrevs
 ]
+
+# dealing with arbitrary values
 try:
 if isinstance(changeid, int):
 node = self.changelog.node(changeid)



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


D7252: dirs: reject consecutive slashes in paths

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


  In practice, this means the tests consistently fails when testing with Rust. 
Can we either have a quick fix of the Rust code or a temporary backout of this 
(until we Rust code is fixed)?

REPOSITORY
  rHG Mercurial

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

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

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