D7075: copies: add an explicit test using multiple roots

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> test-copies-unrelated.t:398
> +
> +Copies involving multiple roots.
> +

nit: maybe "involving *merge* of multiple roots" to clarify how it's different 
from the case above

> test-copies-unrelated.t:403-406
> +  $ echo a >> a
> +  $ hg ci -Aqm 'update a'
> +  $ echo a >> a
> +  $ hg ci -Aqm 'update a'

nit: These seem unlikely to have any effect on the result. remove them? Or at 
least one of them? OTOH, you seem to have deliberately made the contents match 
in revision 2 and revision 7. What's the reason for that? Did that trigger a 
bug in an earlier version of this series?

REPOSITORY
  rHG Mercurial

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

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

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


D7071: copies: use unchecked parentrevs function to access parent

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> copies.py:293
>  
>  repo = a.repo()
>  children = {}

Why not just add `.unfiltered()` here? That should be even faster (3.16s -> 
2.90s compared to this patch for the case I tested).

REPOSITORY
  rHG Mercurial

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

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

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


D7101: fix: match patterns relative to root

2019-10-14 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.
mharbison72 accepted this revision.


  In D7101#104151 , @martinvonz 
wrote:
  
  >> I can’t tell from my phone, but should the matcher in `getworkqueue` and 
the status call in `pathstofix` also be adjusted?  (Not sure if there are 
others.)
  >
  > No, that matcher (it's the same instance that's passed between them) is 
created based on `pats` and `opts`, i.e. command line arguments.
  
  Oh, OK. That makes sense.

REPOSITORY
  rHG Mercurial

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

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

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


D7101: fix: match patterns relative to root

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In D7101#104125 , @mharbison72 
wrote:
  
  > The part of the help text that documents `:pattern` and points to `hg help 
patterns` should probably explicitly state that they are all relative to repo 
root, regardless of what the latter says.
  
  Good point! Done.
  
  > I can’t tell from my phone, but should the matcher in `getworkqueue` and 
the status call in `pathstofix` also be adjusted?  (Not sure if there are 
others.)
  
  No, that matcher (it's the same instance that's passed between them) is 
created based on `pats` and `opts`, i.e. command line arguments.

REPOSITORY
  rHG Mercurial

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

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

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


D7101: fix: match patterns relative to root

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 17164.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7101?vs=17156=17164

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

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

AFFECTED FILES
  hgext/fix.py
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -1321,7 +1321,7 @@
   $ echo modified > bar
   $ hg fix -w bar
   $ cat bar
-  modified
+  $TESTTMP/subprocesscwd
 
   $ cd ../..
 
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -46,8 +46,10 @@
 to false.
 
 The :pattern suboption determines which files will be passed through each
-configured tool. See :hg:`help patterns` for possible values. If there are file
-arguments to :hg:`fix`, the intersection of these patterns is used.
+configured tool. See :hg:`help patterns` for possible values. However, all
+patterns are relative to the repo root, even if that text says they are 
relative
+to the current working directory. If there are file arguments to :hg:`fix`, the
+intersection of these patterns is used.
 
 There is also a configurable limit for the maximum size of file that will be
 processed by :hg:`fix`::
@@ -140,6 +142,7 @@
 context,
 copies,
 error,
+match as matchmod,
 mdiff,
 merge,
 obsolete,
@@ -843,7 +846,11 @@
 
 def affects(self, opts, fixctx, path):
 """Should this fixer run on the file at the given path and context?"""
-return scmutil.match(fixctx, [self._pattern], opts)(path)
+repo = fixctx.repo()
+matcher = matchmod.match(
+repo.root, repo.root, [self._pattern], ctx=fixctx
+)
+return matcher(path)
 
 def shouldoutputmetadata(self):
 """Should the stdout of this fixer start with JSON and a null byte?"""



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


D7090: black: also ignore grey.py

