Re: [PATCH stable] py3: always flush ui streams on Python 3

2020-06-02 Thread Manuel Jacob

On 2020-06-03 05:46, Manuel Jacob wrote:

On 2020-06-03 00:04, Augie Fackler wrote:

On Jun 2, 2020, at 14:07, Manuel Jacob  wrote:

# HG changeset patch
# User Manuel Jacob 
# Date 1591120869 -7200
#  Tue Jun 02 20:01:09 2020 +0200
# Branch stable
# Node ID ebbc45544673c33ea3beb887ed4d5230b015102a
# Parent  91e509a12dbc4cd6cf2dcb9dae3ed383932132ac
py3: always flush ui streams on Python 3

On Python 2, we rely on that stdout and stderr are line buffered. 
Python 3’s

io module doesn’t offer line buffered binary streams.


We use the underlying non-buffer thing though for std{err, out}
though, or so I thought. Are you observing  behavior that this
corrects?


pycompat says:

stdout = sys.stdout.buffer
stderr = sys.stderr.buffer

They are <_io.BufferedWriter name=''> and <_io.BufferedWriter
name=''>, respectively.

I observed the error in TortoiseHg, which is a long-running process.

To trigger the problem with the hg command, you would need to do
something slow that prints on `self._fout`, e.g. `hg pull
https://www.mercurial-scm.org/repo/hg --debug`.


Actually, you don’t need to specify --debug.

Just run `hg pull https://www.mercurial-scm.org/repo/hg` and observe 
that without the patch, "pulling from 
https://www.mercurial-scm.org/repo/hg; will not be immediately printed 
on your screen.


I’ve sent an updated patch with this example in the description and with 
a correction.

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


[PATCH stable v2] py3: always flush ui streams on Python 3

2020-06-02 Thread Manuel Jacob
# HG changeset patch
# User Manuel Jacob 
# Date 1591120869 -7200
#  Tue Jun 02 20:01:09 2020 +0200
# Branch stable
# Node ID 6d7faa3c9b9cebd46ff7964be703d5b67d6eda50
# Parent  91e509a12dbc4cd6cf2dcb9dae3ed383932132ac
py3: always flush ui streams on Python 3

On Python 2, we rely on that stdout and stderr are line buffered. Python 3’s
io module doesn’t offer line buffered binary streams.

To trigger the problem with the hg command, you need to do something slow,
e.g. `hg pull https://www.mercurial-scm.org/repo/hg`.

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1198,9 +1198,14 @@ class ui(object):
 label = opts.get('label', b'')
 msg = self.label(msg, label)
 dest.write(msg)
+# On Python 2, stdout and stderr are usually line buffered, but
 # stderr may be buffered under win32 when redirected to files,
 # including stdout.
-if dest is self._ferr and not getattr(self._ferr, 'closed', False):
+# On Python 3, we use the underlying binary buffer, which does not
+# support line buffering.
+if (pycompat.ispy3 or dest is self._ferr) and not getattr(
+dest, 'closed', False
+):
 dest.flush()
 except IOError as err:
 if dest is self._ferr and err.errno in (
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH stable] py3: always flush ui streams on Python 3

2020-06-02 Thread Manuel Jacob

On 2020-06-03 00:04, Augie Fackler wrote:

On Jun 2, 2020, at 14:07, Manuel Jacob  wrote:

# HG changeset patch
# User Manuel Jacob 
# Date 1591120869 -7200
#  Tue Jun 02 20:01:09 2020 +0200
# Branch stable
# Node ID ebbc45544673c33ea3beb887ed4d5230b015102a
# Parent  91e509a12dbc4cd6cf2dcb9dae3ed383932132ac
py3: always flush ui streams on Python 3

On Python 2, we rely on that stdout and stderr are line buffered. 
Python 3’s

io module doesn’t offer line buffered binary streams.


We use the underlying non-buffer thing though for std{err, out}
though, or so I thought. Are you observing  behavior that this
corrects?


pycompat says:

stdout = sys.stdout.buffer
stderr = sys.stderr.buffer

