D12195: obsolete: don't use os.stat in repo.obsstore.__nonzero__ if it's static HTTP

2022-02-15 Thread av6 (Anton Shestakov)
av6 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  If a repo is accessed via static HTTP, then we obviously can't use os.stat() 
to
  just peek at the file size. Let's download the entire file to check its size.
  Yes, this feels wasteful, but:
  
  1. If we're cloning or pulling a repo from a static HTTP server, we need the 
contents of the obsstore anyway.
  
  2. Implementing statichttpvfs.stat() that uses HEAD will result in one more 
request to a static-only HTTP server, which is already slow. Also parsing a 
response to a HEAD request to construct os.stat_result is pretty hacky. There's 
also a question of the remote server properly supporting HEAD method and 
reporting at least file size.
  
  3. Implementing statichttpvfs.stat() that uses GET is pretty much the same 
thing as we do here, except we can't even cache the response easily, unlike 
simply accessing obsstore._data, which is @propertycache'd.
  
  Importing statichttprepo locally to avoid circular import.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/obsolete.py

CHANGE DETAILS

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -575,11 +575,16 @@
 return len(self._all)
 
 def __nonzero__(self):
+from . import statichttprepo
+if isinstance(self.repo, statichttprepo.statichttprepository):
+# If repo is accessed via static HTTP, then we can't use os.stat()
+# to just peek at the file size.
+return self._data > 1
 if not self._cached('_all'):
 try:
 return self.svfs.stat(b'obsstore').st_size > 1
 except OSError as inst:
-if inst.errno not in (errno.ENOENT, errno.EINVAL):
+if inst.errno != errno.ENOENT:
 raise
 # just build an empty _all list if no obsstore exists, which
 # avoids further stat() syscalls



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


mercurial@48746: 3 new changesets

2022-02-15 Thread Mercurial Commits
3 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/6e930bc45aeb
changeset:   48744:6e930bc45aeb
parent:  48738:00efd2d5037d
user:Simon Sapin 
date:Mon Feb 14 18:51:43 2022 +0100
summary: rust: remove unused `StatusError::IO` enum variant

https://www.mercurial-scm.org/repo/hg/rev/94e36b230990
changeset:   48745:94e36b230990
user:Simon Sapin 
date:Fri Jan 21 17:54:03 2022 +0100
summary: status: prefer relative paths in Rust code

https://www.mercurial-scm.org/repo/hg/rev/18e69f224e4b
changeset:   48746:18e69f224e4b
bookmark:@
tag: tip
user:Pierre-Yves David 
date:Thu Feb 03 18:14:25 2022 +0100
summary: narrow: add support for merging add and remove outside of the 
tracked set

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


mercurial@48743: 5 new changesets (5 on stable)

