D11235: typing: add several assertions to dirstatemap to appease pytype

2021-07-29 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I think it's been mentioned in IRC that these can't be None in this case.  
This
  fixes:
  
File "/mnt/c/Users/Matt/hg/mercurial/dirstatemap.py", line 213, in addfile: 
unsupported operand type(s) for &: 'None' and 'int' [unsupported-operands]
  No attribute '__and__' on None or '__rand__' on int
Called from (traceback):
  line 290, in reset_state
File "/mnt/c/Users/Matt/hg/mercurial/dirstatemap.py", line 214, in addfile: 
unsupported operand type(s) for &: 'None' and 'int' [unsupported-operands]
  No attribute '__and__' on None or '__rand__' on int
Called from (traceback):
  line 290, in reset_state

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  mercurial/dirstatemap.py

CHANGE DETAILS

diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py
+++ b/mercurial/dirstatemap.py
@@ -209,6 +209,9 @@
 else:
 assert size != FROM_P2
 assert size != NONNORMAL
+assert size is not None
+assert mtime is not None
+
 state = b'n'
 size = size & rangemask
 mtime = mtime & rangemask



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


Failed pipeline for branch/stable | mercurial-devel | 1529ac79

2021-07-29 Thread Heptapod


Pipeline #25302 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: 1529ac79 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/commit/1529ac79405751ea94d256ff8d769762509bb2d5
 )
Commit Message: git: restore basic functionality (issue6545)

I...
Commit Author: Augie Fackler

