mercurial@44578: 2 new changesets

2020-03-23 Thread Mercurial Commits
2 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/f8427841c8fc
changeset:   44577:f8427841c8fc
parent:  44576:2ec6160449aa
parent:  44559:bc9a9016467d
user:Yuya Nishihara 
date:Fri Mar 20 17:18:14 2020 +0900
summary: merge with stable

https://www.mercurial-scm.org/repo/hg/rev/90adda73676a
changeset:   44578:90adda73676a
bookmark:@
tag: tip
user:Matt Harbison 
date:Thu Mar 05 11:00:00 2020 -0500
summary: phabricator: add a helper function to convert DREVSPECs to a DREV 
dict list

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


D8322: shelve: split up dounshelve() in unshelvecmd() and _dounshelve()

2020-03-23 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I'd like to be able to override the new `_dounshelve()`, getting
  access to the name of the shelve to unshelve. `unshelvecmd()` seems to
  better match the existing `createcmd()`, `listcmd()` etc.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/shelve.py

CHANGE DETAILS

diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -1074,7 +1074,7 @@
 raise error.Abort(m, hint=hint)
 
 
-def dounshelve(ui, repo, *shelved, **opts):
+def unshelvecmd(ui, repo, *shelved, **opts):
 opts = pycompat.byteskwargs(opts)
 abortf = opts.get(b'abort')
 continuef = opts.get(b'continue')
@@ -1121,6 +1121,10 @@
 if not shelvedfile(repo, basename, patchextension).exists():
 raise error.Abort(_(b"shelved change '%s' not found") % basename)
 
+return _dounshelve(ui, repo, basename, opts)
+
+
+def _dounshelve(ui, repo, basename, opts):
 repo = repo.unfiltered()
 lock = tr = None
 try:
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -7585,7 +7585,7 @@
unshelved.
 """
 with repo.wlock():
-return shelvemod.dounshelve(ui, repo, *shelved, **opts)
+return shelvemod.unshelvecmd(ui, repo, *shelved, **opts)
 
 
 statemod.addunfinished(



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


D8321: darwin: use vim, not vi, to avoid data-loss inducing posix behavior

2020-03-23 Thread spectral (Kyle Lippincott)
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Apple's version of vim, available at
  opensource.apple.com/release/macos-1015.html (for Catalina, but this behavior
  has been there for a while) has several tweaks from the version of vim from
  vim.org. Most of these tweaks appear to be for "Unix2003" compatibility.
  
  One of the tweaks is that if any ex command raises an error, the entire
  process will (when you exit, possibly minutes/hours later) also exit non-zero.
  Ex commands are things like `:foo`.
  
  Luckily, they only enabled this if vim was executed (via a symlink or copying
  the binary) as `vi` or `ex`. If you start it as `vim`, it doesn't have this
  behavior, so let's do that.
  
  To see this in action, run the following two commands on macOS:
  
$ vi -c ':unknown' -c ':qa' ; echo $?
1
$ vim -c ':unknown' -c ':qa' ; echo $?
0
  
  We don't want to start ignoring non-zero return types from the editor because
  that will mean you can't use `:cquit` to intentionally exit 1 (which,
  shows up as 2 if you combine an ex command error and a cquit, but only a 1 if
  you just use cquit, so we can't differentiate between the two statuses). Since
  we can't differentiate, we have to assume that all non-zero exit codes are
  intentional and an indication of the user's desire to not continue with 
whatever
  we're doing. If this was a complicated `hg split` or `hg histedit`, this is
  especially disastrous :(

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1914,6 +1914,12 @@
 # instead default to E to plumb commit messages to
 # avoid confusion.
 editor = b'E'
+elif pycompat.isdarwin:
+# vi on darwin is POSIX compatible to a fault, and that includes
+# exiting non-zero if you make any mistake when running an ex
+# command. Proof: `vi -c ':unknown' -c ':qa'; echo $?` produces 1,
+# while s/vi/vim/ doesn't.
+editor = b'vim'
 else:
 editor = b'vi'
 return encoding.environ.get(b"HGEDITOR") or self.config(



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


D8320: rust: update all dependencies

2020-03-23 Thread Raphaël Gomès
Alphare updated this revision to Diff 20863.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8320?vs=20862=20863

BRANCH
  default

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

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

AFFECTED FILES
  rust/Cargo.lock
  rust/hg-core/Cargo.toml
  rust/hg-core/src/discovery.rs
  rust/hg-core/tests/test_missing_ancestors.rs
  rust/hg-cpython/Cargo.toml

CHANGE DETAILS

diff --git a/rust/hg-cpython/Cargo.toml b/rust/hg-cpython/Cargo.toml
--- a/rust/hg-cpython/Cargo.toml
+++ b/rust/hg-cpython/Cargo.toml
@@ -28,5 +28,5 @@
 simple_logger = "1.6.0"
 
 [dependencies.cpython]
-version = "0.4"
+version = "0.4.1"
 default-features = false
diff --git a/rust/hg-core/tests/test_missing_ancestors.rs 
b/rust/hg-core/tests/test_missing_ancestors.rs
--- a/rust/hg-core/tests/test_missing_ancestors.rs
+++ b/rust/hg-core/tests/test_missing_ancestors.rs
@@ -1,8 +1,9 @@
 use hg::testing::VecGraph;
 use hg::Revision;
 use hg::*;
-use rand::distributions::{Distribution, LogNormal, Uniform};
+use rand::distributions::{Distribution, Uniform};
 use rand::{thread_rng, Rng, RngCore, SeedableRng};
+use rand_distr::LogNormal;
 use std::cmp::min;
 use std::collections::HashSet;
 use std::env;
@@ -191,7 +192,7 @@
 let mu = mu_opt.unwrap_or(1.1);
 let sigma = sigma_opt.unwrap_or(0.8);
 
-let log_normal = LogNormal::new(mu, sigma);
+let log_normal = LogNormal::new(mu, sigma).unwrap();
 let nb = min(maxrev as usize, log_normal.sample(rng).floor() as usize);
 
 let dist = Uniform::from(NULL_REVISION..maxrev);
diff --git a/rust/hg-core/src/discovery.rs b/rust/hg-core/src/discovery.rs
--- a/rust/hg-core/src/discovery.rs
+++ b/rust/hg-core/src/discovery.rs
@@ -597,12 +597,12 @@
 
 #[test]
 fn test_limit_sample_less_than_half() {
-assert_eq!(full_disco().limit_sample((1..6).collect(), 2), vec![4, 2]);
+assert_eq!(full_disco().limit_sample((1..6).collect(), 2), vec![2, 5]);
 }
 
 #[test]
 fn test_limit_sample_more_than_half() {
-assert_eq!(full_disco().limit_sample((1..4).collect(), 2), vec![3, 2]);
+assert_eq!(full_disco().limit_sample((1..4).collect(), 2), vec![1, 2]);
 }
 
 #[test]
diff --git a/rust/hg-core/Cargo.toml b/rust/hg-core/Cargo.toml
--- a/rust/hg-core/Cargo.toml
+++ b/rust/hg-core/Cargo.toml
@@ -10,15 +10,16 @@
 name = "hg"
 
 [dependencies]
-byteorder = "1.3.1"
-hex = "0.4.0"
-lazy_static = "1.3.0"
+byteorder = "1.3.4"
+hex = "0.4.2"
+lazy_static = "1.4.0"
 libc = { version = "0.2.66", optional = true }
-memchr = "2.2.0"
-rand = "0.6.5"
-rand_pcg = "0.1.1"
+memchr = "2.3.3"
+rand = "0.7.3"
+rand_pcg = "0.2.1"
+rand_distr = "0.2.2"
 rayon = "1.3.0"
-regex = "1.1.0"
+regex = "1.3.5"
 twox-hash = "1.5.0"
 same-file = "1.0.6"
 crossbeam = "0.7.3"
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -28,11 +28,6 @@
 
 [[package]]
 name = "autocfg"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index;
-
-[[package]]
-name = "autocfg"
 version = "1.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index;
 
@@ -81,14 +76,6 @@
 ]
 
 [[package]]
-name = "cloudabi"
-version = "0.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index;
-dependencies = [
- "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
 name = "colored"
 version = "1.9.3"
 source = "registry+https://github.com/rust-lang/crates.io-index;
@@ -194,11 +181,6 @@
 source = "registry+https://github.com/rust-lang/crates.io-index;
 
 [[package]]
-name = "fuchsia-cprng"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index;
-
-[[package]]
 name = "getrandom"
 version = "0.1.14"
 source = "registry+https://github.com/rust-lang/crates.io-index;
@@ -237,10 +219,11 @@
  "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "micro-timer 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "pretty_assertions 0.6.1 
(registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_distr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -386,7 +369,7 

D8320: rust: update all dependencies

2020-03-23 Thread Raphaël Gomès
Alphare created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We do this periodically to say up to date.
  
  No major versions were crossed this time per se, but the `rand` is still in 
v0,
  and their 0.7x series broke three things:
  
  - Some distribution-related elements were moved to a separate crate, flashing 
a deprecation warning
  - The `LogNormal::new` associated function now returns a `Result`
  - Certain RNGs were updated to sample a `u32` instead of `usize` when their 
upper-bound is less than `u32::MAX` for better portability, which changed the 
output for 2 tests.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/Cargo.lock
  rust/hg-core/Cargo.toml
  rust/hg-core/src/discovery.rs
  rust/hg-core/tests/test_missing_ancestors.rs
  rust/hg-cpython/Cargo.toml

CHANGE DETAILS

diff --git a/rust/hg-cpython/Cargo.toml b/rust/hg-cpython/Cargo.toml
--- a/rust/hg-cpython/Cargo.toml
+++ b/rust/hg-cpython/Cargo.toml
@@ -28,5 +28,5 @@
 simple_logger = "1.6.0"
 
 [dependencies.cpython]
-version = "0.4"
+version = "0.4.1"
 default-features = false
diff --git a/rust/hg-core/tests/test_missing_ancestors.rs 
b/rust/hg-core/tests/test_missing_ancestors.rs
--- a/rust/hg-core/tests/test_missing_ancestors.rs
+++ b/rust/hg-core/tests/test_missing_ancestors.rs
@@ -1,7 +1,8 @@
 use hg::testing::VecGraph;
 use hg::Revision;
 use hg::*;
-use rand::distributions::{Distribution, LogNormal, Uniform};
+use rand::distributions::{Distribution, Uniform};
+use rand_distr::LogNormal;
 use rand::{thread_rng, Rng, RngCore, SeedableRng};
 use std::cmp::min;
 use std::collections::HashSet;
@@ -191,7 +192,7 @@
 let mu = mu_opt.unwrap_or(1.1);
 let sigma = sigma_opt.unwrap_or(0.8);
 
-let log_normal = LogNormal::new(mu, sigma);
+let log_normal = LogNormal::new(mu, sigma).unwrap();
 let nb = min(maxrev as usize, log_normal.sample(rng).floor() as usize);
 
 let dist = Uniform::from(NULL_REVISION..maxrev);
diff --git a/rust/hg-core/src/discovery.rs b/rust/hg-core/src/discovery.rs
--- a/rust/hg-core/src/discovery.rs
+++ b/rust/hg-core/src/discovery.rs
@@ -597,12 +597,12 @@
 
 #[test]
 fn test_limit_sample_less_than_half() {
-assert_eq!(full_disco().limit_sample((1..6).collect(), 2), vec![4, 2]);
+assert_eq!(full_disco().limit_sample((1..6).collect(), 2), vec![2, 5]);
 }
 
 #[test]
 fn test_limit_sample_more_than_half() {
-assert_eq!(full_disco().limit_sample((1..4).collect(), 2), vec![3, 2]);
+assert_eq!(full_disco().limit_sample((1..4).collect(), 2), vec![1, 2]);
 }
 
 #[test]
diff --git a/rust/hg-core/Cargo.toml b/rust/hg-core/Cargo.toml
--- a/rust/hg-core/Cargo.toml
+++ b/rust/hg-core/Cargo.toml
@@ -10,15 +10,16 @@
 name = "hg"
 
 [dependencies]
-byteorder = "1.3.1"
-hex = "0.4.0"
-lazy_static = "1.3.0"
+byteorder = "1.3.4"
+hex = "0.4.2"
+lazy_static = "1.4.0"
 libc = { version = "0.2.66", optional = true }
-memchr = "2.2.0"
-rand = "0.6.5"
-rand_pcg = "0.1.1"
+memchr = "2.3.3"
+rand = "0.7.3"
+rand_pcg = "0.2.1"
+rand_distr = "0.2.2"
 rayon = "1.3.0"
-regex = "1.1.0"
+regex = "1.3.5"
 twox-hash = "1.5.0"
 same-file = "1.0.6"
 crossbeam = "0.7.3"
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -28,11 +28,6 @@
 
 [[package]]
 name = "autocfg"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index;
-
-[[package]]
-name = "autocfg"
 version = "1.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index;
 
@@ -81,14 +76,6 @@
 ]
 
 [[package]]
-name = "cloudabi"
-version = "0.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index;
-dependencies = [
- "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
 name = "colored"
 version = "1.9.3"
 source = "registry+https://github.com/rust-lang/crates.io-index;
@@ -194,11 +181,6 @@
 source = "registry+https://github.com/rust-lang/crates.io-index;
 
 [[package]]
-name = "fuchsia-cprng"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index;
-
-[[package]]
 name = "getrandom"
 version = "0.1.14"
 source = "registry+https://github.com/rust-lang/crates.io-index;
@@ -237,10 +219,11 @@
  "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "micro-timer 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "pretty_assertions 0.6.1 
(registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_distr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 1.3.0 

D8319: rust: update micro-timer dependency

2020-03-23 Thread Raphaël Gomès
Alphare created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The new version uses a much more robust technique and should remove any 
existing
  risk of bad compiler error or performance hit.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/Cargo.lock
  rust/hg-core/Cargo.toml

CHANGE DETAILS

diff --git a/rust/hg-core/Cargo.toml b/rust/hg-core/Cargo.toml
--- a/rust/hg-core/Cargo.toml
+++ b/rust/hg-core/Cargo.toml
@@ -22,7 +22,7 @@
 twox-hash = "1.5.0"
 same-file = "1.0.6"
 crossbeam = "0.7.3"
-micro-timer = "0.1.2"
+micro-timer = "0.2.1"
 log = "0.4.8"
 
 [dev-dependencies]
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -235,7 +235,7 @@
  "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "micro-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "micro-timer 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "pretty_assertions 0.6.1 
(registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -304,11 +304,21 @@
 
 [[package]]
 name = "micro-timer"
-version = "0.1.2"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index;
+dependencies = [
+ "micro-timer-macros 0.2.0 
(registry+https://github.com/rust-lang/crates.io-index)",
+ "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "micro-timer-macros"
+version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index;
 dependencies = [
  "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -778,7 +788,8 @@
 "checksum memchr 2.3.3 
(registry+https://github.com/rust-lang/crates.io-index)" = 
"3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
 "checksum memmap 0.7.0 
(registry+https://github.com/rust-lang/crates.io-index)" = 
"6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
 "checksum memoffset 0.5.3 
(registry+https://github.com/rust-lang/crates.io-index)" = 
"75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9"
-"checksum micro-timer 0.1.2 
(registry+https://github.com/rust-lang/crates.io-index)" = 
"16439fea388f712c1df7737ceb8f784d407844624b4796faf1e1bf8bbaa97445"
+"checksum micro-timer 0.2.1 
(registry+https://github.com/rust-lang/crates.io-index)" = 
"987429cd6162a80ed5ff44fc790f5090b1c6d617ac73a2e272965ed91201d79b"
+"checksum micro-timer-macros 0.2.0 
(registry+https://github.com/rust-lang/crates.io-index)" = 
"43cec5c0b38783eb33ef7bccf4b250b7a085703e11f5f2238fa31969e629388a"
 "checksum num-integer 0.1.42 
(registry+https://github.com/rust-lang/crates.io-index)" = 
"3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba"
 "checksum num-traits 0.2.11 
(registry+https://github.com/rust-lang/crates.io-index)" = 
"c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096"
 "checksum num_cpus 1.12.0 
(registry+https://github.com/rust-lang/crates.io-index)" = 
"46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6"



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


Re: [PATCH] osutil: move declaration to top of the scope

2020-03-23 Thread Augie Fackler
Queued, thanks

> On Mar 22, 2020, at 08:39, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1584870004 -32400
> #  Sun Mar 22 18:40:04 2020 +0900
> # Node ID bbb3fc76b442292b20e5df97ea462997eb5e
> # Parent  a7f8c657a3f08d1e71ee112f797df011eea7a078
> osutil: move declaration to top of the scope
> 
> Otherwise the build would fail with -Werror=declaration-after-statement.
> 
> diff --git a/mercurial/cext/osutil.c b/mercurial/cext/osutil.c
> --- a/mercurial/cext/osutil.c
> +++ b/mercurial/cext/osutil.c
> @@ -810,9 +810,10 @@ static PyObject *setprocname(PyObject *s
>   /* Check the memory we can use. Typically, argv[i] and
>* argv[i + 1] are continuous. */
>   for (i = 0; i < argc; ++i) {
> + size_t len;
>   if (argv[i] > argvend || argv[i] < argvstart)
>   break; /* not continuous */
> - size_t len = strlen(argv[i]);
> + len = strlen(argv[i]);
>   argvend = argv[i] + len + 1 /* '\0' */;
>   }
>   if (argvend > argvstart) /* sanity check */
> @@ -1169,10 +1170,10 @@ static PyObject *getfsmountpoint(PyObjec
> static PyObject *unblocksignal(PyObject *self, PyObject *args)
> {
>   int sig = 0;
> + sigset_t set;
>   int r;
>   if (!PyArg_ParseTuple(args, "i", ))
>   return NULL;
> - sigset_t set;
>   r = sigemptyset();
>   if (r != 0)
>   return PyErr_SetFromErrno(PyExc_OSError);
> ___
> 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


Re: [PATCH] phabricator: remove *-argument from _getdrevs()

2020-03-23 Thread Augie Fackler
queued, thanks

> On Mar 21, 2020, at 01:26, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1584766870 -32400
> #  Sat Mar 21 14:01:10 2020 +0900
> # Node ID c1c2f6e0cd9f819389c18245d791c906023d9545
> # Parent  a7f8c657a3f08d1e71ee112f797df011eea7a078
> phabricator: remove *-argument from _getdrevs()
> 
> It can't take more than one specs arguments per len(*specs).
> 
> diff --git a/hgext/phabricator.py b/hgext/phabricator.py
> --- a/hgext/phabricator.py
> +++ b/hgext/phabricator.py
> @@ -1632,19 +1632,19 @@ def getdiffmeta(diff):
> return meta
> 
> 
> -def _getdrevs(ui, stack, *specs):
> +def _getdrevs(ui, stack, specs):
> """convert user supplied DREVSPECs into "Differential Revision" dicts
> 
> See ``hg help phabread`` for how to specify each DREVSPEC.
> """
> -if len(*specs) > 0:
> +if len(specs) > 0:
> 
> def _formatspec(s):
> if stack:
> s = b':(%s)' % s
> return b'(%s)' % s
> 
> -spec = b'+'.join(pycompat.maplist(_formatspec, *specs))
> +spec = b'+'.join(pycompat.maplist(_formatspec, specs))
> 
> drevs = querydrev(ui, spec)
> if drevs:
> ___
> 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


Re: [PATCH 3 of 3] revset: leverage internal _rev() function to implement rev()

2020-03-23 Thread Augie Fackler
queued per marmoute review, thanks

> On Mar 21, 2020, at 06:51, Pierre-Yves David  
> wrote:
> 
> That series looks good to me.
> 
> On 3/21/20 6:26 AM, Yuya Nishihara wrote:
>> # HG changeset patch
>> # User Yuya Nishihara 
>> # Date 1584765728 -32400
>> #  Sat Mar 21 13:42:08 2020 +0900
>> # Node ID 98b60b759e2623db637a2ff68eadd5b7e6a8dc12
>> # Parent  1c189a6e5aa76bf71d5078597fd01c1f959244a2
>> revset: leverage internal _rev() function to implement rev()
>> Now 'rev(n)' is identical to 'present(_rev(n))'.
>> diff --git a/mercurial/revset.py b/mercurial/revset.py
>> --- a/mercurial/revset.py
>> +++ b/mercurial/revset.py
>> @@ -2082,19 +2082,11 @@ def removes(repo, subset, x):
>>@predicate(b'rev(number)', safe=True)
>>  def rev(repo, subset, x):
>> -"""Revision with the given numeric identifier.
>> -"""
>> -# i18n: "rev" is a keyword
>> -l = getargs(x, 1, 1, _(b"rev requires one argument"))
>> +"""Revision with the given numeric identifier."""
>>  try:
>> -# i18n: "rev" is a keyword
>> -l = int(getstring(l[0], _(b"rev requires a number")))
>> -except (TypeError, ValueError):
>> -# i18n: "rev" is a keyword
>> -raise error.ParseError(_(b"rev expects a number"))
>> -if l not in repo.changelog and l not in _virtualrevs:
>> +return _rev(repo, subset, x)
>> +except error.RepoLookupError:
>>  return baseset()
>> -return subset & baseset([l])
>>  @predicate(b'_rev(number)', safe=True)
>> ___
>> 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

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


Re: mercurial.host, the Heptapod commercial service

2020-03-23 Thread Anton Shestakov
On Mon, 23 Mar 2020 10:23:05 -0400
Augie Fackler  wrote:

> > On Mar 22, 2020, at 17:29, Georges Racinet  
> > wrote:
> > 
> > We've already bought that domain name, but as a courtesy to the
> > community, we wanted to ask if there were strong objections to us using
> > it for these purposes.
> > 
> > We'll be giving more details both about the upcoming new Heptapod
> > version and the commercial service in separate messages. In the present
> > one, I wanted to focus on the domain name.
> > 
> > So, what do you think ?  
> 
> I guess I'm kind of -0: it kind of makes it sound like it's "blessed" by the 
> upstream community as _the_ hosting provider to me. I suppose if 
> mercurial.host redirected to some other name for the service that doesn't 
> really bug me, since the name wouldn't just be "mercurial host"?

Or an "index" page, having a list of hosting options from
MercurialHosting wiki page (and/or having a link to said wiki page).
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: mercurial.host, the Heptapod commercial service

2020-03-23 Thread Augie Fackler
(-mercurial@)

> On Mar 22, 2020, at 17:29, Georges Racinet  
> wrote:
> 
> Hi everybody,
> 
> Heptapod [1] has made really good progress lately. As a result, we're
> almost ready to launch the long awaited public commercial service [2].
> 
> We're planning to launch it as https://mercurial.host around the middle
> of *this week*.
> 
> We've already bought that domain name, but as a courtesy to the
> community, we wanted to ask if there were strong objections to us using
> it for these purposes.
> 
> We'll be giving more details both about the upcoming new Heptapod
> version and the commercial service in separate messages. In the present
> one, I wanted to focus on the domain name.
> 
> So, what do you think ?

I guess I'm kind of -0: it kind of makes it sound like it's "blessed" by the 
upstream community as _the_ hosting provider to me. I suppose if mercurial.host 
redirected to some other name for the service that doesn't really bug me, since 
the name wouldn't just be "mercurial host"?

Sadly, I don't have concrete naming suggestions that would make sense. Naming 
is hard...

> 
> Take care,
> 
> 
> [1] for those who wouldn't know what I'm talking about, see
> https://heptapod.net
> 
> [2] see https://clever-cloud.com/en/heptapod
> 
> -- 
> Georges Racinet
> https://octobus.net, https://heptapod.net
> GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics
> 
> 
> ___
> 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


Re: [PATCH V2] Improve error message when a user configured editor could not be found

2020-03-23 Thread Yuya Nishihara
On Mon, 23 Mar 2020 10:34:01 +0100, mw...@posteo.de wrote:
> # HG changeset patch
> # User Micha Wiedenmann
> # Date 1584630384 -3600
> #  Do Mrz 19 16:06:24 2020 +0100
> # Node ID c8989a00cf3f4f19d621f075c900b2e5628c6acf
> # Parent  ea40fea992e000fb32edcf41d57721601842a7f2
> hg: Use "procutil.shellsplit" to parse command

Fixed whitespace errors and queued, thanks.

Please consider using the patchbomb extension or Phabricator.
https://www.mercurial-scm.org/wiki/ContributingChanges#Sending_patches
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH V2] Improve error message when a user configured editor could not be found

2020-03-23 Thread mw-u2

# HG changeset patch
# User Micha Wiedenmann
# Date 1584630384 -3600
#  Do Mrz 19 16:06:24 2020 +0100
# Node ID c8989a00cf3f4f19d621f075c900b2e5628c6acf
# Parent  ea40fea992e000fb32edcf41d57721601842a7f2
hg: Use "procutil.shellsplit" to parse command

A commandline containing a space ('"C:\\Program Files\\bar.exe" "..."') 
must not
simply split at whitespace, instead quoting has to be taken into 
account. Use

"shlex.split()" to parse it instead.

This can improve the error message if we fail to launch a user 
configured

editor which does not exist. Consider

[ui]
editor = "C:\Program Files\editor\editor.exe"

where the path does not exist. "hg histedit" currently aborts with


Abort: edit failed: Program exited with status 1


here "Program" is not part of the message but the name of the program 
that
failed (i.e. `basename("C:\\Program ")`). With this change the message 
instead

reads

Abort: edit failed: C:\Program Files\editor\editor.exe exited with 
status 1


which is also not ideal since infact "cmd.exe" exited with code 1, not 
the

editor. But the real error message ("File not found") gets swallowed by
`procutil` and including the correct path improves the error message
nevertheless.

diff -r ea40fea992e0 -r c8989a00cf3f mercurial/ui.py
--- a/mercurial/ui.py   Do Mrz 12 16:25:22 2020 -0700
+++ b/mercurial/ui.py   Do Mrz 19 16:06:24 2020 +0100
@@ -1868,7 +1868,7 @@
 rc = self._runsystem(cmd, environ=environ, cwd=cwd, 
out=out)

 if rc and onerr:
 errmsg = b'%s %s' % (
-os.path.basename(cmd.split(None, 1)[0]),
+procutil.shellsplit(cmd)[0],
 procutil.explainexit(rc),
 )
 if errprefix:


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