2022-02-15 Thread Mercurial Commits
5 new changesets (5 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/aeeb54261099
changeset:   48739:aeeb54261099
branch:  stable
parent:  48727:6e5ab1673020
user:Mathias De Mare 
date:Mon Feb 14 11:32:03 2022 +0100
summary: packaging: replace centos8 by rockylinux 8

https://www.mercurial-scm.org/repo/hg/rev/6387562e68b3
changeset:   48740:6387562e68b3
branch:  stable
user:Mathias De Mare 
date:Tue Feb 15 15:33:33 2022 +0100
summary: contrib: refer to RHEL and derivatives instead of CentOS 
specifically

https://www.mercurial-scm.org/repo/hg/rev/46d12f7762e4
changeset:   48741:46d12f7762e4
branch:  stable
user:Raphaël Gomès 
date:Fri Feb 11 23:43:17 2022 +0100
summary: dirstate-v2: fix infinite loop in pure packer

https://www.mercurial-scm.org/repo/hg/rev/090346b095fb
changeset:   48742:090346b095fb
branch:  stable
user:Raphaël Gomès 
date:Mon Feb 14 19:03:22 2022 +0100
summary: hghave: update rustfmt criterion

https://www.mercurial-scm.org/repo/hg/rev/a1538c05d855
changeset:   48743:a1538c05d855
branch:  stable
tag: tip
user:Raphaël Gomès 
date:Tue Feb 15 15:52:44 2022 +0100
summary: copyright: it's 2022

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


D12194: filemerge: remove unused `repo` argument from `_maketempfiles()`

2022-02-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I missed this in D12171 .

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -745,7 +745,7 @@
 args = _toolstr(repo.ui, tool, b"args")
 
 with _maketempfiles(
-repo, fco, fca, repo.wvfs.join(backup.path()), b"$output" in args
+fco, fca, repo.wvfs.join(backup.path()), b"$output" in args
 ) as temppaths:
 basepath, otherpath, localoutputpath = temppaths
 outpath = b""
@@ -921,7 +921,7 @@
 
 
 @contextlib.contextmanager
-def _maketempfiles(repo, fco, fca, localpath, uselocalpath):
+def _maketempfiles(fco, fca, localpath, uselocalpath):
 """Writes out `fco` and `fca` as temporary files, and (if uselocalpath)
 copies `localpath` to another temporary file, so an external merge tool may
 use them.



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


D12193: filemerge: make `_maketempfiles()` more reusable

2022-02-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  `_maketempfiles()` is very specialized for its current use. I hope to
  use it also when creating temporary files for input for tools that do
  partial conflict resolution. That'll be possible if the function is
  more generic. Instead of passing in two contexts (for "other" and
  "base") and an optional path (for "local"), let's pass a single list
  of files to make backups for. Even if we don't end up using for
  partial conflict resolution, this is still a simplification (but I do
  have a WIP patch for partial conflict resolution and it is able to
  benefit from this).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -742,20 +742,26 @@
 return False, 1, None
 localpath = _workingpath(repo, fcd)
 args = _toolstr(repo.ui, tool, b"args")
-localoutputpath = None
+
+files = [
+(b"base", fca.path(), fca.decodeddata()),
+(b"other", fco.path(), fco.decodeddata()),
+]
+outpath = b""
 if b"$output" in args:
+# read input from backup, write to original
+outpath = localpath
 localoutputpath = backup.path()
 # Remove the .orig to make syntax-highlighting more likely.
 if localoutputpath.endswith(b'.orig'):
 localoutputpath, ext = os.path.splitext(localoutputpath)
+localdata = util.readfile(localpath)
+files.append((b"local", localoutputpath, localdata))
 
-with _maketempfiles(
-fco,
-fca,
-localoutputpath,
-) as temppaths:
-basepath, otherpath, localoutputpath = temppaths
-outpath = b""
+with _maketempfiles(files) as temppaths:
+basepath, otherpath = temppaths[:2]
+if len(temppaths) == 3:
+localpath = temppaths[2]
 
 def format_label(input):
 if input.label_detail:
@@ -777,10 +783,6 @@
 }
 ui = repo.ui
 
-if b"$output" in args:
-# read input from backup, write to original
-outpath = localpath
-localpath = localoutputpath
 replace = {
 b'local': localpath,
 b'base': basepath,
@@ -915,10 +917,9 @@
 
 
 @contextlib.contextmanager
-def _maketempfiles(fco, fca, localpath):
-"""Writes out `fco` and `fca` as temporary files, and (if localpath is not
-None) copies `localpath` to another temporary file, so an external merge
-tool may use them.
+def _maketempfiles(files):
+"""Creates a temporary file for each (prefix, path, data) tuple in `files`,
+so an external merge tool may use them.
 """
 tmproot = pycompat.mkdtemp(prefix=b'hgmerge-')
 
@@ -931,18 +932,11 @@
 util.writefile(name, data)
 return name
 
-def tempfromcontext(prefix, ctx):
-return maketempfrompath(prefix, ctx.path(), ctx.decodeddata())
-
-b = tempfromcontext(b"base", fca)
-c = tempfromcontext(b"other", fco)
-d = localpath
-if localpath is not None:
-data = util.readfile(localpath)
-d = maketempfrompath(b"local", localpath, data)
-
+temp_files = []
+for prefix, path, data in files:
+temp_files.append(maketempfrompath(prefix, path, data))
 try:
-yield b, c, d
+yield temp_files
 finally:
 shutil.rmtree(tmproot)
 



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


D12192: filemerge: reduce some duplication in `_maketempfiles()`

2022-02-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The two callers of the local `maketempfrompath()` function used the
  returned file object in the same way. We can reduce duplication by
  moving that code into the function.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -19,7 +19,6 @@
 )
 from .pycompat import (
 getattr,
-open,
 )
 
 from . import (
@@ -923,30 +922,24 @@
 """
 tmproot = pycompat.mkdtemp(prefix=b'hgmerge-')
 
-def maketempfrompath(prefix, path):
+def maketempfrompath(prefix, path, data):
 fullbase, ext = os.path.splitext(path)
 pre = b"%s~%s" % (os.path.basename(fullbase), prefix)
 name = os.path.join(tmproot, pre)
 if ext:
 name += ext
-f = open(name, "wb")
-return f, name
+util.writefile(name, data)
+return name
 
 def tempfromcontext(prefix, ctx):
-f, name = maketempfrompath(prefix, ctx.path())
-data = ctx.decodeddata()
-f.write(data)
-f.close()
-return name
+return maketempfrompath(prefix, ctx.path(), ctx.decodeddata())
 
 b = tempfromcontext(b"base", fca)
 c = tempfromcontext(b"other", fco)
 d = localpath
 if localpath is not None:
-f, d = maketempfrompath(b"local", d)
 data = util.readfile(localpath)
-f.write(data)
-f.close()
+d = maketempfrompath(b"local", localpath, data)
 
 try:
 yield b, c, d



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


D12191: filemerge: use leverage `util.readfile()` in `_maketempfiles()`

2022-02-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -944,8 +944,8 @@
 d = localpath
 if localpath is not None:
 f, d = maketempfrompath(b"local", d)
-with open(localpath, b'rb') as src:
-f.write(src.read())
+data = util.readfile(localpath)
+f.write(data)
 f.close()
 
 try:



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


D12190: filemerge: move removal of `.orig` extension on temp file close to context

2022-02-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The place where the `.orig` extension is removed in `_maketempfiles()`
  doesn't make it clear that it's the backup path, which is why we have
  a comment in the code explaining it. Let's instead move it out of the
  function and close to where we get it from `backup.path()`, so that
  becomes clear.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -746,6 +746,9 @@
 localoutputpath = None
 if b"$output" in args:
 localoutputpath = backup.path()
+# Remove the .orig to make syntax-highlighting more likely.
+if localoutputpath.endswith(b'.orig'):
+localoutputpath, ext = os.path.splitext(localoutputpath)
 
 with _maketempfiles(
 fco,
@@ -940,10 +943,6 @@
 c = tempfromcontext(b"other", fco)
 d = localpath
 if localpath is not None:
-# We start off with this being the backup filename, so remove the .orig
-# to make syntax-highlighting more likely.
-if d.endswith(b'.orig'):
-d, _ = os.path.splitext(d)
 f, d = maketempfrompath(b"local", d)
 with open(localpath, b'rb') as src:
 f.write(src.read())



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


D12189: filemerge: remove `uselocalpath` argument from `_maketempfiles()`

2022-02-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The `localpath` argument is unused if `uselocalpath` is false, so we
  can use `None` as a sentinel value for the variable instead and remove
  extra `uselocalpath` argument. That's not much of a win, but it's a
  small step towards further improvements.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -743,9 +743,14 @@
 return False, 1, None
 localpath = _workingpath(repo, fcd)
 args = _toolstr(repo.ui, tool, b"args")
+localoutputpath = None
+if b"$output" in args:
+localoutputpath = backup.path()
 
 with _maketempfiles(
-fco, fca, backup.path(), b"$output" in args
+fco,
+fca,
+localoutputpath,
 ) as temppaths:
 basepath, otherpath, localoutputpath = temppaths
 outpath = b""
@@ -908,10 +913,10 @@
 
 
 @contextlib.contextmanager
-def _maketempfiles(fco, fca, localpath, uselocalpath):
-"""Writes out `fco` and `fca` as temporary files, and (if uselocalpath)
-copies `localpath` to another temporary file, so an external merge tool may
-use them.
+def _maketempfiles(fco, fca, localpath):
+"""Writes out `fco` and `fca` as temporary files, and (if localpath is not
+None) copies `localpath` to another temporary file, so an external merge
+tool may use them.
 """
 tmproot = pycompat.mkdtemp(prefix=b'hgmerge-')
 
@@ -934,7 +939,7 @@
 b = tempfromcontext(b"base", fca)
 c = tempfromcontext(b"other", fco)
 d = localpath
-if uselocalpath:
+if localpath is not None:
 # We start off with this being the backup filename, so remove the .orig
 # to make syntax-highlighting more likely.
 if d.endswith(b'.orig'):



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


D12188: filemerge: remove an unnecessary join with absolute path

2022-02-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The `backup` path is now always absolute, so we don't need to join it
  with the working copy path.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -745,7 +745,7 @@
 args = _toolstr(repo.ui, tool, b"args")
 
 with _maketempfiles(
-fco, fca, repo.wvfs.join(backup.path()), b"$output" in args
+fco, fca, backup.path(), b"$output" in args
 ) as temppaths:
 basepath, otherpath, localoutputpath = temppaths
 outpath = b""



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


D12187: filemerge: when using in-memory merge, always put backup files in temp dir

2022-02-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Before calling a merge tool, we create a backup of the local side of
  the merge. That file can be put in the working copy or in a temporary
  directory, depending on the user's config. When we're merging in
  memory, we don't want to write to the actual, on-disk working copy, so
  we write the file to the in-memory working copy instead. However,
  since we don't support external merge tools with in-memory merge, it
  makes no difference where the file is actually stored (and if we ever
  do add support for external merge tools, then the file clearly can't
  live in the in-memory working-copy object anyway). So, since it
  doesn't matter where the file is stored, we can simplify by always
  putting them in the system's temp directory.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -877,7 +877,7 @@
 }
 
 