They are <_io.BufferedWriter name=''> and <_io.BufferedWriter 
name=''>, respectively.


I observed the error in TortoiseHg, which is a long-running process.

To trigger the problem with the hg command, you would need to do 
something slow that prints on `self._fout`, e.g. `hg pull 
https://www.mercurial-scm.org/repo/hg --debug`.



diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1198,9 +1198,14 @@ class ui(object):
label = opts.get('label', b'')
msg = self.label(msg, label)
dest.write(msg)
+# On Python 2, stdout and stderr are usually line 
buffered, but
# stderr may be buffered under win32 when redirected to 
files,

# including stdout.
-if dest is self._ferr and not getattr(self._ferr, 
'closed', False):
+# On Python 3, we use the underlying binary buffer, which 
does not

+# support line buffering.
+if (pycompat.ispy3 or dest is self._ferr) and not 
getattr(

+self._ferr, 'closed', False
+):
dest.flush()
except IOError as err:
if dest is self._ferr and err.errno in (
___
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] git: implement diff manifest method

2020-06-02 Thread Augie Fackler
On Mon, Jun 01, 2020 at 01:10:45PM -0400, Josef 'Jeff' Sipek wrote:
> # HG changeset patch
> # User Josef 'Jeff' Sipek 
> # Date 1591024345 14400
> #  Mon Jun 01 11:12:25 2020 -0400
> # Node ID 8b5e8dc4163b540bf7d0ce6b989090f751081583
> # Parent  c8ee7f58b11b835918e1e83b89741999f8809866
> git: implement diff manifest method

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


Re: [PATCH 4 of 5] git: properly visit child tree objects when resolving a path

2020-06-02 Thread Augie Fackler
On Mon, Jun 01, 2020 at 11:32:48AM -0400, Josef 'Jeff' Sipek wrote:
> # HG changeset patch
> # User Josef 'Jeff' Sipek 
> # Date 1591019387 14400
> #  Mon Jun 01 09:49:47 2020 -0400
> # Node ID c8ee7f58b11b835918e1e83b89741999f8809866
> # Parent  e05b94be1ba0cd6e2ccd9c1688a82ff3a8103a7e
> git: properly visit child tree objects when resolving a path

queued 1-4, thanks

>
> diff --git a/hgext/git/manifest.py b/hgext/git/manifest.py
> --- a/hgext/git/manifest.py
> +++ b/hgext/git/manifest.py
> @@ -56,8 +56,9 @@ class gittreemanifest(object):
>  return val
>  t = self._tree
>  comps = upath.split('/')
> +te = self._tree
>  for comp in comps[:-1]:
> -te = self._tree[comp]
> +te = te[comp]
>  t = self._git_repo[te.id]
>  ent = t[comps[-1]]
>  if ent.filemode == pygit2.GIT_FILEMODE_BLOB:
>
> ___
> 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 2 of 2] rust: leverage .expect() in place of .unwrap() + inline comment

2020-06-02 Thread Augie Fackler
On Mon, May 25, 2020 at 11:27:41PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1590415610 -32400
> #  Mon May 25 23:06:50 2020 +0900
> # Node ID a5b88a7c25d3d8a02cbb2c1b9293200ddb0e06ac
> # Parent  261fbbdabb261a44c0f82537f10abbcc0d85ace1
> rust: leverage .expect() in place of .unwrap() + inline comment

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


mercurial@44905: 20 new changesets

2020-06-02 Thread Mercurial Commits
20 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/1409da2148c8
changeset:   44886:1409da2148c8
user:Manuel Jacob 
date:Sat May 30 19:04:53 2020 +0200
summary: tests: stop checking for optional, now impossible output

https://www.mercurial-scm.org/repo/hg/rev/61cdc8137d53
changeset:   44887:61cdc8137d53
user:Manuel Jacob 
date:Sat May 30 23:18:57 2020 +0200
summary: relnotes: note that we now require modern SSL/TLS features in 
Python

https://www.mercurial-scm.org/repo/hg/rev/95903a8d8c97
changeset:   44888:95903a8d8c97
user:Manuel Jacob 
date:Sun May 31 09:55:45 2020 +0200
summary: sslutil: stop returning argument as third return value of 
protocolsettings()

https://www.mercurial-scm.org/repo/hg/rev/ceb7318013d5
changeset:   44889:ceb7318013d5
user:Manuel Jacob 
date:Sun May 31 10:47:38 2020 +0200
summary: sslutil: fix names of variables containing minimum protocol strings

https://www.mercurial-scm.org/repo/hg/rev/4942c1bdd080
changeset:   44890:4942c1bdd080
user:Manuel Jacob 
date:Sun May 31 11:41:03 2020 +0200
summary: sslutil: add FIXME about supportedprotocols possibly containing 
too many items

https://www.mercurial-scm.org/repo/hg/rev/abcd6db1f2cc
changeset:   44891:abcd6db1f2cc
user:Manuel Jacob 
date:Sun May 31 11:10:21 2020 +0200
summary: sslutil: don't set minimum TLS version to 1.0 if 1.2 but not 1.1 
is available

https://www.mercurial-scm.org/repo/hg/rev/dd7c4a208a4e
changeset:   44892:dd7c4a208a4e
user:Manuel Jacob 
date:Sun May 31 12:07:17 2020 +0200
summary: sslutil: check for OpenSSL without TLS 1.0 support in one case

https://www.mercurial-scm.org/repo/hg/rev/95c832849955
changeset:   44893:95c832849955
user:Manuel Jacob 
date:Sat May 30 23:42:19 2020 +0200
summary: setup: require that Python has TLS 1.1 or TLS 1.2

https://www.mercurial-scm.org/repo/hg/rev/39c598f1c774
changeset:   44894:39c598f1c774
user:Manuel Jacob 
date:Fri May 29 22:47:58 2020 +0200
summary: sslutil: remove comment referring to unsupported legacy stacks

https://www.mercurial-scm.org/repo/hg/rev/5921dc0d5c3a
changeset:   44895:5921dc0d5c3a
user:Manuel Jacob 
date:Sun May 31 22:15:35 2020 +0200
summary: sslutil: remove dead code (that downgraded default minimum TLS 
version)

https://www.mercurial-scm.org/repo/hg/rev/4dcb2791beab
changeset:   44896:4dcb2791beab
user:Manuel Jacob 
date:Sun May 31 00:30:49 2020 +0200
summary: config: remove unused hostsecurity.disabletls10warning config

https://www.mercurial-scm.org/repo/hg/rev/941fef7523c7
changeset:   44897:941fef7523c7
user:Manuel Jacob 
date:Sun May 31 22:31:49 2020 +0200
summary: sslutil: remove dead code (that failed if only TLS 1.0 is 
available)

https://www.mercurial-scm.org/repo/hg/rev/d61c05450b37
changeset:   44898:d61c05450b37
user:Manuel Jacob 
date:Mon Jun 01 03:51:54 2020 +0200
summary: sslutil: properly detect which TLS versions are supported by the 
ssl module

https://www.mercurial-scm.org/repo/hg/rev/4ca1110991c4
changeset:   44899:4ca1110991c4
user:Manuel Jacob 
date:Mon Jun 01 14:07:06 2020 +0200
summary: sslutil: rename 'minimumprotocolui' -> 'minimumprotocol'

https://www.mercurial-scm.org/repo/hg/rev/38e3df9ff1e7
changeset:   44900:38e3df9ff1e7
user:Manuel Jacob 
date:Mon Jun 01 14:20:13 2020 +0200
summary: sslutil: stop storing protocol and options for SSLContext in 
settings dict

https://www.mercurial-scm.org/repo/hg/rev/53b3baaadb64
changeset:   44901:53b3baaadb64
user:Manuel Jacob 
date:Mon Jun 01 14:34:22 2020 +0200
summary: sslutil: propagate return value ssl.PROTOCOL_SSLv23 from 
protocolsettings()