2019-10-14 Thread durin42 (Augie Fackler)
Closed by commit rHG8343070ed758: black: also ignore grey.py (authored by 
durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7090?vs=17137=17163

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

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

AFFECTED FILES
  black.toml
  contrib/examples/fix.hgrc

CHANGE DETAILS

diff --git a/contrib/examples/fix.hgrc b/contrib/examples/fix.hgrc
--- a/contrib/examples/fix.hgrc
+++ b/contrib/examples/fix.hgrc
@@ -12,4 +12,4 @@
 # to have the dependencies for grey.
 #
 # black:command = python3.7 contrib/grey.py --config=black.toml -
-# black:pattern = set:**.py - hgext/fsmonitor/pywatchman/** - 
mercurial/thirdparty/** - "contrib/python-zstandard/**"
+# black:pattern = set:**.py - hgext/fsmonitor/pywatchman/** - 
mercurial/thirdparty/** - "contrib/python-zstandard/** - contrib/grey.py"
diff --git a/black.toml b/black.toml
--- a/black.toml
+++ b/black.toml
@@ -11,6 +11,7 @@
 | mercurial/thirdparty/
 | hgext/fsmonitor/pywatchman/
 | contrib/python-zstandard/
+| contrib/grey.py
 '''
 skip-string-normalization = true
 quiet = true



To: durin42, #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


D7089: black: use multiline exclude definition

2019-10-14 Thread durin42 (Augie Fackler)
Closed by commit rHG2a201b366d5b: black: use multiline exclude definition 
(authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7089?vs=17136=17162

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

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

AFFECTED FILES
  black.toml

CHANGE DETAILS

diff --git a/black.toml b/black.toml
--- a/black.toml
+++ b/black.toml
@@ -1,5 +1,16 @@
 [tool.black]
 line-length = 80
-exclude = 
'build/|wheelhouse/|dist/|packages/|\.hg/|\.mypy_cache/|\.venv/|mercurial/thirdparty/|hgext/fsmonitor/pywatchman/|contrib/python-zstandard/'
+exclude = '''
+build/
+| wheelhouse/
+| dist/
+| packages/
+| \.hg/
+| \.mypy_cache/
+| \.venv/
+| mercurial/thirdparty/
+| hgext/fsmonitor/pywatchman/
+| contrib/python-zstandard/
+'''
 skip-string-normalization = true
 quiet = true



To: durin42, #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


D7088: black: move remaining config knobs into toml file

2019-10-14 Thread durin42 (Augie Fackler)
Closed by commit rHG15c05732d177: black: move remaining config knobs into toml 
file (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7088?vs=17135=17161

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

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

AFFECTED FILES
  black.toml
  contrib/examples/fix.hgrc

CHANGE DETAILS

diff --git a/contrib/examples/fix.hgrc b/contrib/examples/fix.hgrc
--- a/contrib/examples/fix.hgrc
+++ b/contrib/examples/fix.hgrc
@@ -11,5 +11,5 @@
 # git+https://github.com/python/black/@d9e71a75ccfefa3d9156a64c03313a0d4ad981e5
 # to have the dependencies for grey.
 #
-# black:command = python3.7 contrib/grey.py --quiet --config=black.toml 
--skip-string-normalization -
+# black:command = python3.7 contrib/grey.py --config=black.toml -
 # black:pattern = set:**.py - hgext/fsmonitor/pywatchman/** - 
mercurial/thirdparty/** - "contrib/python-zstandard/**"
diff --git a/black.toml b/black.toml
--- a/black.toml
+++ b/black.toml
@@ -1,3 +1,5 @@
 [tool.black]
 line-length = 80
 exclude = 
'build/|wheelhouse/|dist/|packages/|\.hg/|\.mypy_cache/|\.venv/|mercurial/thirdparty/|hgext/fsmonitor/pywatchman/|contrib/python-zstandard/'
+skip-string-normalization = true
+quiet = true



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


D7087: black: rename pyproject.toml to black.toml

2019-10-14 Thread durin42 (Augie Fackler)
Closed by commit rHG8f89899a5446: black: rename pyproject.toml to black.toml 
(authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7087?vs=17134=17160

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

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

AFFECTED FILES
  black.toml
  contrib/examples/fix.hgrc
  pyproject.toml
  tests/test-check-code.t

CHANGE DETAILS

diff --git a/tests/test-check-code.t b/tests/test-check-code.t
--- a/tests/test-check-code.t
+++ b/tests/test-check-code.t
@@ -64,10 +64,10 @@
   COPYING
   Makefile
   README.rst
+  black.toml
   hg
   hgeditor
   hgweb.cgi
-  pyproject.toml
   setup.py
 
 Prevent adding modules which could be shadowed by ancient .so/.dylib.
diff --git a/contrib/examples/fix.hgrc b/contrib/examples/fix.hgrc
--- a/contrib/examples/fix.hgrc
+++ b/contrib/examples/fix.hgrc
@@ -11,5 +11,5 @@
 # git+https://github.com/python/black/@d9e71a75ccfefa3d9156a64c03313a0d4ad981e5
 # to have the dependencies for grey.
 #
-# black:command = python3.7 contrib/grey.py --quiet 
--skip-string-normalization -
+# black:command = python3.7 contrib/grey.py --quiet --config=black.toml 
--skip-string-normalization -
 # black:pattern = set:**.py - hgext/fsmonitor/pywatchman/** - 
mercurial/thirdparty/** - "contrib/python-zstandard/**"
diff --git a/pyproject.toml b/black.toml
rename from pyproject.toml
rename to black.toml



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


D7065: examples: allow the fix configuration to work from any directory

2019-10-14 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.
mharbison72 abandoned this revision.


  In D7065#104119 , @martinvonz 
wrote:
  
  > I talked to @hooper about this and they agreed that using repo-relative 
paths is almost always what the user wants. I've sent D7101 
 for that.
  
  Sounds good to me.

REPOSITORY
  rHG Mercurial

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

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

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


D7101: fix: match patterns relative to root

2019-10-14 Thread mharbison72 (Matt Harbison)
This revision now requires changes to proceed.
mharbison72 added a comment.
mharbison72 requested changes to this revision.


  The part of the help text that documents `:pattern` and points to `hg help 
patterns` should probably explicitly state that they are all relative to repo 
root, regardless of what the latter says.
  
  I can’t tell from my phone, but should the matcher in `getworkqueue` and the 
status call in `pathstofix` also be adjusted?  (Not sure if there are others.)

REPOSITORY
  rHG Mercurial

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

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

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


mercurial@43216: 2 new changesets

2019-10-14 Thread Mercurial Commits
2 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/c157356c03f7
changeset:   43215:c157356c03f7
user:Gregory Szorc 
date:Sat Oct 12 11:36:26 2019 -0700
summary: contrib: update to latest Windows package versions

https://www.mercurial-scm.org/repo/hg/rev/6a350194de7f
changeset:   43216:6a350194de7f
bookmark:@
tag: tip
user:Gregory Szorc 
date:Sat Oct 12 12:41:53 2019 -0700
summary: automation: capture additional exception when formatting

-- 
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


Re: Mercurial 5.2 release as stable release for Python 3.

2019-10-14 Thread Yuya Nishihara
On Mon, 14 Oct 2019 10:08:09 -0700, Gregory Szorc wrote:
> Python 3 on Windows has a ton of test failures. ~120 I believe. I suspect a
> lot of them are the same underlying issues.

Note that many encoding issues wouldn't be covered by our test suite.
I suspect there are at least two encoding-related compatibility issues
on Windows:

- sys.argv
  https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/pycompat.py#l140
- filesystem encoding
  
https://docs.python.org/3/whatsnew/3.6.html#pep-529-change-windows-filesystem-encoding-to-utf-8
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7065: examples: allow the fix configuration to work from any directory

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.
martinvonz added a subscriber: hooper.


  In D7065#103835 , @mharbison72 
wrote:
  
  > In D7065#103834 , @martinvonz 
wrote:
  >
  >> It's unfortunate that this is necessary. I'll see if I can fix fix.py to 
always interpret patterns relative to the repo root.
  >
  > I think that's the most intuitive way to consume these patterns.  But won't 
that muddy the water with the documentation saying, for example, that `glob:` 
is relative to cwd?  Also, there's relative patterns in the file pattern to 
consider.  (I'm not against your proposal at all; I'm just wondering aloud 
because I always get tripped up by the slightly modified ignore rules.)
  
  I talked to @hooper about this and they agreed that using repo-relative paths 
is almost always what the user wants. I've sent D7101 
 for that.

REPOSITORY
  rHG Mercurial

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

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

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


D7101: fix: match patterns relative to root

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

REVISION SUMMARY
  I was surprised fixer patterns (used to determine which fixers to run)
  are applies to the parent directory, not the repo root
  directory. Danny Hooper (the author of the extension) seemed to agree
  that it's better to apply them to the repo root, so that's what this
  patch does.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fix.py
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -1321,7 +1321,7 @@
   $ echo modified > bar
   $ hg fix -w bar
   $ cat bar
-  modified
+  $TESTTMP/subprocesscwd
 
   $ cd ../..
 
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -140,6 +140,7 @@
 context,
 copies,
 error,
+match as matchmod,
 mdiff,
 merge,
 obsolete,
@@ -843,7 +844,11 @@
 
 def affects(self, opts, fixctx, path):
 """Should this fixer run on the file at the given path and context?"""
-return scmutil.match(fixctx, [self._pattern], opts)(path)
+repo = fixctx.repo()
+matcher = matchmod.match(
+repo.root, repo.root, [self._pattern], ctx=fixctx
+)
+return matcher(path)
 
 def shouldoutputmetadata(self):
 """Should the stdout of this fixer start with JSON and a null byte?"""



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


D7100: tests: add test showing that fixer patterns are currently relative to $PWD

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz 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/D7100

AFFECTED FILES
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -1298,7 +1298,7 @@
   $ cat >> .hg/hgrc < [fix]
   > printcwd:command = "$PYTHON" -c "import os; print(os.getcwd())"
-  > printcwd:pattern = path:foo/bar
+  > printcwd:pattern = relpath:foo/bar
   > EOF
 
   $ mkdir foo
@@ -1318,6 +1318,10 @@
   $TESTTMP/subprocesscwd
   $ cat bar
   $TESTTMP/subprocesscwd
+  $ echo modified > bar
+  $ hg fix -w bar
+  $ cat bar
+  modified
 
   $ cd ../..
 
@@ -1373,7 +1377,7 @@
 
   $ cd bar
   $ hg fix --working-dir --config "fix.cooltool:command=echo fixed" \
-  >  --config "fix.cooltool:pattern=rootglob:**"
+  >  --config "fix.cooltool:pattern=glob:**"
   $ cd ..
 
   $ cat foo/file
@@ -1409,7 +1413,7 @@
   $ hg fix --working-dir foo bar baz \
   >--config "fix.changedlines:command=\"$PYTHON\" print.py \"Line 
ranges:\"" \
   >--config 'fix.changedlines:linerange="{first} through {last}"' \
-  >--config 'fix.changedlines:pattern=rootglob:**' \
+  >--config 'fix.changedlines:pattern=glob:**' \
   >--config 'fix.changedlines:skipclean=false'
 
   $ cat foo



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


D6843: ui: option to preserve the progress bar

2019-10-14 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger updated this revision to Diff 17154.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6843?vs=16520=17154

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

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

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1008,6 +1008,13 @@
 Label names take the form of "topic.type". For example, ui.debug()
 issues a label of "ui.debug".
 
+Progress reports via stderr are normally cleared before writing as
+stdout and stderr go to the same terminal. This can be skipped with
+the optional keyword argument "keepprogressbar". The progress bar
+will continue to occupy a partial line on stderr in that case.
+This functionality is intended when Mercurial acts as data source
+in a pipe.
+
 When labeling output for a specific command, a label of
 "cmdname.type" is recommended. For example, status issues
 a label of "status.modified" for modified files.
@@ -1023,8 +1030,9 @@
 self._buffers[-1].extend(args)
 return
 
-# inliend _writenobuf() for speed
-self._progclear()
+# inlined _writenobuf() for speed
+if not opts.get(r'keepprogressbar', False):
+self._progclear()
 msg = b''.join(args)
 
 # opencode timeblockedsection because this is a critical path
@@ -1061,7 +1069,8 @@
 
 def _writenobuf(self, dest, *args, **opts):
 # update write() as well if you touch this code
-self._progclear()
+if not opts.get(r'keepprogressbar', False):
+self._progclear()
 msg = b''.join(args)
 
 # opencode timeblockedsection because this is a critical path



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


Re: Mercurial 5.2 release as stable release for Python 3.

2019-10-14 Thread Gregory Szorc
On Mon, Oct 14, 2019 at 11:21 AM Raphaël Gomès 
wrote:

>
> On 10/14/19 7:08 PM, Gregory Szorc wrote:
>
> I support marking the code base as stable with Python 3 in the upcoming
> few weeks - at least for non-Windows.
>
> If we're serious about this, we all need to be running Mercurial with
> Python 3 locally and fixing bugs. I tried installing a Python 3 Mercurial a
> few days ago and I encountered enough tracebacks to cause me to revert.
> Those include https://bz.mercurial-scm.org/show_bug.cgi?id=6196 and an
> issue with evolve/obsmarkers that can be reproduced by `hg push` to
> hg-committed. I think we should land a patch to Makefile that changes
> https://www.mercurial-scm.org/repo/hg/file/649a9601b9e2/Makefile#l8 to
> `python3` to force the issue. We can revert that before tagging 5.2 if we
> want to do a separate release that is Python 3 primary (there was talk of
> doing a 2.7 5.2 then doing a 5.2.1 or a 5.3 a week or two later that is
> Python 3 native).
>
> I think this is the safer approach, regardless of progress made.
>
> We also still have a handful of test failures on Python 3. See
> https://ci.hg.gregoryszorc.com/. (CI is broken with Python 3.5 for some
> reason. I'll look into it.)
>
> Python 3 on Windows has a ton of test failures. ~120 I believe. I suspect
> a lot of them are the same underlying issues. I almost have my CI system
> working with Windows. But we'll certainly need a bit of effort on Windows
> before we can consider Python 3 stable there. At this time, Python 3 on
> Windows seems to be at risk because of the volume of issues.
>
> Other major blockers to Python 3 are packaging work. I'm the de facto
> maintainer of the Windows packages and will write those patches. But my
> priorities are standing up Windows CI because I think having visibility
> into the test failures is more important because what good is Python 3
> packages if Mercurial isn't usable :) I could also help with non-Windows
> packaging if it is needed.
>
> I would also propose we reinstate the @ code freeze for this release so we
> can all focus on Python 3 and quality of life improvements for the release.
> I don't think we'll put out a quality Python 3 release if we're distracted
> by feature work on @.
>
> I'm not sure what you mean by "@ code freeze", can you elaborate?
>

Until the past ~1 year, the policy was to have a code freeze the 2 weeks
before a major release. Only patches for the stable branch / upcoming
release would be accepted. We did not actively work on the @ bookmark /
default branch during this freeze. The idea was that by pausing feature
development we would focus on putting out a higher quality release. We
changed the policy recently and now it is acceptable to send patches for
@/default in the ~2 weeks before a major release.


> On Mon, Oct 14, 2019 at 9:30 AM Pulkit Goyal <7895pul...@gmail.com> wrote:
>
>> Hey everyone,
>>
>> I hope you are doing well.
>>
>> We released 5.0 as beta release for Python 3 support and much has
>> improved since than. Evolve extension recently started supporting
>> Python 3. There are still few tests failing which are minor.
>>
>> We are planning to mark the upcoming release i.e. 5.2 as stable
>> release for py3 support (except Windows). If we agree on that, we also
>> plan to accept py3 related fixes on stable branch during upcoming
>> feature freeze.
>>
>> It will be the best time to install hg on Python 3 and start testing.
>>
>> What do you think?
>>
>> Thanks and regards
>> Pulkit
>>
>
> ___
> Mercurial-devel mailing 
> listMercurial-devel@mercurial-scm.orghttps://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: Mercurial 5.2 release as stable release for Python 3.

2019-10-14 Thread Raphaël Gomès


On 10/14/19 7:08 PM, Gregory Szorc wrote:
I support marking the code base as stable with Python 3 in the 
upcoming few weeks - at least for non-Windows.


If we're serious about this, we all need to be running Mercurial with 
Python 3 locally and fixing bugs. I tried installing a Python 3 
Mercurial a few days ago and I encountered enough tracebacks to cause 
me to revert. Those include 
https://bz.mercurial-scm.org/show_bug.cgi?id=6196 and an issue with 
evolve/obsmarkers that can be reproduced by `hg push` to hg-committed. 
I think we should land a patch to Makefile that changes 
https://www.mercurial-scm.org/repo/hg/file/649a9601b9e2/Makefile#l8 to 
`python3` to force the issue. We can revert that before tagging 5.2 if 
we want to do a separate release that is Python 3 primary (there was 
talk of doing a 2.7 5.2 then doing a 5.2.1 or a 5.3 a week or two 
later that is Python 3 native).



I think this is the safer approach, regardless of progress made.
We also still have a handful of test failures on Python 3. See 
https://ci.hg.gregoryszorc.com/. (CI is broken with Python 3.5 for 
some reason. I'll look into it.)


Python 3 on Windows has a ton of test failures. ~120 I believe. I 
suspect a lot of them are the same underlying issues. I almost have my 
CI system working with Windows. But we'll certainly need a bit of 
effort on Windows before we can consider Python 3 stable there. At 
this time, Python 3 on Windows seems to be at risk because of the 
volume of issues.


Other major blockers to Python 3 are packaging work. I'm the de facto 
maintainer of the Windows packages and will write those patches. But 
my priorities are standing up Windows CI because I think having 
visibility into the test failures is more important because what good 
is Python 3 packages if Mercurial isn't usable :) I could also help 
with non-Windows packaging if it is needed.


I would also propose we reinstate the @ code freeze for this release 
so we can all focus on Python 3 and quality of life improvements for 
the release. I don't think we'll put out a quality Python 3 release if 
we're distracted by feature work on @.



I'm not sure what you mean by "@ code freeze", can you elaborate?
On Mon, Oct 14, 2019 at 9:30 AM Pulkit Goyal <7895pul...@gmail.com 
> wrote:


Hey everyone,

I hope you are doing well.

We released 5.0 as beta release for Python 3 support and much has
improved since than. Evolve extension recently started supporting
Python 3. There are still few tests failing which are minor.

We are planning to mark the upcoming release i.e. 5.2 as stable
release for py3 support (except Windows). If we agree on that, we also
plan to accept py3 related fixes on stable branch during upcoming
feature freeze.

It will be the best time to install hg on Python 3 and start testing.

What do you think?

Thanks and regards
Pulkit


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


D7070: copies: extract data extraction into a `revinfo` function

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  The extracted function slows down `hg perfpathcopies FIREFOX_BETA_59_END 
FIREFOX_BETA_60_BASE` (not merge-heavy) from 3.55s to 3.87s, but since you also 
changed `ctx.p[12]copies()` to `ctx._copies` it ended up being a net speed 
improvement (3.24s including for the patch as written).

REPOSITORY
  rHG Mercurial

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

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

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


D7099: widening: pass in matchers instead of patterns

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

REVISION SUMMARY
  This matches how it's done for the non-ellipsis case. The oldmatch is
  not used yet, but it should be used eventually when widening no longer
  resends manifests and files the client already has.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py
  hgext/narrow/narrowwirepeer.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowwirepeer.py b/hgext/narrow/narrowwirepeer.py
--- a/hgext/narrow/narrowwirepeer.py
+++ b/hgext/narrow/narrowwirepeer.py
@@ -102,13 +102,13 @@
 cgversion = cgversion
 
 bundler = bundle2.bundle20(repo.ui)
+newmatch = narrowspec.match(
+repo.root, include=newincludes, exclude=newexcludes
+)
+oldmatch = narrowspec.match(
+repo.root, include=oldincludes, exclude=oldexcludes
+)
 if not ellipses:
-newmatch = narrowspec.match(
-repo.root, include=newincludes, exclude=newexcludes
-)
-oldmatch = narrowspec.match(
-repo.root, include=oldincludes, exclude=oldexcludes
-)
 bundle2.widen_bundle(
 bundler,
 repo,
@@ -121,15 +121,7 @@
 )
 else:
 narrowbundle2.generate_ellipses_bundle2_for_widening(
-bundler,
-repo,
-oldincludes,
-oldexcludes,
-newincludes,
-newexcludes,
-cgversion,
-common,
-known,
+bundler, repo, oldmatch, newmatch, cgversion, common, known,
 )
 except error.Abort as exc:
 bundler = bundle2.bundle20(repo.ui)
diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -112,20 +112,8 @@
 
 
 def generate_ellipses_bundle2_for_widening(
-bundler,
-repo,
-oldinclude,
-oldexclude,
-newinclude,
-newexclude,
-version,
-common,
-known,
+bundler, repo, oldmatch, newmatch, version, common, known,
 ):
-newmatch = narrowspec.match(
-repo.root, include=newinclude, exclude=newexclude
-)
-
 common = set(common or [nullid])
 # Steps:
 # 1. Send kill for "$known & ::common"



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


D7097: widening: remove "depth" argument since it's always None

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

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py
  hgext/narrow/narrowwirepeer.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowwirepeer.py b/hgext/narrow/narrowwirepeer.py
--- a/hgext/narrow/narrowwirepeer.py
+++ b/hgext/narrow/narrowwirepeer.py
@@ -130,7 +130,6 @@
 cgversion,
 common,
 known,
-None,
 )
 except error.Abort as exc:
 bundler = bundle2.bundle20(repo.ui)
diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -121,15 +121,10 @@
 version,
 common,
 known,
-depth,
 ):
 newmatch = narrowspec.match(
 repo.root, include=newinclude, exclude=newexclude
 )
-if depth is not None:
-depth = int(depth)
-if depth < 1:
-raise error.Abort(_(b'depth must be positive, got %d') % depth)
 
 common = set(common or [nullid])
 # Steps:
@@ -173,7 +168,7 @@
 repo,
 matcher=newmatch,
 ellipses=True,
-shallow=depth is not None,
+shallow=False,
 ellipsisroots=newellipsis,
 fullnodes=newfull,
 )



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


D7098: widening: trust user to give full "known" set

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

REVISION SUMMARY
  The new narrow_widen wire protocol command is supposed to return data
  for exactly the revisions that the client requested (in order for it
  to be strip-free). So we should not add ancestors the client didn't
  ask for.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -143,14 +143,12 @@
 # c) goto a
 #
 # until they've built up the full new state.
-# Convert to revnums and intersect with "common". The client should
-# have made it a subset of "common" already, but let's be safe.
-known = set(repo.revs(b"%ln & ::%ln", known, common))
+knownrevs = {repo.changelog.rev(n) for n in known}
 # TODO: we could send only roots() of this set, and the
 # list of nodes in common, and the client could work out
 # what to strip, instead of us explicitly sending every
 # single node.
-deadrevs = known
+deadrevs = knownrevs
 
 def genkills():
 for r in deadrevs:
@@ -160,7 +158,7 @@
 
 bundler.newpart(_CHANGESPECPART, data=genkills())
 newvisit, newfull, newellipsis = exchange._computeellipsis(
-repo, set(), common, known, newmatch
+repo, set(), common, knownrevs, newmatch
 )
 if newvisit:
 packer = changegroup.getbundler(



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


D7096: widening: remove unused "heads" argument

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

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py
  hgext/narrow/narrowwirepeer.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowwirepeer.py b/hgext/narrow/narrowwirepeer.py
--- a/hgext/narrow/narrowwirepeer.py
+++ b/hgext/narrow/narrowwirepeer.py
@@ -129,7 +129,6 @@
 newexcludes,
 cgversion,
 common,
-list(common),
 known,
 None,
 )
diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -120,7 +120,6 @@
 newexclude,
 version,
 common,
-heads,
 known,
 depth,
 ):
@@ -132,7 +131,6 @@
 if depth < 1:
 raise error.Abort(_(b'depth must be positive, got %d') % depth)
 
-heads = set(heads or repo.heads())
 common = set(common or [nullid])
 # Steps:
 # 1. Send kill for "$known & ::common"



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


D7095: widening: remove pointless code for second changegroup

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

REVISION SUMMARY
  The caller passes in common==heads, so we will never find any nodes to
  visit in this code and there will therefore never be a second
  changegroup emitted.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -186,28 +186,6 @@
 if b'treemanifest' in repo.requirements:
 part.addparam(b'treemanifest', b'1')
 
-visitnodes, relevant_nodes, ellipsisroots = exchange._computeellipsis(
-repo, common, heads, set(), newmatch, depth=depth
-)
-
-repo.ui.debug(b'Found %d relevant revs\n' % len(relevant_nodes))
-if visitnodes:
-packer = changegroup.getbundler(
-version,
-repo,
-matcher=newmatch,
-ellipses=True,
-shallow=depth is not None,
-ellipsisroots=ellipsisroots,
-fullnodes=relevant_nodes,
-)
-cgdata = packer.generate(common, visitnodes, False, b'narrow_widen')
-
-part = bundler.newpart(b'changegroup', data=cgdata)
-part.addparam(b'version', version)
-if b'treemanifest' in repo.requirements:
-part.addparam(b'treemanifest', b'1')
-
 
 @bundle2.parthandler(_SPECPART, (_SPECPART_INCLUDE, _SPECPART_EXCLUDE))
 def _handlechangespec_2(op, inpart):



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


D7094: widening: remove always-true condition in widening code

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

REVISION SUMMARY
  The function is now specifically about widening, so we don't need to
  check if we're widening.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -134,58 +134,57 @@
 
 heads = set(heads or repo.heads())
 common = set(common or [nullid])
-if known and (oldinclude != newinclude or oldexclude != newexclude):
-# Steps:
-# 1. Send kill for "$known & ::common"
-#
-# 2. Send changegroup for ::common
-#
-# 3. Proceed.
-#
-# In the future, we can send kills for only the specific
-# nodes we know should go away or change shape, and then
-# send a data stream that tells the client something like this:
-#
-# a) apply this changegroup
-# b) apply nodes XXX, YYY, ZZZ that you already have
-# c) goto a
-#
-# until they've built up the full new state.
-# Convert to revnums and intersect with "common". The client should
-# have made it a subset of "common" already, but let's be safe.
-known = set(repo.revs(b"%ln & ::%ln", known, common))
-# TODO: we could send only roots() of this set, and the
-# list of nodes in common, and the client could work out
-# what to strip, instead of us explicitly sending every
-# single node.
-deadrevs = known
+# Steps:
+# 1. Send kill for "$known & ::common"
+#
+# 2. Send changegroup for ::common
+#
+# 3. Proceed.
+#
+# In the future, we can send kills for only the specific
+# nodes we know should go away or change shape, and then
+# send a data stream that tells the client something like this:
+#
+# a) apply this changegroup
+# b) apply nodes XXX, YYY, ZZZ that you already have
+# c) goto a
+#
+# until they've built up the full new state.
+# Convert to revnums and intersect with "common". The client should
+# have made it a subset of "common" already, but let's be safe.
+known = set(repo.revs(b"%ln & ::%ln", known, common))
+# TODO: we could send only roots() of this set, and the
+# list of nodes in common, and the client could work out
+# what to strip, instead of us explicitly sending every
+# single node.
+deadrevs = known
 
-def genkills():
-for r in deadrevs:
-yield _KILLNODESIGNAL
-yield repo.changelog.node(r)
-yield _DONESIGNAL
+def genkills():
+for r in deadrevs:
+yield _KILLNODESIGNAL
+yield repo.changelog.node(r)
+yield _DONESIGNAL
 
-bundler.newpart(_CHANGESPECPART, data=genkills())
-newvisit, newfull, newellipsis = exchange._computeellipsis(
-repo, set(), common, known, newmatch
+bundler.newpart(_CHANGESPECPART, data=genkills())
+newvisit, newfull, newellipsis = exchange._computeellipsis(
+repo, set(), common, known, newmatch
+)
+if newvisit:
+packer = changegroup.getbundler(
+version,
+repo,
+matcher=newmatch,
+ellipses=True,
+shallow=depth is not None,
+ellipsisroots=newellipsis,
+fullnodes=newfull,
 )
-if newvisit:
-packer = changegroup.getbundler(
-version,
-repo,
-matcher=newmatch,
-ellipses=True,
-shallow=depth is not None,
-ellipsisroots=newellipsis,
-fullnodes=newfull,
-)
-cgdata = packer.generate(common, newvisit, False, b'narrow_widen')
+cgdata = packer.generate(common, newvisit, False, b'narrow_widen')
 
-part = bundler.newpart(b'changegroup', data=cgdata)
-part.addparam(b'version', version)
-if b'treemanifest' in repo.requirements:
-part.addparam(b'treemanifest', b'1')
+part = bundler.newpart(b'changegroup', data=cgdata)
+part.addparam(b'version', version)
+if b'treemanifest' in repo.requirements:
+part.addparam(b'treemanifest', b'1')
 
 visitnodes, relevant_nodes, ellipsisroots = exchange._computeellipsis(
 repo, common, heads, set(), newmatch, depth=depth



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


D7093: narrow: drop server support for widening using the getbundle command (BC)

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

REVISION SUMMARY
  The client still supports widening using the getbundle, which we
  (Google) still depend on a for a little while more (we've started the
  migration to the new narrow_widen command, but we're not done yet).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -11,10 +11,7 @@
 import struct
 
 from mercurial.i18n import _
-from mercurial.node import (
-bin,
-nullid,
-)
+from mercurial.node import nullid
 from mercurial import (
 bundle2,
 changegroup,
@@ -65,42 +62,24 @@
 raise ValueError(_(b'no common changegroup version'))
 version = max(cgversions)
 
-oldinclude = sorted(filter(bool, kwargs.get(r'oldincludepats', [])))
-oldexclude = sorted(filter(bool, kwargs.get(r'oldexcludepats', [])))
-newinclude = sorted(filter(bool, kwargs.get(r'includepats', [])))
-newexclude = sorted(filter(bool, kwargs.get(r'excludepats', [])))
-known = {bin(n) for n in kwargs.get(r'known', [])}
+include = sorted(filter(bool, kwargs.get(r'includepats', [])))
+exclude = sorted(filter(bool, kwargs.get(r'excludepats', [])))
 generateellipsesbundle2(
 bundler,
 repo,
-oldinclude,
-oldexclude,
-newinclude,
-newexclude,
+include,
+exclude,
 version,
 common,
 heads,
-known,
 kwargs.get(r'depth', None),
 )
 
 
 def generateellipsesbundle2(
-bundler,
-repo,
-oldinclude,
-oldexclude,
-newinclude,
-newexclude,
-version,
-common,
-heads,
-known,
-depth,
+bundler, repo, include, exclude, version, common, heads, depth,
 ):
-newmatch = narrowspec.match(
-repo.root, include=newinclude, exclude=newexclude
-)
+match = narrowspec.match(repo.root, include=include, exclude=exclude)
 if depth is not None:
 depth = int(depth)
 if depth < 1:
@@ -108,61 +87,9 @@
 
 heads = set(heads or repo.heads())
 common = set(common or [nullid])
-if known and (oldinclude != newinclude or oldexclude != newexclude):
-# Steps:
-# 1. Send kill for "$known & ::common"
-#
-# 2. Send changegroup for ::common
-#
-# 3. Proceed.
-#
-# In the future, we can send kills for only the specific
-# nodes we know should go away or change shape, and then
-# send a data stream that tells the client something like this:
-#
-# a) apply this changegroup
-# b) apply nodes XXX, YYY, ZZZ that you already have
-# c) goto a
-#
-# until they've built up the full new state.
-# Convert to revnums and intersect with "common". The client should
-# have made it a subset of "common" already, but let's be safe.
-known = set(repo.revs(b"%ln & ::%ln", known, common))
-# TODO: we could send only roots() of this set, and the
-# list of nodes in common, and the client could work out
-# what to strip, instead of us explicitly sending every
-# single node.
-deadrevs = known
-
-def genkills():
-for r in deadrevs:
-yield _KILLNODESIGNAL
-yield repo.changelog.node(r)
-yield _DONESIGNAL
-
-bundler.newpart(_CHANGESPECPART, data=genkills())
-newvisit, newfull, newellipsis = exchange._computeellipsis(
-repo, set(), common, known, newmatch
-)
-if newvisit:
-packer = changegroup.getbundler(
-version,
-repo,
-matcher=newmatch,
-ellipses=True,
-shallow=depth is not None,
-ellipsisroots=newellipsis,
-fullnodes=newfull,
-)
-cgdata = packer.generate(common, newvisit, False, b'narrow_widen')
-
-part = bundler.newpart(b'changegroup', data=cgdata)
-part.addparam(b'version', version)
-if b'treemanifest' in repo.requirements:
-part.addparam(b'treemanifest', b'1')
 
 visitnodes, relevant_nodes, ellipsisroots = exchange._computeellipsis(
-repo, common, heads, set(), newmatch, depth=depth
+repo, common, heads, set(), match, depth=depth
 )
 
 repo.ui.debug(b'Found %d relevant revs\n' % len(relevant_nodes))
@@ -170,7 +97,7 @@
 packer = changegroup.getbundler(
 version,
 repo,
-matcher=newmatch,
+matcher=match,
 ellipses=True,
 shallow=depth is not None,
  

D7092: widening: duplicate generateellipsesbundle2() for widening

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

REVISION SUMMARY
  The widening and the non-widening code are quite different. It will be
  clearer to have them as sepearate functions. To start with, I've just
  copied it exactly, so it's clearer over the next few patches how
  they're different.
  
  The new function should gradually become more similar to
  bundle2.widen_bundle(), and should perhaps eventually be merged with
  that function. However, I've left it in narrowbundle2.py for now since
  it still depends on constants like _KILLNODESIGNAL there.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py
  hgext/narrow/narrowwirepeer.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowwirepeer.py b/hgext/narrow/narrowwirepeer.py
--- a/hgext/narrow/narrowwirepeer.py
+++ b/hgext/narrow/narrowwirepeer.py
@@ -120,7 +120,7 @@
 ellipses,
 )
 else:
-narrowbundle2.generateellipsesbundle2(
+narrowbundle2.generate_ellipses_bundle2_for_widening(
 bundler,
 repo,
 oldincludes,
diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -184,6 +184,105 @@
 part.addparam(b'treemanifest', b'1')
 
 
+def generate_ellipses_bundle2_for_widening(
+bundler,
+repo,
+oldinclude,
+oldexclude,
+newinclude,
+newexclude,
+version,
+common,
+heads,
+known,
+depth,
+):
+newmatch = narrowspec.match(
+repo.root, include=newinclude, exclude=newexclude
+)
+if depth is not None:
+depth = int(depth)
+if depth < 1:
+raise error.Abort(_(b'depth must be positive, got %d') % depth)
+
+heads = set(heads or repo.heads())
+common = set(common or [nullid])
+if known and (oldinclude != newinclude or oldexclude != newexclude):
+# Steps:
+# 1. Send kill for "$known & ::common"
+#
+# 2. Send changegroup for ::common
+#
+# 3. Proceed.
+#
+# In the future, we can send kills for only the specific
+# nodes we know should go away or change shape, and then
+# send a data stream that tells the client something like this:
+#
+# a) apply this changegroup
+# b) apply nodes XXX, YYY, ZZZ that you already have
+# c) goto a
+#
+# until they've built up the full new state.
+# Convert to revnums and intersect with "common". The client should
+# have made it a subset of "common" already, but let's be safe.
+known = set(repo.revs(b"%ln & ::%ln", known, common))
+# TODO: we could send only roots() of this set, and the
+# list of nodes in common, and the client could work out
+# what to strip, instead of us explicitly sending every
+# single node.
+deadrevs = known
+
+def genkills():
+for r in deadrevs:
+yield _KILLNODESIGNAL
+yield repo.changelog.node(r)
+yield _DONESIGNAL
+
+bundler.newpart(_CHANGESPECPART, data=genkills())
+newvisit, newfull, newellipsis = exchange._computeellipsis(
+repo, set(), common, known, newmatch
+)
+if newvisit:
+packer = changegroup.getbundler(
+version,
+repo,
+matcher=newmatch,
+ellipses=True,
+shallow=depth is not None,
+ellipsisroots=newellipsis,
+fullnodes=newfull,
+)
+cgdata = packer.generate(common, newvisit, False, b'narrow_widen')
+
+part = bundler.newpart(b'changegroup', data=cgdata)
+part.addparam(b'version', version)
+if b'treemanifest' in repo.requirements:
+part.addparam(b'treemanifest', b'1')
+
+visitnodes, relevant_nodes, ellipsisroots = exchange._computeellipsis(
+repo, common, heads, set(), newmatch, depth=depth
+)
+
+repo.ui.debug(b'Found %d relevant revs\n' % len(relevant_nodes))
+if visitnodes:
+packer = changegroup.getbundler(
+version,
+repo,
+matcher=newmatch,
+ellipses=True,
+shallow=depth is not None,
+ellipsisroots=ellipsisroots,
+fullnodes=relevant_nodes,
+)
+cgdata = packer.generate(common, visitnodes, False, b'narrow_widen')
+
+part = bundler.newpart(b'changegroup', data=cgdata)
+part.addparam(b'version', version)
+if b'treemanifest' in repo.requirements:
+part.addparam(b'treemanifest', b'1')
+
+
 @bundle2.parthandler(_SPECPART, (_SPECPART_INCLUDE, 

D7091: tests: show graph log before and after widening in more cases

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

REVISION SUMMARY
  I'm about to make some changes to which revisions get sent during
  widening. Some more tests will make it clearer what changes. I've also
  switched to graph log so we easily notice if the graph shape changes.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-narrow-widen.t

CHANGE DETAILS

diff --git a/tests/test-narrow-widen.t b/tests/test-narrow-widen.t
--- a/tests/test-narrow-widen.t
+++ b/tests/test-narrow-widen.t
@@ -1,6 +1,11 @@
 #testcases flat tree
   $ . "$TESTDIR/narrow-library.sh"
 
+  $ cat >> $HGRCPATH < [alias]
+  > l = log -G -T "{if(ellipsis, '...')}{rev}: {desc}\n"
+  > EOF
+
 #if tree
   $ cat << EOF >> $HGRCPATH
   > [experimental]
@@ -76,15 +81,23 @@
   $ echo 'widest v4' > widest/f
   $ hg commit -m 'update widest v4'
 
-  $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
-  7: update widest v4
-  6: add outside2
-  5: update inside
-  4: update widest v3
-  3: add wider, update widest
-  2: add outside
-  1: add widest
-  0: add inside
+  $ hg l
+  @  7: update widest v4
+  |
+  o  6: add outside2
+  |
+  o  5: update inside
+  |
+  o  4: update widest v3
+  |
+  o  3: add wider, update widest
+  |
+  o  2: add outside
+  |
+  o  1: add widest
+  |
+  o  0: add inside
+  
 
   $ cd ..
 
@@ -92,6 +105,11 @@
 added upstream revisions.
 
   $ cd narrow
+  $ hg l
+  @  ...1: add outside
+  |
+  o  0: add inside
+  
   $ hg tracked --addinclude widest/f
   comparing with ssh://user@dummy/master
   searching for changes
@@ -100,6 +118,13 @@
   adding manifests
   adding file changes
   added 3 changesets with 2 changes to 2 files
+  $ hg l
+  @  ...2: add outside
+  |
+  o  1: add widest
+  |
+  o  0: add inside
+  
   $ hg tracked
   I path:inside
   I path:widest/f
@@ -130,15 +155,23 @@
   $ cat inside/f
   inside v2
 
-  $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
-  7: update widest v4
-  ...6: add outside2
-  5: update inside
-  4: update widest v3
-  3: add wider, update widest
-  ...2: add outside
-  1: add widest
-  0: add inside
+  $ hg l
+  o  7: update widest v4
+  |
+  o  ...6: add outside2
+  |
+  @  5: update inside
+  |
+  o  4: update widest v3
+  |
+  o  3: add wider, update widest
+  |
+  o  ...2: add outside
+  |
+  o  1: add widest
+  |
+  o  0: add inside
+  
 
 Check that widening with a newline fails
 
@@ -180,15 +213,23 @@
   $ cat widest/f
   widest v4
 
-  $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
-  7: update widest v4
-  ...6: add outside2
-  5: update inside
-  4: update widest v3
-  3: add wider, update widest
-  ...2: add outside
-  1: add widest
-  0: add inside
+  $ hg l
+  @  7: update widest v4
+  |
+  o  ...6: add outside2
+  |
+  o  5: update inside
+  |
+  o  4: update widest v3
+  |
+  o  3: add wider, update widest
+  |
+  o  ...2: add outside
+  |
+  o  1: add widest
+  |
+  o  0: add inside
+  
 
 separate suite of tests: files from 0-10 modified in changes 0-10. This allows
 more obvious precise tests tickling particular corner cases.
@@ -245,15 +286,23 @@
   crosschecking files in changesets and manifests
   checking files
   checked 8 changesets with 4 changes to 4 files
-  $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
-  ...7: add d10/f
-  6: add d9/f
-  ...5: add d8/f
-  4: add d6/f
-  ...3: add d5/f
-  2: add d3/f
-  ...1: add d2/f
-  0: add d0/f
+  $ hg l
+  @  ...7: add d10/f
+  |
+  o  6: add d9/f
+  |
+  o  ...5: add d8/f
+  |
+  o  4: add d6/f
+  |
+  o  ...3: add d5/f
+  |
+  o  2: add d3/f
+  |
+  o  ...1: add d2/f
+  |
+  o  0: add d0/f
+  
   $ hg tracked --addinclude d1
   comparing with ssh://user@dummy/upstream
   searching for changes
@@ -268,16 +317,25 @@
   I path:d3
   I path:d6
   I path:d9
-  $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
-  ...8: add d10/f
-  7: add d9/f
-  ...6: add d8/f
-  5: add d6/f
-  ...4: add d5/f
-  3: add d3/f
-  ...2: add d2/f
-  1: add d1/f
-  0: add d0/f
+  $ hg l
+  @  ...8: add d10/f
+  |
+  o  7: add d9/f
+  |
+  o  ...6: add d8/f
+  |
+  o  5: add d6/f
+  |
+  o  ...4: add d5/f
+  |
+  o  3: add d3/f
+  |
+  o  ...2: add d2/f
+  |
+  o  1: add d1/f
+  |
+  o  0: add d0/f
+  
 
 Verify shouldn't claim the repo is corrupt after a widen.
 
@@ -294,16 +352,42 @@
   $ cd ..
   $ hg clone -q --narrow ssh://user@dummy/upstream narrow3 --include d2 -r 2
   $ cd narrow3
-  $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
-  1: add d2/f
-  ...0: add d1/f
+  $ hg l
+  @  1: add d2/f
+  |
+  o  ...0: add d1/f
+  
   $ hg pull -q -r 3
   $ hg co -q tip
   $ hg pull -q -r 4
   $ echo local > d2/f
   $ hg ci -m local
   created new head
+  $ hg l
+  @  4: local
+  |
+  | o  ...3: add d4/f
+  |/
+  o  ...2: add d3/f
+  |
+  o  1: add d2/f
+  |
+  o  ...0: add d1/f
+  
   $ hg tracked -q --addinclude d0 --addinclude d9
+  $ hg l
+  @  5: local
+  |

Re: Mercurial 5.2 release as stable release for Python 3.

2019-10-14 Thread Gregory Szorc
I support marking the code base as stable with Python 3 in the upcoming few
weeks - at least for non-Windows.

If we're serious about this, we all need to be running Mercurial with
Python 3 locally and fixing bugs. I tried installing a Python 3 Mercurial a
few days ago and I encountered enough tracebacks to cause me to revert.
Those include https://bz.mercurial-scm.org/show_bug.cgi?id=6196 and an
issue with evolve/obsmarkers that can be reproduced by `hg push` to
hg-committed. I think we should land a patch to Makefile that changes
https://www.mercurial-scm.org/repo/hg/file/649a9601b9e2/Makefile#l8 to
`python3` to force the issue. We can revert that before tagging 5.2 if we
want to do a separate release that is Python 3 primary (there was talk of
doing a 2.7 5.2 then doing a 5.2.1 or a 5.3 a week or two later that is
Python 3 native).

We also still have a handful of test failures on Python 3. See
https://ci.hg.gregoryszorc.com/. (CI is broken with Python 3.5 for some
reason. I'll look into it.)

Python 3 on Windows has a ton of test failures. ~120 I believe. I suspect a
lot of them are the same underlying issues. I almost have my CI system
working with Windows. But we'll certainly need a bit of effort on Windows
before we can consider Python 3 stable there. At this time, Python 3 on
Windows seems to be at risk because of the volume of issues.

Other major blockers to Python 3 are packaging work. I'm the de facto
maintainer of the Windows packages and will write those patches. But my
priorities are standing up Windows CI because I think having visibility
into the test failures is more important because what good is Python 3
packages if Mercurial isn't usable :) I could also help with non-Windows
packaging if it is needed.

I would also propose we reinstate the @ code freeze for this release so we
can all focus on Python 3 and quality of life improvements for the release.
I don't think we'll put out a quality Python 3 release if we're distracted
by feature work on @.

On Mon, Oct 14, 2019 at 9:30 AM Pulkit Goyal <7895pul...@gmail.com> wrote:

> Hey everyone,
>
> I hope you are doing well.
>
> We released 5.0 as beta release for Python 3 support and much has
> improved since than. Evolve extension recently started supporting
> Python 3. There are still few tests failing which are minor.
>
> We are planning to mark the upcoming release i.e. 5.2 as stable
> release for py3 support (except Windows). If we agree on that, we also
> plan to accept py3 related fixes on stable branch during upcoming
> feature freeze.
>
> It will be the best time to install hg on Python 3 and start testing.
>
> What do you think?
>
> Thanks and regards
> Pulkit
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7085: fix: warn when a fixer doesn't have a configured command

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHG99f2d939f03c: fix: warn when a fixer doesnt have a 
configured command (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7085?vs=17130=17143

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

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

AFFECTED FILES
  hgext/fix.py
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -1338,6 +1338,8 @@
   fixer tool has no pattern configuration: nopattern
   $ cat foo bar
   foobar (no-eol)
+  $ hg fix --debug --working-dir --config "fix.nocommand:pattern=foo.bar"
+  fixer tool has no command configuration: nocommand
 
   $ cd ..
 
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -802,7 +802,11 @@
 # dangerous to let it affect all files. It would be pointless to let it
 # affect no files. There is no reasonable subset of files to use as the
 # default.
-if pattern is None:
+if command is None:
+ui.warn(
+_(b'fixer tool has no command configuration: %s\n') % (name,)
+)
+elif pattern is None:
 ui.warn(
 _(b'fixer tool has no pattern configuration: %s\n') % (name,)
 )



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


D7086: fix: remove a never-true check for unset pattern in Fixer.affects()

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHG96c4c6f37d52: fix: remove a never-true check for unset 
pattern in Fixer.affects() (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7086?vs=17131=17144

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

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -845,9 +845,7 @@
 
 def affects(self, opts, fixctx, path):
 """Should this fixer run on the file at the given path and context?"""
-return self._pattern is not None and scmutil.match(
-fixctx, [self._pattern], opts
-)(path)
+return scmutil.match(fixctx, [self._pattern], opts)(path)
 
 def shouldoutputmetadata(self):
 """Should the stdout of this fixer start with JSON and a null byte?"""



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


D7084: fix: make Fixer initialization more explicit for clarity

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHG2e3aa8ed5bdf: fix: make Fixer initialization more explicit 
for clarity (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7084?vs=17129=17142

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

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -132,11 +132,9 @@
 from mercurial.i18n import _
 from mercurial.node import nullrev
 from mercurial.node import wdirrev
-from mercurial.pycompat import setattr
 
 from mercurial.utils import (
 procutil,
-stringutil,
 )
 
 from mercurial import (
@@ -172,9 +170,9 @@
 b'linerange': None,
 b'pattern': None,
 b'priority': 0,
-b'metadata': b'false',
-b'skipclean': b'true',
-b'enabled': b'true',
+b'metadata': False,
+b'skipclean': True,
+b'enabled': True,
 }
 
 for key, default in FIXER_ATTRS.items():
@@ -793,29 +791,27 @@
 """
 fixers = {}
 for name in fixernames(ui):
-fixers[name] = Fixer()
-for key in FIXER_ATTRS:
-setattr(
-fixers[name],
-pycompat.sysstr(b'_' + key),
-ui.config(b'fix', name + b':' + key),
-)
-fixers[name]._priority = int(fixers[name]._priority)
-fixers[name]._metadata = stringutil.parsebool(fixers[name]._metadata)
-fixers[name]._skipclean = stringutil.parsebool(fixers[name]._skipclean)
-fixers[name]._enabled = stringutil.parsebool(fixers[name]._enabled)
+enabled = ui.configbool(b'fix', name + b':enabled')
+command = ui.config(b'fix', name + b':command')
+pattern = ui.config(b'fix', name + b':pattern')
+linerange = ui.config(b'fix', name + b':linerange')
+priority = ui.configint(b'fix', name + b':priority')
+metadata = ui.configbool(b'fix', name + b':metadata')
+skipclean = ui.configbool(b'fix', name + b':skipclean')
 # Don't use a fixer if it has no pattern configured. It would be
 # dangerous to let it affect all files. It would be pointless to let it
 # affect no files. There is no reasonable subset of files to use as the
 # default.
-if fixers[name]._pattern is None:
+if pattern is None:
 ui.warn(
 _(b'fixer tool has no pattern configuration: %s\n') % (name,)
 )
-del fixers[name]
-elif not fixers[name]._enabled:
+elif not enabled:
 ui.debug(b'ignoring disabled fixer tool: %s\n' % (name,))
-del fixers[name]
+else:
+fixers[name] = Fixer(
+command, pattern, linerange, priority, metadata, skipclean
+)
 return collections.OrderedDict(
 sorted(fixers.items(), key=lambda item: item[1]._priority, 
reverse=True)
 )
@@ -833,6 +829,16 @@
 class Fixer(object):
 """Wraps the raw config values for a fixer with methods"""
 
+def __init__(
+self, command, pattern, linerange, priority, metadata, skipclean
+):
+self._command = command
+self._pattern = pattern
+self._linerange = linerange
+self._priority = priority
+self._metadata = metadata
+self._skipclean = skipclean
+
 def affects(self, opts, fixctx, path):
 """Should this fixer run on the file at the given path and context?"""
 return self._pattern is not None and scmutil.match(



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


D7083: fix: don't pass in default value when looking up config

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHGf4c1fd6addd5: fix: dont pass in default value when 
looking up config (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7083?vs=17128=17141

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

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -794,11 +794,11 @@
 fixers = {}
 for name in fixernames(ui):
 fixers[name] = Fixer()
-for key, default in FIXER_ATTRS.items():
+for key in FIXER_ATTRS:
 setattr(
 fixers[name],
 pycompat.sysstr(b'_' + key),
-ui.config(b'fix', name + b':' + key, default),
+ui.config(b'fix', name + b':' + key),
 )
 fixers[name]._priority = int(fixers[name]._priority)
 fixers[name]._metadata = stringutil.parsebool(fixers[name]._metadata)



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


D7082: fix: fix registration of config item defaults

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHG5cb3e6f4e069: fix: fix registration of config item defaults 
(authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7082?vs=17127=17140

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

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -178,7 +178,7 @@
 }
 
 for key, default in FIXER_ATTRS.items():
-configitem(b'fix', b'.*(:%s)?' % key, default=default, generic=True)
+configitem(b'fix', b'.*:%s$' % key, default=default, generic=True)
 
 # A good default size allows most source code files to be fixed, but avoids
 # letting fixer tools choke on huge inputs, which could be surprising to the
@@ -794,12 +794,11 @@
 fixers = {}
 for name in fixernames(ui):
 fixers[name] = Fixer()
-attrs = ui.configsuboptions(b'fix', name)[1]
 for key, default in FIXER_ATTRS.items():
 setattr(
 fixers[name],
 pycompat.sysstr(b'_' + key),
-attrs.get(key, default),
+ui.config(b'fix', name + b':' + key, default),
 )
 fixers[name]._priority = int(fixers[name]._priority)
 fixers[name]._metadata = stringutil.parsebool(fixers[name]._metadata)



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


D7078: automation: capture additional exception when formatting

2019-10-14 Thread indygreg (Gregory Szorc)
Closed by commit rHG6a350194de7f: automation: capture additional exception when 
formatting (authored by indygreg).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7078?vs=17119=17139

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

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

AFFECTED FILES
  contrib/automation/hgautomation/winrm.py

CHANGE DETAILS

diff --git a/contrib/automation/hgautomation/winrm.py 
b/contrib/automation/hgautomation/winrm.py
--- a/contrib/automation/hgautomation/winrm.py
+++ b/contrib/automation/hgautomation/winrm.py
@@ -55,7 +55,7 @@
 
 try:
 o = str(o)
-except TypeError:
+except (AttributeError, TypeError):
 o = pprint.pformat(o.extended_properties)
 
 return o



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


D7077: contrib: update to latest Windows package versions

2019-10-14 Thread indygreg (Gregory Szorc)
Closed by commit rHGc157356c03f7: contrib: update to latest Windows package 
versions (authored by indygreg).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7077?vs=17118=17138

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

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

AFFECTED FILES
  contrib/install-windows-dependencies.ps1

CHANGE DETAILS

diff --git a/contrib/install-windows-dependencies.ps1 
b/contrib/install-windows-dependencies.ps1
--- a/contrib/install-windows-dependencies.ps1
+++ b/contrib/install-windows-dependencies.ps1
@@ -37,22 +37,22 @@
 $PYTHON36_x64_URL = 
"https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe;
 $PYTHON36_x64_SHA256 = 
"96088A58B7C43BC83B84E6B67F15E8706C614023DD64F9A5A14E81FF824ADADC"
 
-$PYTHON37_x86_URL = "https://www.python.org/ftp/python/3.7.2/python-3.7.2.exe;
-$PYTHON37_x86_SHA256 = 
"8BACE330FB409E428B04083DD9CA7F6C754366D07E23B3853891D8F8C3D0"
-$PYTHON37_x64_URL = 
"https://www.python.org/ftp/python/3.7.2/python-3.7.2-amd64.exe;
-$PYTHON37_x64_SHA256 = 
"0FE2A696F5A3E481FED795EF6896ED99157BCEF273EF3C4A96F2905CBDB3AA13"
+$PYTHON37_x86_URL = "https://www.python.org/ftp/python/3.7.4/python-3.7.4.exe;
+$PYTHON37_x86_SHA256 = 
"9a30ab5568ba37bfbcae5cdee19e9dc30765c42cf066f605221563ff8b20ee34"
+$PYTHON37_X64_URL = 
"https://www.python.org/ftp/python/3.7.4/python-3.7.4-amd64.exe;
+$PYTHON37_x64_SHA256 = 
"bab92f987320975c7826171a072bfd64f8f0941aaf2cdeba6924b7025c9968a3"
 
-$PYTHON38_x86_URL = 
"https://www.python.org/ftp/python/3.8.0/python-3.8.0b2.exe;
-$PYTHON38_x86_SHA256 = 
"efa37ff7a239332bd5cf8b6e6ff15e3f183da942fd8c8d3e4b6bd11fa5e07e23"
-$PYTHON38_x64_URL = 
"https://www.python.org/ftp/python/3.8.0/python-3.8.0b2-amd64.exe;
-$PYTHON38_x64_SHA256 = 
"4e151f7dfa3605e6f400a3b01acfc2517468d71afb1e20f9299149356b79d8e9"
+$PYTHON38_x86_URL = 
"https://www.python.org/ftp/python/3.8.0/python-3.8.0rc1.exe;
+$PYTHON38_x86_SHA256 = 
"79eb5dd04be8384154ef6767e35ae570ede28188bd6cecce4f18c1aa42d1bb66"
+$PYTHON38_x64_URL = 
"https://www.python.org/ftp/python/3.8.0/python-3.8.0rc1-amd64.exe;
+$PYTHON38_x64_SHA256 = 
"c9cffbaf11487c08432d3ea9a3ac125f0fee41b41e71062477fb057ca1e5ab40"
 
-# PIP 19.0.3.
-$PIP_URL = 
"https://github.com/pypa/get-pip/raw/fee32c376da1ff6496a798986d7939cd51e1644f/get-pip.py;
-$PIP_SHA256 = 
"efe99298f3fbb1f56201ce6b81d2658067d2f7d7dfc2d412e0d3cacc9a397c61"
+# PIP 19.2.3.
+$PIP_URL = 
"https://github.com/pypa/get-pip/raw/309a56c5fd94bd1134053a541cb4657a4e47e09d/get-pip.py;
+$PIP_SHA256 = 
"57e3643ff19f018f8a00dfaa6b7e4620e3c1a7a2171fd218425366ec006b3bfe"
 
-$VIRTUALENV_URL = 
"https://files.pythonhosted.org/packages/37/db/89d6b043b22052109da35416abc3c397655e4bd3cff031446ba02b9654fa/virtualenv-16.4.3.tar.gz;
-$VIRTUALENV_SHA256 = 
"984d7e607b0a5d1329425dd8845bd971b957424b5ba664729fab51ab8c11bc39"
+$VIRTUALENV_URL = 
"https://files.pythonhosted.org/packages/66/f0/6867af06d2e2f511e4e1d7094ff663acdebc4f15d4a0cb0fed1007395124/virtualenv-16.7.5.tar.gz;
+$VIRTUALENV_SHA256 = 
"f78d81b62d3147396ac33fc9d77579ddc42cc2a98dd9ea38886f616b33bc7fb2"
 
 $INNO_SETUP_URL = 
"http://files.jrsoftware.org/is/5/innosetup-5.6.1-unicode.exe;
 $INNO_SETUP_SHA256 = 
"27D49E9BC769E9D1B214C153011978DB90DC01C2ACD1DDCD9ED7B3FE3B96B538"
@@ -60,9 +60,9 @@
 $MINGW_BIN_URL = 
"https://osdn.net/frs/redir.php?m=constant=mingw%2F68260%2Fmingw-get-0.6.3-mingw32-pre-20170905-1-bin.zip;
 $MINGW_BIN_SHA256 = 
"2AB8EFD7C7D1FC8EAF8B2FA4DA4EEF8F3E47768284C021599BC7435839A046DF"
 
-$MERCURIAL_WHEEL_FILENAME = "mercurial-4.9-cp27-cp27m-win_amd64.whl"
-$MERCURIAL_WHEEL_URL = 
"https://files.pythonhosted.org/packages/fe/e8/b872d53dfbbf986bdc46af0b30f580b227fb59bddd2587152a55e205b0cc/$MERCURIAL_WHEEL_FILENAME;
-$MERCURIAL_WHEEL_SHA256 = 
"218cc2e7c3f1d535007febbb03351663897edf27df0e57d6842e3b686492b429"
+$MERCURIAL_WHEEL_FILENAME = "mercurial-5.1.2-cp27-cp27m-win_amd64.whl"
+$MERCURIAL_WHEEL_URL = 
"https://files.pythonhosted.org/packages/6d/47/e031e47f7fe9b16e4e3383da47e2b0a7eae6e603996bc67a03ec4fa1b3f4/$MERCURIAL_WHEEL_FILENAME;
+$MERCURIAL_WHEEL_SHA256 = 
"1d18c7f6ca1456f0f62ee65c9a50c14cbba48ce6e924930cdb10537f5c9eaf5f"
 
 # Writing progress slows down downloads substantially. So disable it.
 $progressPreference = 'silentlyContinue'



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


D7090: black: also ignore grey.py

2019-10-14 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  black.toml
  contrib/examples/fix.hgrc

CHANGE DETAILS

diff --git a/contrib/examples/fix.hgrc b/contrib/examples/fix.hgrc
--- a/contrib/examples/fix.hgrc
+++ b/contrib/examples/fix.hgrc
@@ -12,4 +12,4 @@
 # to have the dependencies for grey.
 #
 # black:command = python3.7 contrib/grey.py --config=black.toml -
-# black:pattern = set:**.py - hgext/fsmonitor/pywatchman/** - 
mercurial/thirdparty/** - "contrib/python-zstandard/**"
+# black:pattern = set:**.py - hgext/fsmonitor/pywatchman/** - 
mercurial/thirdparty/** - "contrib/python-zstandard/** - contrib/grey.py"
diff --git a/black.toml b/black.toml
--- a/black.toml
+++ b/black.toml
@@ -11,6 +11,7 @@
 | mercurial/thirdparty/
 | hgext/fsmonitor/pywatchman/
 | contrib/python-zstandard/
+| contrib/grey.py
 '''
 skip-string-normalization = true
 quiet = true



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


D7088: black: move remaining config knobs into toml file

2019-10-14 Thread durin42 (Augie Fackler)
durin42 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/D7088

AFFECTED FILES
  black.toml
  contrib/examples/fix.hgrc

CHANGE DETAILS

diff --git a/contrib/examples/fix.hgrc b/contrib/examples/fix.hgrc
--- a/contrib/examples/fix.hgrc
+++ b/contrib/examples/fix.hgrc
@@ -11,5 +11,5 @@
 # git+https://github.com/python/black/@d9e71a75ccfefa3d9156a64c03313a0d4ad981e5
 # to have the dependencies for grey.
 #
-# black:command = python3.7 contrib/grey.py --quiet --config=black.toml 
--skip-string-normalization -
+# black:command = python3.7 contrib/grey.py --config=black.toml -
 # black:pattern = set:**.py - hgext/fsmonitor/pywatchman/** - 
mercurial/thirdparty/** - "contrib/python-zstandard/**"
diff --git a/black.toml b/black.toml
--- a/black.toml
+++ b/black.toml
@@ -1,3 +1,5 @@
 [tool.black]
 line-length = 80
 exclude = 
'build/|wheelhouse/|dist/|packages/|\.hg/|\.mypy_cache/|\.venv/|mercurial/thirdparty/|hgext/fsmonitor/pywatchman/|contrib/python-zstandard/'
+skip-string-normalization = true
+quiet = true



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


D7089: black: use multiline exclude definition

2019-10-14 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Our excludes list is pretty complicated, so let's give ourselves some
  readability. Black treats multiline exclude definitions as verbse
  regular expressions, so we can split this up and make it easier to
  consume.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  black.toml

CHANGE DETAILS

diff --git a/black.toml b/black.toml
--- a/black.toml
+++ b/black.toml
@@ -1,5 +1,16 @@
 [tool.black]
 line-length = 80
-exclude = 
'build/|wheelhouse/|dist/|packages/|\.hg/|\.mypy_cache/|\.venv/|mercurial/thirdparty/|hgext/fsmonitor/pywatchman/|contrib/python-zstandard/'
+exclude = '''
+build/
+| wheelhouse/
+| dist/
+| packages/
+| \.hg/
+| \.mypy_cache/
+| \.venv/
+| mercurial/thirdparty/
+| hgext/fsmonitor/pywatchman/
+| contrib/python-zstandard/
+'''
 skip-string-normalization = true
 quiet = true



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


D7087: black: rename pyproject.toml to black.toml

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

REVISION SUMMARY
  Black won't read this automatically (you'll have to specify --config),
  but having a pyproject.toml *at all* puts pip in PEP 517/518 mode
  which breaks us for obscure reasons I don't understand. Rather than
  waste a ton of time fighting with pip, let's just do this.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  black.toml
  contrib/examples/fix.hgrc
  pyproject.toml
  tests/test-check-code.t

CHANGE DETAILS

diff --git a/tests/test-check-code.t b/tests/test-check-code.t
--- a/tests/test-check-code.t
+++ b/tests/test-check-code.t
@@ -64,10 +64,10 @@
   COPYING
   Makefile
   README.rst
+  black.toml
   hg
   hgeditor
   hgweb.cgi
-  pyproject.toml
   setup.py
 
 Prevent adding modules which could be shadowed by ancient .so/.dylib.
diff --git a/contrib/examples/fix.hgrc b/contrib/examples/fix.hgrc
--- a/contrib/examples/fix.hgrc
+++ b/contrib/examples/fix.hgrc
@@ -11,5 +11,5 @@
 # git+https://github.com/python/black/@d9e71a75ccfefa3d9156a64c03313a0d4ad981e5
 # to have the dependencies for grey.
 #
-# black:command = python3.7 contrib/grey.py --quiet 
--skip-string-normalization -
+# black:command = python3.7 contrib/grey.py --quiet --config=black.toml 
--skip-string-normalization -
 # black:pattern = set:**.py - hgext/fsmonitor/pywatchman/** - 
mercurial/thirdparty/** - "contrib/python-zstandard/**"
diff --git a/pyproject.toml b/black.toml
rename from pyproject.toml
rename to black.toml



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


[Bug 6204] New: hgweb fails when reading config file for Python 3

2019-10-14 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6204

Bug ID: 6204
   Summary: hgweb fails when reading config file for Python 3
   Product: Mercurial
   Version: default branch
  Hardware: All
OS: Linux
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: hgweb
  Assignee: bugzi...@mercurial-scm.org
  Reporter: a...@digitalcheetah.com
CC: mercurial-devel@mercurial-scm.org

Hi,

I'm using:

Python 3.5.2 
Mercurial 5.1.2 
Apache 2.4.18
mod_wsgi: 4.6.8
Under Ubuntu 16.04

When I try to clone down a repo I get the following error:

hg clone
https://cloudmp.tcheetah08.com:/zall/cloudmp.tcheetah08.com/cloudmp
abort: HTTP Error 500: Internal Server Error

In the apache error logs this error is recorded: 
  [Mon Oct 14 11:47:17.740209 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] mod_wsgi (pid=78832): Failed to exec Python script file
'/usr/local/bin/hg.wsgi'.
   [Mon Oct 14 11:47:17.740384 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] mod_wsgi (pid=78832): Exception occurred processing WSGI
script '/usr/local/bin/hg.wsgi'.
   [Mon Oct 14 11:47:17.741100 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] Traceback (most recent call last):
   [Mon Oct 14 11:47:17.741136 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File "/usr/local/bin/hg.wsgi", line 28, in 
   [Mon Oct 14 11:47:17.741144 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] application = hgwebdir('/etc/mercurial/hgrc.d/osw.rc')
   [Mon Oct 14 11:47:17.741150 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File
"/usr/local/lib/python3.5/dist-packages/mercurial/hgweb/hgwebdir_mod.py", line
271, in __init__
   [Mon Oct 14 11:47:17.741156 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] self.refresh()
   [Mon Oct 14 11:47:17.741168 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File
"/usr/local/lib/python3.5/dist-packages/mercurial/hgweb/hgwebdir_mod.py", line
303, in refresh
   [Mon Oct 14 11:47:17.741174 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] u.readconfig(self.conf, remap=map, trust=True)
   [Mon Oct 14 11:47:17.741179 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File
"/usr/local/lib/python3.5/dist-packages/mercurial/ui.py", line 420, in
readconfig
   [Mon Oct 14 11:47:17.741185 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] cfg.read(filename, fp, sections=sections, remap=remap)
   [Mon Oct 14 11:47:17.741190 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File
"/usr/local/lib/python3.5/dist-packages/mercurial/config.py", line 201, in read
   [Mon Oct 14 11:47:17.741195 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] sections=sections, remap=remap, include=self.read)
   [Mon Oct 14 11:47:17.741200 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File
"/usr/local/lib/python3.5/dist-packages/mercurial/config.py", line 179, in
parse
   [Mon Oct 14 11:47:17.741206 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] self.set(section, item, m.group(2), "%s:%d" % (src,
line))
   [Mon Oct 14 11:47:17.741227 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] TypeError: %b requires bytes, or an object that implements
__bytes__, not 'str'

The same command works fine if I switch back to Python 2.7.12

Thanks for any help you can give.

andy

-- 
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


D7069: copies: simplify the handling of merges

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
This revision is now accepted and ready to land.
martinvonz added inline comments.
martinvonz accepted this revision.

INLINE COMMENTS

> copies.py:285
>  roots = set(children) - set(missingrevs)
> -# 'work' contains 3-tuples of a (revision number, parent number, copies).
> -# The parent number is only used for knowing which parent the copies dict
> -# came from.
> -# NOTE: To reduce costly copying the 'copies' dicts, we reuse the same
> -# instance for *one* of the child nodes (the last one). Once an instance
> -# has been put on the queue, it is thus no longer safe to modify it.
> -# Conversely, it *is* safe to modify an instance popped off the queue.
> -work = [(r, 1, {}) for r in roots]
> +work = [r for r in roots]
> +all_copies = dict((r, {}) for r in roots)

`list(roots)` is simpler and clearer to me

> copies.py:286
> +work = [r for r in roots]
> +all_copies = dict((r, {}) for r in roots)
>  heapq.heapify(work)

and here `{r: {} for r in roots}` is simpler and clearer to me

REPOSITORY
  rHG Mercurial

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

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

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


D7086: fix: remove a never-true check for unset pattern in Fixer.affects()

2019-10-14 Thread hooper (Danny Hooper)
hooper added a comment.


  Looks good.

REPOSITORY
  rHG Mercurial

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

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

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


Mercurial 5.2 release as stable release for Python 3.

2019-10-14 Thread Pulkit Goyal
Hey everyone,

I hope you are doing well.

We released 5.0 as beta release for Python 3 support and much has
improved since than. Evolve extension recently started supporting
Python 3. There are still few tests failing which are minor.

We are planning to mark the upcoming release i.e. 5.2 as stable
release for py3 support (except Windows). If we agree on that, we also
plan to accept py3 related fixes on stable branch during upcoming
feature freeze.

It will be the best time to install hg on Python 3 and start testing.

What do you think?

Thanks and regards
Pulkit
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH RFC] changegroup: leave out all parent file revisions when creating bundles

2019-10-14 Thread Mads Kiilerich

On 10/11/19 7:57 PM, Mads Kiilerich wrote:

# HG changeset patch
# User Mads Kiilerich 
# Date 1570804632 -7200
#  Fri Oct 11 16:37:12 2019 +0200
# Node ID 72d12ee773795edc163f73b9160e5d29022878dd
# Parent  52781d57313d512efb7150603104bea3ca11d0eb
changegroup: leave out all parent file revisions when creating bundles


I'm not sure the analysis nailed the root cause. It is tricky to 
reproduce good test cases.


But one problem we could fix by pruning ancestors instead of using linkrevs:

Create a repo with aliasing:

  $ hg init repo1
  $ cd repo1
  $ touch f
  $ hg ci -Aqm 0
  $ echo 1 > f
  $ hg ci -m 1f1
  $ hg up -cqr 0
  $ hg branch -q b
  $ echo 1 > f  # linkrev aliasing to rev 1
  $ hg ci -m 2f1

When bundling rev 2 for a repo that has rev 1, f will be skipped even 
though it

isn't an ancestor:

  $ hg bundle -v -r 2 --base 1 bundle.hg
  1 changesets found
  uncompressed size of bundle content:
   185 (changelog)
   163 (manifests)

A bundle with missing ancestor revisions would fail unbundling with "abort:
00changelog.i@d681519c3ea7: unknown parent!". But if using 
fastpathlinkrev and
the ancestors are present but the file revs are not, the bundle can be 
applied

but will break on use:

  $ hg clone -qU . -r 0 repo2
  $ hg -R repo2 pull bundle.hg
  pulling from bundle.hg
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 0 changes to 0 files
  new changesets 5e690c649d09 (1 drafts)
  (run 'hg update' to get a working copy)
  $ hg -R repo2 up -r tip
  abort: data/f.i@d0c79e1d3309: no match found!
  [255]


/Mads

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


D6993: black: add a pyproject.toml that contains our black settings

2019-10-14 Thread indygreg (Gregory Szorc)
indygreg added a comment.


  We're seeing this with the latest version of pip/setuptools: 
https://ci.hg.gregoryszorc.com/job-info/hg-committed-649a9601b9e2642fa0ef12e6ad51ac85ab6e860c-debian10-cpython-2.7-0#failed-tests.
  
  But it only happens when we're using the self-installed 
Python/pip/setuptools: it doesn't reproduce with Debian 10's built-in/system 
Python/pip/setuptools. So it is plausible it is only an issue with modern 
pip/setuptools. That's believable, since pyproject.toml support is relatively 
new.

REPOSITORY
  rHG Mercurial

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

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

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


D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-14 Thread yuja (Yuya Nishihara)
yuja added a comment.


  Just quickly scanned. Not reviewed the core logic.
  
  > +/// Get name in the case stored in the filesystem
  > +/// The name should be relative to root, and be normcase-ed for efficiency.
  > +///
  > +/// Note that this function is unnecessary, and should not be
  > +//  called, for case-sensitive filesystems (simply because it's expensive).
  > +/// The root should be normcase-ed, too.
  > +pub fn filesystem_path>(root: , path: P) -> 
HgPathBuf {
  
  Unused?
  
  I think `path: impl AsRef` syntax is easier to follow unless we need
  a type variable.
  
  > +// TODO path for case-insensitive filesystems, for now this is 
transparent
  > +root.to_owned().join(path.as_ref())
  > +}
  
  `filesystems_path()` sounds like returning a `std::path::PathBuf`, but
  `HgPath` should be a repo-relative path.
  
  > +/// Returns `true` if path refers to an existing path.
  > +/// Returns `true` for broken symbolic links.
  > +/// Equivalent to `exists()` on platforms lacking `lstat`.
  > +pub fn lexists>(path: P) -> bool {
  
  Unused?
  
  > +if !path.as_ref().exists() {
  > +return read_link(path).is_ok();
  > +}
  > +true
  > +}
  
  Maybe you want `fs::symlink_metadata()`?
  I don't know which is faster, but the behavior should be closer to `lstat`.
  
  https://doc.rust-lang.org/std/fs/fn.symlink_metadata.html
  
  > +impl HgMetadata {
  > +#[cfg(unix)]
  > +pub fn from_metadata(metadata: Metadata) -> Self {
  > +use std::os::linux::fs::MetadataExt;
  
  `unix != linux`. Maybe you want `std::os::unix::fs::MetadataExt`.
  
  > +pub fn status>(
  > +mut dmap:  DirstateMap,
  > +root_dir: P,
  > +files: Vec,
  > +list_clean: bool,
  > +last_normal_time: i64,
  > +check_exec: bool,
  > +) -> std::io::Result<(Vec, StatusResult)>
  > +where
  > +P: Sync,
  
  `P: AsRef + Sync`.

REPOSITORY
  rHG Mercurial

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

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

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


Re: D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-14 Thread Yuya Nishihara
Just quickly scanned. Not reviewed the core logic.

> +/// Get name in the case stored in the filesystem
> +/// The name should be relative to root, and be normcase-ed for efficiency.
> +///
> +/// Note that this function is unnecessary, and should not be
> +//  called, for case-sensitive filesystems (simply because it's expensive).
> +/// The root should be normcase-ed, too.
> +pub fn filesystem_path>(root: , path: P) -> 
> HgPathBuf {

Unused?

I think `path: impl AsRef` syntax is easier to follow unless we need
a type variable.

> +// TODO path for case-insensitive filesystems, for now this is 
> transparent
> +root.to_owned().join(path.as_ref())
> +}

`filesystems_path()` sounds like returning a `std::path::PathBuf`, but
`HgPath` should be a repo-relative path.

> +/// Returns `true` if path refers to an existing path.
> +/// Returns `true` for broken symbolic links.
> +/// Equivalent to `exists()` on platforms lacking `lstat`.
> +pub fn lexists>(path: P) -> bool {

Unused?

> +if !path.as_ref().exists() {
> +return read_link(path).is_ok();
> +}
> +true
> +}

Maybe you want `fs::symlink_metadata()`?
I don't know which is faster, but the behavior should be closer to `lstat`.

https://doc.rust-lang.org/std/fs/fn.symlink_metadata.html

> +impl HgMetadata {
> +#[cfg(unix)]
> +pub fn from_metadata(metadata: Metadata) -> Self {
> +use std::os::linux::fs::MetadataExt;

`unix != linux`. Maybe you want `std::os::unix::fs::MetadataExt`.

> +pub fn status>(
> +mut dmap:  DirstateMap,
> +root_dir: P,
> +files: Vec,
> +list_clean: bool,
> +last_normal_time: i64,
> +check_exec: bool,
> +) -> std::io::Result<(Vec, StatusResult)>
> +where
> +P: Sync,

`P: AsRef + Sync`.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@43214: 73 new changesets

2019-10-14 Thread Mercurial Commits
73 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/beed7ce61681
changeset:   43142:beed7ce61681
user:Pierre-Yves David 
date:Sun Oct 06 23:36:51 2019 -0400
summary: sidedatacopies: write copies information in sidedata when 
applicable

https://www.mercurial-scm.org/repo/hg/rev/037a8759eda1
changeset:   43143:037a8759eda1
user:Pierre-Yves David 
date:Sun Oct 06 23:36:51 2019 -0400
summary: sidedatacopies: get and store sidedata in the changelogrevision 
object

https://www.mercurial-scm.org/repo/hg/rev/ea230325dc8c
changeset:   43144:ea230325dc8c
user:Pierre-Yves David 
date:Thu Oct 10 00:01:40 2019 +0200
summary: test: fix zstd related output in pure tests

https://www.mercurial-scm.org/repo/hg/rev/4296cc3c4ae1
changeset:   43145:4296cc3c4ae1
user:Pierre-Yves David 
date:Thu Oct 10 00:06:41 2019 +0200
summary: changelog: make copies related function return None or a valid 
value

https://www.mercurial-scm.org/repo/hg/rev/0171483b082f
changeset:   43146:0171483b082f
user:Pierre-Yves David 
date:Wed Oct 09 22:59:38 2019 +0200
summary: sidedatacopies: read rename information from sidedata

https://www.mercurial-scm.org/repo/hg/rev/54e943b28101
changeset:   43147:54e943b28101
user:Pierre-Yves David 
date:Sun Oct 06 23:36:51 2019 -0400
summary: sidedatacopies: move various copies related function to the copies 
modules

https://www.mercurial-scm.org/repo/hg/rev/843da18386d5
changeset:   43148:843da18386d5
user:Pierre-Yves David 
date:Sun Oct 06 23:36:52 2019 -0400
summary: sidedatacopies: deal with upgrading and downgrading to that format

https://www.mercurial-scm.org/repo/hg/rev/2a0774e9d2a8
changeset:   43149:2a0774e9d2a8
user:Augie Fackler 
date:Tue Oct 08 16:18:15 2019 -0400
summary: dirs: fix trivial over-read of input data

https://www.mercurial-scm.org/repo/hg/rev/7ff40418c6bf
changeset:   43150:7ff40418c6bf
user:Augie Fackler 
date:Wed Oct 09 20:48:12 2019 -0700
summary: fuzz: new fuzzer for dirs.c

https://www.mercurial-scm.org/repo/hg/rev/36e386dbbd30
changeset:   43151:36e386dbbd30
user:Augie Fackler 
date:Wed Oct 09 20:49:23 2019 -0700
summary: fuzz: exercise a little more revlog code

https://www.mercurial-scm.org/repo/hg/rev/b37dd26935ee
changeset:   43152:b37dd26935ee
user:Augie Fackler 
date:Wed Oct 09 20:49:39 2019 -0700
summary: fuzz: new fuzzer for fncache-related functions

https://www.mercurial-scm.org/repo/hg/rev/741fb1a95da2
changeset:   43153:741fb1a95da2
user:Augie Fackler 
date:Wed Oct 09 20:49:58 2019 -0700
summary: fuzz: new target to fuzz jsonescapeu8fast

https://www.mercurial-scm.org/repo/hg/rev/f05d10ef42e3
changeset:   43154:f05d10ef42e3
user:Martin von Zweigbergk 
date:Wed Aug 28 17:45:18 2019 -0700
summary: py3: add a missing b'' prefix in test extension for chg

https://www.mercurial-scm.org/repo/hg/rev/a83c9c79b722
changeset:   43155:a83c9c79b722
user:Denis Laxalde 
date:Thu Oct 10 10:03:01 2019 +0200
summary: py3: only flush before prompting during interactive patch filtering

https://www.mercurial-scm.org/repo/hg/rev/0e6a7ce81dde
changeset:   43156:0e6a7ce81dde
user:Denis Laxalde 
date:Thu Oct 10 10:48:57 2019 +0200
summary: py3: use email.generator.BytesGenerator in patch.split()

https://www.mercurial-scm.org/repo/hg/rev/3460eee570f7
changeset:   43157:3460eee570f7
user:Denis Laxalde 
date:Thu Oct 10 10:53:13 2019 +0200
summary: patchbomb: use mail.Generator alias for py2/py3 compat

https://www.mercurial-scm.org/repo/hg/rev/ff615b6b5b8f
changeset:   43158:ff615b6b5b8f
user:Denis Laxalde 
date:Thu Oct 10 12:20:23 2019 +0200
summary: crecord: drop duplicated set of firstlineofpadtoprint attribute

https://www.mercurial-scm.org/repo/hg/rev/b02387005515
changeset:   43159:b02387005515
user:Denis Laxalde 
date:Thu Oct 10 12:22:15 2019 +0200
summary: py3: use integer division in curseschunkselector.printstring()

https://www.mercurial-scm.org/repo/hg/rev/84a950007619
changeset:   43160:84a950007619
user:Pierre-Yves David 
date:Wed Oct 02 18:39:20 2019 -0400
summary: perf: fix `perfhelper-pathcopies` report of #changesets

https://www.mercurial-scm.org/repo/hg/rev/9d57c2df7b5f
changeset:   43161:9d57c2df7b5f
user:Pierre-Yves David 
date:Thu Oct 10 04:48:31 2019 +0200
summary: perf: fix `perfhelper-mergecopies` report of #changesets

https://www.mercurial-scm.org/repo/hg/rev/3c6976b1f693
changeset:   43162:3c6976b1f693
user:Georges Racinet 
date:Thu Oct 10 11:33:33 2019 +0200
summary: py3-discovery: using plain str in stats dict

https://www.mercurial-scm.org/repo/hg/rev/5617b748aad8
changeset:   43163:5617b748aad8
user:Kyle 

Re: [PATCH 1 of 5] rust-cpython: put leaked reference in PyLeakedRef

2019-10-14 Thread Martin von Zweigbergk via Mercurial-devel
Heh, I have no idea which one I queued. I know you said you forgot --flag
V2, so I assumed the two series I saw on patchwork were the same.

On Mon, Oct 14, 2019, 07:17 Yuya Nishihara  wrote:

> On Mon, 14 Oct 2019 10:10:34 +0200, Raphaël Gomès wrote:
> > I think Georges reviewed the other patch series. I'll be taking a closer
> > look at this one as soon as I finish mine.
>
> Perhaps Martin queued the other rust-cpython series which is/was reviewed
> by Georges. Maybe I shouldn't send two series in parallel.
>
> Anyway, thanks for the review.
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6993: black: add a pyproject.toml that contains our black settings

2019-10-14 Thread durin42 (Augie Fackler)
durin42 added a comment.


  Ugh, weird. I think this is an issue around setuptools versions, but I'll try 
and ask dstufft this week. :(

REPOSITORY
  rHG Mercurial

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

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

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


Re: [PATCH 1 of 5] rust-cpython: put leaked reference in PyLeakedRef

2019-10-14 Thread Yuya Nishihara
On Mon, 14 Oct 2019 10:10:34 +0200, Raphaël Gomès wrote:
> I think Georges reviewed the other patch series. I'll be taking a closer
> look at this one as soon as I finish mine.

Perhaps Martin queued the other rust-cpython series which is/was reviewed
by Georges. Maybe I shouldn't send two series in parallel.

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


Re: [PATCH 1 of 7] rust-cpython: add wrapper around decapsule_make_dirstate_tuple()

2019-10-14 Thread Georges Racinet

On 10/13/19 3:46 PM, Yuya Nishihara wrote:
> On Sun, 13 Oct 2019 22:41:37 +0900, Yuya Nishihara wrote:
>> # HG changeset patch
>> # User Yuya Nishihara 
>> # Date 1570953317 -32400
>> #  Sun Oct 13 16:55:17 2019 +0900
>> # Node ID 083f70b7b5899755bb28ce16d6fc45eee46e84e4
>> # Parent  dbe969ca04b9711aa3b244b2dcea9b9925bab960
>> rust-cpython: add wrapper around decapsule_make_dirstate_tuple()
> This is actually V2. I forgot to add --flag V2, sorry.
Someone queued it already, before I could at least run the tests.
Everything looks fine, I'll follow up in a few days with the removal of
py_set().
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

-- 
Georges Racinet
https://octobus.net
GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics




signature.asc
Description: OpenPGP digital signature
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 5] rust-cpython: put leaked reference in PyLeakedRef

2019-10-14 Thread Georges Racinet


Le 14 octobre 2019 10:10:34 GMT+02:00, "Raphaël Gomès" 
 a écrit :
>I think Georges reviewed the other patch series. 
I think you're right

I'll be taking a
>closer 
>look at this one as soon as I finish mine.
>
>On 10/14/19 7:41 AM, Martin von Zweigbergk via Mercurial-devel wrote:
>
>>
>> I'll queue this mostly based on Georges' review, thanks.
>>

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma 
brièveté.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-14 Thread Raphaël Gomès
Alphare updated this revision to Diff 17133.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7058?vs=17132=17133

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

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

AFFECTED FILES
  rust/Cargo.lock
  rust/hg-core/Cargo.toml
  rust/hg-core/src/dirstate.rs
  rust/hg-core/src/dirstate/status.rs
  rust/hg-core/src/lib.rs
  rust/hg-core/src/utils/files.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/utils/files.rs b/rust/hg-core/src/utils/files.rs
--- a/rust/hg-core/src/utils/files.rs
+++ b/rust/hg-core/src/utils/files.rs
@@ -12,6 +12,7 @@
 use crate::utils::hg_path::{HgPath, HgPathBuf};
 use std::iter::FusedIterator;
 
+use std::fs::{read_link, Metadata};
 use std::path::Path;
 
 pub fn get_path_from_bytes(bytes: &[u8]) ->  {
@@ -79,6 +80,57 @@
 path.to_ascii_lowercase()
 }
 
+/// Get name in the case stored in the filesystem
+/// The name should be relative to root, and be normcase-ed for efficiency.
+///
+/// Note that this function is unnecessary, and should not be
+//  called, for case-sensitive filesystems (simply because it's expensive).
+/// The root should be normcase-ed, too.
+pub fn filesystem_path>(root: , path: P) -> HgPathBuf {
+// TODO path for case-insensitive filesystems, for now this is transparent
+root.to_owned().join(path.as_ref())
+}
+
+/// Returns `true` if path refers to an existing path.
+/// Returns `true` for broken symbolic links.
+/// Equivalent to `exists()` on platforms lacking `lstat`.
+pub fn lexists>(path: P) -> bool {
+if !path.as_ref().exists() {
+return read_link(path).is_ok();
+}
+true
+}
+
+#[derive(Eq, PartialEq, Ord, PartialOrd, Copy, Clone)]
+pub struct HgMetadata {
+pub st_dev: u64,
+pub st_mode: u32,
+pub st_nlink: u64,
+pub st_size: u64,
+pub st_mtime: i64,
+pub st_ctime: i64,
+}
+
+impl HgMetadata {
+#[cfg(unix)]
+pub fn from_metadata(metadata: Metadata) -> Self {
+use std::os::linux::fs::MetadataExt;
+Self {
+st_dev: metadata.st_dev(),
+st_mode: metadata.st_mode(),
+st_nlink: metadata.st_nlink(),
+st_size: metadata.st_size(),
+st_mtime: metadata.st_mtime(),
+st_ctime: metadata.st_ctime(),
+}
+}
+#[cfg(not(unix))]
+pub fn from_metdata(metadata: Metadata) -> Self {
+// TODO support other platforms
+unimplemented!()
+}
+}
+
 #[cfg(test)]
 mod tests {
 use super::*;
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
@@ -12,6 +12,7 @@
 dirs_multiset::{DirsMultiset, DirsMultisetIter},
 dirstate_map::DirstateMap,
 parsers::{pack_dirstate, parse_dirstate, PARENT_SIZE},
+status::status,
 CopyMap, CopyMapIter, DirstateEntry, DirstateParents, EntryState,
 StateMap, StateMapIter,
 };
diff --git a/rust/hg-core/src/dirstate/status.rs 
b/rust/hg-core/src/dirstate/status.rs
new file mode 100644
--- /dev/null
+++ b/rust/hg-core/src/dirstate/status.rs
@@ -0,0 +1,254 @@
+// status.rs
+//
+// Copyright 2019 Raphaël Gomès 
+//
+// This software may be used and distributed according to the terms of the
+// GNU General Public License version 2 or any later version.
+
+//! Rust implementation of dirstate.status (dirstate.py).
+//! It is currently missing a lot of functionality compared to the Python one
+//! and will only be triggered in narrow cases.
+
+use crate::utils::files::HgMetadata;
+use crate::utils::hg_path::{hg_path_to_path_buf, HgPathBuf};
+use crate::{DirstateEntry, DirstateMap, EntryState};
+use rayon::prelude::*;
+use std::collections::HashMap;
+use std::fs::Metadata;
+use std::path::Path;
+
+/// Get stat data about the files explicitly specified by match.
+/// TODO subrepos
+fn walk_explicit + Sync>(
+files: Vec,
+dmap:  DirstateMap,
+root_dir: P,
+) -> std::io::Result>> {
+let mut results = HashMap::new();
+
+// A tuple of the normalized filename and the `Result` of the call to
+// `symlink_metadata` for separate handling.
+type WalkTuple<'a> = (&'a HgPathBuf, std::io::Result);
+
+let stats_res: std::io::Result> = files
+.par_iter()
+.map(|filename| {
+// TODO normalization
+let normalized = filename;
+
+let target_filename =
+root_dir.as_ref().join(hg_path_to_path_buf(normalized)?);
+
+Ok((normalized, target_filename.symlink_metadata()))
+})
+.collect();
+
+for res in stats_res? {
+match res {
+(normalized, Ok(stat)) => {
+if stat.is_file() {
+results.insert(
+normalized.to_owned(),
+Some(HgMetadata::from_metadata(stat)),
+);
+} else {
+if dmap.contains_key(normalized) {
+ 

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-14 Thread Raphaël Gomès
Alphare updated this revision to Diff 17132.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7058?vs=17065=17132

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

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

AFFECTED FILES
  rust/Cargo.lock
  rust/hg-core/Cargo.toml
  rust/hg-core/src/dirstate.rs
  rust/hg-core/src/dirstate/status.rs
  rust/hg-core/src/lib.rs
  rust/hg-core/src/utils/files.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/utils/files.rs b/rust/hg-core/src/utils/files.rs
--- a/rust/hg-core/src/utils/files.rs
+++ b/rust/hg-core/src/utils/files.rs
@@ -12,6 +12,7 @@
 use crate::utils::hg_path::{HgPath, HgPathBuf};
 use std::iter::FusedIterator;
 
+use std::fs::{read_link, Metadata};
 use std::path::Path;
 
 pub fn get_path_from_bytes(bytes: &[u8]) ->  {
@@ -79,6 +80,57 @@
 path.to_ascii_lowercase()
 }
 
+/// Get name in the case stored in the filesystem
+/// The name should be relative to root, and be normcase-ed for efficiency.
+///
+/// Note that this function is unnecessary, and should not be
+//  called, for case-sensitive filesystems (simply because it's expensive).
+/// The root should be normcase-ed, too.
+pub fn filesystem_path>(root: , path: P) -> HgPathBuf {
+// TODO path for case-insensitive filesystems, for now this is transparent
+root.to_owned().join(path.as_ref())
+}
+
+/// Returns `true` if path refers to an existing path.
+/// Returns `true` for broken symbolic links.
+/// Equivalent to `exists()` on platforms lacking `lstat`.
+pub fn lexists>(path: P) -> bool {
+if !path.as_ref().exists() {
+return read_link(path).is_ok();
+}
+true
+}
+
+#[derive(Eq, PartialEq, Ord, PartialOrd, Copy, Clone)]
+pub struct HgMetadata {
+pub st_dev: u64,
+pub st_mode: u32,
+pub st_nlink: u64,
+pub st_size: u64,
+pub st_mtime: i64,
+pub st_ctime: i64,
+}
+
+impl HgMetadata {
+#[cfg(unix)]
+pub fn from_metadata(metadata: Metadata) -> Self {
+use std::os::linux::fs::MetadataExt;
+Self {
+st_dev: metadata.st_dev(),
+st_mode: metadata.st_mode(),
+st_nlink: metadata.st_nlink(),
+st_size: metadata.st_size(),
+st_mtime: metadata.st_mtime(),
+st_ctime: metadata.st_ctime(),
+}
+}
+#[cfg(not(unix))]
+pub fn from_metdata(metadata: Metadata) -> Self {
+// TODO support other platforms
+unimplemented!()
+}
+}
+
 #[cfg(test)]
 mod tests {
 use super::*;
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
@@ -12,6 +12,7 @@
 dirs_multiset::{DirsMultiset, DirsMultisetIter},
 dirstate_map::DirstateMap,
 parsers::{pack_dirstate, parse_dirstate, PARENT_SIZE},
+status::status,
 CopyMap, CopyMapIter, DirstateEntry, DirstateParents, EntryState,
 StateMap, StateMapIter,
 };
diff --git a/rust/hg-core/src/dirstate/status.rs 
b/rust/hg-core/src/dirstate/status.rs
new file mode 100644
--- /dev/null
+++ b/rust/hg-core/src/dirstate/status.rs
@@ -0,0 +1,254 @@
+// status.rs
+//
+// Copyright 2019 Raphaël Gomès 
+//
+// This software may be used and distributed according to the terms of the
+// GNU General Public License version 2 or any later version.
+
+//! Rust implementation of dirstate.status (dirstate.py).
+//! It is currently missing a lot of functionality compared to the Python one
+//! and will only be triggered in narrow cases.
+
+use crate::utils::files::HgMetadata;
+use crate::utils::hg_path::{hg_path_to_path_buf, HgPathBuf};
+use crate::{DirstateEntry, DirstateMap, EntryState};
+use rayon::prelude::*;
+use std::collections::HashMap;
+use std::fs::Metadata;
+use std::path::Path;
+
+/// Get stat data about the files explicitly specified by match.
+/// TODO subrepos
+fn walk_explicit + Sync>(
+files: Vec,
+dmap:  DirstateMap,
+root_dir: P,
+) -> std::io::Result>> {
+let mut results = HashMap::new();
+
+// A tuple of the normalized filename and the `Result` of the call to
+// `symlink_metadata` for separate handling.
+type WalkTuple<'a> = (&'a HgPathBuf, std::io::Result);
+
+let stats_res: std::io::Result> = files
+.par_iter()
+.map(|filename| {
+// TODO normalization
+let normalized = filename;
+
+let target_filename =
+root_dir.as_ref().join(hg_path_to_path_buf(normalized)?);
+
+Ok((normalized, target_filename.symlink_metadata()))
+})
+.collect();
+
+for res in stats_res? {
+match res {
+(normalized, Ok(stat)) => {
+if stat.is_file() {
+results.insert(
+normalized.to_owned(),
+Some(HgMetadata::from_metadata(stat)),
+);
+} else {
+if dmap.contains_key(normalized) {
+ 

D7058: rust-dirstate-status: add first Rust implementation of `dirstate.status`

2019-10-14 Thread Raphaël Gomès
Alphare added a comment.
Alphare marked 3 inline comments as done.


  @martinvonz First of all, thanks a lot for starting the Rust reviews, your 
feedback is very helpful.
  
  For most of your comments, I tried cutting out the parts of the 
implementation that were not needed yet but did not go far enough. I'll send a 
new version in a few minutes.

INLINE COMMENTS

> martinvonz wrote in status.rs:22
> Does this need to be public?

It does not, I used to export it to Python to test it.

> martinvonz wrote in status.rs:22-28
> I'm completely new to Rust (just finished going through the tutorial), so 
> please excuse naive questions...
> 
> What's the advantage of splitting up the definition of `P` like this? Why not 
> constrain it as `AsRef + Sync` either on line 22 or line 28?

I added the where clause well after defining the signature, it's indeed better 
to do either one of the two syntax.

> martinvonz wrote in status.rs:33
> Looks like this will end up getting returned. Do we want that? It seems 
> surprising to me.

It gets removed by the caller. I tried to replicate Python code to get close to 
feature-parity, but the more I dive into this, the less convinced I am that the 
Python implementation should really be trusted. I just removed it completely 
since it has no real effect on the current code.

> martinvonz wrote in status.rs:36-38
> Isn't this the same as `vec!(HgPathBuf::new())`? Do we dislike the `vec!` 
> macro? Or macros in general?

It's the same and much cleaner, I just forgot about using this macro since most 
other collections don't have one.

> martinvonz wrote in status.rs:36-38
> What is this case about? If no files are specified, we want to return stat 
> information for the (repo) root directory? That seems surprising. Does the 
> caller depend on that? Does it have to?

I removed this block of code for the same reason as the sentinel above, it's 
not useful yet, and it might never be.

> martinvonz wrote in status.rs:43
> Please add a comment explaining what the type is. What does the outer 
> `Result` mean? What does the `Option` mean? What are the two `HgPathBuf`s? 
> What does the inner `Result` mean?

Although the inner type should be explained (which I did in my next patch), 
most of the time `Result` is easily identifiable by looking at the different 
`?` within the associated scope, which - I think - makes it not really worth it 
to comment.

> martinvonz wrote in status.rs:44
> Do we want to keep the trailing comma?

No. You would think that `rustfmt` should remove those, but apparently not.

> martinvonz wrote in status.rs:54-55
> Do you think it would be easier to read and reason about this whole function 
> if we did up to here in one step and the `symlink_metadata()` in a separate 
> step after? By "step", I mean either in a separate `.map()` or in a separate 
> `par_iter()`. I think it might be easier to follow if any errors from 
> `hg_path_to_path_buf()` were checked earlier.

For performance reasons I don't want to do any more loops than I need to. I'm 
already resorting to a sequential `for` loop right after because I haven't 
found an easy way of collecting into 3 different collections in parallel. 
Overall, I think that the lack of comments is the real issue, this is not too 
complex.

> martinvonz wrote in status.rs:55
> It doesn't matter yet, but should this be `normalized` instead of `filename`?

Good catch!

> martinvonz wrote in status.rs:63
> https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.collect talks 
> about using a "turbofish". I don't know how specific you *want* to be about 
> the type here (do you want all the details on line 44? If not, you can do 
> `.collect::>>();` here instead.

I figured that having the full type written out was more helpful to understand 
the context. I still do, but I need comments as well. You're right that 
collecting into `Result>` is cleaner and compiles just as well however. 
:)

I like to avoid the turbofish when possible because I think that it's harder to 
read that a normal variable type declaration.

> martinvonz wrote in status.rs:65
> The tutorial seemed to put the `?` where the expression was defined, i.e. at 
> the end of line 63 here.  Seems generally better to me so the variable gets a 
> simpler type and so it's only evaluated once even if the variable is used in 
> multiple places. (Maybe changing it requires the turbofish?)

It is indeed preferable to put the `?` where the expression is defined, however 
in certain cases such as this one, the type inference is not good enough. Here, 
we're collecting into a `Result`; changing it to `collect?` into a `Vec` causes 
the compiler to ask us for type annotations.

I could also have a line right after to do `let stats_res = stats_res?;` but I 
don't think it's really useful since we're only using it once.

> martinvonz wrote in status.rs:83
> Are we going to do more here later? If not, we can just drop the 
> `Option`-wrapping in `stats_res` 

Re: [PATCH 1 of 5] rust-cpython: put leaked reference in PyLeakedRef

2019-10-14 Thread Raphaël Gomès
I think Georges reviewed the other patch series. I'll be taking a closer 
look at this one as soon as I finish mine.


On 10/14/19 7:41 AM, Martin von Zweigbergk via Mercurial-devel wrote:



I'll queue this mostly based on Georges' review, thanks.

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


D7085: fix: warn when a fixer doesn't have a configured command

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

REVISION SUMMARY
  It seems we currently produce an empty command line and then decide to
  not run it, but it seems better to skip that part too.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fix.py
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -1338,6 +1338,8 @@
   fixer tool has no pattern configuration: nopattern
   $ cat foo bar
   foobar (no-eol)
+  $ hg fix --debug --working-dir --config "fix.nocommand:pattern=foo.bar"
+  fixer tool has no command configuration: nocommand
 
   $ cd ..
 
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -802,7 +802,11 @@
 # dangerous to let it affect all files. It would be pointless to let it
 # affect no files. There is no reasonable subset of files to use as the
 # default.
-if pattern is None:
+if command is None:
+ui.warn(
+_(b'fixer tool has no command configuration: %s\n') % (name,)
+)
+elif pattern is None:
 ui.warn(
 _(b'fixer tool has no pattern configuration: %s\n') % (name,)
 )



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


D7086: fix: remove a never-true check for unset pattern in Fixer.affects()

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

REVISION SUMMARY
  We don't create an instance of a Fixer if the pattern is None, so we
  don't need to check that in affects().

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -845,9 +845,7 @@
 
 def affects(self, opts, fixctx, path):
 """Should this fixer run on the file at the given path and context?"""
-return self._pattern is not None and scmutil.match(
-fixctx, [self._pattern], opts
-)(path)
+return scmutil.match(fixctx, [self._pattern], opts)(path)
 
 def shouldoutputmetadata(self):
 """Should the stdout of this fixer start with JSON and a null byte?"""



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


D7084: fix: make Fixer initialization more explicit for clarity

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

REVISION SUMMARY
  I found it quite confusing that Fixer accessed fields that seemed like
  they didn't exist.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -132,11 +132,9 @@
 from mercurial.i18n import _
 from mercurial.node import nullrev
 from mercurial.node import wdirrev
-from mercurial.pycompat import setattr
 
 from mercurial.utils import (
 procutil,
-stringutil,
 )
 
 from mercurial import (
@@ -172,9 +170,9 @@
 b'linerange': None,
 b'pattern': None,
 b'priority': 0,
-b'metadata': b'false',
-b'skipclean': b'true',
-b'enabled': b'true',
+b'metadata': False,
+b'skipclean': True,
+b'enabled': True,
 }
 
 for key, default in FIXER_ATTRS.items():
@@ -793,29 +791,27 @@
 """
 fixers = {}
 for name in fixernames(ui):
-fixers[name] = Fixer()
-for key in FIXER_ATTRS:
-setattr(
-fixers[name],
-pycompat.sysstr(b'_' + key),
-ui.config(b'fix', name + b':' + key),
-)
-fixers[name]._priority = int(fixers[name]._priority)
-fixers[name]._metadata = stringutil.parsebool(fixers[name]._metadata)
-fixers[name]._skipclean = stringutil.parsebool(fixers[name]._skipclean)
-fixers[name]._enabled = stringutil.parsebool(fixers[name]._enabled)
+enabled = ui.configbool(b'fix', name + b':enabled')
+command = ui.config(b'fix', name + b':command')
+pattern = ui.config(b'fix', name + b':pattern')
+linerange = ui.config(b'fix', name + b':linerange')
+priority = ui.configint(b'fix', name + b':priority')
+metadata = ui.configbool(b'fix', name + b':metadata')
+skipclean = ui.configbool(b'fix', name + b':skipclean')
 # Don't use a fixer if it has no pattern configured. It would be
 # dangerous to let it affect all files. It would be pointless to let it
 # affect no files. There is no reasonable subset of files to use as the
 # default.
-if fixers[name]._pattern is None:
+if pattern is None:
 ui.warn(
 _(b'fixer tool has no pattern configuration: %s\n') % (name,)
 )
-del fixers[name]
-elif not fixers[name]._enabled:
+elif not enabled:
 ui.debug(b'ignoring disabled fixer tool: %s\n' % (name,))
-del fixers[name]
+else:
+fixers[name] = Fixer(
+command, pattern, linerange, priority, metadata, skipclean
+)
 return collections.OrderedDict(
 sorted(fixers.items(), key=lambda item: item[1]._priority, 
reverse=True)
 )
@@ -833,6 +829,16 @@
 class Fixer(object):
 """Wraps the raw config values for a fixer with methods"""
 
+def __init__(
+self, command, pattern, linerange, priority, metadata, skipclean
+):
+self._command = command
+self._pattern = pattern
+self._linerange = linerange
+self._priority = priority
+self._metadata = metadata
+self._skipclean = skipclean
+
 def affects(self, opts, fixctx, path):
 """Should this fixer run on the file at the given path and context?"""
 return self._pattern is not None and scmutil.match(



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


D7083: fix: don't pass in default value when looking up config

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

REVISION SUMMARY
  The defaults are now registered correctly so we don't need to pass in
  the default value when we look up a config value.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -794,11 +794,11 @@
 fixers = {}
 for name in fixernames(ui):
 fixers[name] = Fixer()
-for key, default in FIXER_ATTRS.items():
+for key in FIXER_ATTRS:
 setattr(
 fixers[name],
 pycompat.sysstr(b'_' + key),
-ui.config(b'fix', name + b':' + key, default),
+ui.config(b'fix', name + b':' + key),
 )
 fixers[name]._priority = int(fixers[name]._priority)
 fixers[name]._metadata = stringutil.parsebool(fixers[name]._metadata)



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


D7082: fix: fix registration of config item defaults

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

REVISION SUMMARY
  Before this patch, because of the "(:)?", all registered
  patterns would match and the default value would not be the one we
  thought we had registered (maybe it just took the default value for
  the first match?). This didn't matter because we didn't care about the
  default value; we used our own, intended default value in getfixers()
  anyway.
  
  We also have to look up each config item individually in order to not
  get developer warnings.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -178,7 +178,7 @@
 }
 
 for key, default in FIXER_ATTRS.items():
-configitem(b'fix', b'.*(:%s)?' % key, default=default, generic=True)
+configitem(b'fix', b'.*:%s$' % key, default=default, generic=True)
 
 # A good default size allows most source code files to be fixed, but avoids
 # letting fixer tools choke on huge inputs, which could be surprising to the
@@ -794,12 +794,11 @@
 fixers = {}
 for name in fixernames(ui):
 fixers[name] = Fixer()
-attrs = ui.configsuboptions(b'fix', name)[1]
 for key, default in FIXER_ATTRS.items():
 setattr(
 fixers[name],
 pycompat.sysstr(b'_' + key),
-attrs.get(key, default),
+ui.config(b'fix', name + b':' + key, default),
 )
 fixers[name]._priority = int(fixers[name]._priority)
 fixers[name]._metadata = stringutil.parsebool(fixers[name]._metadata)



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


Re: [PATCH 1 of 2] patchcopies: give up any optimization based on `introrev`

2019-10-14 Thread Martin von Zweigbergk via Mercurial-devel
I've updated the queued version:

1. ran contrib/grey.py on it (I also did that on one of your
recent perf patches)
2. s/patchcopies/pathcopies/ in the commit message

On Sun, Oct 13, 2019 at 9:10 PM Yuya Nishihara  wrote:

> On Sun, 13 Oct 2019 23:02:25 +0200, Pierre-Yves David wrote:
> > On 10/13/19 12:08 PM, Yuya Nishihara wrote:
> > > On Fri, 11 Oct 2019 20:00:58 +0200, Pierre-Yves David wrote:
> > >> On 10/11/19 2:02 PM, Yuya Nishihara wrote:
> > >>> On Fri, 11 Oct 2019 01:04:12 +0200, Pierre-Yves David wrote:
> >  # HG changeset patch
> >  # User Pierre-Yves David 
> >  # Date 1570672173 -7200
> >  #  Thu Oct 10 03:49:33 2019 +0200
> >  # Node ID 2477ba483c04067900d1e9f6523b03df68a4d545
> >  # Parent  8ff1ecfadcd110849c47c77e31c92809eea466ab
> >  # EXP-Topic patchcopies-regression
> >  # Available At https://bitbucket.org/octobus/mercurial-devel/
> >  #  hg pull
> https://bitbucket.org/octobus/mercurial-devel/ -r 2477ba483c04
> >  patchcopies: give up any optimization based on `introrev`
> > 
> >  Between 8a0136f69027 and d98fb3f42f33, we sped up the search for the
> >  introduction revision during path copies. However, further checking
> show that
> >  finding the introduction revision is still expensive and that we
> are better off
> >  without it. So we simply drop it and only rely on the linkrev
> optimisation.
> > 
> >  I ran `perfpathcopies` on 6989 pair of revision in the pypy
> >  repository (`hg perfhelper-pathcopies`. The result is massively in
> favor of
> >  dropping this condition. The result of the copy tracing are
> unchanged.
> > 
> >  Attempt to use a smaller changes preserving linkrev usage were
> unsuccessful, it
> >  can return wrong result. The following changesets broke
> test-mv-cp-st-diff.t
> > 
> >    -if not f.isintroducedafter(limit):
> >    +if limit >= 0 and f.linkrev() < limit:
> > return None
> > >>>
> > >>> Sure. I meant comparing linkrevs, not linkrev vs (changelog) rev. If
> both
> > >>> arms were linkrevs, and if the limit pointed to the revision where
> the
> > >>> linkrevs of its files are guaranteed to be the lowest, the comparison
> > >>> (e.g. f.linkrev() < repo[limit][path].linkrev()) would work.
> > >>>
> > >>> My question was whether it would make things fast or not.
> > >>
> > >> Ha, I understand your proposal better now.
> > >>
> > >> My testing of the version in this patch versus the "wrong" version
> using
> > >> linkrev too agressively did not show a significant difference (-1%).
> > >
> > > Do you mean only 1% speedup or measurable speedup on 1% cases? I don't
> think
> > > the former is significant, but the latter could be depending on use
> cases.
> >
> > only ±1% speedup for all (many) cases I looked at.
> >
> > >> So
> > >> I don't it to raise anything better. Can we move forward with this
> > >> series and maybe try a different approach later ?
> > >
> > > Better to leave the _findlimit() function? Or won't it be any useful in
> > > your future work?
> >
> > That seems easy enough t reintroduce later if needed. My current
> > optimization work focus on the changeset based copies tracing algorithm.
> > I don't think I'll spend much time on the filelog based one.
>
> Fair enough. Queued the series, thanks.
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel