Re: mercurial-devel | Pipeline #13969 has failed for branch/stable | 53e3356b

2020-12-04 Thread Pierre-Yves David
One for the ci runner of the osuosl has trouble pulling the mercurial 
repository (for reason unclear so far). We took it out of the worker pool.


The tests are running again on the remaining pool of CI worker.

On 12/4/20 11:13 PM, Heptapod wrote:

✖   Your pipeline has failed.

Project 	octobus  / mercurial-devel 


Branch  
	branch/stable 



Commit  
	53e3356b 
 



Added signature for changeset 1d5189a57405 --H...
Commit Author   
durin42 

Pipeline #13969 
 
triggered by 		Pierre-Yves David 


had 11 failed builds.
Logs may contain sensitive data. Please consider before forwarding this 
email.

✖   test

	test-py2-rust 


✖   test

	test-py3-rust-dirstate-tree 


✖   test

	test-py3-rust 


✖   test

	test-py3-pure 


✖   test

test-py3 

✖   test

test-py2 

✖   test

	rust-cargo-test-py3-dirstate-tree 


✖   test

	rust-cargo-test-py3 


✖   test

	rust-cargo-test-py2 


✖   test

	checks-py3 


✖   test

	checks-py2 



GitLab
You're receiving this email because of your account on 
foss.heptapod.net. Manage all notifications 
 · Help 




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



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


Re: mercurial-devel | Pipeline #13968 has failed for branch/default | 0803791f

2020-12-04 Thread Pierre-Yves David
One for the ci runner of the osuosl has trouble pulling the mercurial 
repository (for reason unclear so far). We took it out of the worker pool.


The tests are running again on the remaining pool of CI worker.

On 12/4/20 11:08 PM, Heptapod wrote:

✖   Your pipeline has failed.

Project 	octobus  / mercurial-devel 


Branch  
	branch/default 
 



Commit  
	0803791f 
 



cext: add .pyi files for C extensions I'm unsu...
Commit Author   
Gregory Szorc 

Pipeline #13968 
 
triggered by 		Pierre-Yves David 


had 3 failed builds.
Logs may contain sensitive data. Please consider before forwarding this 
email.

✖   tests

	test-py2-chg 


✖   tests

	test-py3-rust-dirstate-tree 


✖   tests

	rust-cargo-test-py3-dirstate-tree 



GitLab
You're receiving this email because of your account on 
foss.heptapod.net. Manage all notifications 
 · Help 




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



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


Re: [PATCH 4 of 4] log: do not accept string-matcher pattern as -u/-b/-B parameter

2020-12-04 Thread Augie Fackler
queued thanks