https://www.mercurial-scm.org/repo/hg/rev/24d440e2fdbb
changeset:   44902:24d440e2fdbb
user:Manuel Jacob 
date:Mon Jun 01 15:22:31 2020 +0200
summary: sslutil: fix comment to use inclusive or instead of exclusive or

https://www.mercurial-scm.org/repo/hg/rev/69d3ce00df99
changeset:   44903:69d3ce00df99
user:Valentin Gatien-Baron 
date:Sat May 30 10:28:46 2020 -0400
summary: rust: update the mention of hgcli in rust/README.rst

https://www.mercurial-scm.org/repo/hg/rev/7ca1d635e4a6
changeset:   44904:7ca1d635e4a6
user:Valentin Gatien-Baron 
date:Sat May 30 11:36:30 2020 -0400
summary: rust: add a pointer for profiling to the README

https://www.mercurial-scm.org/repo/hg/rev/f330d6117a5b
changeset:   44905:f330d6117a5b
bookmark:@
tag: tip
user:Valentin Gatien-Baron 
date:Sat May 30 12:36:00 2020 -0400
summary: relnotes: advertize the possibility to use rust

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

Re: [PATCH STABLE] graft: fix --base value to be saved in state file

2020-06-02 Thread Augie Fackler
queued for stable,  thanks

> On Jun 2, 2020, at 08:37, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1591098006 -32400
> #  Tue Jun 02 20:40:06 2020 +0900
> # Branch stable
> # Node ID 2dc5ae953c4a8265578acbe7d3e26c93ec8a08fb
> # Parent  6d968cd40961b0deda12e1a814a574b0704463ed
> graft: fix --base value to be saved in state file
> 
> 'True' just works because it is treated as an integer revision '1' and
> only the truthiness of the basectx is important. If multiple source revisions
> were supported with --base, the resumed graft operation would go wrong.
> 
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -3168,7 +3168,7 @@ def _dograft(ui, repo, *revs, **opts):
> if opts.get(b'no_commit'):
> statedata[b'no_commit'] = True
> if opts.get(b'base'):
> -statedata[b'base'] = True
> +statedata[b'base'] = opts[b'base']
> for pos, ctx in enumerate(repo.set(b"%ld", revs)):
> desc = b'%d:%s "%s"' % (
> ctx.rev(),
> ___
> 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 stable] py3: always flush ui streams on Python 3

2020-06-02 Thread Augie Fackler


> On Jun 2, 2020, at 14:07, Manuel Jacob  wrote:
> 
> # HG changeset patch
> # User Manuel Jacob 
> # Date 1591120869 -7200
> #  Tue Jun 02 20:01:09 2020 +0200
> # Branch stable
> # Node ID ebbc45544673c33ea3beb887ed4d5230b015102a
> # Parent  91e509a12dbc4cd6cf2dcb9dae3ed383932132ac
> py3: always flush ui streams on Python 3
> 
> On Python 2, we rely on that stdout and stderr are line buffered. Python 3’s
> io module doesn’t offer line buffered binary streams.

We use the underlying non-buffer thing though for std{err, out} though, or so I 
thought. Are you observing  behavior that this corrects?

