D10244: tests: ask any chg instance to terminate before looking at sqlite dbs

2021-03-19 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  There are spurious errors in CI where the database is still locked, so
  force the daemon to quit to get deterministic behavior. Since the kill
  command itself is racy, also sleep 2s to give the server time to wake up
  and exit.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-wireproto-exchangev2-shallow.t

CHANGE DETAILS

diff --git a/tests/test-wireproto-exchangev2-shallow.t 
b/tests/test-wireproto-exchangev2-shallow.t
--- a/tests/test-wireproto-exchangev2-shallow.t
+++ b/tests/test-wireproto-exchangev2-shallow.t
@@ -176,6 +176,10 @@
   updating the branch cache
   (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
 
+#if chg
+  $ hg --kill-chg-daemon
+  $ sleep 2
+#endif
   $ sqlite3 -line client-shallow-1/.hg/store/db.sqlite << EOF
   > SELECT id, path, revnum, node, p1rev, p2rev, linkrev, flags FROM filedata 
ORDER BY id ASC;
   > EOF
@@ -347,6 +351,10 @@
   updating the branch cache
   (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
 
+#if chg
+  $ hg --kill-chg-daemon
+  $ sleep 2
+#endif
   $ sqlite3 -line client-shallow-narrow-1/.hg/store/db.sqlite << EOF
   > SELECT id, path, revnum, node, p1rev, p2rev, linkrev, flags FROM filedata 
ORDER BY id ASC;
   > EOF



To: joerg.sonnenberger, #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


D10243: chg: kill trailing comma in SEE ALSO

2021-03-19 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger 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/D10243

AFFECTED FILES
  contrib/chg/chg.1

CHANGE DETAILS

diff --git a/contrib/chg/chg.1 b/contrib/chg/chg.1
--- a/contrib/chg/chg.1
+++ b/contrib/chg/chg.1
@@ -36,6 +36,6 @@
 .B \-\-kill\-chg\-daemon
 Terminate the background command servers.
 .SH SEE ALSO
-.BR hg (1),
+.BR hg (1)
 .SH AUTHOR
 Written by Yuya Nishihara .



To: joerg.sonnenberger, #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/default | mercurial-devel | 8904f282

2021-03-19 Thread Heptapod


Pipeline #19570 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: 8904f282 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/commit/8904f2822f3252547e47ded6019222af89ea9a79
 )
Commit Message: tests: resort to fix test with newer git versio...
Commit Author: Jörg Sonnenberger ( https://foss.heptapod.net/joerg )

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

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

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


Failed pipeline for branch/default | mercurial-devel | 82b07b2d

2021-03-19 Thread Heptapod


Pipeline #19567 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: 82b07b2d ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/commit/82b07b2de3065c619f1feaca49f79fb890ebc1e6
 )
Commit Message: git: fix missing case from 6266d19556ad (introd...
Commit Author: Jörg Sonnenberger ( https://foss.heptapod.net/joerg )

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

Job #177979 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/177979/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


D10242: tests: resort to fix test with newer git versions

2021-03-19 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-git-interop.t

CHANGE DETAILS

diff --git a/tests/test-git-interop.t b/tests/test-git-interop.t
--- a/tests/test-git-interop.t
+++ b/tests/test-git-interop.t
@@ -28,9 +28,9 @@
   $ hg status
   abort: repository specified git format in .hg/requires but has no .git 
directory
   [255]
+  $ git config --global init.defaultBranch master
   $ git init
   Initialized empty Git repository in $TESTTMP/nogit/.git/
-  $ git config --global init.defaultBranch master
 This status invocation shows some hg gunk because we didn't use
 `hg init --git`, which fixes up .git/info/exclude for us.
   $ hg status



To: joerg.sonnenberger, 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


D10241: git: fix missing case from 6266d19556ad (introduction of nodeconstants)

2021-03-19 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/git/gitlog.py

CHANGE DETAILS

diff --git a/hgext/git/gitlog.py b/hgext/git/gitlog.py
--- a/hgext/git/gitlog.py
+++ b/hgext/git/gitlog.py
@@ -218,7 +218,7 @@
 n = nodeorrev
 # handle looking up nullid
 if n == nullid:
-return hgchangelog._changelogrevision(extra={})
+return hgchangelog._changelogrevision(extra={}, manifest=nullid)
 hn = gitutil.togitnode(n)
 # We've got a real commit!
 files = [



To: joerg.sonnenberger, 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@46794: new changeset

2021-03-19 Thread Mercurial Commits
New changeset in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/e2f7b2695ba1
changeset:   46794:e2f7b2695ba1
bookmark:@
tag: tip
parent:  46782:6b52cffd8d0a
parent:  46793:86b47ec1960a
user:Matt Harbison 
date:Thu Mar 18 18:24:59 2021 -0400
summary: merge with stable

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


D10240: rebase: skip obsolete commits even if they have pruned successors

2021-03-19 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Issue 5782 reported that `hg rebase -r ` failed with an error saying that it would cause
  divergence. Commit a603a570cdbe 
 
(rebase: add a test case for
  issue5782, 2018-02-07) fixed it by letting you rebase the
  commit. However, that fix seems inconsistent with how we handle `hg
  rebase -r `. To me, it should make no difference
  whether a commit is pruned itself or if it has (only) pruned
  successors. This patch changes it so we treat these two kinds of
  commits the same way. I let the message we print remain "note: not
  rebasing , it has no successor" even though that last part is
  not technically correct for commits with pruned successors. I doubt it
  will confuse users.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-obsolete.t

CHANGE DETAILS

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -1294,18 +1294,16 @@
   o  0:b173517d0057 a
   
   $ hg rebase -d 0 -r 2
-  rebasing 2:a82ac2b38757 c "c"
+  note: not rebasing 2:a82ac2b38757 c "c", it has no successor
   $ hg log -G -r 'a': --hidden
-  o  5:69ad416a4a26 c
+  *  4:76be324c128b d
   |
-  | *  4:76be324c128b d
+  | x  3:ef8a456de8fa c1 (pruned)
   | |
-  | | x  3:ef8a456de8fa c1 (pruned)
-  | | |
-  | x |  2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa rewritten 
using rebase as 5:69ad416a4a26)
-  | |/
-  | o  1:488e1b7e7341 b
+  x |  2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa)
   |/
+  o  1:488e1b7e7341 b
+  |
   o  0:b173517d0057 a
   
   $ cd ..
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -361,11 +361,9 @@
 (
 self.obsoletenotrebased,
 self.obsoletewithoutsuccessorindestination,
-obsoleteextinctsuccessors,
 ) = _computeobsoletenotrebased(self.repo, obsoleteset, destmap)
 skippedset = set(self.obsoletenotrebased)
 skippedset.update(self.obsoletewithoutsuccessorindestination)
-skippedset.update(obsoleteextinctsuccessors)
 _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
 
 def _prepareabortorcontinue(
@@ -2192,13 +2190,9 @@
 
 `obsoletewithoutsuccessorindestination` is a set with obsolete revisions
 without a successor in destination.
-
-`obsoleteextinctsuccessors` is a set of obsolete revisions with only
-obsolete successors.
 """
 obsoletenotrebased = {}
 obsoletewithoutsuccessorindestination = set()
-obsoleteextinctsuccessors = set()
 
 assert repo.filtername is None
 cl = repo.changelog
@@ -2212,11 +2206,8 @@
 successors.remove(srcnode)
 succrevs = {get_rev(s) for s in successors}
 succrevs.discard(None)
-if succrevs.issubset(extinctrevs):
-# all successors are extinct
-obsoleteextinctsuccessors.add(srcrev)
-if not successors:
-# no successor
+if not successors or succrevs.issubset(extinctrevs):
+# no successor, or all successors are extinct
 obsoletenotrebased[srcrev] = None
 else:
 dstrev = destmap[srcrev]
@@ -2231,11 +,7 @@
 if srcrev in extinctrevs or any(s in destmap for s in 
succrevs):
 obsoletewithoutsuccessorindestination.add(srcrev)
 
-return (
-obsoletenotrebased,
-obsoletewithoutsuccessorindestination,
-obsoleteextinctsuccessors,
-)
+return obsoletenotrebased, obsoletewithoutsuccessorindestination
 
 
 def abortrebase(ui, repo):



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


mercurial@46793: 11 new changesets (11 on stable)

2021-03-19 Thread Mercurial Commits
11 new changesets (11 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/7fd369644c68
changeset:   46783:7fd369644c68
branch:  stable
parent:  46703:ca69e29a2a30
user:Matt Harbison 
date:Fri Mar 12 16:55:18 2021 -0500
summary: typing: disable a few errors calling py3.7+ functions in 
resourceutil.py

https://www.mercurial-scm.org/repo/hg/rev/65f437c240f2
changeset:   46784:65f437c240f2
branch:  stable
user:Matt Harbison 
date:Fri Mar 12 17:22:35 2021 -0500
summary: typing: disable a few errors when accessing Windows specific 
attributes

https://www.mercurial-scm.org/repo/hg/rev/521ac0d7047f
changeset:   46785:521ac0d7047f
branch:  stable
user:Matt Harbison 
date:Sat Mar 13 00:38:59 2021 -0500
summary: typing: disable import error warnings that are already handled

https://www.mercurial-scm.org/repo/hg/rev/52528570312e
changeset:   46786:52528570312e
branch:  stable
user:Matt Harbison 
date:Sat Mar 13 00:40:46 2021 -0500
summary: typing: disable module attribute warnings for properly 
conditionalized code

https://www.mercurial-scm.org/repo/hg/rev/70f8c64812db
changeset:   46787:70f8c64812db
branch:  stable
user:Matt Harbison 
date:Sat Mar 13 00:41:37 2021 -0500
summary: typing: fix directives mangled by black

https://www.mercurial-scm.org/repo/hg/rev/693991ccfc49
changeset:   46788:693991ccfc49
branch:  stable
user:Matt Harbison 
date:Fri Mar 12 19:02:07 2021 -0500
summary: crecord: null out the curses attribute with `None` on failure to 
import

https://www.mercurial-scm.org/repo/hg/rev/914ca0a98518
changeset:   46789:914ca0a98518
branch:  stable
user:Matt Harbison 
date:Fri Mar 12 20:25:12 2021 -0500
summary: typing: add an assertion to mercurial/hgweb/webcommands.py to help 
pytype

https://www.mercurial-scm.org/repo/hg/rev/5137896602d9
changeset:   46790:5137896602d9
branch:  stable
user:Matt Harbison 
date:Fri Mar 12 23:28:56 2021 -0500
summary: typing: add an assertion to verify.py to appease pytype

https://www.mercurial-scm.org/repo/hg/rev/d35063ebd761
changeset:   46791:d35063ebd761
branch:  stable
user:Matt Harbison 
date:Fri Mar 12 21:19:17 2021 -0500
summary: obsutil: maintain a homogenous list when computing successors

https://www.mercurial-scm.org/repo/hg/rev/7e08fa9b3d13
changeset:   46792:7e08fa9b3d13
branch:  stable
user:Matt Harbison 
date:Sat Mar 13 02:07:34 2021 -0500
summary: typing: add assertions to localrepo.py to appease pytype

https://www.mercurial-scm.org/repo/hg/rev/86b47ec1960a
changeset:   46793:86b47ec1960a
branch:  stable
tag: tip
user:Matt Harbison 
date:Sat Mar 13 02:09:23 2021 -0500
summary: typing: rewrite a conditional assignment to unconfuse pytype

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


D10239: rhg: Initial support for the 'status' command

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

REVISION SUMMARY
  Only comparing the working directory with its first parent revision
  is supported. The core logic of dirstate handling and `stat`’ing files
  was already in `hg-core` supporting Python-based hg with Rust extensions,
  so this is mostly plumbing to rhg’s CLI.
  
  For now the command is experimental and disabled by default,
  since it has some bugs that causes a number of tests to fail.
  These failures can be seen with:
  
tests/run-tests.py --rhg --extra-config-opt rhg.status=true

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/repo.rs
  rust/rhg/src/commands/status.rs
  rust/rhg/src/main.rs

CHANGE DETAILS

diff --git a/rust/rhg/src/main.rs b/rust/rhg/src/main.rs
--- a/rust/rhg/src/main.rs
+++ b/rust/rhg/src/main.rs
@@ -307,7 +307,9 @@
 files
 root
 config
+status
 }
+
 pub struct CliInvocation<'a> {
 ui: &'a Ui,
 subcommand_args: &'a ArgMatches<'a>,
diff --git a/rust/rhg/src/commands/status.rs b/rust/rhg/src/commands/status.rs
new file mode 100644
--- /dev/null
+++ b/rust/rhg/src/commands/status.rs
@@ -0,0 +1,315 @@
+// status.rs
+//
+// Copyright 2020, Georges Racinet 
+//
+// This software may be used and distributed according to the terms of the
+// GNU General Public License version 2 or any later version.
+
+use crate::error::CommandError;
+use crate::ui::Ui;
+use clap::{Arg, SubCommand};
+use hg;
+use hg::errors::IoResultExt;
+use hg::matchers::AlwaysMatcher;
+use hg::operations::cat;
+use hg::repo::Repo;
+use hg::revlog::node::Node;
+use hg::utils::hg_path::{hg_path_to_os_string, HgPath};
+use hg::{DirstateMap, StatusError};
+use hg::{HgPathCow, StatusOptions};
+use log::{info, warn};
+use std::convert::TryInto;
+use std::fs;
+use std::io::BufReader;
+use std::io::Read;
+
+pub const HELP_TEXT:  = "
+Show changed files in the working directory
+
+This is a pure Rust version of `hg status`.
+
+Some options might be missing, check the list below.
+";
+
+pub fn args() -> clap::App<'static, 'static> {
+SubCommand::with_name("status")
+.alias("st")
+.about(HELP_TEXT)
+.arg(
+Arg::with_name("all")
+.help("show status of all files")
+.short("-A")
+.long("--all"),
+)
+.arg(
+Arg::with_name("modified")
+.help("show only modified files")
+.short("-m")
+.long("--modified"),
+)
+.arg(
+Arg::with_name("added")
+.help("show only added files")
+.short("-a")
+.long("--added"),
+)
+.arg(
+Arg::with_name("removed")
+.help("show only removed files")
+.short("-r")
+.long("--removed"),
+)
+.arg(
+Arg::with_name("clean")
+.help("show only clean files")
+.short("-c")
+.long("--clean"),
+)
+.arg(
+Arg::with_name("deleted")
+.help("show only deleted files")
+.short("-d")
+.long("--deleted"),
+)
+.arg(
+Arg::with_name("unknown")
+.help("show only unknown (not tracked) files")
+.short("-u")
+.long("--unknown"),
+)
+.arg(
+Arg::with_name("ignored")
+.help("show only ignored files")
+.short("-i")
+.long("--ignored"),
+)
+}
+
+/// Pure data type allowing the caller to specify file states to display
+#[derive(Copy, Clone, Debug)]
+pub struct DisplayStates {
+pub modified: bool,
+pub added: bool,
+pub removed: bool,
+pub clean: bool,
+pub deleted: bool,
+pub unknown: bool,
+pub ignored: bool,
+}
+
+pub const DEFAULT_DISPLAY_STATES: DisplayStates = DisplayStates {
+modified: true,
+added: true,
+removed: true,
+clean: false,
+deleted: true,
+unknown: true,
+ignored: false,
+};
+
+pub const ALL_DISPLAY_STATES: DisplayStates = DisplayStates {
+modified: true,
+added: true,
+removed: true,
+clean: true,
+deleted: true,
+unknown: true,
+ignored: true,
+};
+
+impl DisplayStates {
+pub fn is_empty() -> bool {
+!(self.modified
+|| self.added
+|| self.removed
+|| self.clean
+|| self.deleted
+|| self.unknown
+|| self.ignored)
+}
+}
+
+pub fn run(invocation: ::CliInvocation) -> Result<(), CommandError> {
+let status_enabled_default = false;
+let status_enabled = invocation.config.get_option(b"rhg", b"status")?;
+if !status_enabled.unwrap_or(status_enabled_default) {
+return 

D10238: rhg: Add more conversions between error types

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

REVISION SUMMARY
  This allows using the `?` operator in more places, as the next commit does.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/config/config.rs
  rust/hg-core/src/errors.rs
  rust/hg-core/src/lib.rs
  rust/rhg/src/error.rs

CHANGE DETAILS

diff --git a/rust/rhg/src/error.rs b/rust/rhg/src/error.rs
--- a/rust/rhg/src/error.rs
+++ b/rust/rhg/src/error.rs
@@ -2,11 +2,12 @@
 use crate::ui::UiError;
 use crate::NoRepoInCwdError;
 use format_bytes::format_bytes;
-use hg::config::{ConfigError, ConfigParseError};
+use hg::config::{ConfigError, ConfigParseError, ConfigValueParseError};
 use hg::errors::HgError;
 use hg::repo::RepoError;
 use hg::revlog::revlog::RevlogError;
 use hg::utils::files::get_bytes_from_path;
+use hg::{DirstateError, DirstateMapError, StatusError};
 use std::convert::From;
 
 /// The kind of command error
@@ -61,6 +62,12 @@
 }
 }
 
+impl From for CommandError {
+fn from(error: ConfigValueParseError) -> Self {
+CommandError::abort(error.to_string())
+}
+}
+
 impl From for CommandError {
 fn from(_error: UiError) -> Self {
 // If we already failed writing to stdout or stderr,
@@ -144,3 +151,24 @@
 }
 }
 }
+
+impl From for CommandError {
+fn from(error: StatusError) -> Self {
+CommandError::abort(format!("{}", error))
+}
+}
+
+impl From for CommandError {
+fn from(error: DirstateMapError) -> Self {
+CommandError::abort(format!("{}", error))
+}
+}
+
+impl From for CommandError {
+fn from(error: DirstateError) -> Self {
+match error {
+DirstateError::Common(error) => error.into(),
+DirstateError::Map(error) => error.into(),
+}
+}
+}
diff --git a/rust/hg-core/src/lib.rs b/rust/hg-core/src/lib.rs
--- a/rust/hg-core/src/lib.rs
+++ b/rust/hg-core/src/lib.rs
@@ -17,7 +17,8 @@
 dirstate_map::DirstateMap,
 parsers::{pack_dirstate, parse_dirstate, PARENT_SIZE},
 status::{
-status, BadMatch, BadType, DirstateStatus, StatusError, StatusOptions,
+status, BadMatch, BadType, DirstateStatus, HgPathCow, StatusError,
+StatusOptions,
 },
 CopyMap, CopyMapIter, DirstateEntry, DirstateParents, EntryState,
 StateMap, StateMapIter,
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
@@ -88,25 +88,7 @@
 HgError::UnsupportedFeature(explanation) => {
 write!(f, "unsupported feature: {}", explanation)
 }
-HgError::ConfigValueParseError(ConfigValueParseError {
-origin: _,
-line: _,
-section,
-item,
-value,
-expected_type,
-}) => {
-// TODO: add origin and line number information, here and in
-// corresponding python code
-write!(
-f,
-"config error: {}.{} is not a {} ('{}')",
-String::from_utf8_lossy(section),
-String::from_utf8_lossy(item),
-expected_type,
-String::from_utf8_lossy(value)
-)
-}
+HgError::ConfigValueParseError(error) => error.fmt(f),
 }
 }
 }
diff --git a/rust/hg-core/src/config/config.rs 
b/rust/hg-core/src/config/config.rs
--- a/rust/hg-core/src/config/config.rs
+++ b/rust/hg-core/src/config/config.rs
@@ -17,6 +17,7 @@
 use format_bytes::{write_bytes, DisplayBytes};
 use std::collections::HashSet;
 use std::env;
+use std::fmt;
 use std::path::{Path, PathBuf};
 use std::str;
 
@@ -68,6 +69,21 @@
 pub expected_type: &'static str,
 }
 
+impl fmt::Display for ConfigValueParseError {
+fn fmt(, f:  fmt::Formatter) -> fmt::Result {
+// TODO: add origin and line number information, here and in
+// corresponding python code
+write!(
+f,
+"config error: {}.{} is not a {} ('{}')",
+String::from_utf8_lossy(),
+String::from_utf8_lossy(),
+self.expected_type,
+String::from_utf8_lossy()
+)
+}
+}
+
 impl Config {
 /// Load system and user configuration from various files.
 ///



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