Pipeline #25302 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/pipelines/25302 ) triggered 
by Administrator ( https://foss.heptapod.net/root )
had 2 failed builds.

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

Stage: tests
Name: test-py3-rust
Job #230847 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/230847/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


D11233: dirstate: fix typo in docstring

2021-07-29 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Spotted while repairing git extension tests.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -599,7 +599,7 @@
 
 This function must be called within a `dirstate.parentchange` context.
 
-note: the API is at an early stage and we might need to ajust it
+note: the API is at an early stage and we might need to adjust it
 depending of what information ends up being relevant and useful to
 other processing.
 """



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


D11234: git: restore basic functionality (issue6545)

2021-07-29 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It looks like a big refactor happened on dirstate, and the git extension was
  just ignored.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/git/dirstate.py

CHANGE DETAILS

diff --git a/hgext/git/dirstate.py b/hgext/git/dirstate.py
--- a/hgext/git/dirstate.py
+++ b/hgext/git/dirstate.py
@@ -74,6 +74,8 @@
 self._root = os.path.dirname(root)
 self.git = gitrepo
 self._plchangecallbacks = {}
+# TODO: context.poststatusfixup is bad and uses this attribute
+self._dirty = False
 
 def p1(self):
 try:
@@ -255,12 +257,12 @@
 if match(p):
 yield p
 
-def normal(self, f, parentfiledata=None):
+def set_clean(self, f, parentfiledata=None):
 """Mark a file normal and clean."""
 # TODO: for now we just let libgit2 re-stat the file. We can
 # clearly do better.
 
-def normallookup(self, f):
+def set_possibly_dirty(self, f):
 """Mark a file normal, but possibly dirty."""
 # TODO: for now we just let libgit2 re-stat the file. We can
 # clearly do better.
@@ -296,6 +298,16 @@
 # TODO: figure out a strategy for saving index backups.
 pass
 
+def set_tracked(self, f):
+uf = pycompat.fsdecode(f)
+if uf in self.git.index:
+return False
+index = self.git.index
+index.read()
+index.add(uf)
+index.write()
+return True
+
 def add(self, f):
 index = self.git.index
 index.read()
@@ -310,6 +322,16 @@
 index.remove(fs)
 index.write()
 
+def set_untracked(self, f):
+index = self.git.index
+index.read()
+fs = pycompat.fsdecode(f)
+if fs in index:
+index.remove(fs)
+index.write()
+return True
+return False
+
 def remove(self, f):
 index = self.git.index
 index.read()
@@ -324,6 +346,10 @@
 # TODO
 pass
 
+def update_file(self, *args, **kwargs):
+# TODO
+pass
+
 @contextlib.contextmanager
 def parentchange(self):
 # TODO: track this maybe?



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


D11232: rewriteutil: fix crash when a rewritten message references f{6, 64}

2021-07-29 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Without this, the rewriteutil logic thinks it's found a reference to the wdir
  pseudo-revision, and then tries to look it up and rewrite it. Stop it from
  doing that.
  
  Amusingly, I had trouble working with this changeset when I didn't
  describe the defect above using a regular expression, because it would
  trigger the bug in my installed version of hg.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/rewriteutil.py
  tests/test-rebase-inmemory.t

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -971,9 +971,9 @@
   $ hg ci -m 'this will change hash'
   created new head
   $ echo changed >> update_hash_refs
-  $ hg ci -m "this starts as the child of `hg log -r . -T'{node|short}'` but 
not 506e2454484b"
+  $ hg ci -m "this starts as the child of `hg log -r . -T'{node|short}'` but 
not 506e2454484b. Also, "
   $ hg tglog
-  @  5: becd28036887 'this starts as the child of 98789aa60148 but not 
506e2454484b'
+  @  5: a8b42cbbde83 'this starts as the child of 98789aa60148 but not 
506e2454484b. Also, '
   |
   o  4: 98789aa60148 'this will change hash'
   |
@@ -987,10 +987,10 @@
   
   $ hg rebase -r '.^::' -d 3
   rebasing 4:98789aa60148 "this will change hash"
-  rebasing 5:becd28036887 tip "this starts as the child of 98789aa60148 but 
not 506e2454484b"
-  saved backup bundle to 
$TESTTMP/keep_merge/.hg/strip-backup/98789aa60148-72ec40bd-rebase.hg
+  rebasing 5:a8b42cbbde83 tip "this starts as the child of 98789aa60148 but 
not 506e2454484b. Also, "
+  saved backup bundle to 
$TESTTMP/keep_merge/.hg/strip-backup/98789aa60148-da3f4c2c-rebase.hg
   $ hg tglog
-  @  5: a445b8426f4b 'this starts as the child of c16c25696fe7 but not 
506e2454484b'
+  @  5: 0fd2912e6cc1 'this starts as the child of c16c25696fe7 but not 
506e2454484b. Also, '
   |
   o  4: c16c25696fe7 'this will change hash'
   |
diff --git a/mercurial/rewriteutil.py b/mercurial/rewriteutil.py
--- a/mercurial/rewriteutil.py
+++ b/mercurial/rewriteutil.py
@@ -207,7 +207,12 @@
 hashes = re.findall(NODE_RE, commitmsg)
 unfi = repo.unfiltered()
 for h in hashes:
-fullnode = scmutil.resolvehexnodeidprefix(unfi, h)
+try:
+fullnode = scmutil.resolvehexnodeidprefix(unfi, h)
+except error.WdirUnsupported:
+# Someone has an f... in a commit message we're
+# rewriting. Don't try rewriting that.
+continue
 if fullnode is None:
 continue
 ctx = unfi[fullnode]



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


D11231: tests: add explicit coverage for update_hash_refs from rewriteutil

2021-07-29 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I couldn't find any evidence this is covered by tests in core (but there's a
  good chance I missed it). We've seen a cute bug in that code, but first
  let's just cover the cases that work correctly.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-rebase-inmemory.t

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -963,6 +963,46 @@
   o  0: d20a80d4def3 'base'
   
 
+Test that update_hash_refs works.
+  $ hg co 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo update_hash_refs > update_hash_refs
+  $ hg add update_hash_refs
+  $ hg ci -m 'this will change hash'
+  created new head
+  $ echo changed >> update_hash_refs
+  $ hg ci -m "this starts as the child of `hg log -r . -T'{node|short}'` but 
not 506e2454484b"
+  $ hg tglog
+  @  5: becd28036887 'this starts as the child of 98789aa60148 but not 
506e2454484b'
+  |
+  o  4: 98789aa60148 'this will change hash'
+  |
+  | o3: 506e2454484b 'merge'
+  | |\
+  +---o  2: 531f80391e4a 'c'
+  | |
+  | o  1: 6f252845ea45 'a'
+  |/
+  o  0: d20a80d4def3 'base'
+  
+  $ hg rebase -r '.^::' -d 3
+  rebasing 4:98789aa60148 "this will change hash"
+  rebasing 5:becd28036887 tip "this starts as the child of 98789aa60148 but 
not 506e2454484b"
+  saved backup bundle to 
$TESTTMP/keep_merge/.hg/strip-backup/98789aa60148-72ec40bd-rebase.hg
+  $ hg tglog
+  @  5: a445b8426f4b 'this starts as the child of c16c25696fe7 but not 
506e2454484b'
+  |
+  o  4: c16c25696fe7 'this will change hash'
+  |
+  o3: 506e2454484b 'merge'
+  |\
+  | o  2: 531f80391e4a 'c'
+  | |
+  o |  1: 6f252845ea45 'a'
+  |/
+  o  0: d20a80d4def3 'base'
+  
+
   $ cd ..
 
 Test (virtual) working directory without changes, created by merge conflict



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


Failed pipeline for branch/stable | mercurial-devel | 1d8c1103

2021-07-29 Thread Heptapod


Pipeline #25219 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: 1d8c1103 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/commit/1d8c1103ad14c166cb6c19e42bc802876f48f67a
 )
Commit Message: help: indicate how to run downgrade a repositor...
Commit Author: Pierre-Yves David ( https://foss.heptapod.net/marmoute )

Pipeline #25219 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/pipelines/25219 ) triggered 
by Administrator ( https://foss.heptapod.net/root )
had 3 failed builds.

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

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

Stage: tests
Name: test-py3
Job #230764 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/230764/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


[Bug 6558] New: more test-nointerrupt.t trouble

2021-07-29 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6558

Bug ID: 6558
   Summary: more test-nointerrupt.t trouble
   Product: Mercurial
   Version: stable branch
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: pierre-yves.da...@ens-lyon.org
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

It looks like we still have failure from time to time. It is currently  unclear
if this is the test fault or if actual misbehavior are in play :

https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/230764

https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/230763

-- 
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 6557] New: Malpensa Airport ICAO Code

2021-07-29 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6557

Bug ID: 6557
   Summary: Malpensa Airport ICAO Code
   Product: Mercurial project
   Version: unspecified
  Hardware: PC
OS: Windows
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: website
  Assignee: bugzi...@mercurial-scm.org
  Reporter: airfleetrat...@gmail.com
CC: mercurial-devel@mercurial-scm.org

Airport codes are for giving a distinctive identity to an airport. When it
comes to Malpensa Airport, you can find two different codes – IATA and ICAO
codes. If you want to  know about the Malpensa Airport ICAO Code And IATA Code
then you can connect us.

https://www.airfleetrating.com/airport-codes/malpensa-international-airport/

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


D11230: rhg: Propagate permission errors when finding a repository

2021-07-29 Thread SimonSapin
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The Rust standard library has a `Path::is_dir` method that returns false
  for any I/O error (such as a permission error),
  not just "No such file or directory".
  
  Instead add an `is_dir` function that returns false for non-directories
  and for "No such file or directory" errors, but propagates other I/O errors.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  rust/hg-core/src/errors.rs
  rust/hg-core/src/repo.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/repo.rs b/rust/hg-core/src/repo.rs
--- a/rust/hg-core/src/repo.rs
+++ b/rust/hg-core/src/repo.rs
@@ -1,5 +1,5 @@
 use crate::config::{Config, ConfigError, ConfigParseError};
-use crate::errors::{HgError, IoErrorContext, IoResultExt};
+use crate::errors::{HgError, HgResultExt, IoErrorContext, IoResultExt};
 use crate::exit_codes;
 use crate::requirements;
 use crate::utils::files::get_path_from_bytes;
@@ -51,7 +51,7 @@
 // ancestors() is inclusive: it first yields `current_directory`
 // as-is.
 for ancestor in current_directory.ancestors() {
-if ancestor.join(".hg").is_dir() {
+if is_dir(ancestor.join(".hg"))? {
 return Ok(ancestor.to_path_buf());
 }
 }
@@ -73,9 +73,9 @@
 explicit_path: Option,
 ) -> Result {
 if let Some(root) = explicit_path {
-if root.join(".hg").is_dir() {
+if is_dir(root.join(".hg"))? {
 Self::new_at_path(root.to_owned(), config)
-} else if root.is_file() {
+} else if is_file()? {
 Err(HgError::unsupported("bundle repository").into())
 } else {
 Err(RepoError::NotFound {
@@ -130,7 +130,7 @@
 if relative {
 shared_path = dot_hg.join(shared_path)
 }
-if !shared_path.is_dir() {
+if !is_dir(_path)? {
 return Err(HgError::corrupted(format!(
 ".hg/sharedpath points to nonexistent directory {}",
 shared_path.display()
@@ -286,3 +286,20 @@
 .with_context(|| IoErrorContext::RenamingFile { from, to })
 }
 }
+
+fn fs_metadata(
+path: impl AsRef,
+) -> Result, HgError> {
+let path = path.as_ref();
+std::fs::metadata(path)
+.with_context(|| IoErrorContext::ReadingMetadata(path.to_owned()))
+.io_not_found_as_none()
+}
+
+fn is_dir(path: impl AsRef) -> Result {
+Ok(fs_metadata(path)?.map_or(false, |meta| meta.is_dir()))
+}
+
+fn is_file(path: impl AsRef) -> Result {
+Ok(fs_metadata(path)?.map_or(false, |meta| meta.is_file()))
+}
diff --git a/rust/hg-core/src/errors.rs b/rust/hg-core/src/errors.rs
--- a/rust/hg-core/src/errors.rs
+++ b/rust/hg-core/src/errors.rs
@@ -47,6 +47,8 @@
 /// Details about where an I/O error happened
 #[derive(Debug)]
 pub enum IoErrorContext {
+/// `std::fs::metadata`
+ReadingMetadata(std::path::PathBuf),
 ReadingFile(std::path::PathBuf),
 WritingFile(std::path::PathBuf),
 RemovingFile(std::path::PathBuf),
@@ -108,6 +110,9 @@
 impl fmt::Display for IoErrorContext {
 fn fmt(, f:  fmt::Formatter) -> fmt::Result {
 match self {
+IoErrorContext::ReadingMetadata(path) => {
+write!(f, "when reading metadata of {}", path.display())
+}
 IoErrorContext::ReadingFile(path) => {
 write!(f, "when reading {}", path.display())
 }



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


D11229: rhg: Add build and config instructions to the README file

2021-07-29 Thread SimonSapin
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This adds documentation explaining how to compile, configure, and use rhg
  as well as how the fallback mechanism works.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  rust/rhg/README.md

CHANGE DETAILS

diff --git a/rust/rhg/README.md b/rust/rhg/README.md
--- a/rust/rhg/README.md
+++ b/rust/rhg/README.md
@@ -1,4 +1,77 @@
-# rhg
+# `rhg`
+
+The `rhg` executable implements a subset of the functionnality of `hg`
+using only Rust, to avoid the startup cost of a Python interpreter.
+This subset is initially small but grows over time as `rhg` is improved.
+When fallback to the Python implementation is configured (see below),
+`rhg` aims to be a drop-in replacement for `hg` that should behave the same,
+except that some commands run faster.
+
+
+## Building
+
+To compile `rhg`, either run `cargo build --release` from this `rust/rhg/`
+directory, or run `make build-rhg` from the repository root.
+The executable can then be found at `rust/target/release/rhg`.
+
+
+## Mercurial configuration
+
+`rhg` reads Mercurial configuration from the usual sources:
+the user’s `~/.hgrc`, a repository’s `.hg/hgrc`, command line `--config`, etc.
+It has some specific configuration in the `[rhg]` section:
+
+* `on-unsupported` governs the behavior of `rhg` when it encounters something
+  that it does not support but “full” `hg` possibly does.
+  This can be in configuration, on the command line, or in a repository.
+
+  - `abort`, the default value, makes `rhg` print a message to stderr
+to explain what is not supported, then terminate with a 252 exit code.
+  - `abort-silent` makes it terminate with the same exit code,
+but without printing anything.
+  - `fallback` makes it silently call a (presumably Python-based) `hg`
+subprocess with the same command-line parameters.
+The `rhg.fallback-executable` configuration must be set.
+
+* `fallback-executable`: path to the executable to run in a sub-process
+  when falling back to a Python implementation of Mercurial.
 
-This project provides a fastpath Rust implementation of the Mercurial (`hg`)
-version control tool.
+* `allowed-extensions`: a list of extension names that `rhg` can ignore.
+
+  Mercurial extensions can modify the behavior of existing `hg` sub-commands,
+  including those that `rhg` otherwise supports.
+  Because it cannot load Python extensions, finding them
+  enabled in configuration is considered “unsupported” (see above).
+  A few exceptions are made for extensions that `rhg` does know about,
+  with the Rust implementation duplicating their behavior.
+
+  This configuration makes additional exceptions: `rhg` will proceed even if
+  those extensions are enabled.
+
+
+## Installation and configuration example
+
+For example, to install `rhg` as `hg` for the current user with fallback to
+the system-wide install of Mercurial, and allow it to run even though the
+`rebase` and `absorb` extensions are enabled, on a Unix-like platform:
+
+* Build `rhg` (see above)
+* Make sure the `~/.local/bin` exists and is in `$PATH`
+* From the repository root, make a symbolic link with
+  `ln -s rust/target/release/rhg ~/.local/bin/hg`
+* Configure `~/.hgrc` with:
+
+```
+[rhg]
+on-unsupported = fallback
+fallback-executable = /usr/bin/hg
+allowed-extensions = rebase, absorb
+```
+
+* Check that the output of running
+  `hg notarealsubcommand`
+  starts with `hg: unknown command`, which indicates fallback.
+
+* Check that the output of running
+  `hg notarealsubcommand --config rhg.on-unsupported=abort`
+  starts with `unsupported feature:`.



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


D11228: tests: make test-serve works on system that allow user to bind low port

2021-07-29 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It is possible to encounter linux system configured in a way that allow port
  < 1024 to be bound by any users. So we update a test to focus more on the 
actual
  test: "resolving `daytime` to an actual port number.
  
  The new auto-scaling CI runner provided by clever cloud is doing so. This is 
the
  initial motivation for this change, but it seems useful anyway.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  tests/test-serve.t

CHANGE DETAILS

diff --git a/tests/test-serve.t b/tests/test-serve.t
--- a/tests/test-serve.t
+++ b/tests/test-serve.t
@@ -44,13 +44,20 @@
   listening at http://localhost/ (bound to *$LOCALIP*:HGPORT2) (glob) (?)
   % errors
 
-With -v and -p daytime (should fail because low port)
+With -v and -p daytime
 
-#if no-root no-windows
+# On some system this will fails because port < 1024 are not bindable by normal
+# users.
+#
+# On some others the kernel is configured to allow any user to bind them and
+# this will work fine
+
+#if no-windows
   $ KILLQUIETLY=Y
   $ hgserve -p daytime
-  abort: cannot start server at 'localhost:13': Permission denied
-  abort: child process failed to start
+  abort: cannot start server at 'localhost:13': Permission denied (?)
+  abort: child process failed to start (?)
+  listening at http://localhost/ (bound to $LOCALIP:13) (?)
   % errors
   $ KILLQUIETLY=N
 #endif



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