-def _makebackup(repo, ui, wctx, fcd):
+def _makebackup(repo, ui, fcd):
 """Makes and returns a filectx-like object for ``fcd``'s backup file.
 
 In addition to preserving the user's pre-existing modifications to `fcd`
@@ -894,30 +894,17 @@
 # merge -> filemerge). (I suspect the fileset import is the weakest link)
 from . import context
 
-backup = scmutil.backuppath(ui, repo, fcd.path())
-inworkingdir = backup.startswith(repo.wvfs.base) and not backup.startswith(
-repo.vfs.base
-)
-if isinstance(fcd, context.overlayworkingfilectx) and inworkingdir:
-# If the backup file is to be in the working directory, and we're
-# merging in-memory, we must redirect the backup to the memory context
-# so we don't disturb the working directory.
-relpath = backup[len(repo.wvfs.base) + 1 :]
-wctx[relpath].write(fcd.data(), fcd.flags())
-return wctx[relpath]
+if isinstance(fcd, context.overlayworkingfilectx):
+# If we're merging in-memory, we're free to put the backup anywhere.
+fd, backup = pycompat.mkstemp(b'hg-merge-backup')
+with os.fdopen(fd, 'wb') as f:
+f.write(fcd.data())
 else:
-# Otherwise, write to wherever path the user specified the backups
-# should go. We still need to switch based on whether the source is
-# in-memory so we can use the fast path of ``util.copy`` if both are
-# on disk.
-if isinstance(fcd, context.overlayworkingfilectx):
-util.writefile(backup, fcd.data())
-else:
-a = _workingpath(repo, fcd)
-util.copyfile(a, backup)
-# A arbitraryfilectx is returned, so we can run the same functions on
-# the backup context regardless of where it lives.
-return context.arbitraryfilectx(backup, repo=repo)
+backup = scmutil.backuppath(ui, repo, fcd.path())
+a = _workingpath(repo, fcd)
+util.copyfile(a, backup)
+
+return context.arbitraryfilectx(backup, repo=repo)
 
 
 @contextlib.contextmanager
@@ -1065,7 +1052,7 @@
 ui.warn(onfailure % fduipath)
 return 1, False
 
-backup = _makebackup(repo, ui, wctx, fcd)
+backup = _makebackup(repo, ui, fcd)
 r = 1
 try:
 internalmarkerstyle = ui.config(b'ui', b'mergemarkers')



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


D12186: sparse: add timing block for parsing sparse configs

2022-02-15 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This was showing up in an operation I was doing today, and I'd like to
  be able to get trace spans for it instead of just profiler samples.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/sparse.py

CHANGE DETAILS

diff --git a/mercurial/sparse.py b/mercurial/sparse.py
--- a/mercurial/sparse.py
+++ b/mercurial/sparse.py
@@ -38,63 +38,66 @@
 
 Returns a tuple of includes, excludes, and profiles.
 """
-includes = set()
-excludes = set()
-profiles = set()
-current = None
-havesection = False
+with util.timedcm(
+'sparse.parseconfig(ui, %d bytes, action=%s)', len(raw), action
+):
+includes = set()
+excludes = set()
+profiles = set()
+current = None
+havesection = False
 