> 
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -1198,9 +1198,14 @@ class ui(object):
> label = opts.get('label', b'')
> msg = self.label(msg, label)
> dest.write(msg)
> +# On Python 2, stdout and stderr are usually line buffered, but
> # stderr may be buffered under win32 when redirected to files,
> # including stdout.
> -if dest is self._ferr and not getattr(self._ferr, 'closed', 
> False):
> +# On Python 3, we use the underlying binary buffer, which does 
> not
> +# support line buffering.
> +if (pycompat.ispy3 or dest is self._ferr) and not getattr(
> +self._ferr, 'closed', False
> +):
> dest.flush()
> except IOError as err:
> if dest is self._ferr and err.errno in (
> ___
> 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


[PATCH stable] py3: always flush ui streams on Python 3

2020-06-02 Thread Manuel Jacob
# HG changeset patch
# User Manuel Jacob 
# Date 1591120869 -7200
#  Tue Jun 02 20:01:09 2020 +0200
# Branch stable
# Node ID ebbc45544673c33ea3beb887ed4d5230b015102a
# Parent  91e509a12dbc4cd6cf2dcb9dae3ed383932132ac
py3: always flush ui streams on Python 3

On Python 2, we rely on that stdout and stderr are line buffered. Python 3’s
io module doesn’t offer line buffered binary streams.

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1198,9 +1198,14 @@ class ui(object):
 label = opts.get('label', b'')
 msg = self.label(msg, label)
 dest.write(msg)
+# On Python 2, stdout and stderr are usually line buffered, but
 # stderr may be buffered under win32 when redirected to files,
 # including stdout.
-if dest is self._ferr and not getattr(self._ferr, 'closed', False):
+# On Python 3, we use the underlying binary buffer, which does not
+# support line buffering.
+if (pycompat.ispy3 or dest is self._ferr) and not getattr(
+self._ferr, 'closed', False
+):
 dest.flush()
 except IOError as err:
 if dest is self._ferr and err.errno in (
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Heptapod 0.13.0 "dual python" released

2020-06-02 Thread Georges Racinet
Dear Mercurial users and developers.

we're happy to announce the release of Heptapod 0.13.0, the adaptation
of GitLab CE for Mercurial. This new version ships Mercurial 5.4,
supports both Python 2 and 3, brings in support for wikis and more.

The full announcement is at
https://heptapod.net/heptapod-0.13.0.html#heptapod-0.13.0.

We now have an indicative roadmap page [1] that covers the next few
versions up to Heptapod 1.0. As always, feedback is very much welcomed.

We encourage people managing their own instances to try Python 3 as much
as they can. There's an easy way to fallback to Python 2 if needed [2].

The flagship instances, https://foss.heptapod.net and
https://heptapod.host, are running Heptapod 0.13.0 already.

Cheers,

[1] https://heptapod.net/pages/roadmap.html#roadmap

[2] detailed page about Python 3:
https://heptapod.net/py3-heptapod-0-13.html#py3-heptapod-0-13.


-- 
Georges Racinet
https://octobus.net, https://about.heptapod.host, https://heptapod.net
GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics




signature.asc
Description: OpenPGP digital signature
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8605: rust-dependencies: upgrade `micro-timer` dependency

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

REVISION SUMMARY
  I wanted to to a tour of dependencies to upgrade, but only `micro-timer` has a
  new release which does not print when the function panics, which should be 
less
  misleading.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  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
@@ -21,7 +21,7 @@
 twox-hash = "1.5.0"
 same-file = "1.0.6"
 crossbeam = "0.7.3"
-micro-timer = "0.2.1"
+micro-timer = "0.3.0"
 log = "0.4.8"
 
 [dev-dependencies]



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


[Bug 6342] New: json(successorssets) returns string for non-obsolete changeset

2020-06-02 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6342

Bug ID: 6342
   Summary: json(successorssets) returns string for non-obsolete
changeset
   Product: Mercurial
   Version: unspecified
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: templater
  Assignee: bugzi...@mercurial-scm.org
  Reporter: aayjaychan...@gmail.com
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

`hg log --hidden --template "json(successorssets)"` returns an empty list for a
pruned changeset, but returns an empty string for a non-obsolete changeset.

$  hg init
$  echo aaa > aaa
$  hg commit -A -m aaa
adding aaa
$  echo bbb > bbb
$  hg commit -A -m bbb
adding bbb
$  hg prune -r .
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
working directory is now at 261ab3ca85da
1 changesets pruned
$  hg log --hidden -T "json(successorssets)"
[
 {"successorssets": []},
 {"successorssets": ""}
]

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


[PATCH STABLE] graft: fix --base value to be saved in state file

2020-06-02 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1591098006 -32400
#  Tue Jun 02 20:40:06 2020 +0900
# Branch stable
# Node ID 2dc5ae953c4a8265578acbe7d3e26c93ec8a08fb
# Parent  6d968cd40961b0deda12e1a814a574b0704463ed
graft: fix --base value to be saved in state file

'True' just works because it is treated as an integer revision '1' and
only the truthiness of the basectx is important. If multiple source revisions
were supported with --base, the resumed graft operation would go wrong.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3168,7 +3168,7 @@ def _dograft(ui, repo, *revs, **opts):
 if opts.get(b'no_commit'):
 statedata[b'no_commit'] = True
 if opts.get(b'base'):
-statedata[b'base'] = True
+statedata[b'base'] = opts[b'base']
 for pos, ctx in enumerate(repo.set(b"%ld", revs)):
 desc = b'%d:%s "%s"' % (
 ctx.rev(),
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: planned work: minimal/partial Rust executable utility

2020-06-02 Thread Pierre-Yves David



On 5/28/20 9:57 PM, Gregory Szorc wrote:
On Thu, May 28, 2020 at 12:40 PM Gregory Szorc > wrote:


On Thu, May 28, 2020 at 11:22 AM Augie Fackler mailto:r...@durin42.com>> wrote:



 > On May 28, 2020, at 10:10, Pierre-Yves David
mailto:pierre-yves.da...@ens-lyon.org>> wrote:
 >
 > We plan to start sending patches to build a minimal Rust
executable capable of fulfilling "some" operations to "some"
extend. The idea is to start small by building a tiny tool that:
 >
 > * focuses on usage inside script/prompt (where having a
different executable for some special action is fine),
 > * explicitly only support a tiny subset of commands/flags,
 > * help getting more building blocks in the `hg-core` crate,
 > * respect the `hg` command line for everything it supports
(to make it a good base for something bigger).
 > * is not called `hg` since it is not fully compatible with
hg, yet (maybe rhg ? or fhg ?)
 > * last, but not least, help our new developer Antoine Cezar
to get familiar with the Mercurial internals and Rust code.
 >
 > In practice, here are the current plans for the first batch:
 >
 > 0) ignore configs (and extensions) for now,
 > 1) crash (with a specific return code) if anything unknown is
seen,
 > 2) implement the following basic operations (in this order):
 >    * hg root [it gets us  a basic executable]
 >    * hg files [it gets us requirement checking and dirstate
reading]
 >    * hg files --rev REV [it gets us basic read-only revlog
support]
 >    * hg cat --rev REV [it gets us full revlog support (eg: fn
cache and co)]
 >
 > Once this is done, we probably make further plans (eg: config
parsing, basic revspec support, more commands,… who knows)
 >
 >
 > What do you think?