> On Dec 1, 2020, at 07:50, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1606821744 -32400
> #  Tue Dec 01 20:22:24 2020 +0900
> # Node ID 8e8feec5114933aaa5224ff33acfa1bc9a52625c
> # Parent  773cf7f8899449979131792e82a49fc6bc0d25ec
> log: do not accept string-matcher pattern as -u/-b/-B parameter
> 
> I'm pretty sure this is a bug introduced after we've switched the filtering
> backend to revset matcher.
> 
> diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py
> --- a/mercurial/logcmdutil.py
> +++ b/mercurial/logcmdutil.py
> @@ -898,13 +898,13 @@ def _makenofollowfilematcher(repo, pats,
> def _makerevset(repo, wopts, slowpath):
> """Return a revset string built from log options and file patterns"""
> opts = {
> -b'branch': [repo.lookupbranch(b) for b in wopts.branches],
> +b'branch': [b'literal:' + repo.lookupbranch(b) for b in 
> wopts.branches],
> b'date': wopts.date,
> b'keyword': wopts.keywords,
> b'no_merges': wopts.no_merges,
> b'only_merges': wopts.only_merges,
> b'prune': wopts.prune_ancestors,
> -b'user': wopts.users,
> +b'user': [b'literal:' + v for v in wopts.users],
> }
> 
> if wopts.filter_revisions_by_pats and slowpath:
> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -2310,6 +2310,7 @@ def bookmarkrevs(repo, mark):
> def format_bookmark_revspec(mark):
> """Build a revset expression to select revisions reachable by a given
> bookmark"""
> +mark = b'literal:' + mark
> return revsetlang.formatspec(
> b"ancestors(bookmark(%s)) - "
> b"ancestors(head() and not bookmark(%s)) - "
> diff --git a/tests/test-glog-beautifygraph.t b/tests/test-glog-beautifygraph.t
> --- a/tests/test-glog-beautifygraph.t
> +++ b/tests/test-glog-beautifygraph.t
> @@ -1588,19 +1588,19 @@ glog always reorders nodes which explain
> (list
>   (func
> (symbol 'user')
> -(string 'test'))
> +(string 'literal:test'))
>   (func
> (symbol 'user')
> -(string 'not-a-user'
> +(string 'literal:not-a-user'
>,
> ,
> ->,
> +>,
>,
> ->>>
> +>>>
>   $ testlog -b not-a-branch
>   abort: unknown revision 'not-a-branch'
>   abort: unknown revision 'not-a-branch'
> @@ -1611,28 +1611,28 @@ glog always reorders nodes which explain
> (list
>   (func
> (symbol 'branch')
> -(string 'default'))
> +(string 'literal:default'))
>   (or
> (list
>   (func
> (symbol 'branch')
> -(string 'branch'))
> +(string 'literal:branch'))
>   (func
> (symbol 'branch')
> -(string 'branch'))
> +(string 'literal:branch'))
>,
> ,
> ->,
> +>,
>   ,
> -  >,
> +  >,
>,
> -  
> +  
>   $ testlog -k expand -k merge
>   []
>   (or
> diff --git a/tests/test-glog.t b/tests/test-glog.t
> --- a/tests/test-glog.t
> +++ b/tests/test-glog.t
> @@ -1438,19 +1438,19 @@ glog always reorders nodes which explain
> (list
>   (func
> (symbol 'user')
> -(string 'test'))
> +(string 'literal:test'))
>   (func
> (symbol 'user')
> -(string 'not-a-user'
> +(string 'literal:not-a-user'
>,
> ,
> ->,
> +>,
>,
> ->>>
> +>>>
>   $ testlog -b not-a-branch
>   abort: unknown revision 'not-a-branch'
>   abort: unknown revision 'not-a-branch'
> @@ -1461,28 +1461,28 @@ glog always reorders nodes which explain
> (list
>   (func
> (symbol 'branch')
> -(string 'default'))
> +(string 'literal:default'))
>   (or
> (list
>   (func
> (symbol 'branch')
> -(string 'branch'))
> +(string 'literal:branch'))
>   (func
> (symbol 'branch')
> -(string 'branch'))
> +(string 'literal:branch'))
>,
> ,
> ->,
> +>,
>   ,
> -  >,
> +  >,
>,
> -  
> +  
>   $ testlog -k expand -k merge
>   []
>   (or
> diff --git a/tests/test-log-bookmark.t b/tests/test-log-bookmark.t
> --- a/tests/test-log-bookmark.t
> +++ b/tests/test-log-bookmark.t
> @@ -190,3 +190,9 @@ Unknown bookmark:
>   $ hg log -B unknown
>   abort: bookmark 'unknown' does not exist
>   [255]
> +
> +Shouldn't accept string-matcher syntax:
> +
> +  $ hg log -B 're:.*'
> +  abort: bookmark 're:.*' does not exist
> +  [255]
> diff --git a/tests/test-log.t b/tests/test-log.t
> --- a/tests/test-log.t
> +++ 

Re: [PATCH STABLE] ui: remove excessive strtolocal() from debuguigetpass

2020-12-04 Thread Augie Fackler
queued for stable, thanks

> On Dec 3, 2020, at 05:06, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1606988543 -32400
> #  Thu Dec 03 18:42:23 2020 +0900
> # Branch stable
> # Node ID 074a20823c4be85d4b98a76c2ba961ff640cc80e
> # Parent  27c23c8f14da48a24a0896b588721c0139e92560
> ui: remove excessive strtolocal() from debuguigetpass
> 
> ui.getpass() returns Optional[bytes], and strtolocal(bytes) would crash.
> Follows up 07b0a687c01a "ui: ensure `getpass()` returns bytes."
> 
> diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
> --- a/mercurial/debugcommands.py
> +++ b/mercurial/debugcommands.py
> @@ -3787,9 +3787,7 @@ def debugtemplate(ui, repo, tmpl, **opts
> def debuguigetpass(ui, prompt=b''):
> """show prompt to type password"""
> r = ui.getpass(prompt)
> -if r is not None:
> -r = encoding.strtolocal(r)
> -else:
> +if r is None:
> r = b""
> ui.writenoi18n(b'response: %s\n' % r)
> 
> 
> ___
> 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


mercurial-devel | Pipeline #13969 has failed for branch/stable | 53e3356b

2020-12-04 Thread Heptapod


Your pipeline has failed.

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

Commit: 53e3356b ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/commit/53e3356b4564e0e461e751a078258a09e9dc815b
 )
Commit Message: Added signature for changeset 1d5189a57405

--H...
Commit Author: durin42 ( https://foss.heptapod.net/durin42 )

Pipeline #13969 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/pipelines/13969 ) triggered 
by Pierre-Yves David ( https://foss.heptapod.net/marmoute )
had 11 failed builds.

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

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

Stage: test
Name: test-py3-rust-dirstate-tree
Job #128959 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/128959/raw )

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

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

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

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

Stage: test
Name: rust-cargo-test-py3-dirstate-tree
Job #128952 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/128952/raw )

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

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

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

Stage: test
Name: checks-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


[Bug 6451] New: Py_SET_TYPE() should be used to support Python 3.10

2020-12-04 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6451

Bug ID: 6451
   Summary: Py_SET_TYPE() should be used to support Python 3.10
   Product: Mercurial
   Version: default branch
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: victor.stin...@gmail.com
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

Created attachment 2090
  --> https://bz.mercurial-scm.org/attachment.cgi?id=2090=edit
Patch adding pythoncapi_compat.h and replace Py_TYPE() assignments with
Py_SET_TYPE() calls.

In Python 3.10, "Py_SET_TYPE(obj, type)" should now be used instead of using
absuing the Py_TYPE() macro: "Py_TYPE(obj) = type;".

See https://www.python.org/dev/peps/pep-0620/ and
https://bugs.python.org/issue39573 for the rationale.

Py_TYPE() was converted to a static inline macro in Python 3.10 to raise a
compiler error on "Py_TYPE(obj) = type;". But since this change broke too many
C extensions, I reverted it.

So I'm now proposing patches to every broken C extensions before considering to
re-apply the change in the Python C API.

Attached patch replaces "Py_TYPE(obj) = type;" with "Py_SET_TYPE(obj, type);".
It adds a copy of the pythoncapi_compat.h header file coming from my project:
https://github.com/pythoncapi/pythoncapi_compat

The initial version of the patch was created by upgrade_pythoncapi.py tool
which is also part of pythoncapi_compat project.

Sadly, I had to copy pythoncapi_compat.h in two directories: mercurial/ and
contrib/python-zstandard/zstd/common/. I didn't know if a contrib/ extension
can add mercurial/ to its include directory list (-I compiler flag).

Feel free to rewrite my patch and steal the patch, I'm not sure to the
Mercurial code base.

There is no need to update pythoncapi_compat.h unless tomorrow you will need a
new function if a newer version of this header file. IMO it's a good practice
to vendor a copy of the header file (which is less than 300 lines of C code).
The pythoncapi_compat project is new and I'm not sure that it's going to be
packaged widely on Windows, macOS and very single Linux distribution (for
example).

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


mercurial-devel | Pipeline #13968 has failed for branch/default | 0803791f

2020-12-04 Thread Heptapod


Your pipeline has failed.

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

Commit: 0803791f ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/commit/0803791f51af39712f00033df07de5cd7ffb15ca
 )
Commit Message: cext: add .pyi files for C extensions

I'm unsu...
Commit Author: Gregory Szorc ( https://foss.heptapod.net/indygreg )

Pipeline #13968 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/pipelines/13968 ) triggered 
by Pierre-Yves David ( https://foss.heptapod.net/marmoute )
had 3 failed builds.

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

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

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

Stage: tests
Name: rust-cargo-test-py3-dirstate-tree

-- 
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@46031: new changeset

2020-12-04 Thread Mercurial Commits
New changeset in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/c701f616d852
changeset:   46031:c701f616d852
bookmark:@
tag: tip
user:Martin von Zweigbergk 
date:Thu Dec 03 13:23:59 2020 -0800
summary: tests: update test-releasenotes-formatting.t with new exit codes

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


D9520: rhg: use persistent nodemap when available

2020-12-04 Thread SimonSapin
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  … for node ID → revision number lookups, instead on linear scan in a revlog.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/requirements.rs
  rust/hg-core/src/revlog.rs
  rust/hg-core/src/revlog/index.rs
  rust/hg-core/src/revlog/nodemap_docket.rs
  rust/hg-core/src/revlog/revlog.rs
  tests/test-rhg.t

CHANGE DETAILS

diff --git a/tests/test-rhg.t b/tests/test-rhg.t
--- a/tests/test-rhg.t
+++ b/tests/test-rhg.t
@@ -197,4 +197,6 @@
   .hg/store/00changelog.i
   .hg/store/00changelog.n
   $ rhg files -r c3ae8dec9fad
-  [252]
+  of
+  $ rhg cat -r c3ae8dec9fad of
+  r5000
diff --git a/rust/hg-core/src/revlog/revlog.rs 
b/rust/hg-core/src/revlog/revlog.rs
--- a/rust/hg-core/src/revlog/revlog.rs
+++ b/rust/hg-core/src/revlog/revlog.rs
@@ -14,6 +14,9 @@
 
 use super::index::Index;
 use super::node::{NodePrefixRef, NODE_BYTES_LENGTH, NULL_NODE};
+use super::nodemap;
+use super::nodemap::NodeMap;
+use super::nodemap_docket::NodeMapDocket;
 use super::patch;
 use crate::revlog::Revision;
 
@@ -27,7 +30,7 @@
 UnknowDataFormat(u8),
 }
 
-fn mmap_open(path: ) -> Result {
+pub(super) fn mmap_open(path: ) -> Result {
 let file = File::open(path)?;
 let mmap = unsafe { MmapOptions::new().map() }?;
 Ok(mmap)
@@ -41,6 +44,7 @@
 index: Index,
 /// When index and data are not interleaved: bytes of the revlog data
 data_bytes: Option + Send>>,
+nodemap: Option,
 }
 
 impl Revlog {
@@ -77,7 +81,20 @@
 Some(Box::new(data_mmap))
 };
 
-Ok(Revlog { index, data_bytes })
+let nodemap = NodeMapDocket::read_from_file(index_path)?.map(
+|(docket, data)| {
+nodemap::NodeTree::load_bytes(
+Box::new(data),
+docket.data_length,
+)
+},
+);
+
+Ok(Revlog {
+index,
+data_bytes,
+nodemap,
+})
 }
 
 /// Return number of entries of the `Revlog`.
@@ -96,6 +113,13 @@
 ,
 node: NodePrefixRef,
 ) -> Result {
+if let Some(nodemap) =  {
+return nodemap
+.find_bin(, node)
+// TODO: propagate details of this error:
+.map_err(|_| RevlogError::Corrupted)?
+.ok_or(RevlogError::InvalidRevision);
+}
 // This is brute force. But it is fast enough for now.
 // Optimization will come later.
 let mut found_by_prefix = None;
diff --git a/rust/hg-core/src/revlog/nodemap_docket.rs 
b/rust/hg-core/src/revlog/nodemap_docket.rs
new file mode 100644
--- /dev/null
+++ b/rust/hg-core/src/revlog/nodemap_docket.rs
@@ -0,0 +1,112 @@
+use memmap::Mmap;
+use std::convert::TryInto;
+use std::path::{Path, PathBuf};
+
+use super::revlog::{mmap_open, RevlogError};
+
+const ONDISK_VERSION: u8 = 1;
+
+pub(super) struct NodeMapDocket {
+pub data_length: usize,
+// TODO: keep here more of the data from `parse()` when we need it
+}
+
+impl NodeMapDocket {
+pub fn read_from_file(
+index_path: ,
+) -> Result, RevlogError> {
+let docket_path = index_path.with_extension("n");
+let docket_bytes = match std::fs::read(_path) {
+Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
+return Ok(None)
+}
+Err(e) => return Err(RevlogError::IoError(e)),
+Ok(bytes) => bytes,
+};
+
+let mut input = if let Some((_VERSION, rest)) =
+docket_bytes.split_first()
+{
+rest
+} else {
+return Ok(None);
+};
+let input =  input;
+
+let uid_size = read_u8(input)? as usize;
+let _tip_rev = read_be_u64(input)?;
+// TODO: do we care about overflow for 4 GB+ nodemap files on 32-bit
+// systems?
+let data_length = read_be_u64(input)? as usize;
+let _data_unused = read_be_u64(input)?;
+let tip_node_size = read_be_u64(input)? as usize;
+let uid = read_bytes(input, uid_size)?;
+let _tip_node = read_bytes(input, tip_node_size)?;
+
+let uid =
+std::str::from_utf8(uid).map_err(|_| RevlogError::Corrupted)?;
+let docket = NodeMapDocket { data_length };
+
+// TODO: use `std::fs::read` here when the `persistent-nodemap.mmap`
+// config is false?
+let mmap = mmap_open(_path(_path, uid))
+// TODO: do we want to silently ignore a file not found here and
+// return `None`? The equivalent Python code has a
+// branch that might have intended to do that, but looks like it
+// causes a NameError exception.
+.map_err(RevlogError::IoError)?;
+if mmap.len() < 

D9519: rhg: add a test with persistent-nodemap

2020-12-04 Thread SimonSapin
SimonSapin 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/D9519

AFFECTED FILES
  tests/test-rhg.t

CHANGE DETAILS

diff --git a/tests/test-rhg.t b/tests/test-rhg.t
--- a/tests/test-rhg.t
+++ b/tests/test-rhg.t
@@ -165,3 +165,36 @@
   $ rhg debugrequirements
   abort: .hg/requires is corrupted
   [255]
+
+Persistent nodemap
+  $ cd $TESTTMP
+  $ rm -rf repository
+  $ hg init repository
+  $ cd repository
+  $ rhg debugrequirements | grep nodemap
+  [1]
+  $ hg debugbuilddag .+5000 --overwritten-file --config 
"storage.revlog.nodemap.mode=warn"
+  $ hg id -r tip
+  c3ae8dec9fad tip
+  $ ls .hg/store/00changelog*
+  .hg/store/00changelog.d
+  .hg/store/00changelog.i
+  $ rhg files -r c3ae8dec9fad
+  of
+
+  $ cd $TESTTMP
+  $ rm -rf repository
+  $ hg --config format.use-persistent-nodemap=True init repository
+  $ cd repository
+  $ rhg debugrequirements | grep nodemap
+  persistent-nodemap
+  $ hg debugbuilddag .+5000 --overwritten-file --config 
"storage.revlog.nodemap.mode=warn"
+  $ hg id -r tip
+  c3ae8dec9fad tip
+  $ ls .hg/store/00changelog*
+  .hg/store/00changelog-*.nd (glob)
+  .hg/store/00changelog.d
+  .hg/store/00changelog.i
+  .hg/store/00changelog.n
+  $ rhg files -r c3ae8dec9fad
+  [252]



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


D9518: wireprotov2: re-add tuple around `bundle2` check

2020-12-04 Thread Raphaël Gomès
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I stumbled upon this while looking for the current (v1) `capable` method. It
  looks like 9c2c77c73f23 
 
accidentally removed the comma, turning the tuple into
  a simple parenthesis expression.
  
  This has not been detected since wireproto2 is not in use AFAIK.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  mercurial/httppeer.py

CHANGE DETAILS

diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -892,7 +892,7 @@
 return True
 
 # Other concepts.
-if name in b'bundle2':
+if name in (b'bundle2',):
 return True
 
 # Alias command-* to presence of command of that name.



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


D9517: commandserver: handle IOError related to flushing of streams

2020-12-04 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  After dispatch, without chg we have handling of flushing of streams and
  exception handling related to it. The exception handling part is important
  because there can be exceptions when flushing fout or ferr.
  
  One such case is in `test-basic.t` which was failing on python3+chg without 
this
  patch as this handling was missing from chg.
  
  Failure can be seen at
  https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/128399
  
  Honestly I am not sure which one of `chgserver.py` or `commandserver.py` the
  change should go in.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/commandserver.py
  mercurial/dispatch.py

CHANGE DETAILS

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -104,6 +104,36 @@
 raise exc
 
 
+def closestdio(ui, err):
+status = None
+# In all cases we try to flush stdio streams.
+if util.safehasattr(ui, b'fout'):
+assert ui is not None  # help pytype
+assert ui.fout is not None  # help pytype
+try:
+ui.fout.flush()
+except IOError as e:
+err = e
+status = -1
+
+if util.safehasattr(ui, b'ferr'):
+assert ui is not None  # help pytype
+assert ui.ferr is not None  # help pytype
+try:
+if err is not None and err.errno != errno.EPIPE:
+ui.ferr.write(
+b'abort: %s\n' % encoding.strtolocal(err.strerror)
+)
+ui.ferr.flush()
+# There's not much we can do about an I/O error here. So (possibly)
+# change the status code and move on.
+except IOError:
+status = -1
+
+_silencestdio()
+return status
+
+
 def run():
 """run the command in sys.argv"""
 try:
@@ -117,31 +147,9 @@
 err = e
 status = -1
 
-# In all cases we try to flush stdio streams.
-if util.safehasattr(req.ui, b'fout'):
-assert req.ui is not None  # help pytype
-assert req.ui.fout is not None  # help pytype
-try:
-req.ui.fout.flush()
-except IOError as e:
-err = e
-status = -1
-
-if util.safehasattr(req.ui, b'ferr'):
-assert req.ui is not None  # help pytype
-assert req.ui.ferr is not None  # help pytype
-try:
-if err is not None and err.errno != errno.EPIPE:
-req.ui.ferr.write(
-b'abort: %s\n' % encoding.strtolocal(err.strerror)
-)
-req.ui.ferr.flush()
-# There's not much we can do about an I/O error here. So (possibly)
-# change the status code and move on.
-except IOError:
-status = -1
-
-_silencestdio()
+ret = closestdio(req.ui, err)
+if ret:
+status = ret
 except KeyboardInterrupt:
 # Catch early/late KeyboardInterrupt as last ditch. Here nothing will
 # be printed to console to avoid another IOError/KeyboardInterrupt.
diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py
--- a/mercurial/commandserver.py
+++ b/mercurial/commandserver.py
@@ -355,7 +355,18 @@
 )
 
 try:
-ret = self._dispatchcommand(req) & 255
+err = None
+try:
+status = self._dispatchcommand(req)
+except error.StdioError as e:
+status = -1
+err = e
+
+retval = dispatch.closestdio(req.ui, err)
+if retval:
+status = retval
+
+ret = status & 255
 # If shutdown-on-interrupt is off, it's important to write the
 # result code *after* SIGINT handler removed. If the result code
 # were lost, the client wouldn't be able to continue processing.



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


D9516: perf: use the `perf-` prefix for perf command

2020-12-04 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is the one command namespace where they should not be any ambiguity about
  command that should be in it. The perf extensions is only adding performance
  related command.
  
  so this is a good ground to start putting dash folding to the tests.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/perf.py

CHANGE DETAILS

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -744,7 +744,7 @@
 # perf commands
 
 
-@command(b'perfwalk', formatteropts)
+@command(b'perf-walk', formatteropts)
 def perfwalk(ui, repo, *pats, **opts):
 opts = _byteskwargs(opts)
 timer, fm = gettimer(ui, opts)
@@ -759,7 +759,7 @@
 fm.end()
 
 
-@command(b'perfannotate', formatteropts)
+@command(b'perf-annotate', formatteropts)
 def perfannotate(ui, repo, f, **opts):
 opts = _byteskwargs(opts)
 timer, fm = gettimer(ui, opts)
@@ -769,7 +769,7 @@
 
 
 @command(
-b'perfstatus',
+b'perf-status',
 [
 (b'u', b'unknown', False, b'ask status to look for unknown files'),
 (b'', b'dirstate', False, b'benchmark the internal dirstate call'),
@@ -806,7 +806,7 @@
 fm.end()
 
 
-@command(b'perfaddremove', formatteropts)
+@command(b'perf-addremove', formatteropts)
 def perfaddremove(ui, repo, **opts):
 opts = _byteskwargs(opts)
 timer, fm = gettimer(ui, opts)
@@ -837,7 +837,7 @@
 cl._nodepos = None
 
 
-@command(b'perfheads', formatteropts)
+@command(b'perf-heads', formatteropts)
 def perfheads(ui, repo, **opts):
 """benchmark the computation of a changelog heads"""
 opts = _byteskwargs(opts)
@@ -855,7 +855,7 @@
 
 
 @command(
-b'perftags',
+b'perf-tags',
 formatteropts
 + [
 (b'', b'clear-revlogs', False, b'refresh changelog and manifest'),
@@ -880,7 +880,7 @@
 fm.end()
 
 
-@command(b'perfancestors', formatteropts)
+@command(b'perf-ancestors', formatteropts)
 def perfancestors(ui, repo, **opts):
 opts = _byteskwargs(opts)
 timer, fm = gettimer(ui, opts)
@@ -894,7 +894,7 @@
 fm.end()
 
 
-@command(b'perfancestorset', formatteropts)
+@command(b'perf-ancestorset', formatteropts)
 def perfancestorset(ui, repo, revset, **opts):
 opts = _byteskwargs(opts)
 timer, fm = gettimer(ui, opts)
@@ -910,7 +910,7 @@
 fm.end()
 
 
-@command(b'perfdiscovery', formatteropts, b'PATH')
+@command(b'perf-discovery', formatteropts, b'PATH')
 def perfdiscovery(ui, repo, path, **opts):
 """benchmark discovery between local repo and the peer at given path"""
 repos = [repo, None]
@@ -928,7 +928,7 @@
 
 
 @command(
-b'perfbookmarks',
+b'perf-bookmarks',
 formatteropts
 + [
 (b'', b'clear-revlogs', False, b'refresh changelog and manifest'),
@@ -953,7 +953,7 @@
 fm.end()
 
 
-@command(b'perfbundleread', formatteropts, b'BUNDLE')
+@command(b'perf-bundleread', formatteropts, b'BUNDLE')
 def perfbundleread(ui, repo, bundlepath, **opts):
 """Benchmark reading of bundle files.
 
@@ -1080,7 +1080,7 @@
 
 
 @command(
-b'perfchangegroupchangelog',
+b'perf-changegroupchangelog',
 formatteropts
 + [
 (b'', b'cgversion', b'02', b'changegroup version'),
@@ -1116,7 +1116,7 @@
 fm.end()
 
 
-@command(b'perfdirs', formatteropts)
+@command(b'perf-dirs', formatteropts)
 def perfdirs(ui, repo, **opts):
 opts = _byteskwargs(opts)
 timer, fm = gettimer(ui, opts)
@@ -1132,7 +1132,7 @@
 
 
 @command(
-b'perfdirstate',
+b'perf-dirstate',
 [
 (
 b'',
@@ -1195,7 +1195,7 @@
 fm.end()
 
 
-@command(b'perfdirstatedirs', formatteropts)
+@command(b'perf-dirstatedirs', formatteropts)
 def perfdirstatedirs(ui, repo, **opts):
 """benchmap a 'dirstate.hasdir' call from an empty `dirs` cache"""
 opts = _byteskwargs(opts)
@@ -1212,7 +1212,7 @@
 fm.end()
 
 
-@command(b'perfdirstatefoldmap', formatteropts)
+@command(b'perf-dirstatefoldmap', formatteropts)
 def perfdirstatefoldmap(ui, repo, **opts):
 """benchmap a `dirstate._map.filefoldmap.get()` request
 
@@ -1233,7 +1233,7 @@
 fm.end()
 
 
-@command(b'perfdirfoldmap', formatteropts)
+@command(b'perf-dirfoldmap', formatteropts)
 def perfdirfoldmap(ui, repo, **opts):
 """benchmap a `dirstate._map.dirfoldmap.get()` request
 
@@ -1255,7 +1255,7 @@
 fm.end()
 
 
-@command(b'perfdirstatewrite', formatteropts)
+@command(b'perf-dirstatewrite', formatteropts)
 def perfdirstatewrite(ui, repo, **opts):
 """benchmap the time it take to write a dirstate on disk"""
 opts = _byteskwargs(opts)
@@ -1297,7 +1297,7 @@
 
 
 @command(
-b'perfmergecalculate',
+b'perf-mergecalculate',
 [
 (b'r', b'rev', b'.', b'rev to merge against'),
 (b'', b'from', b'', b'rev to merge from'),
@@ -1330,7 +1330,7 @@
 
 
 @command(
-

D9515: command: automatically create alias for command using '-' in names

2020-12-04 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  As discussed during the "5.6 Sprint" ignoring dash in command name open the 
way
  to using them more. We can now move existing command to more readable (dash
  using) names without breaking any compatibility.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -359,7 +359,17 @@
 
 
 def parsealiases(cmd):
-return cmd.split(b"|")
+base_aliases = cmd.split(b"|")
+all_aliases = set(base_aliases)
+extra_aliases = []
+for alias in base_aliases:
+if b'-' in alias:
+folded_alias = alias.replace(b'-', b'')
+if folded_alias not in all_aliases:
+all_aliases.add(folded_alias)
+extra_aliases.append(folded_alias)
+base_aliases.extend(extra_aliases)
+return base_aliases
 
 
 def setupwrapcolorwrite(ui):



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