-for line in raw.split(b'\n'):
-line = line.strip()
-if not line or line.startswith(b'#'):
-# empty or comment line, skip
-continue
-elif line.startswith(b'%include '):
-line = line[9:].strip()
-if line:
-profiles.add(line)
-elif line == b'[include]':
-if havesection and current != includes:
-# TODO pass filename into this API so we can report it.
-raise error.Abort(
-_(
-b'%(action)s config cannot have includes '
-b'after excludes'
+for line in raw.split(b'\n'):
+line = line.strip()
+if not line or line.startswith(b'#'):
+# empty or comment line, skip
+continue
+elif line.startswith(b'%include '):
+line = line[9:].strip()
+if line:
+profiles.add(line)
+elif line == b'[include]':
+if havesection and current != includes:
+# TODO pass filename into this API so we can report it.
+raise error.Abort(
+_(
+b'%(action)s config cannot have includes '
+b'after excludes'
+)
+% {b'action': action}
 )
-% {b'action': action}
-)
-havesection = True
-current = includes
-continue
-elif line == b'[exclude]':
-havesection = True
-current = excludes
-elif line:
-if current is None:
-raise error.Abort(
-_(
-b'%(action)s config entry outside of '
-b'section: %(line)s'
+havesection = True
+current = includes
+continue
+elif line == b'[exclude]':
+havesection = True
+current = excludes
+elif line:
+if current is None:
+raise error.Abort(
+_(
+b'%(action)s config entry outside of '
+b'section: %(line)s'
+)
+% {b'action': action, b'line': line},
+hint=_(
+b'add an [include] or [exclude] line '
+b'to declare the entry type'
+),
 )
-% {b'action': action, b'line': line},
-hint=_(
-b'add an [include] or [exclude] line '
-b'to declare the entry type'
-),
-)
 
-if line.strip().startswith(b'/'):
-ui.warn(
-_(
-b'warning: %(action)s profile cannot use'
-b' paths starting with /, ignoring %(line)s\n'
+if line.strip().startswith(b'/'):
+ui.warn(
+_(
+b'warning: %(action)s profile cannot use'
+b' paths starting with /, ignoring %(line)s\n'
+)
+% {b'action': action, b'line': line}
 )
-% {b'action': action, b'line': line}
-)
-continue
-current.add(line)
+continue
+current.add(line)
 
-return includes, excludes, profiles
+return includes, excludes, profiles
 
 
 # Exists as separate function to facilitate monkeypatching.



To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___

D12185: narrowspec: add timing block for validating narrowspec

2022-02-15 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This was showing up in an operation I was doing today, and I'd like to
  be able to get trace spans for it instead of just profiler samples.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/narrowspec.py

CHANGE DETAILS

diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -109,23 +109,24 @@
 and patterns that are loaded from sources that use the internal,
 prefixed pattern representation (but can't necessarily be fully trusted).
 """
-if not isinstance(pats, set):
-raise error.ProgrammingError(
-b'narrow patterns should be a set; got %r' % pats
-)
+with util.timedcm('narrowspec.validatepatterns(pats size=%d)', len(pats)):
+if not isinstance(pats, set):
+raise error.ProgrammingError(
+b'narrow patterns should be a set; got %r' % pats
+)
 
-for pat in pats:
-if not pat.startswith(VALID_PREFIXES):
-# Use a Mercurial exception because this can happen due to user
-# bugs (e.g. manually updating spec file).
-raise error.Abort(
-_(b'invalid prefix on narrow pattern: %s') % pat,
-hint=_(
-b'narrow patterns must begin with one of '
-b'the following: %s'
+for pat in pats:
+if not pat.startswith(VALID_PREFIXES):
+# Use a Mercurial exception because this can happen due to user
+# bugs (e.g. manually updating spec file).
+raise error.Abort(
+_(b'invalid prefix on narrow pattern: %s') % pat,
+hint=_(
+b'narrow patterns must begin with one of '
+b'the following: %s'
+)
+% b', '.join(VALID_PREFIXES),
 )
-% b', '.join(VALID_PREFIXES),
-)
 
 
 def format(includes, excludes):



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


mercurial-devel | Failed pipeline for branch/default | b4fcfa0c

2022-02-15 Thread Heptapod


Pipeline #34925 has failed!

Project: mercurial-devel ( https://foss.heptapod.net/mercurial/mercurial-devel )
Branch: branch/default ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/commits/branch/default )

Commit: b4fcfa0c ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/commit/b4fcfa0c3dac6a331616b9ffb19d9b6d367a83df
 )
Commit Message: revlog: register changelogv2 C implementation i...
Commit Author: Pacien TRAN-GIRARD ( https://foss.heptapod.net/pacien )

Pipeline #34925 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/pipelines/34925 ) 
triggered by Administrator ( https://foss.heptapod.net/root )
had 1 failed job.

Job #341537 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/341537/raw )

Stage: tests
Name: rust-cargo-test-py2

-- 
You're receiving this email because of your account on foss.heptapod.net.



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


mercurial-devel | Failed pipeline for branch/stable | ffa23f1d

2022-02-15 Thread Heptapod


Pipeline #34918 has failed!

Project: mercurial-devel ( https://foss.heptapod.net/mercurial/mercurial-devel )
Branch: branch/stable ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/commits/branch/stable )

Commit: ffa23f1d ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/commit/ffa23f1d301b8ed2dea591da35bb2bdefa60995c
 )
Commit Message: contrib: refer to RHEL and derivatives instead ...
Commit Author: Mathias De Mare ( https://foss.heptapod.net/mathias.de_mare )

Pipeline #34918 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/pipelines/34918 ) 
triggered by Raphaël Gomès ( https://foss.heptapod.net/raphael.gomes )
had 1 failed job.

Job #341436 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/341436/raw )

Stage: tests
Name: test-py2-pure

-- 
You're receiving this email because of your account on foss.heptapod.net.



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


D12184: dirstate-tracked-key: update the config value to match latest discussion

2022-02-15 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Special cases are not special enough, we align the option name on the other.
  
  The `version` value is undocumented for now as it can only have a single 
value.
  It is supported in the code to properly detect and abort if more value are
  introduced in the future value.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/configitems.py
  mercurial/helptext/config.txt
  mercurial/localrepo.py
  tests/test-help.t
  tests/test-status-tracked-key.t

CHANGE DETAILS

diff --git a/tests/test-status-tracked-key.t b/tests/test-status-tracked-key.t
--- a/tests/test-status-tracked-key.t
+++ b/tests/test-status-tracked-key.t
@@ -9,7 +9,7 @@
 
   $ cat << EOF >> $HGRCPATH
   > [format]
-  > exp-dirstate-tracked-key-version=1
+  > dirstate-tracked-key=yes
   > EOF
 
   $ hg init tracked-key-test
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -1599,7 +1599,7 @@
   
   "use-dirstate-v2"
   
-  "exp-dirstate-tracked-key-version"
+  "dirstate-tracked-key"
   
   "use-persistent-nodemap"
   
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -3695,14 +3695,12 @@
 else:
 requirements.add(requirementsmod.SHARED_REQUIREMENT)
 
-tracked_key = ui.configint(b'format', b'exp-dirstate-tracked-key-version')
-if tracked_key:
-if tracked_key != 1:
-msg = _("ignoring unknown tracked key version: %d\n")
-hint = _(
-"see `hg help config.format.exp-dirstate-tracked-key-version"
-)
-ui.warn(msg % tracked_key, hint=hint)
+if ui.configbool(b'format', b'dirstate-tracked-key'):
+version = ui.configint(b'format', b'dirstate-tracked-key.version')
+msg = _("ignoring unknown tracked key version: %d\n")
+hint = _("see `hg help config.format.exp-dirstate-tracked-key-version")
+if version != 1:
+ui.warn(msg % version, hint=hint)
 else:
 requirements.add(requirementsmod.DIRSTATE_TRACKED_KEY_V1)
 
diff --git a/mercurial/helptext/config.txt b/mercurial/helptext/config.txt
--- a/mercurial/helptext/config.txt
+++ b/mercurial/helptext/config.txt
@@ -944,16 +944,13 @@
 
 For a more comprehensive guide, see :hg:`help internals.dirstate-v2`.
 
-``exp-dirstate-tracked-key-version``
+``dirstate-tracked-key``
 Enable or disable the writing of "tracked key" file alongside the dirstate.
+(default to disabled)
 
 That "tracked-key" can help external automations to detect changes to the
 set of tracked files.
 
-Two values are currently supported:
-- 0: no file is written (the default),
-- 1: a file in version "1" is written.
-
 The tracked-key is written in a new `.hg/dirstate-tracked-key`. That file
 contains two lines:
 - the first line is the file version (currently: 1),
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -1284,8 +1284,14 @@
 )
 coreconfigitem(
 b'format',
-b'exp-dirstate-tracked-key-version',
-default=0,
+b'dirstate-tracked-key',
+default=False,
+experimental=True,
+)
+coreconfigitem(
+b'format',
+b'dirstate-tracked-key.version',
+default=1,
 experimental=True,
 )
 coreconfigitem(



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


mercurial-devel | Failed pipeline for branch/default | b431c37d

2022-02-15 Thread Heptapod


Pipeline #34917 has failed!

Project: mercurial-devel ( https://foss.heptapod.net/mercurial/mercurial-devel )
Branch: branch/default ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/commits/branch/default )

Commit: b431c37d ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/commit/b431c37d71acdee70d7495cfcf96cdc48fc09618
 )
Commit Message: revlog: register changelogv2 C implementation i...
Commit Author: Pacien TRAN-GIRARD ( https://foss.heptapod.net/pacien )

Pipeline #34917 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/pipelines/34917 ) 
triggered by Administrator ( https://foss.heptapod.net/root )
had 7 failed jobs.

Job #341424 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/341424/raw )

Stage: tests
Name: test-py2-chg
Job #341418 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/341418/raw )

Stage: tests
Name: test-py3
Job #341417 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/341417/raw )

Stage: tests
Name: test-py2
Job #341421 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/341421/raw )

Stage: tests
Name: test-py2-rust
Job #341422 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/341422/raw )

Stage: tests
Name: test-py3-rust
Job #341423 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/341423/raw )

Stage: tests
Name: test-py3-rhg
Job #341425 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/341425/raw )

Stage: tests
Name: test-py3-chg

-- 
You're receiving this email because of your account on foss.heptapod.net.



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


D12183: copyright: it's 2022

2022-02-15 Thread Raphaël Gomès
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  contrib/packaging/debian/copyright
  contrib/packaging/inno/mercurial.iss
  contrib/win32/ReadMe.html
  mercurial/commands.py
  mercurial/helptext/hg.1.txt
  mercurial/helptext/hgignore.5.txt
  mercurial/helptext/hgrc.5.txt
  mercurial/utils/urlutil.py
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1722,7 +1722,7 @@
 extra['console'] = [
 {
 'script': 'hg',
-'copyright': 'Copyright (C) 2005-2021 Olivia Mackall and others',
+'copyright': 'Copyright (C) 2005-2022 Olivia Mackall and others',
 'product_version': version,
 }
 ]
diff --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py
--- a/mercurial/utils/urlutil.py
+++ b/mercurial/utils/urlutil.py
@@ -1,6 +1,6 @@
 # utils.urlutil - code related to [paths] management
 #
-# Copyright 2005-2021 Olivia Mackall  and others
+# Copyright 2005-2022 Olivia Mackall  and others
 #
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
diff --git a/mercurial/helptext/hgrc.5.txt b/mercurial/helptext/hgrc.5.txt
--- a/mercurial/helptext/hgrc.5.txt
+++ b/mercurial/helptext/hgrc.5.txt
@@ -34,7 +34,7 @@
 Copying
 ===
 This manual page is copyright 2005 Bryan O'Sullivan.
-Mercurial is copyright 2005-2021 Olivia Mackall.
+Mercurial is copyright 2005-2022 Olivia Mackall.
 Free use of this software is granted under the terms of the GNU General
 Public License version 2 or any later version.
 
diff --git a/mercurial/helptext/hgignore.5.txt 
b/mercurial/helptext/hgignore.5.txt
--- a/mercurial/helptext/hgignore.5.txt
+++ b/mercurial/helptext/hgignore.5.txt
@@ -26,7 +26,7 @@
 Copying
 ===
 This manual page is copyright 2006 Vadim Gelfer.
-Mercurial is copyright 2005-2021 Olivia Mackall.
+Mercurial is copyright 2005-2022 Olivia Mackall.
 Free use of this software is granted under the terms of the GNU General
 Public License version 2 or any later version.
 
diff --git a/mercurial/helptext/hg.1.txt b/mercurial/helptext/hg.1.txt
--- a/mercurial/helptext/hg.1.txt
+++ b/mercurial/helptext/hg.1.txt
@@ -112,7 +112,7 @@
 
 Copying
 """
-Copyright (C) 2005-2021 Olivia Mackall.
+Copyright (C) 2005-2022 Olivia Mackall.
 Free use of this software is granted under the terms of the GNU General
 Public License version 2 or any later version.
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -7928,7 +7928,7 @@
 )
 license = _(
 b"(see https://mercurial-scm.org for more information)\n"
-b"\nCopyright (C) 2005-2021 Olivia Mackall and others\n"
+b"\nCopyright (C) 2005-2022 Olivia Mackall and others\n"
 b"This is free software; see the source for copying conditions. "
 b"There is NO\nwarranty; "
 b"not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
diff --git a/contrib/win32/ReadMe.html b/contrib/win32/ReadMe.html
--- a/contrib/win32/ReadMe.html
+++ b/contrib/win32/ReadMe.html
@@ -140,7 +140,7 @@
 
 
 
-  Mercurial is Copyright 2005-2021 Olivia Mackall and others.
+  Mercurial is Copyright 2005-2022 Olivia Mackall and others.
 
 
 
diff --git a/contrib/packaging/inno/mercurial.iss 
b/contrib/packaging/inno/mercurial.iss
--- a/contrib/packaging/inno/mercurial.iss
+++ b/contrib/packaging/inno/mercurial.iss
@@ -6,7 +6,7 @@
 #endif
 
 [Setup]
-AppCopyright=Copyright 2005-2021 Olivia Mackall and others
+AppCopyright=Copyright 2005-2022 Olivia Mackall and others
 AppName=Mercurial
 AppVersion={#VERSION}
 OutputBaseFilename=Mercurial-{#VERSION}{#SUFFIX}
@@ -29,7 +29,7 @@
 DefaultDirName={pf}\Mercurial
 SourceDir=stage
 VersionInfoDescription=Mercurial distributed SCM (version {#VERSION})
-VersionInfoCopyright=Copyright 2005-2021 Olivia Mackall and others
+VersionInfoCopyright=Copyright 2005-2022 Olivia Mackall and others
 VersionInfoCompany=Olivia Mackall and others
 VersionInfoVersion={#QUAD_VERSION}
 InternalCompressLevel=max
diff --git a/contrib/packaging/debian/copyright 
b/contrib/packaging/debian/copyright
--- a/contrib/packaging/debian/copyright
+++ b/contrib/packaging/debian/copyright
@@ -3,7 +3,7 @@
 Source: https://www.mercurial-scm.org/
 
 Files: *
-Copyright: 2005-2021, Olivia Mackall  and others.
+Copyright: 2005-2022, Olivia Mackall  and others.
 License: GPL-2+
  This program is free software; you can redistribute it
  and/or modify it under the terms of the GNU General Public



To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org

D12182: contrib: refer to RHEL and derivatives instead of CentOS specifically

2022-02-15 Thread Mathias De Maré
Mathiasdm created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  Makefile
  contrib/packaging/Makefile
  contrib/packaging/docker/centos7
  contrib/packaging/docker/centos8
  contrib/packaging/docker/rhel7
  contrib/packaging/docker/rhel8

CHANGE DETAILS

diff --git a/contrib/packaging/docker/centos8 b/contrib/packaging/docker/rhel8
rename from contrib/packaging/docker/centos8
rename to contrib/packaging/docker/rhel8
diff --git a/contrib/packaging/docker/centos7 b/contrib/packaging/docker/rhel7
rename from contrib/packaging/docker/centos7
rename to contrib/packaging/docker/rhel7
diff --git a/contrib/packaging/Makefile b/contrib/packaging/Makefile
--- a/contrib/packaging/Makefile
+++ b/contrib/packaging/Makefile
@@ -13,20 +13,20 @@
 
 FEDORA_RELEASE := 31
 
-CENTOS_RELEASES := \
+RHEL_RELEASES := \
   7 \
   8
 
-# Build a Python for these CentOS releases.
-CENTOS_WITH_PYTHON_RELEASES :=
-CENTOS_WITH_NONVERSIONED_PYTHON :=
-CENTOS_WITH_36_DOCUTILS := 7
+# Build a Python for these RHEL (and derivatives) releases.
+RHEL_WITH_PYTHON_RELEASES :=
+RHEL_WITH_NONVERSIONED_PYTHON :=
+RHEL_WITH_36_DOCUTILS := 7
 
 help:
@echo 'Packaging Make Targets'
@echo ''
-   @echo 'docker-centos{$(strip $(CENTOS_RELEASES))}'
-   @echo '   Build an RPM for a specific CentOS version using Docker.'
+   @echo 'docker-rhel{$(strip $(RHEL_RELEASES))}'
+   @echo '   Build an RPM for a specific RHEL/derivative version using 
Docker.'
@echo ''
@echo 'docker-debian-{$(strip $(DEBIAN_CODENAMES))}'
@echo '   Build Debian packages specific to a Debian distro using 
Docker.'
@@ -53,8 +53,8 @@
@echo 'ppa'
@echo '   Build a Debian source package locally targeting the current 
system'
@echo ''
-   @echo 'centos{$(strip $(CENTOS_RELEASES))}'
-   @echo '   Build an RPM for a specific CentOS version locally'
+   @echo 'rhel{$(strip $(RHEL_RELEASES))}'
+   @echo '   Build an RPM for a specific RHEL/derivative version locally'
@echo ''
@echo 'fedora'
@echo '   Build an RPM for Fedora $(FEDORA_RELEASE) locally'
@@ -106,22 +106,22 @@
 docker-fedora:
./dockerrpm fedora$(FEDORA_RELEASE)
 
-# CentOS targets.
-define centos_targets
-.PHONY: centos$(1)
-centos$(1):
-   mkdir -p $$(HGROOT)/packages/centos$(1)
-   ./buildrpm $$(if $$(filter 
$(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter 
$(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,))$$(if $$(filter 
$(1),$$(CENTOS_WITH_36_DOCUTILS)), --docutilspackage python36-docutils,)
-   cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* 
$$(HGROOT)/packages/centos$(1)
-   cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* 
$$(HGROOT)/packages/centos$(1)
+# RHEL targets.
+define rhel_targets
+.PHONY: rhel$(1)
+rhel$(1):
+   mkdir -p $$(HGROOT)/packages/rhel$(1)
+   ./buildrpm $$(if $$(filter 
$(1),$$(RHEL_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter 
$(1),$$(RHEL_WITH_NONVERSIONED_PYTHON)),--python python,))$$(if $$(filter 
$(1),$$(RHEL_WITH_36_DOCUTILS)), --docutilspackage python36-docutils,)
+   cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* 
$$(HGROOT)/packages/rhel$(1)
+   cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* 
$$(HGROOT)/packages/rhel$(1)
 
-.PHONY: docker-centos$(1)
-docker-centos$(1):
-   ./dockerrpm centos$(1) $$(if $$(filter 
$(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter 
$(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,))$$(if $$(filter 
$(1),$$(CENTOS_WITH_36_DOCUTILS)), --docutilspackage python36-docutils,)
+.PHONY: docker-rhel$(1)
+docker-rhel$(1):
+   ./dockerrpm rhel$(1) $$(if $$(filter 
$(1),$$(RHEL_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter 
$(1),$$(RHEL_WITH_NONVERSIONED_PYTHON)),--python python,))$$(if $$(filter 
$(1),$$(RHEL_WITH_36_DOCUTILS)), --docutilspackage python36-docutils,)
 
 endef
 
-$(foreach release,$(CENTOS_RELEASES),$(eval $(call centos_targets,$(release
+$(foreach release,$(RHEL_RELEASES),$(eval $(call rhel_targets,$(release
 
 .PHONY: linux-wheels
 linux-wheels: linux-wheels-x86_64 linux-wheels-i686
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -204,11 +204,11 @@
 # Packaging targets
 
 packaging_targets := \
-  centos7 \
-  centos8 \
+  rhel7 \
+  rhel8 \
   deb \
-  docker-centos7 \
-  docker-centos8 \
+  docker-rhel7 \
+  docker-rhel8 \
   docker-debian-bullseye \
   docker-debian-buster \
   docker-debian-stretch \



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


mercurial-devel | Failed pipeline for branch/default | db885385

2022-02-15 Thread Heptapod


Pipeline #34910 has failed!

Project: mercurial-devel ( https://foss.heptapod.net/mercurial/mercurial-devel )
Branch: branch/default ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/commits/branch/default )

Commit: db885385 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/commit/db88538510caedaa6f0be1824a7473f89b1ac3fc
 )
Commit Message: filemerge: move check for identical sides out o...
Commit Author: Martin von Zweigbergk ( https://foss.heptapod.net/martinvonz )

Pipeline #34910 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/pipelines/34910 ) 
triggered by Administrator ( https://foss.heptapod.net/root )
had 1 failed job.

Job #341318 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/341318/raw )

Stage: tests
Name: test-py2

-- 
You're receiving this email because of your account on foss.heptapod.net.



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


mercurial-devel | Failed pipeline for branch/default | e179a84f

2022-02-15 Thread Heptapod


Pipeline #34901 has failed!

Project: mercurial-devel ( https://foss.heptapod.net/mercurial/mercurial-devel )
Branch: branch/default ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/commits/branch/default )

Commit: e179a84f ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/commit/e179a84fcf793daa133b2bfed32fdd030b8b4ce5
 )
Commit Message: status: prefer relative paths in Rust code

… w...
Commit Author: Simon Sapin ( https://foss.heptapod.net/SimonSapin )

Pipeline #34901 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/pipelines/34901 ) 
triggered by Administrator ( https://foss.heptapod.net/root )
had 1 failed job.

Job #341253 ( 
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/341253/raw )

Stage: tests
Name: test-py2-rust

-- 
You're receiving this email because of your account on foss.heptapod.net.



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


[Bug 6646] New: python 3.10 compatibility warnings break tests

2022-02-15 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6646

Bug ID: 6646
   Summary: python 3.10 compatibility warnings break tests
   Product: Mercurial
   Version: 6.0.2
  Hardware: All
OS: NetBSD
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: t...@giga.or.at
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

Zeroconf deprecation warnings in 3.10 break some tests.

--- /scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-paths.t 
+++ /scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-paths.t.err 
@@ -146,6 +146,8 @@ 

 #if no-pyoxidizer  
   $ hg paths --config extensions.zeroconf= 
+  /tmp/hgtests.2d_twpz0/install/lib/python/hgext/zeroconf/Zeroconf.py:1464:
DeprecationWarning: notifyAll() is deprecated, use notify_all() instead 
+self.condition.notifyAll() 
   dupe = $TESTTMP/b#tip
   dupe:pushurl = https://example.com/dupe  
   expand = $TESTTMP/a/$SOMETHING/bar   

ERROR: test-paths.t output changed  
!.s.s..s..s..s...ssssss.
 
--- /scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-hgrc.t  
+++ /scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-hgrc.t.err  
@@ -310,6 +310,8 @@ 

 #if no-pyoxidizer  
   $ HGRCSKIPREPO=1 hg paths --config extensions.zeroconf=  
+  /tmp/hgtests.2d_twpz0/install/lib/python/hgext/zeroconf/Zeroconf.py:1464:
DeprecationWarning: notifyAll() is deprecated, use notify_all() instead 
+self.condition.notifyAll() 
   foo = $TESTTMP/bar   
 #else  
   $ HGRCSKIPREPO=1 hg paths --config extensions.zeroconf=  

ERROR: test-hgrc.t output changed   


There is another warning text change which I suspect is also python
3.10-specific:

--- /scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-parseindex.t
+++
/scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-parseindex.t.err
@@ -113,7 +113,7 @@ 
   1: head out of range 
   -2: head out of range
   -1: head out of range
-  None: an integer is required( .got type NoneType.)? (re) 
+  None: 'NoneType' object cannot be interpreted as an integer  
   good roots:  
   0: [0]   
   1: [1]   
@@ -124,7 +124,7 @@ 
   -2: []   
   -1: [] 
   bad roots:   
-  None: an integer is required( .got type NoneType.)? (re) 
+  None: 'NoneType' object cannot be interpreted as an integer  

   $ cd ..  


ERROR: test-parseindex.t output changed

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


[Bug 6645] New: test-https.t: compatibility warnings break test

2022-02-15 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6645

Bug ID: 6645
   Summary: test-https.t: compatibility warnings break test
   Product: Mercurial
   Version: 6.0.2
  Hardware: All
OS: NetBSD
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: t...@giga.or.at
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

In 6.0.2 with python 3.10 on NetBSD, the test test-https.t fails with:

--- /scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-https.t
+++ /scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-https.t.err
@@ -29,6 +29,8 @@
   adding foo.d/baR.d.hg/bAR
   adding foo.d/foo
   $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV
+  /tmp/hgtests.2d_twpz0/install/lib/python/mercurial/sslutil.py:536:
DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
+sslcontext = ssl.SSLContext(protocol)
   $ cat ../hg0.pid >> $DAEMON_PIDS

 cacert not found
@@ -50,6 +52,10 @@

 #if no-defaultcacertsloaded
   $ hg clone https://localhost:$HGPORT/ copy-pull
+  /tmp/hgtests.2d_twpz0/install/lib/python/mercurial/sslutil.py:310:
DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
+sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+  /tmp/hgtests.2d_twpz0/install/lib/python/mercurial/sslutil.py:311:
DeprecationWarning: ssl.OP_NO_SSL*/ssl.OP_NO_TLS* options are deprecated
+sslcontext.options |= commonssloptions(settings[b'minimumprotocol'])
   (an attempt was made to load CA certificates but none were loaded; see
https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial
to avoid this error)
   abort: error: *certificate verify failed* (glob)
   [100]
@@ -73,6 +79,10 @@

   $ echo baddata > badca.pem
   $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone
https://localhost:$HGPORT/
+  /tmp/hgtests.2d_twpz0/install/lib/python/mercurial/sslutil.py:310:
DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
+sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+  /tmp/hgtests.2d_twpz0/install/lib/python/mercurial/sslutil.py:311:
DeprecationWarning: ssl.OP_NO_SSL*/ssl.OP_NO_TLS* options are deprecated
+sslcontext.options |= commonssloptions(settings[b'minimumprotocol'])
   abort: error loading CA file badca.pem: * (glob)
   (file is empty or malformed?)
   [255]
@@ -81,14 +91,22 @@

 (modern ssl is able to discern whether the loaded cert is a CA cert)
   $ hg --config
hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone
https://localhost:$HGPORT/
+  /tmp/hgtests.2d_twpz0/install/lib/python/mercurial/sslutil.py:310:
DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
+  (the full certificate chain may not be available locally; see "hg help
debugssl") (windows !)
+sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+  /tmp/hgtests.2d_twpz0/install/lib/python/mercurial/sslutil.py:311:
DeprecationWarning: ssl.OP_NO_SSL*/ssl.OP_NO_TLS* options are deprecated
+sslcontext.options |= commonssloptions(settings[b'minimumprotocol'])
   (an attempt was made to load CA certificates but none were loaded; see
https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial
to avoid this error)
-  (the full certificate chain may not be available locally; see "hg help
debugssl") (windows !)
   abort: error: *certificate verify failed* (glob)
   [100]

 A per-host certificate matching the server's cert will be accepted

   $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem"
clone -U https://localhost:$HGPORT/ perhostgood1
+  /tmp/hgtests.2d_twpz0/install/lib/python/mercurial/sslutil.py:310:
DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
+sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+  /tmp/hgtests.2d_twpz0/install/lib/python/mercurial/sslutil.py:311:
DeprecationWarning: ssl.OP_NO_SSL*/ssl.OP_NO_TLS* options are deprecated
+sslcontext.options |= commonssloptions(settings[b'minimumprotocol'])
   requesting all changes
   adding changesets
   adding manifests
@@ -100,6 +118,10 @@

   $ cat "$CERTSDIR/client-cert.pem" "$CERTSDIR/pub.pem" > perhost.pem
   $ hg --config hostsecurity.localhost:verifycertsfile=perhost.pem clone -U
https://localhost:$HGPORT/ perhostgood2
+  /tmp/hgtests.2d_twpz0/install/lib/python/mercurial/sslutil.py:310:
DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
+sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+  /tmp/hgtests.2d_twpz0/install/lib/python/mercurial/sslutil.py:311:
DeprecationWarning: ssl.OP_NO_SSL*/ssl.OP_NO_TLS* options are deprecated
+sslcontext.options |= commonssloptions(settings[b'minimumprotocol'])
   requesting all changes
   adding changesets
   adding manifests
@@ -111,6 +133,10 @@

   $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem"
--config

[Bug 6644] New: test-wireproto-content-redirects.t test failure

2022-02-15 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6644

Bug ID: 6644
   Summary: test-wireproto-content-redirects.t test failure
   Product: Mercurial
   Version: 6.0.2
  Hardware: All
OS: NetBSD
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: t...@giga.or.at
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

There is a new test failure in 6.0.2 with python 3.10 on NetBSD:

---
/scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-wireproto-content-redirects.t
 
+++
/scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-wireproto-content-redirects.t.err
 
@@ -109,6 +109,7 @@
   s> \r\n 
   s> 8\r\n
   s> \x00\x00\x00\x01\x00\x02\x002   
+  s>   
   s> \r\n 
   s> 0\r\n
   s> \r\n
@@ -437,6 +438,7 @@ 
   s> \r\n
   s> 8\r\n   
   s> \x00\x00\x00\x01\x00\x02\x002 
+  s> 
   s> \r\n
   s> 0\r\n   
   s> \r\n
@@ -771,6 +773,7 @@   
   s> \r\n 
   s> 8\r\n   
   s> \x00\x00\x00\x01\x00\x02\x002   
+  s>  
   s> \r\n
   s> 0\r\n   
   s> \r\n 
@@ -1095,6 +1098,7 @@ 
   s> \r\n  
   s> 8\r\n   
   s> \x00\x00\x00\x01\x00\x02\x002  
+  s> 
   s> \r\n
   s> 0\r\n   
   s> \r\n

ERROR: test-wireproto-content-redirects.t output changed

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


[Bug 6643] New: test-http-bad-server.t test failure

2022-02-15 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6643

Bug ID: 6643
   Summary: test-http-bad-server.t test failure
   Product: Mercurial
   Version: 6.0.2
  Hardware: All
OS: NetBSD
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: t...@giga.or.at
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

There is a new test failure in 6.0.2 with python 3.10 on NetBSD:

---
/scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-http-bad-server.t   
+++
/scratch/devel/py-mercurial/work/mercurial-6.0.2/tests/test-http-bad-server.t.err
 
@@ -739,7 +739,7 @@ 

   $ hg clone http://localhost:$HGPORT/ clone 
   requesting all changes   
-  abort: HTTP request error (incomplete response) (py3 !)
+  abort: HTTP request error (incomplete response; expected 4 bytes got 3)  
   abort: HTTP request error (incomplete response; expected 4 bytes got 3)
(no-py3 !)  
   (this may be an intermittent network failure; if the error persists,
consider contacting the network or server operator) 
   [255]
@@ -784,7 +784,7 @@

   $ hg clone http://localhost:$HGPORT/ clone 
   requesting all changes   
-  abort: HTTP request error (incomplete response) (py3 !)
+  abort: HTTP request error (incomplete response; expected 4 bytes got 3)
   abort: HTTP request error (incomplete response; expected 4 bytes got 3)
(no-py3 !)  
   (this may be an intermittent network failure; if the error persists,
consider contacting the network or server operator) 
   [255]
@@ -982,7 +982,7 @@ 
   adding changesets
   transaction abort!   
   rollback completed
-  abort: HTTP request error (incomplete response) (py3 !)  
+  abort: HTTP request error (incomplete response; expected 466 bytes got 7)  
   abort: HTTP request error (incomplete response; expected 466 bytes got 7)
(no-py3 !)  
   (this may be an intermittent network failure; if the error persists,
consider contacting the network or server operator) 
   [255]
@@ -1097,7 +1097,7 @@   
   adding file changes
   transaction abort! 
   rollback completed 
-  abort: HTTP request error (incomplete response) (py3 !)
+  abort: HTTP request error (incomplete response; expected 32 bytes got 9)   
   abort: HTTP request error (incomplete response; expected 32 bytes got 9)
(no-py3 !)  
   (this may be an intermittent network failure; if the error persists,
consider contacting the network or server operator) 
   [255]  

ERROR: test-http-bad-server.t output changed

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


D12181: narrow: add support for merging add and remove outside of the tracked set

2022-02-15 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This extend f1eb77dceb36 
 to 
test and support the remaining action. Or, at least,
  the simple incarnation of them.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/commit.py
  mercurial/merge.py
  tests/test-narrow-merge-outside.t

CHANGE DETAILS

diff --git a/tests/test-narrow-merge-outside.t 
b/tests/test-narrow-merge-outside.t
new file mode 100644
--- /dev/null
+++ b/tests/test-narrow-merge-outside.t
@@ -0,0 +1,111 @@
+===
+Test merge behavior with narrow for item outside of the narrow spec
+===
+
+This test currently check for  simple "outside of narrow" merge case. I suspect
+there might be more corner case that need testing, so extending this tests, or
+replacing it by a more "generative" version, comparing behavior with and 
without narow.
+
+This the feature is currently working with flat manifest only. This is the only
+case tested. Consider using test-case if tree start supporting this case of
+merge.
+
+Create some initial setup
+
+  $ . "$TESTDIR/narrow-library.sh"
+
+  $ hg init server
+  $ echo root > server/root
+  $ mkdir server/inside
+  $ mkdir server/outside
+  $ echo babar > server/inside/inside-change
+  $ echo pom > server/outside/outside-changing
+  $ echo arthur > server/outside/outside-removed
+  $ hg -R server add server/
+  adding server/inside/inside-change
+  adding server/outside/outside-changing
+  adding server/outside/outside-removed
+  adding server/root
+  $ hg -R server commit -m root
+
+
+
+  $ hg clone ssh://user@dummy/server client --narrow --include inside
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  new changesets a0c415d360e5
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+"trivial" change outside of narrow spec on the server
+
+  $ echo zephir > server/outside/outside-added
+  $ hg -R server add server/outside/outside-added
+  $ echo flore > server/outside/outside-changing
+  $ hg -R server remove server/outside/outside-removed
+  $ hg -R server commit -m "outside change"
+
+Merge them with some unrelated local change
+
+  $ echo celeste > client/inside/inside-change
+  $ hg -R client commit -m "inside change"
+  $ hg -R client pull
+  pulling from ssh://user@dummy/server
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files (+1 heads)
+  new changesets f9ec5453023e
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg -R client merge
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg -R client ci -m 'merge changes'
+  $ hg -R client push -r .
+  pushing to ssh://user@dummy/server
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 2 changesets with 1 changes to 1 files
+
+Checking result
+---
+
+general sentry of all output
+
+  $ hg --repository server manifest --debug --rev 0
+  360afd990eeff79e4a7f9f3ded5ecd7bc2fd3b59 644   inside/inside-change
+  7db95ce5cd8e734ad12e3f5f37779a08070a1399 644   outside/outside-changing
+  1591f6db41a30b68bd94ddccf4a4ce4f4fbe2a44 644   outside/outside-removed
+  50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644   root
+  $ hg --repository server manifest --debug --rev 1
+  360afd990eeff79e4a7f9f3ded5ecd7bc2fd3b59 644   inside/inside-change
+  486c008d6dddcaeb5e5f99556a121800cdcfb149 644   outside/outside-added
+  153d7af5e4f53f44475bc0ff2b806c86f019eda4 644   outside/outside-changing
+  50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644   root
+
+  $ hg --repository server manifest --debug --rev 2
+  1b3ab69c6c847abc8fd25537241fedcd4d188668 644   inside/inside-change
+  7db95ce5cd8e734ad12e3f5f37779a08070a1399 644   outside/outside-changing
+  1591f6db41a30b68bd94ddccf4a4ce4f4fbe2a44 644   outside/outside-removed
+  50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644   root
+  $ hg --repository server manifest --debug --rev 3
+  1b3ab69c6c847abc8fd25537241fedcd4d188668 644   inside/inside-change
+  486c008d6dddcaeb5e5f99556a121800cdcfb149 644   outside/outside-added
+  153d7af5e4f53f44475bc0ff2b806c86f019eda4 644   outside/outside-changing
+  50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644   root
+
+The file changed outside should be changed by the merge
+
+  $ hg --repository server manifest --debug --rev 'desc("inside change")' | 
grep outside-changing
+  7db95ce5cd8e734ad12e3f5f37779a08070a1399