I think this makes a lot of sense. I can see it used in two ways:

1) We've often talked about a `hg buildshellprompthelper`
command (name is bad, please figure out a better one) that could
emit a shell function to efficiently and supportedly emit things
people want in their prompt, and then depending on what was
requested we could use a native-code helper binary instead of
the full `hg`)

2) The "PyOxidizer delegating binary" thing that Martin mentioned.

I worry a little bit around the margins of novel storage formats
etc and how we support those, but erroring out for now is
probably adequate.


My assumption is the end state of any work in this area will be a
native [Rust] binary that:

a) Is capable of servicing an `hg` command without starting a Python
interpreter
b) Is capable of acting as a command server and client
c) Starts a Python interpreter and dispatches to Python code when
pure Rust code paths don't exist or are unwanted
d) Eventually becomes the `hg` in some (all?) distributions of Mercurial


Yep, I confirm that we are aiming in the same direction. And should 
eventually get there over time.




I question whether it is worth building out one-off binaries if we
assume this will be the end state.

I think we should:

1. Use `pyoxidizer init-rust-project` to create a skeleton for a
Rust executable project. Say in `rust/hgcli`
2. Hook up a `pyoxidizer.bzl` so it can run the Python Mercurial
that we have today
3. Teach `run-tests.py`, `Makefile`, etc to build and use the new
executable in a turnkey manner
4. Start hacking up `main()` to inject Rust code before the Python
interpreter is started (via environment variables, minimal argument
parsing, or whatever)

Alternatively, we can inject PyOxidizer later, after we have a stub
executable. But I suspect it will be drastically easier to do from
the beginning, as that approach forces you to think about the
interactions between Rust and Python sooner rather than later. Plus,
the sooner this happens, the sooner it benefits end-users. Having
chg baked into the executable so it is easier to use will be a huge
win for users. If we were talking about a science experiment, I'd be
inclined to start simple now. But Mercurial will be around for
years, so why accrue technical debt against something that is part
of the project's long-term vision.

PyOxidizer should hopefully be stable enough that its presence
doesn't hinder progress that much. Although I may need to land some
features in PyOxidizer to help with e.g. reducing build times and
not making iterative development as painful.

Also, Eden's public source code has GPL'd Rust sources for things
like configuration file and argument parsing. See e.g.

[Bug 6341] New: fold after a merge that changes the resulting diff

2020-06-02 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6341

Bug ID: 6341
   Summary: fold after a merge that changes the resulting diff
   Product: Mercurial
   Version: unspecified
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: evolution
  Assignee: bugzi...@mercurial-scm.org
  Reporter: georges.raci...@octobus.net
CC: mercurial-devel@mercurial-scm.org,
pierre-yves.da...@ens-lyon.org
Python Version: ---

Created attachment 2071
  --> https://bz.mercurial-scm.org/attachment.cgi?id=2071=edit
Merge and follow-up changesets, to fold

I've had more than doubts for a while that history editing involving big merges
could behave badly. I'm almost sure that happened to me several times with `hg
rebase`, but always found out after the fact.

Here is a concrete case I had on the Heptapod repository, this time with `hg
fold`. It's not small, but hopefully will allow to produce a smaller case and a
test. 

To reproduce, you'll need a partial clone (about 100k changesets) and the
bundle attached to this bug report.

## Setup

hg init merge-fold-issue
cd fold-issue
hg pull -r 6722aa0d392f -r 7e939fce5f42
https://mirror.octobus.net/heptapod/heptapod
hg unbundle /path/to/merge-follow-up.bundle
hg up gitlab-12-10

Here's the stack at this point:

s3(4562aad1648a): Fixed a bad merge conflict resolution
s2(5d910dd2a9f9): Merge with GitLab 12.10
^ Add latest changes from gitlab-org/gitlab@12-10-stable-ee
s1(05c3e70b82f8)^ Partial revert to common ancestor of GitLab 12.3.5 and
12-10-stable (base current)
s1(05c3e70b82f8)@ Partial revert to common ancestor of GitLab 12.3.5 and
12-10-stable (current)
s0(6722aa0d392f)^ Prevent accepting Merge Requests targeting topics (base)

## Check of initial condition

hg di -r 7e939fce5f42 -r s3 config | wc -l  # outputs 115

## Reproduction and check of problem

hg fold --exact -r s2+s3
hg di -r 7e939fce5f42 -r s2 config | wc -l  # outputs 3967

Here's the stack after the fold:

### topic: gitlab-12-10
### target: heptapod (branch)
s2(216d4aac3aaa): Merge with GitLab 12.10
^ Add latest changes from gitlab-org/gitlab@12-10-stable-ee
s1(05c3e70b82f8)^ Partial revert to common ancestor of GitLab 12.3.5 and
12-10-stable (base current)
s1(05c3e70b82f8)@ Partial revert to common ancestor of GitLab 12.3.5 and
12-10-stable (current)
s0(6722aa0d392f)^ Prevent accepting Merge Requests targeting topics (base)



## Versions

## Versions

$ hg version --debug
starting pager for command 'version'
Mercurial Distributed SCM (version 5.4)
(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2020 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Enabled extensions:

  convertinternal  
  hgkinternal  
  strip  internal  
  mq internal  
  gpginternal  
  transplant internal  
  rebase internal  
  purge  internal  
  graphlog   internal  
  evolve external  10.0.0
  topic  external  0.19.0
  histedit   internal  
  amend  internal  
  absorb internal  
  patchbomb  internal  
  phabricatorinternal  
  perf   external  
  mercurial_keyring  external  
  share  internal  

Mercurial is running with this Python version:

  Python 3.7.7 (default, Mar 13 2020, 10:23:39) 
  [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux

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