Re: pycompat.ispy3 in tests

2022-05-26 Thread Augie Fackler
Just not done yet AFAIK. Please feel encouraged to rip them out as you see them.

> On May 24, 2022, at 8:05 PM, Manuel Jacob  wrote:
> 
> I’ve seen that there are some pycompat.ispy3 left in tests/, while they were 
> removed in mercurial/. Was there a specific reason that they are left in the 
> tests (e.g. the possibility to run new tests with older Mercurial versions) 
> or was the removal just not done yet?
> ___
> 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


D12609: obsolete: remove two unused constants

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

REVISION SUMMARY
  I'm not sure what these constants were intended for, but they have no
  users so it's time to say goodbye.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/obsolete.py

CHANGE DETAILS

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -338,8 +338,6 @@
 _fm1nodesha256size = _calcsize(_fm1nodesha256)
 _fm1fsize = _calcsize(_fm1fixed)
 _fm1parentnone = 3
-_fm1parentshift = 14
-_fm1parentmask = _fm1parentnone << _fm1parentshift
 _fm1metapair = b'BB'
 _fm1metapairsize = _calcsize(_fm1metapair)
 



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


D12608: node: manually implement Debug

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

REVISION SUMMARY
  I got too irritated today with the default Debug implementation of
  hg::revlog::Node while playing with a new parser. This isn't quite
  what I wanted, but it wasn't much code and it at least gives you
  output that's easy to visually compare to a node.hex()ed identifier
  from the Python side of things.
  
  Sadly, this doesn't influence the output in lldb or the VSCode
  debugger extension that uses lldb under the covers, but it at least
  means debug prints are a little more useful.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/revlog/node.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/revlog/node.rs b/rust/hg-core/src/revlog/node.rs
--- a/rust/hg-core/src/revlog/node.rs
+++ b/rust/hg-core/src/revlog/node.rs
@@ -53,12 +53,21 @@
 /// the size or return an error at runtime.
 ///
 /// [`nybbles_len`]: #method.nybbles_len
-#[derive(Copy, Clone, Debug, PartialEq, BytesCast, derive_more::From)]
+#[derive(Copy, Clone, PartialEq, BytesCast, derive_more::From)]
 #[repr(transparent)]
 pub struct Node {
 data: NodeData,
 }
 
+impl fmt::Debug for Node {
+fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+let n = format!("{:x?}", self.data);
+// We're using debug_tuple because it makes the output a little
+// more compact without losing data.
+f.debug_tuple("Node").field(&n).finish()
+}
+}
+
 /// The node value for NULL_REVISION
 pub const NULL_NODE: Node = Node {
 data: [0; NODE_BYTES_LENGTH],



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


Re: [PATCH] rebase: add boolean config item rebase.norebasesource

2022-05-04 Thread Augie Fackler


> On Apr 20, 2022, at 2:19 PM, C. Masloch  wrote:
> 
> # HG changeset patch
> # User C. Masloch 
> # Date 1650475479 -7200
> #  Wed Apr 20 19:24:39 2022 +0200
> # Node ID 4fd9ac0558249d24552b9efeed1ac77452c73319
> # Parent  f45e1618cbf68aca4e72b6fed8dd2acef6f39a10
> rebase: add boolean config item rebase.norebasesource
> 
> This allows to use rebase without recording a rebase_source extra
> field. This is useful for example to build a mirror converted from
> another SCM (such as svn) by converting only new revisions, and
> then incrementally add them to the destination by pulling from the
> newly converted (unrelated) repo and rebasing the new revisions
> onto the last old already stored changeset. Without this patch the
> rebased changesets would always receive some rebase_source that
> would depend on the particular history of the conversion process,
> instead of only depending on the original source revisions.

Interesting. An unusual process.

> 
> This is used to implement a hg mirror repo of SvarDOS (a partially
> nonfree but completely redistributable DOS distribution) in the
> scripts at https://hg.pushbx.org/ecm/svardos.scr/
> 
> In particular, cre.sh creates an svn mirror, upd.sh recreates an
> entire hg repo from the svn mirror (which takes too long to do in a
> regular job), and akt.sh uses hg convert with the config item
> convert.svn.startrev to incrementally convert only the two most
> recent revisions already found in the mirror destination plus any
> possible new revisions. If any are found, the temporary repo's
> changesets are pulled into the destination (as changesets from an
> unrelated repository). Then the changesets corresponding to the new
> revisions are rebased onto the prior final changeset. (Finally, the
> two remaining duplicates of the prior head and its parent are
> stripped from the destination repository.)
> 
> Without this patch, the particular rebase_source extra field would
> depend on the order and times at which akt.sh was used, instead of
> only depending on the source repository. In other words, whatever
> sequence of upd.sh and akt.sh is used at whatever times, it is
> desired that the final output repositories always match each other
> exactly.
> 
> diff --git a/hgext/rebase.py b/hgext/rebase.py
> --- a/hgext/rebase.py
> +++ b/hgext/rebase.py
> @@ -547,7 +547,10 @@
> date = self.date
> if date is None:
> date = ctx.date()
> -extra = {b'rebase_source': ctx.hex()}
> +if repo.ui.configbool(b'rebase', b'norebasesource'):
> +extra = {}
> +else:
> +extra = {b'rebase_source': ctx.hex()}
> for c in self.extrafns:
> c(ctx, extra)
> destphase = max(ctx.phase(), phases.draft)
> diff --git a/mercurial/configitems.py b/mercurial/configitems.py
> --- a/mercurial/configitems.py
> +++ b/mercurial/configitems.py
> @@ -2770,3 +2770,8 @@
> b'experimental.inmemory',
> default=False,
> )
> +coreconfigitem(
> +b'rebase',
> +b'norebasesource',
> +default=False,
> +)

I’m basically fine with this, but:

1) could you add some description in a comment about what this does here
2) could you mark it as experimental=True so it’s hidden from mundane uses?

Thanks!

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


D12603: diff: graduate merge diffs from experimental and add to tweakdefaults

2022-05-04 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I've been using this functionality for two years without incident and
  it's been outstanding. In my opinion it's time to both remove the
  experimental warning label and move this straight into tweakdefaults.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/configitems.py
  mercurial/ui.py

CHANGE DETAILS

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -81,6 +81,8 @@
 git = 1
 showfunc = 1
 word-diff = 1
+# use merge-diff functionality to make `diff` of a merge easier to understand
+merge = yes
 """
 
 samplehgrcs = {
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -774,7 +774,6 @@
 b'diff',
 b'merge',
 default=False,
-experimental=True,
 )
 coreconfigitem(
 b'email',



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


Re: [PATCH stable] docs: use proper rst markup for preformatted blocks

2022-05-04 Thread Augie Fackler
This appears to be landed as 363b6. Thanks!

On Tue, May 3, 2022 at 10:53 AM Mads Kiilerich  wrote:

> # HG changeset patch
> # User Mads Kiilerich 
> # Date 1651574481 -7200
> #  Tue May 03 12:41:21 2022 +0200
> # Branch stable
> # Node ID 1d257c4c15683ee998edcc7dd6caf5a4cb52c820
> # Parent  f2ef6a4f918f59f2ff01e5d4dc01c94ea35bd32f
> docs: use proper rst markup for preformatted blocks
>
> The multiple lines were re-flowed to a single line, both in man page and
> html.
>
> diff --git a/mercurial/helptext/rust.txt b/mercurial/helptext/rust.txt
> --- a/mercurial/helptext/rust.txt
> +++ b/mercurial/helptext/rust.txt
> @@ -28,7 +28,8 @@ in progress. For more experimental work
>  Checking for Rust
>  =
>
> -You may already have the Rust extensions depending on how you install
> Mercurial.
> +You may already have the Rust extensions depending on how you install
> +Mercurial::
>
>$ hg debuginstall | grep -i rust
>checking Rust extensions (installed)
> @@ -46,7 +47,7 @@ version to use.
>  Using pip
>  -
>
> -Users of `pip` can install the Rust extensions with the following command:
> +Users of `pip` can install the Rust extensions with the following
> command::
>
>$ pip install mercurial --global-option --rust --no-use-pep517
>
>
> ___
> 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: on your commits about hash collisions

2022-04-30 Thread Augie Fackler
Strange. I don’t remember seeing anything in the moderation queue. This user 
does have nodupes set in mailman, so they won’t get copies of their own 
messages to the list, but I also don’t see anything on mercurial-devel in April 
from them.

I’ve got nothing.

> On Apr 30, 2022, at 15:05, Martin von Zweigbergk via Mercurial-devel 
>  wrote:
> 
> 
> Alex says his emails are not getting through to the mailing list. Any idea 
> why? Maybe Augie knows?
> 
> -- Forwarded message -
> From: Александр Литягин  >
> Date: Sat, Apr 30, 2022, 06:59
> Subject: mercurial: on your commits about hash collisions
> To: mailto:martinv...@google.com>>
> 
> 
> Hallow Martin!
> 
> You`ve commited into mercurial repo rev 65eda809b943:
> 
> >> tests: demonstrate crash on partial amend with copies in changesets
> 
> Maybe you interests about my patch on similar problems 
> https://bz.mercurial-scm.org/show_bug.cgi?id=6588 
> 
> 
> I got hash duplications when grapht/transplant revisions rigth on same 
> parent. 
> (This problem affects files, not revisions, therefore it not obvious to 
> detect.)
> 
> My solution was to mark duplicate chenges with differ meta tags. And for 
> that, improved file content comparators - it 
> now take into evaluation only data part of change. So now i have full fridom 
> to change contents of changeset meta, with
> no warry that it breaks file change detections in dirstate.
> 
> All patches i placed in bug-report.
> 
> 
> 
> ___
> 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: Moving away from Phabricator

2022-04-13 Thread Augie Fackler


> On Apr 13, 2022, at 12:06 PM, Raphaël Gomès  wrote:
> 
> Hi everyone,
> 
> It has now been more than a month and our window to migrate out of our VM is 
> closing down.
> 

Thanks for keeping track of this!

> I am happy to report that the new versions of Heptapod and the evolve 
> extension have brought the expected speedups and the push/pull times on 
> Heptapod are now much better. There still remains a lot to be desired with 
> regards to exchange, but that is for another discussion.
> 
> It's time to make an inventory of the project and make some decisions about 
> what stays the same, what changes and what disappears. We also need to 
> discuss the contribution and review process.
> 
> # Inventory
> 
> We still don't have a clear path for VM hosting, but maybe the OSUOSL can 
> help us, seeing as a good amount of the foss.heptapod.net CI there. 
> Seehttps://osuosl.org/services/hosting/details 
> .
> 
> ## The mailing lists
> 
> They're not going anywhere, of course. Additionally, the ability to send 
> patches to the devel mailing list will stay, but will not be the preferred 
> way proposed.
> 
> They are currently managed by a mailman on the VM, which will need to be 
> migrated out. The OSUOSL people have already agreed to manage our mailing 
> lists for us. This could be a good solution to further reduce sysadmin burden.
> 

If we finish off the lists and phabricator, that reduces our footprint a _lot_ 
FWIW. That removes all (I think?) the reasons we have to send mail, so you’re 
really down to hosting the wiki and the repos.

> 
> ## Phabricator
> 
> Phabricator will be turned off and be replaced as a means of contribution by 
> Heptapod.
> 
> The `phab.mercurial-scm.org` differential URLs will be kept around as a 
> static archive: I have already started the relatively painful (basically 
> because of AJAX) endeavor of creating the scripts to save the valuable 
> history of our review discussions, and hope to have enough free time to have 
> it done before the VM dies.
> 
> ## mercurial-scm.org
> 
> The website will need to be migrated out. I don't expect this to be a major 
> hassle.
> 
> On a related but technically independent front, I've started some very simple 
> patches to improve its contents (like not advertising that we use Python 
> 2...).
> 
> ## Wiki
> 
> The wiki needs to be migrated out. I'm not exactly sure what the story of 
> MoinMoin is currently, but this should also be a relatively simple process.
> 
> ## Repos
> 
> I think the project should still use hgweb to advertise at least its main 
> (read-only) repository and any other repo that doesn't have a better home. 
> See the part about the contribution process for more discussion about the 
> hg-committed repo.
> 

These all sound right.

> ## Patchwork
> 
> What should we do about patchwork? I've only been reminded of its existence 
> by looking around the VM. Maybe my `getpatches` alias uses it underneath for 
> queuing from the mailing list?
> 

If your getpatches alias is the one I think it is, that probably hits 
https://hgpatches.durin42.com/?  Which, as the 
URL suggests, is actually running on a machine I own. It’s been 
zero-maintenance for years, but if y’all care about it long-term we should 
probably transition it eventually. Though it’s not as pressing.

> ## Buildbot
> 
> This has been functionally dead for a long while and will not be carried over 
> now that we have the Heptapod CI.
> 
> ## Bugzilla
> 
> We will want to - of course - keep our bug tracking. We're using Bugzilla 
> with MySQL, but we could use PostgreSQL in the target machine if that makes 
> it easier, I don't think this particular aspect would be too hard to migrate 
> on its own.
> 
> The migration from bugzilla to another tool (like Heptapod/Gitlab issues) 
> should probably be another discussion to simplify the transition.
> 

Agreed. Bugzilla has been a pretty minor pain point compared to phabricator.

> ## Other things?
> 
> Have I forgotten an important piece of the project?
> 

hgbot runs on mercurial-scm.org . It uses a sqlite 
database and is pretty minimal in terms of overhead, so as long as wherever we 
put the VM can handle the irc connection, seems fine.

> 
> # Review process
> 

I’m inactive enough I’ll defer to the opinions of others here. Others: if you 
have opinions, _please_ speak up! This is your chance to make a difference 
before we EOL phabricator and your choices are (by default) heptapod and `hg 
email`.

[snip review process options]
> 
> # Conclusion
> 
> The hope of this migration is to remove a lot of the sysadmin burden, 
> simplify, strengthen and modernize the contribution and review process and 
> leave the project in a healthier, more maintainable state. I hope to see my 
> mental load reduced by a lot after this transition, and I'm pretty sure I'm 
> not the only one.
> 

Thanks a bunch!

___

Re: Python 3.x version support / dropping 3.5 and 3.6

2022-03-02 Thread Augie Fackler


> On Mar 1, 2022, at 2:53 PM, Raphaël Gomès  wrote:
> 
> 
> On 2/27/22 22:19, Gregory Szorc wrote:
>> 6.1 will be the last release to support Python 2.7. That means 6.2 will be 
>> Python 3 only.
>> 
>> Currently our Python 3 support is for 3.5-3.10.
>> 
>> Python 3.5 dropped out of support in September 2020 and Python 3.6 in 
>> December 2021 (https://endoflife.date/python).
>> 
>> Do we have any interest in dropping support for 3.5 or 3.6 in the 6.2 
>> release?
>> 
>> Features of interest in 3.6:
>> 
>> * Variable type annotations. (Annotating on <3.6 requires special syntax in 
>> comments)
>> * Stabilization of async (unsure how much we'll adopt async though)
>> * PEP 519 path protocol. This might enable us to clean up path handling 
>> throughout the codebase by adopting richly typed path objects with nice 
>> path-like primitives.
>> * Enhancements to typing module to make it more useful.
>> 
>> Features of interest in 3.7:
>> 
>> * Postponed evaluation of type annotations (this is likely huge for managing 
>> startup time)
>> * importlib.resources (allows us to clean up non-module file loading)
>> * @dataclass and data classes
>> 
>> I think the only in-support major distro still supporting 3.5 is Debian 9 
>> Stretch, which goes out of support on 2022-06-30.
>> 
>> 3.6 is more complicated. CentOS/RHEL 7 and Ubuntu 18.04 ship Python 3.6. 
>> Although the former is already out of support. Ubuntu 18.04 is still in main 
>> support until 2023-04-03 and has security support for another few years.
>> 
>> My pulse on the larger Python ecosystem is that 3.5 is mostly dead and 3.6 
>> is starting to wilt but not quite dead. Tons of projects dropped 3.5 in the 
>> past year.
>> 
>> **So I'd like to propose dropping support for Python 3.5 in 6.2.** That 
>> would mean 6.1 is our last release with both Python 2.7 and 3.5 support.
>> 
> Agreed, I think this is cautious enough.
>> I don't think I can in good faith recommend dropping 3.6 support at this 
>> time since it is still in wide use. But I do like the allure of the above 
>> highlighted features in 3.7 and think they could lead to a higher quality 
>> Mercurial and cleaner code base. If anyone else wants to make the case for 
>> dropping 3.6 despite its apparent use in supported distros, I'd love to hear 
>> it.
>> 
> +1

Throwing an idea out there: we stop testing against 3.6 and don’t sweat 
breakages now that it’s EOL upstream, but accept patches from people that care 
(eg distro packagers) to keep it alive for some amount of time after the Python 
version goes EOL.

Thoughts?

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


D12279: cleanup: directly use concurrent.futures instead of via pycompat

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Python 2 is gone.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/httppeer.py
  mercurial/localrepo.py
  mercurial/pycompat.py
  mercurial/wireprotov1peer.py

CHANGE DETAILS

diff --git a/mercurial/wireprotov1peer.py b/mercurial/wireprotov1peer.py
--- a/mercurial/wireprotov1peer.py
+++ b/mercurial/wireprotov1peer.py
@@ -10,6 +10,7 @@
 import sys
 import weakref
 
+from concurrent import futures
 from .i18n import _
 from .node import bin
 from .pycompat import (
@@ -88,7 +89,7 @@
 return b';'.join(cmds)
 
 
-class unsentfuture(pycompat.futures.Future):
+class unsentfuture(futures.Future):
 """A Future variation to represent an unsent command.
 
 Because we buffer commands and don't submit them immediately, calling
@@ -99,7 +100,7 @@
 
 def result(self, timeout=None):
 if self.done():
-return pycompat.futures.Future.result(self, timeout)
+return futures.Future.result(self, timeout)
 
 self._peerexecutor.sendcommands()
 
@@ -154,7 +155,7 @@
 # a batchable one and refuse to service it.
 
 def addcall():
-f = pycompat.futures.Future()
+f = futures.Future()
 self._futures.add(f)
 self._calls.append((command, args, fn, f))
 return f
@@ -194,7 +195,7 @@
 # cycle between us and futures.
 for f in self._futures:
 if isinstance(f, unsentfuture):
-f.__class__ = pycompat.futures.Future
+f.__class__ = futures.Future
 f._peerexecutor = None
 
 calls = self._calls
@@ -258,7 +259,7 @@
 # hard and it is easy to encounter race conditions, deadlocks, etc.
 # concurrent.futures already solves these problems and its thread pool
 # executor has minimal overhead. So we use it.
-self._responseexecutor = pycompat.futures.ThreadPoolExecutor(1)
+self._responseexecutor = futures.ThreadPoolExecutor(1)
 self._responsef = self._responseexecutor.submit(
 self._readbatchresponse, states, wireresults
 )
diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -35,8 +35,6 @@
 import SocketServer as socketserver
 import xmlrpclib
 
-from .thirdparty.concurrent import futures
-
 def future_set_exception_info(f, exc_info):
 f.set_exception_info(*exc_info)
 
@@ -45,7 +43,6 @@
 
 else:
 import builtins
-import concurrent.futures as futures
 import http.cookiejar as cookielib
 import http.client as httplib
 import pickle
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -16,6 +16,7 @@
 import time
 import weakref
 
+from concurrent import futures
 from .i18n import _
 from .node import (
 bin,
@@ -278,7 +279,7 @@
 # method on the peer and return a resolved future.
 fn = getattr(self._peer, pycompat.sysstr(command))
 
-f = pycompat.futures.Future()
+f = futures.Future()
 
 try:
 result = fn(**pycompat.strkwargs(args))
diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -14,6 +14,7 @@
 import socket
 import struct
 
+from concurrent import futures
 from .i18n import _
 from .pycompat import getattr
 from . import (
@@ -538,12 +539,12 @@
 raise exception
 
 
-class queuedcommandfuture(pycompat.futures.Future):
+class queuedcommandfuture(futures.Future):
 """Wraps result() on command futures to trigger submission on call."""
 
 def result(self, timeout=None):
 if self.done():
-return pycompat.futures.Future.result(self, timeout)
+return futures.Future.result(self, timeout)
 
 self._peerexecutor.sendcommands()
 



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


D12283: rust: jettison Python 2 support

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/Cargo.lock
  rust/hg-cpython/Cargo.toml
  rust/hg-cpython/src/lib.rs

CHANGE DETAILS

diff --git a/rust/hg-cpython/src/lib.rs b/rust/hg-cpython/src/lib.rs
--- a/rust/hg-cpython/src/lib.rs
+++ b/rust/hg-cpython/src/lib.rs
@@ -62,7 +62,7 @@
 Ok(())
 });
 
-#[cfg(not(any(feature = "python27-bin", feature = "python3-bin")))]
+#[cfg(not(feature = "python3-bin"))]
 #[test]
 #[ignore]
 fn libpython_must_be_linked_to_run_tests() {
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
@@ -12,12 +12,10 @@
 default = ["python3"]
 
 # Features to build an extension module:
-python27 = ["cpython/python27-sys", "cpython/extension-module-2-7"]
 python3 = ["cpython/python3-sys", "cpython/extension-module"]
 
-# Enable one of these features to build a test executable linked to libpython:
-# e.g. cargo test --no-default-features --features python27-bin
-python27-bin = ["cpython/python27-sys"]
+# Enable this feature to build a test executable linked to libpython:
+# e.g. cargo test --no-default-features --features python3-bin
 python3-bin = ["cpython/python3-sys"]
 
 [dependencies]
@@ -29,4 +27,3 @@
 env_logger = "0.7.1"
 stable_deref_trait = "1.2.0"
 vcsgraph = "0.2.0"
-
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -166,7 +166,6 @@
  "libc",
  "num-traits",
  "paste",
- "python27-sys",
  "python3-sys",
 ]
 
@@ -671,16 +670,6 @@
 ]
 
 [[package]]
-name = "python27-sys"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "94670354e264300dde81a5864cbb6bfc9d56ac3dcf3a278c32cb52f816f4dfd1"
-dependencies = [
- "libc",
- "regex",
-]
-
-[[package]]
 name = "python3-sys"
 version = "0.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";



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


D12282: setup: always decode xcode version

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Not decoding was a Python 2 thing.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1663,9 +1663,7 @@
 if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'):
 version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[1].splitlines()
 if version:
-version = version[0]
-if sys.version_info[0] == 3:
-version = version.decode('utf-8')
+version = version[0].decode('utf-8')
 xcode4 = version.startswith('Xcode') and StrictVersion(
 version.split()[1]
 ) >= StrictVersion('4.0')



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


D12281: setup: remove Rust support for Python 2

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1380,13 +1380,9 @@
 
 cargocmd = ['cargo', 'rustc', '--release']
 
-feature_flags = []
+feature_flags = ['python3']
 
 cargocmd.append('--no-default-features')
-if sys.version_info[0] == 2:
-feature_flags.append('python27')
-elif sys.version_info[0] == 3:
-feature_flags.append('python3')
 
 rust_features = env.get("HG_RUST_FEATURES")
 if rust_features:



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


D12280: cleanup: stop bundling concurrent.futures on Python 2

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We no longer support Python 2.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/thirdparty/concurrent/LICENSE
  mercurial/thirdparty/concurrent/__init__.py
  mercurial/thirdparty/concurrent/futures/__init__.py
  mercurial/thirdparty/concurrent/futures/_base.py
  mercurial/thirdparty/concurrent/futures/process.py
  mercurial/thirdparty/concurrent/futures/thread.py
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1249,14 +1249,6 @@
 ):
 packages.append('mercurial.templates.%s' % name)
 
-if sys.version_info[0] == 2:
-packages.extend(
-[
-'mercurial.thirdparty.concurrent',
-'mercurial.thirdparty.concurrent.futures',
-]
-)
-
 if 'HG_PY2EXE_EXTRA_INSTALL_PACKAGES' in os.environ:
 # py2exe can't cope with namespace packages very well, so we have to
 # install any hgext3rd.* extensions that we want in the final py2exe
diff --git a/mercurial/thirdparty/concurrent/futures/thread.py 
b/mercurial/thirdparty/concurrent/futures/thread.py
deleted file mode 100644
--- a/mercurial/thirdparty/concurrent/futures/thread.py
+++ /dev/null
@@ -1,162 +0,0 @@
-# Copyright 2009 Brian Quinlan. All Rights Reserved.
-# Licensed to PSF under a Contributor Agreement.
-
-"""Implements ThreadPoolExecutor."""
-
-from __future__ import absolute_import
-
-import atexit
-from . import _base
-import itertools
-import Queue as queue
-import threading
-import weakref
-import sys
-
-try:
-from multiprocessing import cpu_count
-except ImportError:
-# some platforms don't have multiprocessing
-def cpu_count():
-return None
-
-__author__ = 'Brian Quinlan (br...@sweetapp.com)'
-
-# Workers are created as daemon threads. This is done to allow the interpreter
-# to exit when there are still idle threads in a ThreadPoolExecutor's thread
-# pool (i.e. shutdown() was not called). However, allowing workers to die with
-# the interpreter has two undesirable properties:
-#   - The workers would still be running during interpretor shutdown,
-# meaning that they would fail in unpredictable ways.
-#   - The workers could be killed while evaluating a work item, which could
-# be bad if the callable being evaluated has external side-effects e.g.
-# writing to a file.
-#
-# To work around this problem, an exit handler is installed which tells the
-# workers to exit when their work queues are empty and then waits until the
-# threads finish.
-
-_threads_queues = weakref.WeakKeyDictionary()
-_shutdown = False
-
-def _python_exit():
-global _shutdown
-_shutdown = True
-items = list(_threads_queues.items()) if _threads_queues else ()
-for t, q in items:
-q.put(None)
-for t, q in items:
-t.join(sys.maxint)
-
-atexit.register(_python_exit)
-
-class _WorkItem(object):
-def __init__(self, future, fn, args, kwargs):
-self.future = future
-self.fn = fn
-self.args = args
-self.kwargs = kwargs
-
-def run(self):
-if not self.future.set_running_or_notify_cancel():
-return
-
-try:
-result = self.fn(*self.args, **self.kwargs)
-except:
-e, tb = sys.exc_info()[1:]
-self.future.set_exception_info(e, tb)
-else:
-self.future.set_result(result)
-
-def _worker(executor_reference, work_queue):
-try:
-while True:
-work_item = work_queue.get(block=True)
-if work_item is not None:
-work_item.run()
-# Delete references to object. See issue16284
-del work_item
-continue
-executor = executor_reference()
-# Exit if:
-#   - The interpreter is shutting down OR
-#   - The executor that owns the worker has been collected OR
-#   - The executor that owns the worker has been shutdown.
-if _shutdown or executor is None or executor._shutdown:
-# Notice other workers
-work_queue.put(None)
-return
-del executor
-except:
-_base.LOGGER.critical('Exception in worker', exc_info=True)
-
-
-class ThreadPoolExecutor(_base.Executor):
-
-# Used to assign unique thread names when thread_name_prefix is not 
supplied.
-_counter = itertools.count().next
-
-def __init__(self, max_workers=None, thread_name_prefix=''):
-"""Initializes a new ThreadPoolExecutor instance.
-
-Args:
-max_workers: The maximum number of threads that can be used to
-execute the given calls.
-thread_name_prefix: An optional name prefix to give our threads.
-"""
-if 

D12277: setup: remove pygit2 Python 2 logic

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1243,13 +1243,6 @@
 'hgdemandimport',
 ]
 
-# The pygit2 dependency dropped py2 support with the 1.0 release in Dec 2019.
-# Prior releases do not build at all on Windows, because Visual Studio 2008
-# doesn't understand C 11.  Older Linux releases are buggy.
-if sys.version_info[0] == 2:
-packages.remove('hgext.git')
-
-
 for name in os.listdir(os.path.join('mercurial', 'templates')):
 if name != '__pycache__' and os.path.isdir(
 os.path.join('mercurial', 'templates', name)



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


D12278: imports: allow importing futures from concurrent

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/import-checker.py

CHANGE DETAILS

diff --git a/contrib/import-checker.py b/contrib/import-checker.py
--- a/contrib/import-checker.py
+++ b/contrib/import-checker.py
@@ -24,6 +24,7 @@
 allowsymbolimports = (
 '__future__',
 'breezy',
+'concurrent',
 'hgclient',
 'mercurial',
 'mercurial.hgweb.common',



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


D12276: setup: inline now-constant list

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This varied when we supported Python 2.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -773,14 +773,10 @@
 f.write(b'/* this file is autogenerated by setup.py */\n')
 f.write(b'#define HGPYTHONLIB "%s"\n' % pythonlib)
 
-macros = None
-if sys.version_info[0] >= 3:
-macros = [('_UNICODE', None), ('UNICODE', None)]
-
 objects = self.compiler.compile(
 ['mercurial/exewrapper.c'],
 output_dir=self.build_temp,
-macros=macros,
+macros=[('_UNICODE', None), ('UNICODE', None)],
 )
 self.compiler.link_executable(
 objects, self.hgtarget, libraries=[], output_dir=self.build_temp



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


D12275: setup: unconditionally do this python 3 step

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -747,19 +747,18 @@
 
 # Also overwrite python3.dll so that hgext.git is usable.
 # TODO: also handle the MSYS flavor
-if sys.version_info[0] >= 3:
-python_x = os.path.join(
-os.path.dirname(fsdecode(buf.value)),
-"python3.dll",
+python_x = os.path.join(
+os.path.dirname(fsdecode(buf.value)),
+"python3.dll",
+)
+
+if os.path.exists(python_x):
+dest = os.path.join(
+os.path.dirname(self.hgtarget),
+os.path.basename(python_x),
 )
 
-if os.path.exists(python_x):
-dest = os.path.join(
-os.path.dirname(self.hgtarget),
-os.path.basename(python_x),
-)
-
-shutil.copy(python_x, dest)
+shutil.copy(python_x, dest)
 
 if not pythonlib:
 log.warn(



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


D12274: setup: remove Python 2 support code for determining dylib suffix

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -51,11 +51,7 @@
 print(error, file=sys.stderr)
 sys.exit(1)
 
-if sys.version_info[0] >= 3:
-DYLIB_SUFFIX = sysconfig.get_config_vars()['EXT_SUFFIX']
-else:
-# deprecated in Python 3
-DYLIB_SUFFIX = sysconfig.get_config_vars()['SO']
+DYLIB_SUFFIX = sysconfig.get_config_vars()['EXT_SUFFIX']
 
 # Solaris Python packaging brain damage
 try:



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


D12273: setup: inline os.fsdecode now that we're done with Python 2

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -741,12 +741,9 @@
 
 # Copy the pythonXY.dll next to the binary so that it runs
 # without tampering with PATH.
-fsdecode = lambda x: x
-if sys.version_info[0] >= 3:
-fsdecode = os.fsdecode
 dest = os.path.join(
 os.path.dirname(self.hgtarget),
-fsdecode(dllbasename),
+os.fsdecode(dllbasename),
 )
 
 if not os.path.exists(dest):



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


D12272: setup: inline encoding constant that is only used once

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This was variable back when we supported Python 2.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -22,8 +22,6 @@
 import sys, platform
 import sysconfig
 
-libdir_escape = 'unicode_escape'
-
 
 def sysstr(s):
 return s.decode('latin-1')
@@ -1116,7 +1114,7 @@
 )
 continue
 
-data = data.replace(b'@LIBDIR@', libdir.encode(libdir_escape))
+data = data.replace(b'@LIBDIR@', libdir.encode('unicode_escape'))
 with open(outfile, 'wb') as fp:
 fp.write(data)
 



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


D12271: setup: remove printf trampoline

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,6 @@
 import sys, platform
 import sysconfig
 
-printf = eval('print')
 libdir_escape = 'unicode_escape'
 
 
@@ -51,7 +50,7 @@
 version enabling these features (likely this requires the OpenSSL version to
 be at least 1.0.1).
 """
-printf(error, file=sys.stderr)
+print(error, file=sys.stderr)
 sys.exit(1)
 
 if sys.version_info[0] >= 3:
@@ -236,8 +235,8 @@
 returncode, out, err = runcmd(cmd, self.env)
 err = filterhgerr(err)
 if err or returncode != 0:
-printf("stderr from '%s':" % (' '.join(cmd)), file=sys.stderr)
-printf(err, file=sys.stderr)
+print("stderr from '%s':" % (' '.join(cmd)), file=sys.stderr)
+print(err, file=sys.stderr)
 return b''
 return out
 
@@ -470,7 +469,7 @@
 if hgrustext != 'cpython' and hgrustext is not None:
 if hgrustext:
 msg = 'unknown HGWITHRUSTEXT value: %s' % hgrustext
-printf(msg, file=sys.stderr)
+print(msg, file=sys.stderr)
 hgrustext = None
 self.rust = hgrustext is not None
 self.no_rust = not self.rust



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


D12270: setup: remove more Python 2 support code

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I'll inline print() etc in future patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -22,23 +22,12 @@
 import sys, platform
 import sysconfig
 
-if sys.version_info[0] >= 3:
-printf = eval('print')
-libdir_escape = 'unicode_escape'
-
-def sysstr(s):
-return s.decode('latin-1')
+printf = eval('print')
+libdir_escape = 'unicode_escape'
 
-else:
-libdir_escape = 'string_escape'
 
-def printf(*args, **kwargs):
-f = kwargs.get('file', sys.stdout)
-end = kwargs.get('end', '\n')
-f.write(b' '.join(args) + end)
-
-def sysstr(s):
-return s
+def sysstr(s):
+return s.decode('latin-1')
 
 
 import ssl



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


D12269: setup: remove ssl check that only matters on 2.7

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -43,19 +43,6 @@
 
 import ssl
 
-try:
-ssl.SSLContext
-except AttributeError:
-error = """
-The `ssl` module does not have the `SSLContext` class. This indicates an old
-Python version which does not support modern security features (which were
-added to Python 2.7 as part of "PEP 466"). Please make sure you have installed
-at least Python 2.7.9 or a Python version with backports of these security
-features.
-"""
-printf(error, file=sys.stderr)
-sys.exit(1)
-
 # ssl.HAS_TLSv1* are preferred to check support but they were added in Python
 # 3.7. Prior to CPython commit 6e8cda91d92da72800d891b2fc2073ecbc134d98
 # (backported to the 3.7 branch), ssl.PROTOCOL_TLSv1_1 / ssl.PROTOCOL_TLSv1_2



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


D12268: setup: remove block that tries to help Python 2.6 users

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It's time to move on folks.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -41,39 +41,6 @@
 return s
 
 
-# Attempt to guide users to a modern pip - this means that 2.6 users
-# should have a chance of getting a 4.2 release, and when we ratchet
-# the version requirement forward again hopefully everyone will get
-# something that works for them.
-if sys.version_info < (2, 7, 4, 'final'):
-pip_message = (
-'This may be due to an out of date pip. '
-'Make sure you have pip >= 9.0.1.'
-)
-try:
-import pip
-
-pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
-if pip_version < (9, 0, 1):
-pip_message = (
-'Your pip version is out of date, please install '
-'pip >= 9.0.1. pip {} detected.'.format(pip.__version__)
-)
-else:
-# pip is new enough - it must be something else
-pip_message = ''
-except Exception:
-pass
-error = """
-Mercurial does not support Python older than 2.7.4.
-Python {py} detected.
-{pip}
-""".format(
-py=sys.version_info, pip=pip_message
-)
-printf(error, file=sys.stderr)
-sys.exit(1)
-
 import ssl
 
 try:



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


D12266: setup: drop statement of support for Python before 3.5.3

2022-03-02 Thread durin42 (Augie Fackler)
durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  🎉🎉

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -13,15 +13,7 @@
 # bug link: https://bugs.python.org/issue25270
 supportedpy = ','.join(
 [
-'>=2.7.4',
-'!=3.0.*',
-'!=3.1.*',
-'!=3.2.*',
-'!=3.3.*',
-'!=3.4.*',
-'!=3.5.0',
-'!=3.5.1',
-'!=3.5.2',
+'>=3.5.3',
 '!=3.6.0',
 '!=3.6.1',
 ]
@@ -37,7 +29,6 @@
 def sysstr(s):
 return s.decode('latin-1')
 
-
 else:
 libdir_escape = 'string_escape'
 



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


D12186: sparse: add timing block for parsing sparse configs

2022-02-15 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This was showing up in an operation I was doing today, and I'd like to
  be able to get trace spans for it instead of just profiler samples.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/sparse.py

CHANGE DETAILS

diff --git a/mercurial/sparse.py b/mercurial/sparse.py
--- a/mercurial/sparse.py
+++ b/mercurial/sparse.py
@@ -38,63 +38,66 @@
 
 Returns a tuple of includes, excludes, and profiles.
 """
-includes = set()
-excludes = set()
-profiles = set()
-current = None
-havesection = False
+with util.timedcm(
+'sparse.parseconfig(ui, %d bytes, action=%s)', len(raw), action
+):
+includes = set()
+excludes = set()
+profiles = set()
+current = None
+havesection = False
 
-for line in raw.split(b'\n'):
-line = line.strip()
-if not line or line.startswith(b'#'):
-# empty or comment line, skip
-continue
-elif line.startswith(b'%include '):
-line = line[9:].strip()
-if line:
-profiles.add(line)
-elif line == b'[include]':
-if havesection and current != includes:
-# TODO pass filename into this API so we can report it.
-raise error.Abort(
-_(
-b'%(action)s config cannot have includes '
-b'after excludes'
+for line in raw.split(b'\n'):
+line = line.strip()
+if not line or line.startswith(b'#'):
+# empty or comment line, skip
+continue
+elif line.startswith(b'%include '):
+line = line[9:].strip()
+if line:
+profiles.add(line)
+elif line == b'[include]':
+if havesection and current != includes:
+# TODO pass filename into this API so we can report it.
+raise error.Abort(
+_(
+b'%(action)s config cannot have includes '
+b'after excludes'
+)
+% {b'action': action}
 )
-% {b'action': action}
-)
-havesection = True
-current = includes
-continue
-elif line == b'[exclude]':
-havesection = True
-current = excludes
-elif line:
-if current is None:
-raise error.Abort(
-_(
-b'%(action)s config entry outside of '
-b'section: %(line)s'
+havesection = True
+current = includes
+continue
+elif line == b'[exclude]':
+havesection = True
+current = excludes
+elif line:
+if current is None:
+raise error.Abort(
+_(
+b'%(action)s config entry outside of '
+b'section: %(line)s'
+)
+% {b'action': action, b'line': line},
+hint=_(
+b'add an [include] or [exclude] line '
+b'to declare the entry type'
+),
 )
-% {b'action': action, b'line': line},
-hint=_(
-b'add an [include] or [exclude] line '
-b'to declare the entry type'
-),
-)
 
-if line.strip().startswith(b'/'):
-ui.warn(
-_(
-b'warning: %(action)s profile cannot use'
-b' paths starting with /, ignoring %(line)s\n'
+if line.strip().startswith(b'/'):
+ui.warn(
+_(
+b'warning: %(action)s profile cannot use'
+b' paths starting with /, ignoring %(line)s\n'
+)
+% {b'action': action, b'line': line}
 )
-% {b'action': action, b'line': line}
-)
-continue
-current.add(line)
+continue
+current.add(line)
 
-return includes, excludes, profiles
+return includes, excludes, profiles
 
 
 # Exists as separate function to facilitate monkeypatching.



To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercuria

D12185: narrowspec: add timing block for validating narrowspec

2022-02-15 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This was showing up in an operation I was doing today, and I'd like to
  be able to get trace spans for it instead of just profiler samples.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/narrowspec.py

CHANGE DETAILS

diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -109,23 +109,24 @@
 and patterns that are loaded from sources that use the internal,
 prefixed pattern representation (but can't necessarily be fully trusted).
 """
-if not isinstance(pats, set):
-raise error.ProgrammingError(
-b'narrow patterns should be a set; got %r' % pats
-)
+with util.timedcm('narrowspec.validatepatterns(pats size=%d)', len(pats)):
+if not isinstance(pats, set):
+raise error.ProgrammingError(
+b'narrow patterns should be a set; got %r' % pats
+)
 
-for pat in pats:
-if not pat.startswith(VALID_PREFIXES):
-# Use a Mercurial exception because this can happen due to user
-# bugs (e.g. manually updating spec file).
-raise error.Abort(
-_(b'invalid prefix on narrow pattern: %s') % pat,
-hint=_(
-b'narrow patterns must begin with one of '
-b'the following: %s'
+for pat in pats:
+if not pat.startswith(VALID_PREFIXES):
+# Use a Mercurial exception because this can happen due to user
+# bugs (e.g. manually updating spec file).
+raise error.Abort(
+_(b'invalid prefix on narrow pattern: %s') % pat,
+hint=_(
+b'narrow patterns must begin with one of '
+b'the following: %s'
+)
+% b', '.join(VALID_PREFIXES),
 )
-% b', '.join(VALID_PREFIXES),
-)
 
 
 def format(includes, excludes):



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


D11958: git: add opener attribute to gitstore

2022-01-05 Thread durin42 (Augie Fackler)
durin42 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/D11958

AFFECTED FILES
  hgext/git/__init__.py

CHANGE DETAILS

diff --git a/hgext/git/__init__.py b/hgext/git/__init__.py
--- a/hgext/git/__init__.py
+++ b/hgext/git/__init__.py
@@ -51,6 +51,7 @@
 class gitstore(object):  # store.basicstore):
 def __init__(self, path, vfstype):
 self.vfs = vfstype(path)
+self.opener = self.vfs
 self.path = self.vfs.base
 self.createmode = store._calcmode(self.vfs)
 # above lines should go away in favor of:



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


Re: [PATCH] help: properly document the default pattern

2021-12-27 Thread Augie Fackler
Queued, thanks.

> On Dec 26, 2021, at 1:46 PM, Jordi Gutiérrez Hermoso  
> wrote:
> 
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso 
> # Date 1550269232 18000
> #  Fri Feb 15 17:20:32 2019 -0500
> # Node ID e5b62cbab03e443841b23a333aac035ad3987fbf
> # Parent  d3ec8201610485fa8bfda40771869ae67bfc6404
> help: properly document the default pattern
> 
> The default isn't to glob. It's relpath, which does no globbing at
> all. Thus most commands and options like -X/-I and hg files require
> `glob:` in front of them to actually do any globbing.
> 
> I think long ago the default was to glob, but that hasn't been true
> for a long time.
> 
> diff --git a/mercurial/helptext/patterns.txt b/mercurial/helptext/patterns.txt
> --- a/mercurial/helptext/patterns.txt
> +++ b/mercurial/helptext/patterns.txt
> @@ -1,8 +1,10 @@
> Mercurial accepts several notations for identifying one or more files
> at a time.
> 
> -By default, Mercurial treats filenames as shell-style extended glob
> -patterns.
> +By default, Mercurial treats filenames verbatim without pattern
> +matching, relative to the current working directory. Note that your
> +system shell might perform pattern matching of its own before passing
> +filenames into Mercurial.
> 
> Alternate pattern notations must be specified explicitly.
> 
> ___
> 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: Removing exchange-v2

2021-12-03 Thread Augie Fackler
Make it so IMO.

> On Dec 3, 2021, at 9:41 AM, Raphaël Gomès  wrote:
> 
> Hi all,
> 
> The exchange-v2 protocol has been untouched for years now, is incomplete and 
> does not seem to have any chance at coming back to life. Its tests are 
> unreliable enough to make the CI flaky, which can be quite annoying for the 
> developers using it daily (though it's nothing compared to the Windows 
> flakiness, but we're working on that).
> 
> I thought I'd send this email in case someone was preparing to get back on 
> that horse soon, complete the implementation and fix those tests. If there 
> are no takers by the end of the month (year!), I'll remove all of the code 
> and the associated tests.
> 
> Thanks,
> Raphaël
> 
> ___
> 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: Proposing a new release calendar

2021-11-29 Thread Augie Fackler
Revising the calendar seems fine. I think “on or after” dates make sense, 
especially as release management often involves corporate contributors.

> On Nov 29, 2021, at 9:58 AM, Raphaël Gomès  wrote:
> 
> This is a good point, though these are "on or around" dates, which means that 
> usually the next work day is the actual release day.
> 
> We've already had a Jan 1 date since 2.0 (IIUC), so this shouldn't be too 
> much of a problem, though I can see going for an explicit Jan 3 or something 
> to clarify it.
> 
> On 11/29/21 3:55 PM, Julien Cristau wrote:
>> On Mon, Nov 22, 2021 at 11:34:19AM +0100, Raphaël Gomès wrote:
>>> Hi all,
>>> 
>>> This email is in part prompted by the previous releases' delay, but also by
>>> discussions around release timing we've previously had. 6.0 is very likely
>>> coming out tomorrow with a delay of 22 days due to a lot of issues with
>>> Windows Python 3 support. I was going to propose to move the 6.1 release to
>>> March 1st 2022 just this once, but thought about doing this more
>>> permanently.
>>> 
>>> With the relatively limited resources we have and the current calendar
>>> including a release that falls right in the middle of summer where activity
>>> is lowest and help is less available, I propose that we go back to 3 major
>>> releases a year with the following calendar:
>>> 
>>> Freeze date | Major Release | Minor | Minor | Minor
>>> ---
>>> Feb 15  | Mar 1 | Apr 1 | May 1 | Jun 1
>>> Jun 17  | Jul 1 | Aug 1 | Sep 1 | Oct 1
>>> Oct 18  | Nov 1 | Dec 1 | Jan 1 | Feb 1
>>> 
>>> What do you all think?
>>> 
>> Is Jan 1 a good choice there, for even a minor release?  That seems
>> likely to either slip or ruin somebody's holidays...
>> 
>> Cheers,
>> Julien

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


Re: Call for comments on new dirstate format contents

2021-10-18 Thread Augie Fackler


> On Oct 18, 2021, at 4:16 AM, Pierre-Yves David 
>  wrote:
> 
> 
> On 10/15/21 2:22 PM, Pierre-Yves David wrote:
>> 
>> On 10/13/21 10:57 AM, Simon Sapin wrote:
>>> Please let us know of any question or comment!
>> 
>> 
>> I remember discussion about storing WC exec-bit and symlink status to help 
>> system without support for thoses (Windows we are looking at you). That is 
>> necessary to solve things like "issue5883".
>> 
>> Storage wise this should be fairly simpler, so we should be able to reserve 
>> some useful value for that in the new format. Regarding the implementation 
>> of a behavior fixing the associated issues, it seems complicated to get 
>> something done as the freeze is a couple of days away.
>> 
>> I just remembered this and I am not actively working on it today so I don't 
>> have a very concret idea about it yet. Matt Harbison might have more 
>> concretes idea about this.
> 
> Okay, so the core of the issue is : "Windows" has no way of storing the exec 
> bits in the file-system and since we read it from the file system at commit 
> time, we have no way to set it (or unset it) in general, and during merges in 
> particular. The solution people have been leaning at for years is "store the 
> exec bits in the dirstate entry for the file and has some API (+ UI) to 
> set/unset it.
> 
> So it seems like we need to reserve at least 2 bits for this. (WC_EXEC_BITS, 
> WC_SYMLINK), then comes the question of how do we manage these two bits:
> 
> 1) We could enforce them all the time, requiring `hg status` runs to 
> synchronize the value between the fs and the dirstate when they differ, as 1 
> mean set and 0 mean unset. That approach requires more work but would allow 
> repository to move to a different fs without loosing information.
> 
> 2) We could have a third bits to indicate if the feature is in use. 
> Repository on file system that needs it could start using the feature 
> conditionally. This as the advantage that we just needs to reserve the flags, 
> and can implement the feature later, the code behaving as it is today if that 
> third flag is unset. However this means that moving repository between file 
> system might loose information.
> In this scenario we would still need code to at least preserve the existing 
> value in the code.
> 
> I guess I'll start poking a (2) and see how much work it actually save use 
> compared to (1)

This feels like it comes back to past desires to separate the parts of dirstate 
that track user intent and the parts of dirstate that record caches of 
filesystem state, but it also seems awfully late in the process of v2 to 
address that here.

I read through the design: it seems like a good improvement over the old 
dirstate format, with my only gripe that we (still) haven’t resolved the 
cache-vs-userdata duality of dirstate. Seems fine enough to me.

AF

> 
> --
> 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: Renaming foss.heptapod.net/octobus/mercurial-devel to foss.heptapod.net/mercurial/mercurial-devel

2021-09-29 Thread Augie Fackler
Seems fine to me. Can you add it to the project infrastructure wiki page
with appropriate contact people listed?

On Wed, Sep 29, 2021, 05:47 Raphaël Gomès  wrote:

> Hi all,
>
> We've seen some people think that
> foss.heptapod.net/octobus/mercurial-devel is an Octobus-only repository
> and serves some sort of company purpose. The URL includes "octobus"
> purely because we historically didn't want to send the wrong message
> that this repository was official in any form by using "mercurial"
> directly.
>
> Nowadays the vast majority of the CI for the project runs on Heptapod
> and people outside of Octobus have been using this repository for a
> while. We want to encourage external developers to contribute to
> Mercurial in the way they find easier, and Heptapod is a good way of
> running patches against the CI, getting feedback before submission.
>
> This is of course *not* a proposal to make this repo the canonical one,
> but simply to ask if people had any objections to renaming (and keeping
> the redirect, of course) foss.heptapod.net/octobus/mercurial-devel to
> foss.heptapod.net/mercurial/mercurial-devel.
>
> Depending on how fast people answer and if we agree or not it might not
> be my doing, since I'll be off for two weeks starting Saturday.
>
> Thanks,
> Raphaël
>
> ___
> 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: Giving up August releases?

2021-08-25 Thread Augie Fackler
Maybe we should shift the schedule so that major releases don't fall during
major european holiday windows?

On Wed, Aug 25, 2021 at 12:36 PM Raphaël Gomès 
wrote:

> Hi all,
>
> Mercurial 5.9 was just released and it was a painful release: there were
> lots of bugs that took a long time to fix because of their impact and/or
> diversity as well as a lack of time from basically everyone involved (or
> not involved), including myself.
>
> I think that a lot of the pain stemmed from the timing: August is just
> not a good time to do releases, everyone is on vacation or trying to be.
>
> What do you think about cutting out the August release altogether for
> the years to come?
>
> Raphaël
>
> ___
> 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


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


Re: Subject: 5.9 freeze, Windows, regression-fixes and Python 2 drop

2021-07-15 Thread Augie Fackler
I’m going to be unable to pay attention to Mercurial stuff during the freeze 
(probably the whole freeze? unsure) so it’d be helpful if others can make sure 
releases happen (including signing and cross-review).

I’m +0 on a freeze this time, to try and smoke out some real problems, as long 
as we also get that 5.8 pull regression fixed.

AF

> On Jul 13, 2021, at 12:05 PM, Raphaël Gomès  wrote:
> 
> Also relevant to fix before the release: https://phab.mercurial-scm.org/D11052
> 
> On 7/13/21 3:47 PM, Raphaël Gomès wrote:
>> Hi all,
>> 
>> As you know, the 5.9 freeze is coming up and should happen on the 18th of 
>> July.
>> 
>> This release will be a special one since, as of yesterday¹, all critical 
>> tests pass on our Windows Python 3 Heptapod CI. Tests related to extensions 
>> (like SVN support, `remotefilelog`, etc.) still have to be worked on and 
>> there is minor flakyness with a few tests², but the message is: I vote that 
>> this be the first release to support Python 3 Windows officially and the 
>> last to support Python 2 altogether. This will give us enough time to iron 
>> out the details in time for the 6.0 release to be the first Python 3 only 
>> release of Mercurial.
>> 
>> For the past few versions we haven't had much of a real freeze, which I 
>> think makes sense given the volume of contributions and the relatively good 
>> track-record of (lack of) regressions, but this time I want to propose that 
>> we observe a real freeze to dedicate at least some time to fixing the issues 
>> we're having and stabilizing the new stuff.
>> 
>> To name some things explicitly:
>>   - The parent ordering issue³ which is almost 50% why I'm advocating for 
>> the freeze⁴
>>   - Windows Python 3 support and improving CI coverage
>>   - `chg` now almost consistently times out some tests
>>   - `test-chg.t` is super flaky because of `sleep` calls
>>   - Bugs that have began building a settlement in bugzilla
>> 
>> I, for one, am happy that the end of the Py2 era is finally visible at the 
>> end of the tunnel and would like to thank all involved in the recent Windows 
>> endeavor.
>> 
>> Lastly, the Heptapod Windows CI Octobus is providing for this transition 
>> will cost about 400€ per month. We're currently running on free credit we 
>> have thanks to a partnership with OVH given for use in the Heptapod project, 
>> but this will run out one day and we very much encourage those who can help 
>> to reach out. Octobus is a 5-people European team already funding the 
>> development of Heptapod out of pocket, and there is only so much that can be 
>> reasonable for us to shoulder in the long-run.
>> 
>> What are your thoughts?
>> Raphaël
>> 
>> [1] https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/222914
>> [2] https://foss.heptapod.net/octobus/mercurial-devel/-/issues/12
>> [3] https://bz.mercurial-scm.org/show_bug.cgi?id=6538
>> [4] Larger users, including Mozilla, are affected by the bug: 
>> https://bugzilla.mozilla.org/show_bug.cgi?id=1720302
>> 
>> ___
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

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


D11092: pyoxidizer: add hooks to inject extra python packages and install files

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

REVISION SUMMARY
  We need this type of hook to inject our internal extension and resource files
  at Google. Presumably this could be useful to others, so instead of trying to
  carry an internal patch we've done this in a modular way that should be of
  value upstream.
  
  I'm extremely puzzled by the behavior of glob() on Windows, and I'll
  be filing at least one (probably two) bugs upstream about it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hgcli/pyoxidizer.bzl

CHANGE DETAILS

diff --git a/rust/hgcli/pyoxidizer.bzl b/rust/hgcli/pyoxidizer.bzl
--- a/rust/hgcli/pyoxidizer.bzl
+++ b/rust/hgcli/pyoxidizer.bzl
@@ -103,6 +103,12 @@
 exe.add_python_resources(
 exe.pip_install(["-r", ROOT + 
"/contrib/packaging/requirements-windows-py3.txt"]),
 )
+extra_packages = VARS.get("extra_py_packages", "")
+if extra_packages:
+for extra in extra_packages.split(","):
+extra_src, pkgs = extra.split("=")
+pkgs = pkgs.split(":")
+exe.add_python_resources(exe.read_package_root(extra_src, pkgs))
 
 return exe
 
@@ -144,6 +150,17 @@
 print("copying %s to %s" % (path, new_path))
 manifest.add_file(manifest.get_file(path), path = new_path)
 
+extra_install_files = VARS.get("extra_install_files", "")
+if extra_install_files:
+for extra in extra_install_files.split(","):
+print("adding extra files from %s" % extra)
+# TODO: I expected a ** glob to work, but it didn't.
+#
+# TODO: I know this has forward-slash paths. As far as I can tell,
+# backslashes don't ever match glob() expansions in 
+# tugger-starlark, even on Windows.
+manifest.add_manifest(glob(include=[extra + "/*/*"], 
strip_prefix=extra+"/"))
+
 # We also install a handful of additional files.
 EXTRA_CONTRIB_FILES = [
 "bash_completion",



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


D11093: packaging: add command line flag to add extra vars to pyoxidizer

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

REVISION SUMMARY
  This felt simpler than the previous incarnation of injecting
  content into the WiX build. I decided the easiest way to pass
  an arbitrary map into the process was some json - I may regret this,
  but time will tell on that.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/packaging/hgpackaging/cli.py
  contrib/packaging/hgpackaging/wix.py

CHANGE DETAILS

diff --git a/contrib/packaging/hgpackaging/wix.py 
b/contrib/packaging/hgpackaging/wix.py
--- a/contrib/packaging/hgpackaging/wix.py
+++ b/contrib/packaging/hgpackaging/wix.py
@@ -8,6 +8,7 @@
 # no-check-code because Python 3 native.
 
 import collections
+import json
 import os
 import pathlib
 import re
@@ -386,6 +387,7 @@
 extra_wxs: typing.Optional[typing.Dict[str, str]] = None,
 extra_features: typing.Optional[typing.List[str]] = None,
 signing_info: typing.Optional[typing.Dict[str, str]] = None,
+extra_pyoxidizer_vars=None,
 ):
 """Build a WiX MSI installer using PyOxidizer."""
 hg_build_dir = source_dir / "build"
@@ -418,6 +420,9 @@
 if signing_info["timestamp_url"]:
 build_vars["TIME_STAMP_SERVER_URL"] = signing_info["timestamp_url"]
 
+if extra_pyoxidizer_vars:
+build_vars.update(json.loads(extra_pyoxidizer_vars))
+
 if extra_wxs:
 raise Exception(
 "support for extra .wxs files has been temporarily dropped"
diff --git a/contrib/packaging/hgpackaging/cli.py 
b/contrib/packaging/hgpackaging/cli.py
--- a/contrib/packaging/hgpackaging/cli.py
+++ b/contrib/packaging/hgpackaging/cli.py
@@ -64,6 +64,7 @@
 extra_packages_script=None,
 extra_wxs=None,
 extra_features=None,
+extra_pyoxidizer_vars=None,
 ):
 if not pyoxidizer_target and not python:
 raise Exception("--python required unless building with PyOxidizer")
@@ -105,7 +106,7 @@
 "timestamp_url": sign_timestamp_url,
 }
 
-fn(**kwargs)
+fn(**kwargs, extra_pyoxidizer_vars=extra_pyoxidizer_vars)
 
 
 def get_parser():
@@ -168,6 +169,12 @@
 "in the installer from the extra wxs files"
 ),
 )
+
+sp.add_argument(
+"--extra-pyoxidizer-vars",
+help="json map of extra variables to pass to pyoxidizer",
+)
+
 sp.set_defaults(func=build_wix)
 
 return parser



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


D11030: parsers: move DirstateItem to attr.s

2021-07-08 Thread durin42 (Augie Fackler)
durin42 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/D11030

AFFECTED FILES
  mercurial/pure/parsers.py

CHANGE DETAILS

diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py
+++ b/mercurial/pure/parsers.py
@@ -14,6 +14,7 @@
 nullrev,
 sha1nodeconstants,
 )
+from ..thirdparty import attr
 from .. import (
 error,
 pycompat,
@@ -43,6 +44,7 @@
 AMBIGUOUS_TIME = -1
 
 
+@attr.s
 class DirstateItem(object):
 """represent a dirstate entry
 
@@ -54,13 +56,10 @@
 - mtime,
 """
 
-__slot__ = ('_state', '_mode', '_size', '_mtime')
-
-def __init__(self, state, mode, size, mtime):
-self._state = state
-self._mode = mode
-self._size = size
-self._mtime = mtime
+_state = attr.ib()
+_mode = attr.ib()
+_size = attr.ib()
+_mtime = attr.ib()
 
 def __getitem__(self, idx):
 if idx == 0 or idx == -4:



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


D11006: remotefilelog: stop using RuntimeError for control flow

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

REVISION SUMMARY
  We introduce a new exception to handle the various failure categories,
  rather than relying on RuntimeError.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/remotefilelog/basestore.py
  hgext/remotefilelog/shallowutil.py
  tests/test-remotefilelog-corrupt-cache.t

CHANGE DETAILS

diff --git a/tests/test-remotefilelog-corrupt-cache.t 
b/tests/test-remotefilelog-corrupt-cache.t
--- a/tests/test-remotefilelog-corrupt-cache.t
+++ b/tests/test-remotefilelog-corrupt-cache.t
@@ -38,7 +38,7 @@
   $ chmod u+w 
$CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
   $ echo x > 
$CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
   $ hg up tip 2>&1 | egrep "^[^ ].*unexpected remotefilelog"
-  RuntimeError: unexpected remotefilelog header: illegal format
+  hgext.remotefilelog.shallowutil.BadRemotefilelogHeader: unexpected 
remotefilelog header: illegal format
 
 Verify detection and remediation when remotefilelog.validatecachelog is set
 
diff --git a/hgext/remotefilelog/shallowutil.py 
b/hgext/remotefilelog/shallowutil.py
--- a/hgext/remotefilelog/shallowutil.py
+++ b/hgext/remotefilelog/shallowutil.py
@@ -233,6 +233,10 @@
 return x
 
 
+class BadRemotefilelogHeader(error.StorageError):
+"""Exception raised when parsing a remotefilelog blob header fails."""
+
+
 def parsesizeflags(raw):
 """given a remotefilelog blob, return (headersize, rawtextsize, flags)
 
@@ -253,16 +257,20 @@
 elif s.startswith(constants.METAKEYFLAG):
 flags = int(s[len(constants.METAKEYFLAG) :])
 else:
-raise RuntimeError(
+raise BadRemotefilelogHeader(
 b'unsupported remotefilelog header: %s' % header
 )
 else:
 # v0, str(int(size)) is the header
 size = int(header)
 except ValueError:
-raise RuntimeError("unexpected remotefilelog header: illegal format")
+raise BadRemotefilelogHeader(
+"unexpected remotefilelog header: illegal format"
+)
 if size is None:
-raise RuntimeError("unexpected remotefilelog header: no size found")
+raise BadRemotefilelogHeader(
+"unexpected remotefilelog header: no size found"
+)
 return index + 1, size, flags
 
 
diff --git a/hgext/remotefilelog/basestore.py b/hgext/remotefilelog/basestore.py
--- a/hgext/remotefilelog/basestore.py
+++ b/hgext/remotefilelog/basestore.py
@@ -308,7 +308,7 @@
 # Content matches the intended path
 return True
 return False
-except (ValueError, RuntimeError):
+except (ValueError, shallowutil.BadRemotefilelogHeader):
 pass
 
 return False



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


D11008: shallowutil: dedent code after the previous change

2021-07-07 Thread durin42 (Augie Fackler)
durin42 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/D11008

AFFECTED FILES
  hgext/remotefilelog/shallowutil.py

CHANGE DETAILS

diff --git a/hgext/remotefilelog/shallowutil.py 
b/hgext/remotefilelog/shallowutil.py
--- a/hgext/remotefilelog/shallowutil.py
+++ b/hgext/remotefilelog/shallowutil.py
@@ -251,23 +251,22 @@
 raise BadRemotefilelogHeader(
 "unexpected remotefilelog header: illegal format"
 )
-if True:
-header = raw[:index]
-if header.startswith(b'v'):
-# v1 and above, header starts with 'v'
-if header.startswith(b'v1\n'):
-for s in header.split(b'\n'):
-if s.startswith(constants.METAKEYSIZE):
-size = int(s[len(constants.METAKEYSIZE) :])
-elif s.startswith(constants.METAKEYFLAG):
-flags = int(s[len(constants.METAKEYFLAG) :])
-else:
-raise BadRemotefilelogHeader(
-b'unsupported remotefilelog header: %s' % header
-)
+header = raw[:index]
+if header.startswith(b'v'):
+# v1 and above, header starts with 'v'
+if header.startswith(b'v1\n'):
+for s in header.split(b'\n'):
+if s.startswith(constants.METAKEYSIZE):
+size = int(s[len(constants.METAKEYSIZE) :])
+elif s.startswith(constants.METAKEYFLAG):
+flags = int(s[len(constants.METAKEYFLAG) :])
 else:
-# v0, str(int(size)) is the header
-size = int(header)
+raise BadRemotefilelogHeader(
+b'unsupported remotefilelog header: %s' % header
+)
+else:
+# v0, str(int(size)) is the header
+size = int(header)
 if size is None:
 raise BadRemotefilelogHeader(
 "unexpected remotefilelog header: no size found"



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


D11007: shallowutil: narrow scope of try/except block

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

REVISION SUMMARY
  This will make this code easier to understand in the future.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/remotefilelog/shallowutil.py

CHANGE DETAILS

diff --git a/hgext/remotefilelog/shallowutil.py 
b/hgext/remotefilelog/shallowutil.py
--- a/hgext/remotefilelog/shallowutil.py
+++ b/hgext/remotefilelog/shallowutil.py
@@ -247,6 +247,11 @@
 size = None
 try:
 index = raw.index(b'\0')
+except ValueError:
+raise BadRemotefilelogHeader(
+"unexpected remotefilelog header: illegal format"
+)
+if True:
 header = raw[:index]
 if header.startswith(b'v'):
 # v1 and above, header starts with 'v'
@@ -263,10 +268,6 @@
 else:
 # v0, str(int(size)) is the header
 size = int(header)
-except ValueError:
-raise BadRemotefilelogHeader(
-"unexpected remotefilelog header: illegal format"
-)
 if size is None:
 raise BadRemotefilelogHeader(
 "unexpected remotefilelog header: no size found"



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


D11005: remotefilelog: tweak corrupt cache test to grep more flexibly

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

REVISION SUMMARY
  I'm about to fix the abuse of RuntimeError here, which breaks the test
  if I don't do this.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-remotefilelog-corrupt-cache.t

CHANGE DETAILS

diff --git a/tests/test-remotefilelog-corrupt-cache.t 
b/tests/test-remotefilelog-corrupt-cache.t
--- a/tests/test-remotefilelog-corrupt-cache.t
+++ b/tests/test-remotefilelog-corrupt-cache.t
@@ -37,7 +37,7 @@
   > EOF
   $ chmod u+w 
$CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
   $ echo x > 
$CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
-  $ hg up tip 2>&1 | egrep "^RuntimeError"
+  $ hg up tip 2>&1 | egrep "^[^ ].*unexpected remotefilelog"
   RuntimeError: unexpected remotefilelog header: illegal format
 
 Verify detection and remediation when remotefilelog.validatecachelog is set



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


Re: Request: Please delete my signature from quotes of my email

2021-06-16 Thread Augie Fackler
We don't control nabble. As far as I know those are steps /you/ can follow.



On Wed, Jun 16, 2021, 17:20 鍋谷 英憲 (Heddi Nabbisen) via Mercurial-devel <
mercurial-devel@mercurial-scm.org> wrote:

>
> Augie
>
> Hello. Thank you for your kind reply🙂
> I am sorry, too. I didn't know my email would be stored in public space...
>
> I have checked Nabble's helps.
> It enables us to delete own posts (which I have carried out):
>
> > Most archives do not allow you to delete your message. With Nabble, you
> can.
>
> Well, if possible, whichever sooner or later, would you try to delete the
> post?
>
> > Log in to (or register with) Nabble and then you can find and delete
> your posts on Nabble.
>
> http://n8.nabble.com/help/Answer.jtp?id=13
>
> Den 17 juni 2021 00:44 skrev Augie Fackler :
>
> I’m afraid there’s nothing we can do to assist you on this: nabble isn’t
> even a service we run, and you’ve emailed a public mailing list with this
> information. Maybe nabble can help, but I’m not sure what their policy is.
>
> Sorry!
>
> > On Jun 16, 2021, at 1:28 AM, nabbisen--- via Mercurial-devel <
> mercurial-devel@mercurial-scm.org> wrote:
> >
> > Hello, Martin von Zweigbergk,
> >
> >
> http://mercurial.808500.n3.nabble.com/PATCH-improve-mobile-view-with-viewport-and-css-media-query-tp4102209p4102210.html
> >
> > Delete the last line (aka, that below "Best regards,") from quotes of my
> email, please. It affects my privacy seriously. Thank you.
> >
> > _
> > Sent from http://mercurial.808500.n3.nabble.com
> >
> > ___
> > Mercurial-devel mailing list
> > Mercurial-devel@mercurial-scm.org
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
>
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: Request: Please delete my signature from quotes of my email

2021-06-16 Thread Augie Fackler
I’m afraid there’s nothing we can do to assist you on this: nabble isn’t even a 
service we run, and you’ve emailed a public mailing list with this information. 
Maybe nabble can help, but I’m not sure what their policy is.

Sorry!

> On Jun 16, 2021, at 1:28 AM, nabbisen--- via Mercurial-devel 
>  wrote:
> 
> Hello, Martin von Zweigbergk,
> 
> http://mercurial.808500.n3.nabble.com/PATCH-improve-mobile-view-with-viewport-and-css-media-query-tp4102209p4102210.html
> 
> Delete the last line (aka, that below "Best regards,") from quotes of my 
> email, please. It affects my privacy seriously. Thank you.
> 
> _
> Sent from http://mercurial.808500.n3.nabble.com
> 
> ___
> 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


Does anyone still look at patchwork?

2021-06-16 Thread Augie Fackler
I’m poking some sysadmin/infra stuff today, and I’m not sure anyone looks at 
patchwork anymore. Is it still used, or should we consider getting rid of it?

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


D10777: fuzz: add hg to sys.path when constructing mpatch corpus

2021-05-27 Thread durin42 (Augie Fackler)
durin42 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/D10777

AFFECTED FILES
  contrib/fuzz/mpatch_corpus.py

CHANGE DETAILS

diff --git a/contrib/fuzz/mpatch_corpus.py b/contrib/fuzz/mpatch_corpus.py
--- a/contrib/fuzz/mpatch_corpus.py
+++ b/contrib/fuzz/mpatch_corpus.py
@@ -1,10 +1,15 @@
 from __future__ import absolute_import, print_function
 
 import argparse
+import os
 import struct
 import sys
 import zipfile
 
+# Add ../.. to sys.path as an absolute path so we can import hg modules
+hgloc = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
+sys.path[0:0] = [hgloc]
+
 from mercurial import (
 hg,
 ui as uimod,



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


Re: Manifest handling

2021-05-25 Thread Augie Fackler
On Fri, Apr 30, 2021 at 6:45 PM Joerg Sonnenberger  wrote:
>
> Hello all,
> this is a bit of a brain dump based on a recent discussion with
> Pierre-Yves on IRC. I think it deserves some input from others and maybe
> it can grow into a proper plan in time.
>
> For the context of this discussion, see
>   https://phab.mercurial-scm.org/D10082
> and
>   https://bz.mercurial-scm.org/show_bug.cgi?id=6219
> In short, the changelog entry itself is supposed to keep a list of files
> touched by the change, but there are two major shortcomings:
> (1) It doesn't show removals.
> (2) Older versions notoriously mishandled merges.
>
> This is painful not just for the review mentioned above, but various
> other places that want to efficiently track what files could have been
> affected by a changeset. This is made even worse by the inability to do
> get fast manifest deltas. The current manifest code again has two major
> shortcomings:
> (1) It only works against the delta parent and that isn't necessarily
> one of the changeset parents.
> (2) It doesn't show removals.
>
> Now I have been discussing "Bonsai" changesets as option for a while,
> but that would certainly introduce a major breakage and is therefore
> something that must be opt-in. But the idea by itself has enough merits
> and brings the question on whether we can't compute the equivalent as
> (non-optional) cache. What do we want in such a cache? We want to allow
> walking from parent to child or the other way around and efficiently
> compute the new file nodes. For merge commits, it should be possible to
> traverse to either parent efficently. The first idea would be to store
> lists of (path, old node, new node) for non-merges and (path, p1 node,
> p2 node, new node) for merge commits. Added/removed files are using a
> special marker node like  like in other places. This would be
> require variable size entries (more parsing) and quite a bit of text
> storage for big/deep repos. That's undesirable, so the first improvement
> would be to have a side table of the path names similar to how we handle
> it in the rev-branch-cache. The second option would be to store file
> revisions and not nodes, but that has some concerns about strip handling.
> It would reduce the size of the entries by factor of 4 to 7 though. Using
> such a data structure for traversing is easy, just figure out which
> parent is the desired parent and pick the appropiate old/new entries.
>
> Computing this structure is bit tricky as we do not want to ever compute
> the full text of parent or child. So we need to process the diffs
> directly. For that, we need to know the starting position of each file.
> The end of each line we compute easily based on the node len and the
> path name. We can exploit the special nature of the manifest: all lines
> are sorted and path is unique. Based on that we can build an augmented
> binary tree that keeps track of the size of its subtrees. The tree can
> be shared with the delta base and updated bottom-up, e.g. as
> red-black-tree that would require O(d log n) new nodes to be written
> where d is the number of lines touched and n the total number of lines
> in the manifest. For merges or if the delta is not against the parent of
> a changeset, a bit more work is necessary to compute the precise diff.
> This can be done either by walking the path between the nodes or by
> recursively comparing the trees. I would expect that in most cases the
> recursive compare works quite well as most tree nodes should end up
> being shared for the typical short term forks and the like.
>
> Thoughts?

Sounds tricky, but possibly useful. A wrinkle: how would this interact
with narrowing? Would the cache you describe just have to be rebuilt
on a widen/narrow event? Assume that reifying the entire changelog
isn't feasible for sufficiently large repositories on normal
workstations...

(Other than that, no thoughts to add past what PYD had)

>
> Joerg
> ___
> 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 1 of 1] fix sparse:subprepo.subrepo - now provide DummySubrepo for subs out of sparse

2021-05-19 Thread Augie Fackler
Elaborating more: this appears to introduce import cycles caught by running the 
tests under Python 2.7. I’m not sure why that test is broken on Python 3, but 
I’ll try to make a note to explore that.

> On May 19, 2021, at 4:29 AM, Raphaël Gomès  wrote:
> 
> Hi,
> 
> This patch breaks a few tests in the Heptapod CI [1]. I have removed it from 
> the queue, please feel free to send a second version.
> 
> [1] https://foss.heptapod.net/octobus/mercurial-devel/-/pipelines/22116 
> 
> On 5/13/21 7:35 PM, alexrayne wrote:
>> # HG changeset patch
>> # User alexrayne  
>> # Date 1619989845 -10800
>> #  Mon May 03 00:10:45 2021 +0300
>> # Branch stable
>> # Node ID 57d1837724ebe88c276013a621a3de9163bd51f7
>> # Parent  b7e623ac98b6f0d3b4e2f394637ae3f1a2a59711
>> fix sparse:subprepo.subrepo - now provide DummySubrepo for subs out of 
>> sparse.
>> This dummy sub is empty node, always clean and ready to get/remove
>> fix subrepoutil.submerge - now ignores changes for items out of sparce
>> 
>> diff --git a/hgext/sparse.py b/hgext/sparse.py
>> --- a/hgext/sparse.py
>> +++ b/hgext/sparse.py
>> @@ -78,6 +78,8 @@
>>  from mercurial import (
>>  commands,
>>  dirstate,
>> +subrepoutil,
>> +subrepo,
>>  error,
>>  extensions,
>>  logcmdutil,
>> @@ -106,6 +108,7 @@
>>  _setuplog(ui)
>>  _setupadd(ui)
>>  _setupdirstate(ui)
>> +_setupsubrepo(ui)
>>  
>>  
>>  def replacefilecache(cls, propname, replacement):
>> @@ -285,6 +288,52 @@
>>  
>>  extensions.wrapfunction(dirstate.dirstate, func, _wrapper)
>>  
>> +class DummySubrepo(subrepo.abstractsubrepo):
>> +""" Dumy subrepo is replacement of subrepo, that should be filterout 
>> from sparce.
>> +this subrepo acts as always clean and always get/remove well.
>> +"""
>> +
>> +def dirty(self, ignoreupdate=False, missing=False):
>> +return False
>> +
>> +def get(self, state, overwrite=False):
>> +return
>> +
>> +def remove(self):
>> +return
>> +
>> +
>> +
>> +def _setupsubrepo(ui):
>> +"""Modify the dirstate to prevent stat'ing excluded files,
>> +and to prevent modifications to files outside the checkout.
>> +"""
>> +
>> +def _state(orig, ctx, ui):
>> +sparsematch = sparse.matcher(ctx.repo(), revs=[ ctx.rev() ])
>> +if not sparsematch.always():
>> +# filter allstate, leave only sparce pathes
>> +allstate = orig(ctx, ui)
>> +sparcestate = dict()
>> +for (idx, item) in allstate.items():
>> +if sparsematch(idx):
>> +sparcestate[idx] = item
>> +return sparcestate
>> +else:
>> +return orig(ctx, ui)
>> +
>> +#extensions.wrapfunction(subrepoutil, b'state', _state)
>> +
>> +""" provide DummySubrepo for pathes out of sparse
>> +"""
>> +def _subrepo(orig, ctx, path, allowwdir=False, allowcreate=True):
>> +sparsematch = sparse.matcher(ctx.repo(), revs=[ ctx.rev() ])
>> +if not sparsematch.always():
>> +if not sparsematch(path):
>> +return DummySubrepo(ctx, path)
>> +return orig(ctx, path, allowwdir, allowcreate)
>> +
>> +extensions.wrapfunction(subrepo, b'subrepo', _subrepo)
>>  
>>  @command(
>>  b'debugsparse',
>> diff --git a/mercurial/subrepoutil.py b/mercurial/subrepoutil.py
>> --- a/mercurial/subrepoutil.py
>> +++ b/mercurial/subrepoutil.py
>> @@ -21,6 +21,7 @@
>>  pathutil,
>>  phases,
>>  pycompat,
>> +sparse,
>>  util,
>>  )
>>  from .utils import (
>> @@ -183,6 +184,9 @@
>>  sa = actx.substate
>>  sm = {}
>>  
>> +s1match = sparse.matcher(repo, revs=[ wctx.rev() ])
>> +s2match = sparse.matcher(repo, revs=[ mctx.rev() ])
>> +
>>  repo.ui.debug(b"subrepo merge %s %s %s\n" % (wctx, mctx, actx))
>>  
>>  def debug(s, msg, r=b""):
>> @@ -192,6 +196,9 @@
>>  
>>  promptssrc = filemerge.partextras(labels)
>>  for s, l in sorted(pycompat.iteritems(s1)):
>> +if not s1match(s):
>> +sm[s] = l   # ignore changes out of sparse
>> +continue
>>  a = sa.get(s, nullstate)
>>  ld = l  # local state with possible dirty flag for compares
>>  if wctx.sub(s).dirty():
>> @@ -202,6 +209,9 @@
>>  prompts = promptssrc.copy()
>>  prompts[b's'] = s
>>  if s in s2:
>> +if not s2match(s):
>> +sm[s] = l   # ignore changes out of sparse
>> +continue
>>  r = s2[s]
>>  if ld == r or r == a:  # no change or local is newer
>>  sm[s] = l
>> @@ -288,6 +298,14 @@
>>  mctx.sub(s).get(r)
>>  sm[s] = r
>>  elif r != sa[s]:
>> +if not s2match(s):
>> +# ignore changes out of sparse, 
>

D10733: hghave: make error output easier to diagnose

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

REVISION SUMMARY
  I had a typo that meant the new bash check was throwing an exception
  (due to a missing argument), but it was very hard to diagnose without
  this change.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -104,8 +104,8 @@
 check, desc = checks[feature]
 try:
 available = check()
-except Exception:
-result['error'].append('hghave check failed: %s' % feature)
+except Exception as e:
+result['error'].append('hghave check %s failed: %r' % (feature, e))
 continue
 
 if not negate and not available:



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


D10732: tests: add req on bash for test-transaction-rollback-on-sigpipe (issue6429)

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

REVISION SUMMARY
  I think we could work around this by rewriting the helper scripts in
  Python, but I don't want to deal with that now and this should prevent
  failures due to a lack of bash.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/hghave.py
  tests/test-transaction-rollback-on-sigpipe.t

CHANGE DETAILS

diff --git a/tests/test-transaction-rollback-on-sigpipe.t 
b/tests/test-transaction-rollback-on-sigpipe.t
--- a/tests/test-transaction-rollback-on-sigpipe.t
+++ b/tests/test-transaction-rollback-on-sigpipe.t
@@ -1,3 +1,4 @@
+#require bash
 Test that, when an hg push is interrupted and the remote side recieves SIGPIPE,
 the remote hg is able to successfully roll back the transaction.
 
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -1121,3 +1121,8 @@
 return True
 except ImportError:
 return False
+
+
+@check("bash", "bash shell")
+def has_bash():
+return matchoutput("bash -c 'echo hi'", b'^hi$')



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


D6594: [ABANDONED] RFC dirstatemap

2021-05-12 Thread durin42 (Augie Fackler)
Herald added a subscriber: mercurial-patches.
durin42 added a comment.
durin42 added subscribers: muxator, gracinet.


  (+ infra list, some folks that I think volunteered in the past)

REPOSITORY
  rHG Mercurial

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

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

To: Alphare, #hg-reviewers
Cc: gracinet, mercurial-patches, muxator, yuja, durin42, kevincox, mjpieters, 
mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: certificate errors when accessing http://mercurial.selenic.com/release

2021-05-07 Thread Augie Fackler
Probably. I don’t have time even for sysadmin problems that are pressing (like 
our Debian bistro falling out of support), much less this though. :(

> On May 7, 2021, at 11:57 AM, Dan Villiom Podlaski Christiansen 
>  wrote:
> 
> When I search for something Mercurial-related, I sometimes get results on 
> mercurial.selenic.com, see for example the third result in this one:
> 
> https://duckduckgo.com/?q=mercurial+convert
> 
> Since mercurial.selenic.com is an alias for mercurial-scm.org, shouldn't it 
> be in the certificate as well?
> 
>> On 4 Feb 2021, at 05.08, Augie Fackler  wrote:
>> 
>> We haven’t used the mercurial.selenic.com domain in several years - try 
>> using mercurial-scm.org instead.
>> 
>>> On Jan 23, 2021, at 5:26 PM, Danny Schneider  
>>> wrote:
>>> 
>>> This is what happens:
>>> 
>>> 
>>> LC_TIME="en_EN.UTF-8" wget 
>>> http://mercurial.selenic.com/release/mercurial-5.6.tar.gz
>>> --2021-01-23 23:21:20-- 
>>> http://mercurial.selenic.com/release/mercurial-5.6.tar.gz
>>> Resolving mercurial.selenic.com (mercurial.selenic.com)... 192.81.134.36, 
>>> 2600:3c01::f03c:91ff:fedb:76b6
>>> Connecting to mercurial.selenic.com 
>>> (mercurial.selenic.com)|192.81.134.36|:80... connected.
>>> HTTP request sent, awaiting response... 302 Found
>>> Location: https://mercurial.selenic.com/release/mercurial-5.6.tar.gz 
>>> [following]
>>> --2021-01-23 23:21:21-- 
>>> https://mercurial.selenic.com/release/mercurial-5.6.tar.gz
>>> Connecting to mercurial.selenic.com 
>>> (mercurial.selenic.com)|192.81.134.36|:443... connected.
>>> ERROR: no certificate subject alternative name matches
>>>requested host name 'mercurial.selenic.com'.
>>> To connect to mercurial.selenic.com insecurely, use 
>>> `--no-check-certificate'.
>>> 
>>> 
>>> The same happens when I try to access http://mercurial.selenic.com/release 
>>> with a browser
>>> 
>>> -- 
>>> Danny Schneider
>>> Mit freundlichem Gruß
>>> 
>>> With best regards
>>> 
>>> Danny Schneider
>>> ___
>>> 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
> 
> --
> 
> Dan Villiom Podlaski Christiansen
> dan...@gmail.com — +45 2728 9771
> 

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


D10669: debugcommands: fix some plural-agreements I noticed

2021-05-04 Thread durin42 (Augie Fackler)
durin42 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/D10669

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -4086,7 +4086,7 @@
 should complete almost instantaneously and the chances of a consumer being
 unable to access the repository should be low.
 
-By default, all revlog will be upgraded. You can restrict this using flag
+By default, all revlogs will be upgraded. You can restrict this using flags
 such as `--manifest`:
 
   * `--manifest`: only optimize the manifest



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


Re: [PATCH] improve mobile view with viewport and css media query

2021-04-12 Thread Augie Fackler
(+pulkitg because it’s website-related)

> On Apr 1, 2021, at 9:14 PM, Heddi Nabbisen via Mercurial-devel 
>  wrote:
> 
> # HG changeset patch
> # User nabbisen 
> # Date 1617325695 -32400
> #  Fri Apr 02 10:08:15 2021 +0900
> # Node ID f269688339206a9f7c85fb089cd9adb9c8215a92
> # Parent  5284da57c604bc5a36ac74b36001ce3d6e0be1d3
> improve mobile view with viewport and css media query
> 
> diff -r 5284da57c604 -r f26968833920 static/css/styles.css
> --- a/static/css/styles.css   Mon Oct 26 14:55:33 2020 +0100
> +++ b/static/css/styles.css   Fri Apr 02 10:08:15 2021 +0900
> @@ -205,3 +205,20 @@
> .wrap {
> white-space: pre-wrap;
> }
> +
> +/** todo: 876px? */
> +@media (max-width: 876px) {
> +body { width: 100vw; padding: 0; margin: 0; }
> +
> +.row { padding: 0.3rem 0.7rem; }
> +.col { float: unset; display: block; width: 100%; padding: 0.3rem 
> 0.7rem; margin: 0; }
> +.big { float: unset; width: 100%; }
> +
> +#nav { position: static; width: 100vw; height: auto; padding: 0.3rem 0; 
> line-height: 1.25em; }
> +
> +#content { padding: 0.4rem 0.2rem; }
> +#content .table-of-contents { font-size: 100%; }
> +#content .table-of-contents li { line-height: 2.4em; }
> +
> +pre, .output { overflow-x: auto; }
> +}
> diff -r 5284da57c604 -r f26968833920 templates/base.html
> --- a/templates/base.html Mon Oct 26 14:55:33 2020 +0100
> +++ b/templates/base.html Fri Apr 02 10:08:15 2021 +0900
> @@ -1,8 +1,9 @@
> - -   "http://www.w3.org/TR/html4/loose.dtd";>
> -
> +
> +
> 
> -
> +
> +
> +
>  type="text/css" rel="stylesheet">
> 
> 
> ___
> 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: Python 2 removal and thg packaging status

2021-04-12 Thread Augie Fackler


> On Apr 3, 2021, at 6:34 PM, Matt Harbison  wrote:
> 
> On Sat, Apr 3, 2021 at 12:18 PM Raphaël Gomès  > wrote:
>> 
>> Hello all,
>> 
>> As you all know, Mercurial's codebase is still burdened by Python 2
>> support. Patches still
>> need to be adapted for backwards compat, some Python niceties still
>> cannot be used,
>> and the Heptapod CI which is used on a near majority of the patches we
>> collectively land
>> is still putting in double shifts as well.
>> 
>> At the last (virtual) sprint, everybody present agreed that the time had
>> long passed to drop
>> Python 2 support, but that it couldn't be done until TortoiseHg's Python
>> 3 Windows packaging
>> story was straightened out. Where are we standing on the matter? Are we
>> close?
> 
> I've been making progress on adding type hints and fixing issues in
> the TortoiseHg code.  The good news is there are ~13 files left that
> are excluded.  The bad news is I know for a fact that some of the
> *included* files have type mismatches that pytype isn't detecting.
> Some of this could be helped by moving to py3.  (e.g. pytype seems to
> not recognize `foo[b'bar']` as calling `__getitem__()` on an object,
> and treats it as returning Any, even when there's type info on the
> function.  Subclassing typing.Mapping seems to help in some cases, but
> classes like `config.config` and `localrepo.localrepository` really
> can't subclass that because they have functions like `items()` with a
> signature that differs from the base class.  It also seems to struggle
> with @annotations.)  IDK for sure how far I am through adding type
> hints, because it's so non linear by nature.  If I had to guess, maybe
> 50%?
> 
> Stepping back from the thg work, there's also core work that still
> needs to be done.  I just ran the tests locally and got 19 failures
> (excluding fixes I'm about the send), and skipping 114 which are
> mostly never going to work on Windows because of symlink, executable
> bit, casefolding, etc.  Some of those skips are test-convert-* other
> than git, so I assume that's a mess.  I don't care about that, but
> somebody might.  Of the failures, 4 are test-gendoc-*, so IDK how
> important those are.  Some of the other failures are... concerning.
> But they may have simple fixes.  There are runtime issues that are not
> detected by tests, such as
> https://bz.mercurial-scm.org/show_bug.cgi?id=6446 
>  and getting no
> output for commands that spin up a pager.  (I *think* the latter is
> limited to running `hg` instead of `hg.exe` in a venv, so maybe this
> is fixable by compiling wrapper.exe and not installing the `hg` script
> when running `setup.py` on Windows.)  I also need to finish up the py3
> porting series for mercurial_keyring, as that still has a few issues.
> 
> I think that it would be beneficial to have a beta period for thg
> where both py2 and py3 are built (like we did with hg), to find some
> of the issues that pytype isn't catching.  I'll probably regret this
> because IDK how long I can sustain the current pace, but if we can get
> the Windows and Mac packaging done for 5.8, maybe 5.8 can be the beta
> period and 5.9 is py3 only?  (It might be OK if the packaging isn't
> ready until 5.8.1, since Yuya seems to be OK with landing packaging
> and py3 fixes on stable if they aren't crazy.)  I think Greg made some
> MSI related enhancement to PyOxidizer recently, but IDK what the means
> for the state of things, or how far away a macOS *.app bundle is.
> Worst case scenario, I can build thg 5.9 with hg 5.8.2 if thg progress
> can't keep pace.  I just don't want that going on forever.

I think this plan is sensible and you should proceed with it.

> 
>> I am CC'ing Greg who proposed to help at the time, as well as Matt, the
>> maintainer, since they
>> might know better than anyone where we're currently standing.
>> 
>> Thanks,
>> Raphaël
>> 
> ___
> 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


D10185: black: merge config into main pyproject.toml now that we have it

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

REVISION SUMMARY
  This means that naive contributors who just run `black` on a source file
  will get reasonable behavior as long as they have a recent black. Yay!
  
  This was previously D9834  but was 
rolled back due to test
  failures. nbjoerg thinks it's time to try again, so let's give it a
  shot.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  black.toml
  contrib/examples/fix.hgrc
  pyproject.toml
  tests/test-check-code.t
  tests/test-check-format.t

CHANGE DETAILS

diff --git a/tests/test-check-format.t b/tests/test-check-format.t
--- a/tests/test-check-format.t
+++ b/tests/test-check-format.t
@@ -1,5 +1,5 @@
 #require black test-repo
 
   $ cd $RUNTESTDIR/..
-  $ black --config=black.toml --check --diff `hg files 'set:(**.py + 
grep("^#!.*python")) - mercurial/thirdparty/**'`
+  $ black --check --diff `hg files 'set:(**.py + grep("^#!.*python")) - 
mercurial/thirdparty/**'`
 
diff --git a/tests/test-check-code.t b/tests/test-check-code.t
--- a/tests/test-check-code.t
+++ b/tests/test-check-code.t
@@ -66,7 +66,6 @@
   COPYING
   Makefile
   README.rst
-  black.toml
   hg
   hgeditor
   hgweb.cgi
diff --git a/pyproject.toml b/pyproject.toml
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,18 @@
 [build-system]
 requires = ["setuptools", "wheel"]
 build-backend = "setuptools.build_meta"
+
+[tool.black]
+line-length = 80
+exclude = '''
+build/
+| wheelhouse/
+| dist/
+| packages/
+| \.hg/
+| \.mypy_cache/
+| \.venv/
+| mercurial/thirdparty/
+'''
+skip-string-normalization = true
+quiet = true
diff --git a/contrib/examples/fix.hgrc b/contrib/examples/fix.hgrc
--- a/contrib/examples/fix.hgrc
+++ b/contrib/examples/fix.hgrc
@@ -5,7 +5,7 @@
 rustfmt:command = rustfmt +nightly
 rustfmt:pattern = set:"**.rs" - "mercurial/thirdparty/**"
 
-black:command = black --config=black.toml -
+black:command = black
 black:pattern = set:**.py - mercurial/thirdparty/**
 
 # Mercurial doesn't have any Go code, but if we did this is how we
diff --git a/black.toml b/black.toml
deleted file mode 100644
--- a/black.toml
+++ /dev/null
@@ -1,14 +0,0 @@
-[tool.black]
-line-length = 80
-exclude = '''
-build/
-| wheelhouse/
-| dist/
-| packages/
-| \.hg/
-| \.mypy_cache/
-| \.venv/
-| mercurial/thirdparty/
-'''
-skip-string-normalization = true
-quiet = true



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


D10184: pyproject: add config file

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

REVISION SUMMARY
  This will tell pip et al to call our setup.py for the majority of
  packaging concerns, but also gives us a place to put standard config
  stuff like black.
  
  This was previously D9833 , but was 
rolled back due to test
  breakage. nbjoerg thinks that breakage is now resolved, so we're
  trying again.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  pyproject.toml
  tests/test-check-code.t

CHANGE DETAILS

diff --git a/tests/test-check-code.t b/tests/test-check-code.t
--- a/tests/test-check-code.t
+++ b/tests/test-check-code.t
@@ -70,6 +70,7 @@
   hg
   hgeditor
   hgweb.cgi
+  pyproject.toml
   rustfmt.toml
   setup.py
 
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools", "wheel"]
+build-backend = "setuptools.build_meta"



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


Re: [RFC] Interaction between strip and caches

2021-02-26 Thread Augie Fackler


> On Dec 14, 2020, at 5:03 PM, Joerg Sonnenberger  wrote:
> 
> Hello all,
> while looking at the revbranchcache, I noticed that it is doing quite an
> expensive probalistic invalidation dance. It is essentially looking up
> the revision in the changelog again and compares the first 32bit to see
> if they (still) match. Other caches are doing cheaper checks like
> remembering the head revision and node and checking it again to match.
> The goal is in all cases to detect one of two cases:
> 
> (1) Repository additions by a hg instance without support for the cache.
> (2) Repository removals by strip without update support specific to the
> cache in use.
> 
> The first part is generally handled reasonable well and cheap. Keep
> track of the number of revisions and process to all missing changesets
> is something code has to support anyway. The real difficult problem is
> the second part. I would like us to adopt a more explicit way of dealing
> with this and opt-in support via a repository requirement. Given that
> the strip command has finally become part of core, it looks like a good
> time to do this now.
> 
> The first option is to require strip to nuke all caches that it can't
> update. This is easy to implement and works reliable by nature with all
> existing caches. It is also the more blunt option.

Won’t the caches invalidate themselves an this defect happens today?

> The second option is to keep a journal of strips. This can be a single
> monotonically increasing counter and every cache just reads the counter
> and rebuilds itself. Alternatively it could be a full journal that lists
> the revisions and associated nodes removed. This requires changes to
> existing caches but has the advantage that strip can be replayed by the
> cache logic to avoid a full rebuild.

Potentially complicated, but could be worthwhile in a large repo with strips. 
Is that something you expect to encounter? For the most part we’ve historically 
considered strip an anti-pattern of sorts and not worried super hard about 
optimizing it.

> 
> Joerg
> ___
> 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: SHA1 replacement steps

2021-02-26 Thread Augie Fackler


> On Feb 15, 2021, at 9:18 AM, Joerg Sonnenberger  wrote:
> 
> Hello all,
> to help the review process along, here are the rough steps I see in
> preparation for supporting 256bit hashes:
> 
> (1) Move the current 160bit constants from mercurial.node into a
> subclass. Instead of a global constant, derive the correct constant from
> the repo/revlog/... instance and pass it down as necessary. The API
> change itself is in D9750. The expectation for this step is that a
> repository has one hash size and one set of magic values, but it doesn't
> change anything regarding the hash function itself. A follow-up change
> is necessary to replace the global constants (approximately D9465 minus
> D9750).

I was somewhat assuming we’d alter various codepaths to always emit 256-bit 
hashes, even if they end in all NUL. Your way sounds a little more complicated 
but is also fine, I don’t feel strongly.

> 
> (2) Adjust various on-disk formats to switch between the current 160bit
> and 256bit encoding based on the node constants in use. This would be a
> non-functional change for existing repositories.

Are any on-disk formats not already using 256-bit storage? I know revlogs are, 
so I _think_ this is only going to matter for caches.

> 
> (3) Introduce the tagged 256(*) hash function. My plan here is to use
> Blake2b configured for 248bit output and a suffix of b'\x01'. It is a
> bit wasteful to reserve 8bit for the tag, but simplifies code. Biggest
> downside is that the full Blake2b support is not available in Python 2.

Honestly I think new hash functions is exactly the kind of thing we should gate 
on Python 3. If someone is _really_ enthusiastic they can write a backport 
extension or something, for the users that are (bafflingly) caring about modern 
hashes but stuck on an ancient Python.

> 
> The tag would allow different hash functions to co-exist and embed
> existing SHA1 hashes by zero padding.
> 
> (4) Adjust hash verification logic to derive the hash function from the
> tag of a node, not just hard-coding it.
> 
> At the end of step 4, most repositories can be converted in a mostly
> transparent way.

Notably, you can allow people to only upgrade new hashes if they’re so 
inclined, which lets you preserve gpg signatures etc.

> Some additional changes might be necessary for allowing
> "short" node ids for things like .hgtags, but overall, existing hashes
> should just continue to work as before.

Overall +1. We can arm-wrestle later about if allowing a “new commits are 
blake2b” mode (vs convert-the-repo mode) is reasonable, I don’t think it’ll 
take a ton of code either way.

One request: I think we should reserve a couple of suffixes (0xff and 0xfe, 
perhaps?) for “private use” - this would be useful for large installations that 
do strange things with hashing out of necessity.

Sorry for taking so long to respond to this - this is well thought out and I 
was just too busy with other work stuff for a couple weeks straight.

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


D10066: fuzz: if the caller of our makefile sets CC and CXX, trust them

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

REVISION SUMMARY
  This should fix the broken fuzzing build, because we've been
  explicitly using clang++ but are now being given a CXX=afl++, which
  does extra stuff.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/fuzz/Makefile

CHANGE DETAILS

diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -1,5 +1,5 @@
-CC = clang
-CXX = clang++
+CC ?= clang
+CXX ?= clang++
 
 # By default, use our own standalone_fuzz_target_runner.
 # This runner does no fuzzing, but simply executes the inputs



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


Re: certificate errors when accessing http://mercurial.selenic.com/release

2021-02-03 Thread Augie Fackler
We haven’t used the mercurial.selenic.com  
domain in several years - try using mercurial-scm.org instead.

> On Jan 23, 2021, at 5:26 PM, Danny Schneider  
> wrote:
> 
> This is what happens:
> 
> 
> LC_TIME="en_EN.UTF-8" wget 
> http://mercurial.selenic.com/release/mercurial-5.6.tar.gz
> --2021-01-23 23:21:20-- 
> http://mercurial.selenic.com/release/mercurial-5.6.tar.gz
> Resolving mercurial.selenic.com (mercurial.selenic.com)... 192.81.134.36, 
> 2600:3c01::f03c:91ff:fedb:76b6
> Connecting to mercurial.selenic.com 
> (mercurial.selenic.com)|192.81.134.36|:80... connected.
> HTTP request sent, awaiting response... 302 Found
> Location: https://mercurial.selenic.com/release/mercurial-5.6.tar.gz 
> [following]
> --2021-01-23 23:21:21-- 
> https://mercurial.selenic.com/release/mercurial-5.6.tar.gz
> Connecting to mercurial.selenic.com 
> (mercurial.selenic.com)|192.81.134.36|:443... connected.
> ERROR: no certificate subject alternative name matches
> requested host name 'mercurial.selenic.com'.
> To connect to mercurial.selenic.com insecurely, use `--no-check-certificate'.
> 
> 
> The same happens when I try to access http://mercurial.selenic.com/release 
> with a browser
> 
> -- 
> Danny Schneider
> Mit freundlichem Gruß
> 
> With best regards
> 
> Danny Schneider
> ___
> 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


D9944: relnotes: add entry for `hg diff --merge -c`

2021-02-01 Thread durin42 (Augie Fackler)
durin42 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/D9944

AFFECTED FILES
  relnotes/next

CHANGE DETAILS

diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -5,6 +5,10 @@
  * The `rev-branch-cache` is now updated incrementally whenever changesets
are added.
 
+ * `hg diff` now takes an experimental `--merge` flag which causes `hg
+diff --change` to show the changes relative to an automerge for
+merge changesets. This makes it easier to detect and review manual
+changes performed in merge changesets.
 
 == New Experimental Features ==
 



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


D9939: diff: suppress `merging foo` output lines when performing a merge diff

2021-02-01 Thread durin42 (Augie Fackler)
durin42 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/D9939

AFFECTED FILES
  mercurial/commands.py
  tests/test-diff-change.t

CHANGE DETAILS

diff --git a/tests/test-diff-change.t b/tests/test-diff-change.t
--- a/tests/test-diff-change.t
+++ b/tests/test-diff-change.t
@@ -197,7 +197,6 @@
 merge diff should show only manual edits to a merge:
 
   $ hg diff --merge -c 6
-  merging file.txt
 (no diff output is expected here)
 
 Construct an "evil merge" that does something other than just the merge.
@@ -228,7 +227,6 @@
 up, making it easy to identify changes someone is otherwise trying to sneak
 into a merge.
   $ hg diff --merge -c 7
-  merging file.txt
   diff -r 8ad85e839ba7 file.txt
   --- a/file.txt   Thu Jan 01 00:00:00 1970 +
   +++ b/file.txt   Thu Jan 01 00:00:00 1970 +
@@ -277,7 +275,6 @@
   +this file is new in p2 of the merge
 With --merge, it's a diff against the conflicted content.
   $ hg diff --merge -c 11
-  merging file.txt
   diff -r 5010caab09f6 file.txt
   --- a/file.txt   Thu Jan 01 00:00:00 1970 +
   +++ b/file.txt   Thu Jan 01 00:00:00 1970 +
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2567,7 +2567,7 @@
 pctx1 = mctx.p1()
 pctx2 = mctx.p2()
 wctx = contextmod.overlayworkingctx(repo)
-wctx.setbase(ctx1)
+wctx.setbase(pctx1)
 with ui.configoverride(
 {
 (
@@ -2577,7 +2577,9 @@
 },
 b'diff --merge',
 ):
+repo.ui.pushbuffer()
 stats = mergemod.merge(pctx2, wc=wctx)
+repo.ui.popbuffer()
 ctx1 = wctx
 ctx2 = mctx
 else:



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


D9908: context: add missing manifest invalidation after write in overlayworkingctx

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

REVISION SUMMARY
  This was breaking my merge-diff logic that will be in the next patch.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -2597,6 +2597,7 @@
 b'flags': flags,
 b'copied': copied,
 }
+util.clearcachedproperty(self, b'_manifest')
 
 def filectx(self, path, filelog=None):
 return overlayworkingfilectx(



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


D9855: histedit: rip out mysterious catch-all ignore curses.error handler

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

REVISION SUMMARY
  I have no idea why this was here, and ripping it out doesn't obviously
  break anything for me (tests all pass, I can poke around chistedit UI
  a bit without issue), so I'm thinking we should rip it out and see if
  we get bug reports.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1623,63 +1623,60 @@
 stdscr.clear()
 stdscr.refresh()
 while True:
-try:
-oldmode, unused = state[b'mode']
-if oldmode == MODE_INIT:
-changemode(state, MODE_RULES)
-e = event(state, ch)
-
-if e == E_QUIT:
-return False
-if e == E_HISTEDIT:
-return state[b'rules']
+oldmode, unused = state[b'mode']
+if oldmode == MODE_INIT:
+changemode(state, MODE_RULES)
+e = event(state, ch)
+
+if e == E_QUIT:
+return False
+if e == E_HISTEDIT:
+return state[b'rules']
+else:
+if e == E_RESIZE:
+size = screen_size()
+if size != stdscr.getmaxyx():
+curses.resizeterm(*size)
+
+curmode, unused = state[b'mode']
+sizes = layout(curmode)
+if curmode != oldmode:
+state[b'page_height'] = sizes[b'main'][0]
+# Adjust the view to fit the current screen size.
+movecursor(state, state[b'pos'], state[b'pos'])
+
+# Pack the windows against the top, each pane spread across the
+# full width of the screen.
+y, x = (0, 0)
+helpwin, y, x = drawvertwin(sizes[b'help'], y, x)
+mainwin, y, x = drawvertwin(sizes[b'main'], y, x)
+commitwin, y, x = drawvertwin(sizes[b'commit'], y, x)
+
+if e in (E_PAGEDOWN, E_PAGEUP, E_LINEDOWN, E_LINEUP):
+if e == E_PAGEDOWN:
+changeview(state, +1, b'page')
+elif e == E_PAGEUP:
+changeview(state, -1, b'page')
+elif e == E_LINEDOWN:
+changeview(state, +1, b'line')
+elif e == E_LINEUP:
+changeview(state, -1, b'line')
+
+# start rendering
+commitwin.erase()
+helpwin.erase()
+mainwin.erase()
+if curmode == MODE_PATCH:
+renderpatch(mainwin, state)
+elif curmode == MODE_HELP:
+renderstring(mainwin, state, __doc__.strip().splitlines())
 else:
-if e == E_RESIZE:
-size = screen_size()
-if size != stdscr.getmaxyx():
-curses.resizeterm(*size)
-
-curmode, unused = state[b'mode']
-sizes = layout(curmode)
-if curmode != oldmode:
-state[b'page_height'] = sizes[b'main'][0]
-# Adjust the view to fit the current screen size.
-movecursor(state, state[b'pos'], state[b'pos'])
-
-# Pack the windows against the top, each pane spread across the
-# full width of the screen.
-y, x = (0, 0)
-helpwin, y, x = drawvertwin(sizes[b'help'], y, x)
-mainwin, y, x = drawvertwin(sizes[b'main'], y, x)
-commitwin, y, x = drawvertwin(sizes[b'commit'], y, x)
-
-if e in (E_PAGEDOWN, E_PAGEUP, E_LINEDOWN, E_LINEUP):
-if e == E_PAGEDOWN:
-changeview(state, +1, b'page')
-elif e == E_PAGEUP:
-changeview(state, -1, b'page')
-elif e == E_LINEDOWN:
-changeview(state, +1, b'line')
-elif e == E_LINEUP:
-changeview(state, -1, b'line')
-
-# start rendering
-commitwin.erase()
-helpwin.erase()
-mainwin.erase()
-if curmode == MODE_PATCH:
-renderpatch(mainwin, state)
-elif curmode == MODE_HELP:
-renderstring(mainwin, state, __doc__.strip().splitlines())
-else:
-renderrules(mainwin, state)
-rendercommit(commitwin, state)
-renderhelp(helpwin, state)
-curses.doupdate()
-# done rendering
-ch = encoding.strtolocal(stdscr.getkey())
-except curses.error:
-pass
+renderrules(mainwin, state)
+rendercommi

D9854: histedit: notice when the main window underflows height and abort

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

REVISION SUMMARY
  If you try to have a 13-line-tall terminal and use curses histedit, it
  fails by spinning in an infinite loop due to the catch-all ignore of
  curses errors on line 1682 of histedit.py. We should also fix that
  catch-all ignore of curses errors (what other demons lurk here, I
  wonder?) but we can trivially catch this case and guide the user to a
  happy path. We've seen this mostly in IDE users that have a tendency
  to have really tiny embedded terminal windows.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1581,10 +1581,19 @@
 def layout(mode):
 maxy, maxx = stdscr.getmaxyx()
 helplen = len(helplines(mode))
+mainlen = maxy - helplen - 12
+if mainlen < 1:
+raise error.Abort(
+_(b"terminal dimensions %d by %d too small for curses 
histedit")
+% (maxy, maxx),
+hint=_(
+b"enlarge your terminal or use --config ui.interface=text"
+),
+)
 return {
 b'commit': (12, maxx),
 b'help': (helplen, maxx),
-b'main': (maxy - helplen - 12, maxx),
+b'main': (mainlen, maxx),
 }
 
 def drawvertwin(size, y, x):



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


D9853: histedit: don't assign to _ for unused values

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

REVISION SUMMARY
  I don't know what this ignored value is, but we need to not clobber
  the _() function from gettext, or we get mysterious crashes instead of
  internationalizing some strings in my upcoming patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1615,7 +1615,7 @@
 stdscr.refresh()
 while True:
 try:
-oldmode, _ = state[b'mode']
+oldmode, unused = state[b'mode']
 if oldmode == MODE_INIT:
 changemode(state, MODE_RULES)
 e = event(state, ch)
@@ -1630,7 +1630,7 @@
 if size != stdscr.getmaxyx():
 curses.resizeterm(*size)
 
-curmode, _ = state[b'mode']
+curmode, unused = state[b'mode']
 sizes = layout(curmode)
 if curmode != oldmode:
 state[b'page_height'] = sizes[b'main'][0]



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


D9834: black: merge config into main pyproject.toml now that we have it

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

REVISION SUMMARY
  This means that naive contributors who just run `black` on a source file
  will get reasonable behavior as long as they have a recent black. Yay!

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  black.toml
  contrib/examples/fix.hgrc
  pyproject.toml
  tests/test-check-code.t
  tests/test-check-format.t

CHANGE DETAILS

diff --git a/tests/test-check-format.t b/tests/test-check-format.t
--- a/tests/test-check-format.t
+++ b/tests/test-check-format.t
@@ -1,5 +1,5 @@
 #require black test-repo
 
   $ cd $RUNTESTDIR/..
-  $ black --config=black.toml --check --diff `hg files 'set:(**.py + 
grep("^#!.*python")) - mercurial/thirdparty/**'`
+  $ black --check --diff `hg files 'set:(**.py + grep("^#!.*python")) - 
mercurial/thirdparty/**'`
 
diff --git a/tests/test-check-code.t b/tests/test-check-code.t
--- a/tests/test-check-code.t
+++ b/tests/test-check-code.t
@@ -65,7 +65,6 @@
   COPYING
   Makefile
   README.rst
-  black.toml
   hg
   hgeditor
   hgweb.cgi
diff --git a/pyproject.toml b/pyproject.toml
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,18 @@
 [build-system]
 requires = ["setuptools", "wheel"]
 build-backend = "setuptools.build_meta"
+
+[tool.black]
+line-length = 80
+exclude = '''
+build/
+| wheelhouse/
+| dist/
+| packages/
+| \.hg/
+| \.mypy_cache/
+| \.venv/
+| mercurial/thirdparty/
+'''
+skip-string-normalization = true
+quiet = true
diff --git a/contrib/examples/fix.hgrc b/contrib/examples/fix.hgrc
--- a/contrib/examples/fix.hgrc
+++ b/contrib/examples/fix.hgrc
@@ -5,7 +5,7 @@
 rustfmt:command = rustfmt +nightly
 rustfmt:pattern = set:"**.rs" - "mercurial/thirdparty/**"
 
-black:command = black --config=black.toml -
+black:command = black
 black:pattern = set:**.py - mercurial/thirdparty/**
 
 # Mercurial doesn't have any Go code, but if we did this is how we
diff --git a/black.toml b/black.toml
deleted file mode 100644
--- a/black.toml
+++ /dev/null
@@ -1,14 +0,0 @@
-[tool.black]
-line-length = 80
-exclude = '''
-build/
-| wheelhouse/
-| dist/
-| packages/
-| \.hg/
-| \.mypy_cache/
-| \.venv/
-| mercurial/thirdparty/
-'''
-skip-string-normalization = true
-quiet = true



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


D9833: pyproject: add config file

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

REVISION SUMMARY
  This will tell pip et al to call our setup.py for the majority of
  packaging concerns, but also gives us a place to put standard config
  stuff like black.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  pyproject.toml
  tests/test-check-code.t

CHANGE DETAILS

diff --git a/tests/test-check-code.t b/tests/test-check-code.t
--- a/tests/test-check-code.t
+++ b/tests/test-check-code.t
@@ -69,6 +69,7 @@
   hg
   hgeditor
   hgweb.cgi
+  pyproject.toml
   rustfmt.toml
   setup.py
 
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools", "wheel"]
+build-backend = "setuptools.build_meta"



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


D9791: revlog: migrate from PyEval_CallObject to PyObject_Call

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

REVISION SUMMARY
  The former was deprecated in 3.9.0.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -498,7 +498,7 @@
return -1;
}
 
-   result = PyEval_CallObject(filter, arglist);
+   result = PyObject_Call(filter, arglist, NULL);
Py_DECREF(arglist);
if (!result) {
return -1;



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


D9790: fuzz: fix Makefile default PYTHON_CONFIG_FLAGS to be modern

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

REVISION SUMMARY
  This is actually what we already do on oss-fuzz, so it's more correct as tests
  go.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/fuzz/Makefile

CHANGE DETAILS

diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -11,7 +11,7 @@
 LIB_FUZZING_ENGINE ?= standalone_fuzz_target_runner.o
 
 PYTHON_CONFIG ?= $$OUT/sanpy/bin/python-config
-PYTHON_CONFIG_FLAGS ?= --ldflags
+PYTHON_CONFIG_FLAGS ?= --ldflags --embed
 
 CXXFLAGS += -Wno-deprecated-register
 



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


D9752: fuzz: try and ensure fuzzer tests run against the right python-config

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

REVISION SUMMARY
  Also only under python 3.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/fuzz/Makefile
  tests/test-fuzz-targets.t

CHANGE DETAILS

diff --git a/tests/test-fuzz-targets.t b/tests/test-fuzz-targets.t
--- a/tests/test-fuzz-targets.t
+++ b/tests/test-fuzz-targets.t
@@ -1,4 +1,4 @@
-#require test-repo
+#require test-repo py3
 
   $ cd $TESTDIR/../contrib/fuzz
   $ OUT=$TESTTMP ; export OUT
@@ -26,13 +26,23 @@
   >-fsanitize=fuzzer-no-link,address || return 1
   > }
 
+Try to find a python3-config that's next to our sys.executable. If
+that doesn't work, fall back to looking for a global python3-config
+and hope that works out for the best.
+  $ PYBIN=`$PYTHON -c 'import sys, os; print(os.path.dirname(sys.executable))'`
+  $ if [ -x "$PYBIN/python3-config" ] ; then
+  >   PYTHON_CONFIG="$PYBIN/python3-config"
+  > else
+  >   PYTHON_CONFIG="`which python3-config`"
+  > fi
+
 #if clang-libfuzzer
   $ CXX=clang++ havefuzz || exit 80
-  $ $MAKE -s clean all PYTHON_CONFIG=`which python-config`
+  $ $MAKE -s clean all PYTHON_CONFIG="$PYTHON_CONFIG"
 #endif
 #if no-clang-libfuzzer clang-6.0
   $ CXX=clang++-6.0 havefuzz || exit 80
-  $ $MAKE -s clean all CC=clang-6.0 CXX=clang++-6.0 PYTHON_CONFIG=`which 
python-config`
+  $ $MAKE -s clean all CC=clang-6.0 CXX=clang++-6.0 
PYTHON_CONFIG="$PYTHON_CONFIG"
 #endif
 #if no-clang-libfuzzer no-clang-6.0
   $ exit 80
diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -23,6 +23,7 @@
python $< $@
 
 pyutil.o: pyutil.cc pyutil.h
+   $(PYTHON_CONFIG) --cflags
$(CXX) $(CXXFLAGS) -g -O1 \
  `$(PYTHON_CONFIG) --cflags` \
  -I../../mercurial -c -o pyutil.o pyutil.cc



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


D9561: histedit: adjust comment describing `edit` action for clarity

2020-12-10 Thread durin42 (Augie Fackler)
durin42 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/D9561

AFFECTED FILES
  hgext/histedit.py
  tests/test-histedit-arguments.t
  tests/test-histedit-bookmark-motion.t
  tests/test-histedit-commute.t
  tests/test-histedit-edit.t
  tests/test-histedit-obsolete.t
  tests/test-histedit-outgoing.t

CHANGE DETAILS

diff --git a/tests/test-histedit-outgoing.t b/tests/test-histedit-outgoing.t
--- a/tests/test-histedit-outgoing.t
+++ b/tests/test-histedit-outgoing.t
@@ -49,7 +49,7 @@
   #
   # Commands:
   #
-  #  e, edit = use commit, but stop for amending
+  #  e, edit = use commit, but allow edits before making new commit
   #  m, mess = edit commit message without changing commit content
   #  p, pick = use commit
   #  b, base = checkout changeset and apply further changesets from there
@@ -84,7 +84,7 @@
   #
   # Commands:
   #
-  #  e, edit = use commit, but stop for amending
+  #  e, edit = use commit, but allow edits before making new commit
   #  m, mess = edit commit message without changing commit content
   #  p, pick = use commit
   #  b, base = checkout changeset and apply further changesets from there
@@ -111,7 +111,7 @@
   #
   # Commands:
   #
-  #  e, edit = use commit, but stop for amending
+  #  e, edit = use commit, but allow edits before making new commit
   #  m, mess = edit commit message without changing commit content
   #  p, pick = use commit
   #  b, base = checkout changeset and apply further changesets from there
diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -139,7 +139,7 @@
   #
   # Commands:
   #
-  #  e, edit = use commit, but stop for amending
+  #  e, edit = use commit, but allow edits before making new commit
   #  m, mess = edit commit message without changing commit content
   #  p, pick = use commit
   #  b, base = checkout changeset and apply further changesets from there
diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t
--- a/tests/test-histedit-edit.t
+++ b/tests/test-histedit-edit.t
@@ -475,7 +475,7 @@
   #
   # Commands:
   #
-  #  e, edit = use commit, but stop for amending
+  #  e, edit = use commit, but allow edits before making new commit
   #  m, mess = edit commit message without changing commit content
   #  p, fold = use commit
   #  b, base = checkout changeset and apply further changesets from there
diff --git a/tests/test-histedit-commute.t b/tests/test-histedit-commute.t
--- a/tests/test-histedit-commute.t
+++ b/tests/test-histedit-commute.t
@@ -68,7 +68,7 @@
   #
   # Commands:
   #
-  #  e, edit = use commit, but stop for amending
+  #  e, edit = use commit, but allow edits before making new commit
   #  m, mess = edit commit message without changing commit content
   #  p, pick = use commit
   #  b, base = checkout changeset and apply further changesets from there
@@ -94,7 +94,7 @@
   #
   # Commands:
   #
-  #  e, edit = use commit, but stop for amending
+  #  e, edit = use commit, but allow edits before making new commit
   #  m, mess = edit commit message without changing commit content
   #  p, pick = use commit
   #  b, base = checkout changeset and apply further changesets from there
@@ -120,7 +120,7 @@
   #
   # Commands:
   #
-  #  e, edit = use commit, but stop for amending
+  #  e, edit = use commit, but allow edits before making new commit
   #  m, mess = edit commit message without changing commit content
   #  p, pick = use commit
   #  b, base = checkout changeset and apply further changesets from there
@@ -405,7 +405,7 @@
   #
   # Commands:
   #
-  #  e, edit = use commit, but stop for amending
+  #  e, edit = use commit, but allow edits before making new commit
   #  m, mess = edit commit message without changing commit content
   #  p, pick = use commit
   #  b, base = checkout changeset and apply further changesets from there
diff --git a/tests/test-histedit-bookmark-motion.t 
b/tests/test-histedit-bookmark-motion.t
--- a/tests/test-histedit-bookmark-motion.t
+++ b/tests/test-histedit-bookmark-motion.t
@@ -73,7 +73,7 @@
   #
   # Commands:
   #
-  #  e, edit = use commit, but stop for amending
+  #  e, edit = use commit, but allow edits before making new commit
   #  m, mess = edit commit message without changing commit content
   #  p, pick = use commit
   #  b, base = checkout changeset and apply further changesets from there
@@ -130,7 +130,7 @@
   #
   # Commands:
   #
-  #  e, edit = use commit, but stop for amending
+  #  e, edit = use commit, but allow edits before making new commit
   #  m, mess = edit commit message without changing commit content
   #  p, pick = use commit
   #  b, base = checkout changeset and apply further changesets from there
diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t
--- a/tests/test-his

D9560: histedit: tweak `edit` message to try and guide users to our workflow

2020-12-10 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  histedit predates evolve, so it drops you on an _uncommitted_ version
  of the commit you're amending/splitting, which is in contrast to git
  which expects you to use `git commit --amend` (I think - I'm basing
  this on internal bug reports). My hope is that this output will guide
  users a little more towards the expected workflow.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/histedit.py
  tests/test-histedit-arguments.t
  tests/test-histedit-commute.t
  tests/test-histedit-edit.t
  tests/test-histedit-no-backup.t
  tests/test-histedit-no-change.t
  tests/test-histedit-obsolete.t
  tests/test-qrecord.t
  tests/test-rebase-pull.t

CHANGE DETAILS

diff --git a/tests/test-rebase-pull.t b/tests/test-rebase-pull.t
--- a/tests/test-rebase-pull.t
+++ b/tests/test-rebase-pull.t
@@ -88,8 +88,8 @@
   $ hg histedit . -q --commands - << EOF
   > edit d80cc2da061e histedit: generate unfinished state
   > EOF
-  Editing (d80cc2da061e), you may commit or record as needed now.
-  (hg histedit --continue to resume)
+  Editing (d80cc2da061e), commit as needed now to split the change
+  (to amend d80cc2da061e, `hg histedit --continue` after making changes)
   [240]
   $ hg pull --rebase
   abort: histedit in progress
diff --git a/tests/test-qrecord.t b/tests/test-qrecord.t
--- a/tests/test-qrecord.t
+++ b/tests/test-qrecord.t
@@ -456,8 +456,8 @@
   > edit ea55e2ae468f foo bar
   > EOF
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  Editing (ea55e2ae468f), you may commit or record as needed now.
-  (hg histedit --continue to resume)
+  Editing (ea55e2ae468f), commit as needed now to split the change
+  (to amend ea55e2ae468f, `hg histedit --continue` after making changes)
   [240]
   $ echo 'foo bar' > a
   $ hg qrecord -d '0 0' -m aaa a.patch <> plan
   $ echo "edit `hg log -r 1 -T '{node|short}'`" >> plan
   $ hg histedit -r 'all()' --commands plan
-  Editing (1b2d564fad96), you may commit or record as needed now.
-  (hg histedit --continue to resume)
+  Editing (1b2d564fad96), commit as needed now to split the change
+  (to amend 1b2d564fad96, `hg histedit --continue` after making changes)
   [240]
   $ hg st
   A b
@@ -70,8 +70,8 @@
   $ echo "pick `hg log -r 5 -T '{node|short}'`" >> plan
   $ echo "edit `hg log -r 4 -T '{node|short}'`" >> plan
   $ hg histedit -r 'all()' --commands plan
-  Editing (49d44ab2be1b), you may commit or record as needed now.
-  (hg histedit --continue to resume)
+  Editing (49d44ab2be1b), commit as needed now to split the change
+  (to amend 49d44ab2be1b, `hg histedit --continue` after making changes)
   [240]
   $ hg st
   A b
@@ -225,8 +225,8 @@
   > edit b346ab9a313d 6 c
   > EOF
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  Editing (b346ab9a313d), you may commit or record as needed now.
-  (hg histedit --continue to resume)
+  Editing (b346ab9a313d), commit as needed now to split the change
+  (to amend b346ab9a313d, `hg histedit --continue` after making changes)
   [240]
   $ echo c >> c
   $ hg histedit --continue
@@ -359,8 +359,8 @@
   > pick ee118ab9fa44 16 k
   > EOF
   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
-  Editing (b449568bf7fc), you may commit or record as needed now.
-  (hg histedit --continue to resume)
+  Editing (b449568bf7fc), commit as needed now to split the change
+  (to amend b449568bf7fc, `hg histedit --continue` after making changes)
   [240]
   $ echo f >> f
   $ hg histedit --continue
@@ -401,8 +401,8 @@
   > pick ee118ab9fa44 16 k
   > EOF
   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
-  Editing (b449568bf7fc), you may commit or record as needed now.
-  (hg histedit --continue to resume)
+  Editing (b449568bf7fc), commit as needed now to split the change
+  (to amend b449568bf7fc, `hg histedit --continue` after making changes)
   [240]
   $ echo f >> f
   $ hg histedit --continue
@@ -527,8 +527,8 @@
   > roll 3a6c53ee7f3d 17 j
   > edit ee118ab9fa44 18 k
   > EOF
-  Editing (ee118ab9fa44), you may commit or record as needed now.
-  (hg histedit --continue to resume)
+  Editing (ee118ab9fa44), commit as needed now to split the change
+  (to amend ee118ab9fa44, `hg histedit --continue` after making changes)
   [240]
 
 #if abortcommand
@@ -566,8 +566,8 @@
   > pick 3a6c53ee7f3d 17 j
   > edit ee118ab9fa44 18 k
   > EOF
-  Editing (ee118ab9fa44), you may commit or record as needed now.
-  (hg histedit --continue to resume)
+  Editing (ee118ab9fa44), commit as needed now to split the change
+  (to amend ee118ab9fa44, `hg histedit --continue` after making changes)
   [240]
   $ hg histedit --continue --config experimental.evolution.track-operation=1
   $ hg log -G
diff --git a/tests/test-histedit-no-change.t b/tests/test-histedit-no-change.t
---

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

2020-12-04 Thread Augie Fackler
queued thanks

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

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

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

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

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


Re: [PATCH STABLE] diff: do not concatenate immutable bytes while building a/b bodies (issue6445)

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

> On Nov 27, 2020, at 22:00, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1606529754 -32400
> #  Sat Nov 28 11:15:54 2020 +0900
> # Branch stable
> # Node ID 1e93d856abc0ecb7f537af5c77e0d75ffe93db08
> # Parent  81da6feb5000140adb8972607415855953415233
> diff: do not concatenate immutable bytes while building a/b bodies (issue6445)
> 
> Use bytearray instead. I don't know what's changed since Python 2, but bytes
> concatenation is 100x slow on Python 3.
> 
>  % python2.7 -m timeit -s "s = b''" "for i in range(1): s += b'line'"
>  1000 loops, best of 3: 321 usec per loop
> 
>  % python3.9 -m timeit -s "s = b''" "for i in range(1): s += b'line'"
>  5 loops, best of 5: 39.2 msec per loop
> 
> Benchmark using tailwind.css (measuring the fast path, a is empty):
> 
>  % HGRCPATH=/dev/null python2.7 ./hg log -R /tmp/issue6445 -p --time \
>  --color=always --config diff.word-diff=true >/dev/null
>  (prev) time: real 1.580 secs (user 1.560+0.000 sys 0.020+0.000)
>  (this) time: real 1.610 secs (user 1.570+0.000 sys 0.030+0.000)
> 
>  % HGRCPATH=/dev/null python3.9 ./hg log -R /tmp/issue6445 -p --time \
>  --color=always --config diff.word-diff=true >/dev/null
>  (prev) time: real 114.500 secs (user 114.460+0.000 sys 0.030+0.000)
>  (this) time: real 2.180 secs (user 2.140+0.000 sys 0.040+0.000)
> 
> Benchmark using random tabular text data (not the fast path):
> 
>  % dd if=/dev/urandom bs=1k count=1000 | hexdump -v -e '16/1 "%3u," "\n"' > 
> ttf
>  % hg ci -ma
>  % dd if=/dev/urandom bs=1k count=1000 | hexdump -v -e '16/1 "%3u," "\n"' > 
> ttf
>  % hg ci -mb
> 
>  % HGRCPATH=/dev/null python2.7 ./hg log -R /tmp/issue6445 -p --time \
>  --color=always --config diff.word-diff=true >/dev/null
>  (prev) time: real 3.240 secs (user 3.040+0.000 sys 0.200+0.000
>  (this) time: real 3.230 secs (user 3.070+0.000 sys 0.160+0.000)
> 
>  % HGRCPATH=/dev/null python3.9 ./hg log -R /tmp/issue6445 -p --time \
>  --color=always --config diff.word-diff=true >/dev/null
>  (prev) time: real 44.130 secs (user 43.850+0.000 sys 0.270+0.000)
>  (this) time: real 4.170 secs (user 3.850+0.000 sys 0.310+0.000)
> 
> diff --git a/mercurial/patch.py b/mercurial/patch.py
> --- a/mercurial/patch.py
> +++ b/mercurial/patch.py
> @@ -2731,8 +2731,8 @@ def diffsinglehunk(hunklines):
> def diffsinglehunkinline(hunklines):
> """yield tokens for a list of lines in a single hunk, with inline 
> colors"""
> # prepare deleted, and inserted content
> -a = b''
> -b = b''
> +a = bytearray()
> +b = bytearray()
> for line in hunklines:
> if line[0:1] == b'-':
> a += line[1:]
> @@ -2746,8 +2746,8 @@ def diffsinglehunkinline(hunklines):
> yield t
> return
> # re-split the content into words
> -al = wordsplitter.findall(a)
> -bl = wordsplitter.findall(b)
> +al = wordsplitter.findall(bytes(a))
> +bl = wordsplitter.findall(bytes(b))
> # re-arrange the words to lines since the diff algorithm is line-based
> aln = [s if s == b'\n' else s + b'\n' for s in al]
> bln = [s if s == b'\n' else s + b'\n' for s in bl]
> 
> ___
> 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


D9471: procutil: correctly convert to bytes when shell=False

2020-11-30 Thread durin42 (Augie Fackler)
durin42 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/D9471

AFFECTED FILES
  mercurial/utils/procutil.py

CHANGE DETAILS

diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py
--- a/mercurial/utils/procutil.py
+++ b/mercurial/utils/procutil.py
@@ -654,9 +654,13 @@
 stdin.write(stdin_bytes)
 stdin.flush()
 stdin.seek(0)
+if shell:
+script = tonativestr(script)
+else:
+script = [tonativestr(s) for s in script]
 
 p = subprocess.Popen(
-tonativestr(script),
+script,
 shell=shell,
 env=tonativeenv(env),
 close_fds=True,



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


D9430: formating: upgrade to black 20.8b1

2020-11-27 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: indygreg.
Herald added a reviewer: martinvonz.
Herald added a reviewer: martinvonz.
Herald added subscribers: mercurial-patches, Kwan.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This required a couple of small tweaks to un-confuse black, but now it
  works. Big formatting changes come from:
  
  - Dramatically improved collection-splitting logic upstream
  - Black having a strong (correct IMO) opinion that """ is better than '''

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/automation/hgautomation/aws.py
  contrib/automation/hgautomation/cli.py
  contrib/automation/hgautomation/windows.py
  contrib/byteify-strings.py
  contrib/check-code.py
  contrib/packaging/hgpackaging/cli.py
  contrib/packaging/hgpackaging/inno.py
  contrib/packaging/hgpackaging/wix.py
  contrib/perf.py
  contrib/python-hook-examples.py
  contrib/python-zstandard/make_cffi.py
  contrib/python3-ratchet.py
  contrib/synthrepo.py
  contrib/testparseutil.py
  doc/hgmanpage.py
  hgext/acl.py
  hgext/automv.py
  hgext/blackbox.py
  hgext/bugzilla.py
  hgext/churn.py
  hgext/convert/__init__.py
  hgext/convert/bzr.py
  hgext/convert/common.py
  hgext/convert/convcmd.py
  hgext/convert/cvsps.py
  hgext/convert/filemap.py
  hgext/eol.py
  hgext/extdiff.py
  hgext/factotum.py
  hgext/fetch.py
  hgext/fix.py
  hgext/fsmonitor/__init__.py
  hgext/fsmonitor/pywatchman/__init__.py
  hgext/fsmonitor/pywatchman/capabilities.py
  hgext/git/__init__.py
  hgext/git/manifest.py
  hgext/githelp.py
  hgext/gpg.py
  hgext/hgk.py
  hgext/histedit.py
  hgext/hooklib/changeset_obsoleted.py
  hgext/hooklib/changeset_published.py
  hgext/infinitepush/__init__.py
  hgext/infinitepush/bundleparts.py
  hgext/infinitepush/indexapi.py
  hgext/infinitepush/sqlindexapi.py
  hgext/keyword.py
  hgext/largefiles/__init__.py
  hgext/largefiles/basestore.py
  hgext/largefiles/lfcommands.py
  hgext/largefiles/lfutil.py
  hgext/largefiles/localstore.py
  hgext/largefiles/overrides.py
  hgext/largefiles/proto.py
  hgext/largefiles/remotestore.py
  hgext/largefiles/reposetup.py
  hgext/largefiles/wirestore.py
  hgext/lfs/__init__.py
  hgext/lfs/blobstore.py
  hgext/lfs/wrapper.py
  hgext/mq.py
  hgext/narrow/narrowbundle2.py
  hgext/narrow/narrowwirepeer.py
  hgext/notify.py
  hgext/pager.py
  hgext/patchbomb.py
  hgext/phabricator.py
  hgext/purge.py
  hgext/rebase.py
  hgext/record.py
  hgext/remotefilelog/__init__.py
  hgext/remotefilelog/basestore.py
  hgext/remotefilelog/contentstore.py
  hgext/remotefilelog/fileserverclient.py
  hgext/remotefilelog/remotefilectx.py
  hgext/remotefilelog/remotefilelogserver.py
  hgext/remotefilelog/repack.py
  hgext/remotefilelog/shallowrepo.py
  hgext/remotenames.py
  hgext/schemes.py
  hgext/share.py
  hgext/transplant.py
  hgext/uncommit.py
  hgext/win32mbcs.py
  hgext/win32text.py
  i18n/check-translation.py
  mercurial/ancestor.py
  mercurial/archival.py
  mercurial/bookmarks.py
  mercurial/branchmap.py
  mercurial/bundle2.py
  mercurial/bundlerepo.py
  mercurial/changelog.py
  mercurial/cmdutil.py
  mercurial/commands.py
  mercurial/commandserver.py
  mercurial/commit.py
  mercurial/config.py
  mercurial/configitems.py
  mercurial/context.py
  mercurial/copies.py
  mercurial/crecord.py
  mercurial/dagop.py
  mercurial/dagparser.py
  mercurial/debugcommands.py
  mercurial/diffutil.py
  mercurial/dirstate.py
  mercurial/dirstateguard.py
  mercurial/discovery.py
  mercurial/dispatch.py
  mercurial/encoding.py
  mercurial/error.py
  mercurial/exchange.py
  mercurial/exchangev2.py
  mercurial/extensions.py
  mercurial/filemerge.py
  mercurial/fileset.py
  mercurial/help.py
  mercurial/hg.py
  mercurial/hgweb/__init__.py
  mercurial/hgweb/common.py
  mercurial/hgweb/hgweb_mod.py
  mercurial/hgweb/request.py
  mercurial/hgweb/webutil.py
  mercurial/hook.py
  mercurial/httppeer.py
  mercurial/interfaces/dirstate.py
  mercurial/interfaces/repository.py
  mercurial/keepalive.py
  mercurial/localrepo.py
  mercurial/lock.py
  mercurial/logcmdutil.py
  mercurial/logexchange.py
  mercurial/mail.py
  mercurial/manifest.py
  mercurial/match.py
  mercurial/mdiff.py
  mercurial/merge.py
  mercurial/mergestate.py
  mercurial/metadata.py
  mercurial/minirst.py
  mercurial/narrowspec.py
  mercurial/obsolete.py
  mercurial/obsutil.py
  mercurial/parser.py
  mercurial/patch.py
  mercurial/pathutil.py
  mercurial/posix.py
  mercurial/progress.py
  mercurial/pure/charencode.py
  mercurial/pure/mpatch.py
  mercurial/pure/osutil.py
  mercurial/pure/parsers.py
  mercurial/rcutil.py
  mercurial/registrar.py
  mercurial/repoview.py
  mercurial/revlog.py
  mercurial/revlogutils/nodemap.py
  mercurial/revset.py
  mercurial/revsetlang.py
  mercurial/scmutil.py
  mercurial/setdiscovery.py
  mercurial/shelve.py
  mercurial/similar.py
  mercurial/simplemerge.py
  mercurial/sshpeer.py
  mercurial/sslutil.py
  mercurial/

D9428: merge: remove spurious ' and trailing whitespace from triple-quoted string

2020-11-27 Thread durin42 (Augie Fackler)
durin42 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/D9428

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -544,10 +544,10 @@
 
 
 class mergeresult(object):
-An object representing result of merging manifests.
+'''An object representing result of merging manifests.
 
 It has information about what actions need to be performed on dirstate
-mapping of divergent renames and other such cases. '''
+mapping of divergent renames and other such cases.'''
 
 def __init__(self):
 """



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


D9429: osutil: reformat triple-quoted string so black doesn't confuse itself

2020-11-27 Thread durin42 (Augie Fackler)
durin42 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/D9429

AFFECTED FILES
  mercurial/pure/osutil.py

CHANGE DETAILS

diff --git a/mercurial/pure/osutil.py b/mercurial/pure/osutil.py
--- a/mercurial/pure/osutil.py
+++ b/mercurial/pure/osutil.py
@@ -293,7 +293,8 @@
 '''mimics the read-only attributes of Python file objects
 by raising 'TypeError: readonly attribute' if someone tries:
   f = posixfile('foo.txt')
-  f.name = 'bla'  '''
+  f.name = 'bla'
+'''
 return self._file.__setattr__(name, value)
 
 def __enter__(self):



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


D9403: git: update test for hg and git output changes

2020-11-25 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Clearly nobody is running this in their CI. :(

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -67,8 +67,8 @@
 
 Without creating the .hg, hg status fails:
   $ hg status
-  abort: no repository found in '$TESTTMP/foo' (.hg not found)!
-  [255]
+  abort: no repository found in '$TESTTMP/foo' (.hg not found)
+  [10]
 But if you run hg init --git, it works:
   $ hg init --git
   $ hg id --traceback
@@ -304,14 +304,10 @@
   $ hg status
   heads mismatch, rebuilding dagcache
   M beta
-  $ git status
+  $ git status | egrep -v '^$|^  \(use '
   On branch master
   Changes not staged for commit:
-(use "git add ..." to update what will be committed)
-(use "git checkout -- ..." to discard changes in working directory)
-  
modified:   beta
-  
   no changes added to commit (use "git add" and/or "git commit -a")
 
 Contents of each commit should be the same



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


D9402: gitlog: add tiprev() function

2020-11-25 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Lots of stuff was broken because this was missing.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -148,6 +148,14 @@
 )
 return (int(r[0]) for r in t)
 
+def tiprev(self):
+t = self._db.execute(
+'SELECT rev FROM changelog '
+'ORDER BY REV DESC '
+'LIMIT 1'
+)
+return next(t)
+
 def _partialmatch(self, id):
 if nodemod.wdirhex.startswith(id):
 raise error.WdirUnsupported



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


D9401: pyoxidizer: make sure defaultrc directory exists before trying to write to it

2020-11-25 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  When doing some work involving one-file binaries, this line is failing
  for me. It seems reasonable to just make sure the destination
  directory exists before splatting the file into it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/packaging/hgpackaging/pyoxidizer.py

CHANGE DETAILS

diff --git a/contrib/packaging/hgpackaging/pyoxidizer.py 
b/contrib/packaging/hgpackaging/pyoxidizer.py
--- a/contrib/packaging/hgpackaging/pyoxidizer.py
+++ b/contrib/packaging/hgpackaging/pyoxidizer.py
@@ -127,6 +127,7 @@
 
 # Write out a default editor.rc file to configure notepad as the
 # default editor.
+os.makedirs(out_dir / "defaultrc")
 with (out_dir / "defaultrc" / "editor.rc").open(
 "w", encoding="utf-8"
 ) as fh:



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


Re: Heptapod 0.17 released

2020-11-23 Thread Augie Fackler


> On Nov 23, 2020, at 09:31, Georges Racinet  
> wrote:
> 
> - Mercurial native mode (very experimental, don't activate at all on
> production servers).
> 
> It's what we've always wanted to do. We hope it can be made the
> default mode by the end of the year.

That sounds like a huge milestone. Congrats!___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: --extra-packages-script and PyOxidizer (was: Re: D8477: packaging: support building WiX installers with PyOxidizer)

2020-11-19 Thread Augie Fackler
Last post for a while, I'm going to run with this a bit:

I'm going to try putting module_search_path = ["$ORIGIN/extra_packages"] or 
similar, and then locally patch the scripts to drop extra stuff there. Will 
report back in a few days, perhaps after the US Thanksgiving holiday.

AF

> On Nov 19, 2020, at 12:29, Augie Fackler  wrote:
> 
> Okay, looking some more, I have an idea. Please shoot it down if it's bad!
> 
> Basically I think I can (for now) maintain a local patch that adds a call to 
> `PythonExecutable.read_package_root()` and gives it our "google" extension in 
> the packages argument. Does that sound about right?
> 
> (I'll probably poke at this after lunch, but any feedback on the merits of 
> this hackery welcomed.)
> 
>> On Nov 19, 2020, at 11:36, Augie Fackler > <mailto:r...@durin42.com>> wrote:
>> 
>> (resending to keep the list, sorry for the double-send Greg!)
>> 
>>> On Nov 18, 2020, at 18:03, Gregory Szorc >> <mailto:gregory.sz...@gmail.com>> wrote:
>>> 
>>> On Wed, Nov 18, 2020 at 2:40 PM Augie Fackler >> <mailto:r...@durin42.com>> wrote:
>>> 
>>> 
>>> > On Apr 30, 2020, at 01:53, indygreg (Gregory Szorc) 
>>> > mailto:phabrica...@mercurial-scm.org>> 
>>> > wrote:
>>> > 
>>> > REVISION DETAIL
>>> >  https://phab.mercurial-scm.org/D8477 
>>> > <https://phab.mercurial-scm.org/D8477>
>>> > 
>>> > AFFECTED FILES
>>> >  contrib/packaging/hgpackaging/cli.py
>>> >  contrib/packaging/hgpackaging/wix.py
>>> >  contrib/packaging/wix/mercurial.wxs
>>> > 
>>> 
>>> [snip other diff regions]
>>> 
>>> > diff --git a/contrib/packaging/hgpackaging/cli.py 
>>> > b/contrib/packaging/hgpackaging/cli.py
>>> > --- a/contrib/packaging/hgpackaging/cli.py
>>> > +++ b/contrib/packaging/hgpackaging/cli.py
>>> > @@ -50,6 +50,7 @@
>>> [snip misc hunks]
>>> 
>>> > if extra_packages_script:
>>> > +if pyoxidizer_target:
>>> > +raise Exception(
>>> > +"pyoxidizer does not support --extra-packages-script"
>>> > +)
>>> 
>>> Is this a fundamental limitation, or is there just some code to write to 
>>> make this? I need to inject our custom extension into the MSI we distribute 
>>> to our users, and I figure this is probably roughly the way. I'm finally to 
>>> the point that I appear to have the rest of the process working, so now I 
>>> "just" need to wire up including the Google-custom bits.
>>> 
>>> The problem is that there's no easy way to pass conditional state into the 
>>> Starlark execution environment outside of changing the name of the target 
>>> you want to build and having different targets for different configurations.
>> 
>> (I haven't dug yet, so please forgive me if this is a bad idea) Would it 
>> work to have an "extra stuff" tree somewhere that PyOxidizer includes? 
>> That's pretty much what we do for the existing installer setup - that is, 
>> all we do is drop extra files in the right places and then WiX picks them 
>> up. Could we do something similar with PyOxidizer?
>> 
>>> One way to address this would be to expose environment variables as 
>>> Starlark variables. Or a `--var key=value` syntax to register custom 
>>> variables. These features may or may not have been requested in the 
>>> PyOxidizer issue tracker. Both are reasonable IMO. Would you mind 
>>> commenting on or filing a GitHub issue representing the feature you think 
>>> works best?
>> 
>> I can't find anything obvious. I think my preference would be to add some 
>> sort of --var syntax so it's explicit rather than environmental. Do you have 
>> a preference?
>> 
>> (Searching issue trackers is hard!)
> 

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


D9342: pyoxidizer: run buildifier

2020-11-19 Thread durin42 (Augie Fackler)
durin42 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/D9342

AFFECTED FILES
  rust/hgcli/pyoxidizer.bzl

CHANGE DETAILS

diff --git a/rust/hgcli/pyoxidizer.bzl b/rust/hgcli/pyoxidizer.bzl
--- a/rust/hgcli/pyoxidizer.bzl
+++ b/rust/hgcli/pyoxidizer.bzl
@@ -17,6 +17,7 @@
 if not IS_WINDOWS:
 resource.add_location = "in-memory"
 return
+
 # We use a custom resource routing policy to influence where things are 
loaded
 # from.
 #
@@ -39,6 +40,7 @@
 def make_exe(dist):
 """Builds a Rust-wrapped Mercurial binary."""
 packaging_policy = dist.make_python_packaging_policy()
+
 # Extension may depend on any Python functionality. Include all
 # extensions.
 packaging_policy.extension_module_filter = "all"
@@ -50,8 +52,10 @@
 config = dist.make_python_interpreter_config()
 config.raw_allocator = "system"
 config.run_command = RUN_CODE
+
 # We want to let the user load extensions from the file system
 config.filesystem_importer = True
+
 # We need this to make resourceutil happy, since it looks for sys.frozen.
 config.sys_frozen = True
 config.legacy_windows_stdio = True



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


Re: --extra-packages-script and PyOxidizer (was: Re: D8477: packaging: support building WiX installers with PyOxidizer)

2020-11-19 Thread Augie Fackler
Okay, looking some more, I have an idea. Please shoot it down if it's bad!

Basically I think I can (for now) maintain a local patch that adds a call to 
`PythonExecutable.read_package_root()` and gives it our "google" extension in 
the packages argument. Does that sound about right?

(I'll probably poke at this after lunch, but any feedback on the merits of this 
hackery welcomed.)

> On Nov 19, 2020, at 11:36, Augie Fackler  wrote:
> 
> (resending to keep the list, sorry for the double-send Greg!)
> 
>> On Nov 18, 2020, at 18:03, Gregory Szorc > <mailto:gregory.sz...@gmail.com>> wrote:
>> 
>> On Wed, Nov 18, 2020 at 2:40 PM Augie Fackler > <mailto:r...@durin42.com>> wrote:
>> 
>> 
>> > On Apr 30, 2020, at 01:53, indygreg (Gregory Szorc) 
>> > mailto:phabrica...@mercurial-scm.org>> 
>> > wrote:
>> > 
>> > REVISION DETAIL
>> >  https://phab.mercurial-scm.org/D8477 
>> > <https://phab.mercurial-scm.org/D8477>
>> > 
>> > AFFECTED FILES
>> >  contrib/packaging/hgpackaging/cli.py
>> >  contrib/packaging/hgpackaging/wix.py
>> >  contrib/packaging/wix/mercurial.wxs
>> > 
>> 
>> [snip other diff regions]
>> 
>> > diff --git a/contrib/packaging/hgpackaging/cli.py 
>> > b/contrib/packaging/hgpackaging/cli.py
>> > --- a/contrib/packaging/hgpackaging/cli.py
>> > +++ b/contrib/packaging/hgpackaging/cli.py
>> > @@ -50,6 +50,7 @@
>> [snip misc hunks]
>> 
>> > if extra_packages_script:
>> > +if pyoxidizer_target:
>> > +raise Exception(
>> > +"pyoxidizer does not support --extra-packages-script"
>> > +)
>> 
>> Is this a fundamental limitation, or is there just some code to write to 
>> make this? I need to inject our custom extension into the MSI we distribute 
>> to our users, and I figure this is probably roughly the way. I'm finally to 
>> the point that I appear to have the rest of the process working, so now I 
>> "just" need to wire up including the Google-custom bits.
>> 
>> The problem is that there's no easy way to pass conditional state into the 
>> Starlark execution environment outside of changing the name of the target 
>> you want to build and having different targets for different configurations.
> 
> (I haven't dug yet, so please forgive me if this is a bad idea) Would it work 
> to have an "extra stuff" tree somewhere that PyOxidizer includes? That's 
> pretty much what we do for the existing installer setup - that is, all we do 
> is drop extra files in the right places and then WiX picks them up. Could we 
> do something similar with PyOxidizer?
> 
>> One way to address this would be to expose environment variables as Starlark 
>> variables. Or a `--var key=value` syntax to register custom variables. These 
>> features may or may not have been requested in the PyOxidizer issue tracker. 
>> Both are reasonable IMO. Would you mind commenting on or filing a GitHub 
>> issue representing the feature you think works best?
> 
> I can't find anything obvious. I think my preference would be to add some 
> sort of --var syntax so it's explicit rather than environmental. Do you have 
> a preference?
> 
> (Searching issue trackers is hard!)

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


Re: --extra-packages-script and PyOxidizer (was: Re: D8477: packaging: support building WiX installers with PyOxidizer)

2020-11-19 Thread Augie Fackler
(resending to keep the list, sorry for the double-send Greg!)

> On Nov 18, 2020, at 18:03, Gregory Szorc  <mailto:gregory.sz...@gmail.com>> wrote:
> 
> On Wed, Nov 18, 2020 at 2:40 PM Augie Fackler  <mailto:r...@durin42.com>> wrote:
> 
> 
> > On Apr 30, 2020, at 01:53, indygreg (Gregory Szorc) 
> > mailto:phabrica...@mercurial-scm.org>> 
> > wrote:
> > 
> > REVISION DETAIL
> >  https://phab.mercurial-scm.org/D8477 <https://phab.mercurial-scm.org/D8477>
> > 
> > AFFECTED FILES
> >  contrib/packaging/hgpackaging/cli.py
> >  contrib/packaging/hgpackaging/wix.py
> >  contrib/packaging/wix/mercurial.wxs
> > 
> 
> [snip other diff regions]
> 
> > diff --git a/contrib/packaging/hgpackaging/cli.py 
> > b/contrib/packaging/hgpackaging/cli.py
> > --- a/contrib/packaging/hgpackaging/cli.py
> > +++ b/contrib/packaging/hgpackaging/cli.py
> > @@ -50,6 +50,7 @@
> [snip misc hunks]
> 
> > if extra_packages_script:
> > +if pyoxidizer_target:
> > +raise Exception(
> > +"pyoxidizer does not support --extra-packages-script"
> > +)
> 
> Is this a fundamental limitation, or is there just some code to write to make 
> this? I need to inject our custom extension into the MSI we distribute to our 
> users, and I figure this is probably roughly the way. I'm finally to the 
> point that I appear to have the rest of the process working, so now I "just" 
> need to wire up including the Google-custom bits.
> 
> The problem is that there's no easy way to pass conditional state into the 
> Starlark execution environment outside of changing the name of the target you 
> want to build and having different targets for different configurations.

(I haven't dug yet, so please forgive me if this is a bad idea) Would it work 
to have an "extra stuff" tree somewhere that PyOxidizer includes? That's pretty 
much what we do for the existing installer setup - that is, all we do is drop 
extra files in the right places and then WiX picks them up. Could we do 
something similar with PyOxidizer?

> One way to address this would be to expose environment variables as Starlark 
> variables. Or a `--var key=value` syntax to register custom variables. These 
> features may or may not have been requested in the PyOxidizer issue tracker. 
> Both are reasonable IMO. Would you mind commenting on or filing a GitHub 
> issue representing the feature you think works best?

I can't find anything obvious. I think my preference would be to add some sort 
of --var syntax so it's explicit rather than environmental. Do you have a 
preference?

(Searching issue trackers is hard!)___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 4 of 4 STABLE] chg: reset errno prior to calling strtol()

2020-11-17 Thread Augie Fackler
queued for stable, thanks

> On Nov 2, 2020, at 21:54, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1604370261 -32400
> #  Tue Nov 03 11:24:21 2020 +0900
> # Branch stable
> # Node ID 81da6feb5000140adb8972607415855953415233
> # Parent  9534de20358f656be05e0633a3a2ba59932326f3
> chg: reset errno prior to calling strtol()
> 
> Otherwise we can't figure out if the last strtol() invocation failed or
> not.
> 
> diff --git a/contrib/chg/chg.c b/contrib/chg/chg.c
> --- a/contrib/chg/chg.c
> +++ b/contrib/chg/chg.c
> @@ -276,6 +276,7 @@ static void execcmdserver(const struct c
>   debugmsg("closing files based on /proc contents");
>   struct dirent *de;
>   while ((de = readdir(dp))) {
> + errno = 0;
>   char *end;
>   long fd_value = strtol(de->d_name, &end, 10);
>   if (end == de->d_name) {
> ___
> 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] chgserver: backport py3 buffered I/O workarounds from procutil

2020-11-17 Thread Augie Fackler
queued, thanks

> On Nov 17, 2020, at 08:04, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1605608948 -32400
> #  Tue Nov 17 19:29:08 2020 +0900
> # Node ID 0748354881c942727aef46945d721bc51d213e9d
> # Parent  d68618954adef9c2cbec868c1af0e01f67288cb8
> chgserver: backport py3 buffered I/O workarounds from procutil
> 
> I've recently switched to new machine and I found chg's stdout is fully
> buffered.
> 
> Even though chg server is a daemon process, it inherits the environment
> where the chg client originally forked the server. This means the server's
> stdout might have been wrapped by LineBufferedWrapper. That's why we need
> to do wrap/unwrap in both ways.
> 
> The "if" condition in _restoreio() looks weird, but I'm not willing to
> clean things up because stdio behavior is fundamentally different between
> py2 and py3, and py2 support will be dropped anyway.
> 
> diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
> --- a/mercurial/chgserver.py
> +++ b/mercurial/chgserver.py
> @@ -409,14 +409,23 @@ class chgcmdserver(commandserver.server)
> # be unbuffered no matter if it is a tty or not.
> if fn == b'ferr':
> newfp = fp
> +elif pycompat.ispy3:
> +# On Python 3, the standard library doesn't offer 
> line-buffered
> +# binary streams, so wrap/unwrap it.
> +if fp.isatty():
> +newfp = procutil.make_line_buffered(fp)
> +else:
> +newfp = procutil.unwrap_line_buffered(fp)
> else:
> -# make it line buffered explicitly because the default is
> -# decided on first write(), where fout could be a pager.
> +# Python 2 uses the I/O streams provided by the C library, so
> +# make it line-buffered explicitly. Otherwise the default 
> would
> +# be decided on first write(), where fout could be a pager.
> if fp.isatty():
> bufsize = 1  # line buffered
> else:
> bufsize = -1  # system default
> newfp = os.fdopen(fp.fileno(), mode, bufsize)
> +if newfp is not fp:
> setattr(ui, fn, newfp)
> setattr(self, cn, newfp)
> 
> @@ -440,13 +449,16 @@ class chgcmdserver(commandserver.server)
> ui = self.ui
> for (ch, fp, fd), (cn, fn, mode) in zip(self._oldios, _iochannels):
> newfp = getattr(ui, fn)
> -# close newfp while it's associated with client; otherwise it
> -# would be closed when newfp is deleted
> -if newfp is not fp:
> +# On Python 2, newfp and fp may be separate file objects 
> associated
> +# with the same fd, so we must close newfp while it's associated
> +# with the client. Otherwise the new associated fd would be 
> closed
> +# when newfp gets deleted. On Python 3, newfp is just a wrapper
> +# around fp even if newfp is not fp, so deleting newfp is safe.
> +if not (pycompat.ispy3 or newfp is fp):
> newfp.close()
> # restore original fd: fp is open again
> try:
> -if newfp is fp and 'w' in mode:
> +if (pycompat.ispy3 or newfp is fp) and 'w' in mode:
> # Discard buffered data which couldn't be flushed because
> # of EPIPE. The data should belong to the current session
> # and should never persist.
> diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py
> --- a/mercurial/utils/procutil.py
> +++ b/mercurial/utils/procutil.py
> @@ -80,6 +80,13 @@ def make_line_buffered(stream):
> return LineBufferedWrapper(stream)
> 
> 
> +def unwrap_line_buffered(stream):
> +if isinstance(stream, LineBufferedWrapper):
> +assert not isinstance(stream.orig, LineBufferedWrapper)
> +return stream.orig
> +return stream
> +
> +
> class WriteAllWrapper(object):
> def __init__(self, orig):
> self.orig = orig
> 
> ___
> 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


D9290: pyoxidizer: switch to modern config using run_command instead of run_mode

2020-11-10 Thread durin42 (Augie Fackler)
durin42 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/D9290

AFFECTED FILES
  rust/hgcli/pyoxidizer.bzl

CHANGE DETAILS

diff --git a/rust/hgcli/pyoxidizer.bzl b/rust/hgcli/pyoxidizer.bzl
--- a/rust/hgcli/pyoxidizer.bzl
+++ b/rust/hgcli/pyoxidizer.bzl
@@ -49,7 +49,7 @@
 
 config = dist.make_python_interpreter_config()
 config.raw_allocator = "system"
-config.run_mode = "eval:%s" % RUN_CODE
+config.run_command = RUN_CODE
 # We want to let the user load extensions from the file system
 config.filesystem_importer = True
 # We need this to make resourceutil happy, since it looks for sys.frozen.



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


D9289: pyoxidizer: default to one-file binary on non-Windows platforms

2020-11-10 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Windows has some extra constraints that require a multi-file install,
  but we expect folks to use an MSI or similar installer there so it's
  less of a big deal.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hgcli/pyoxidizer.bzl

CHANGE DETAILS

diff --git a/rust/hgcli/pyoxidizer.bzl b/rust/hgcli/pyoxidizer.bzl
--- a/rust/hgcli/pyoxidizer.bzl
+++ b/rust/hgcli/pyoxidizer.bzl
@@ -14,6 +14,9 @@
 return default_python_distribution(flavor = "standalone_dynamic")
 
 def resource_callback(policy, resource):
+if not IS_WINDOWS:
+resource.add_location = "in-memory"
+return
 # We use a custom resource routing policy to influence where things are 
loaded
 # from.
 #
@@ -40,7 +43,8 @@
 # extensions.
 packaging_policy.extension_module_filter = "all"
 packaging_policy.resources_location = "in-memory"
-packaging_policy.resources_location_fallback = "filesystem-relative:lib"
+if IS_WINDOWS:
+packaging_policy.resources_location_fallback = 
"filesystem-relative:lib"
 packaging_policy.register_resource_callback(resource_callback)
 
 config = dist.make_python_interpreter_config()



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


D9291: make: add a pyoxidizer target

2020-11-10 Thread durin42 (Augie Fackler)
durin42 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/D9291

AFFECTED FILES
  Makefile

CHANGE DETAILS

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,8 @@
 PYTHON?=python3
 endif
 
+PYOXIDIZER?=pyoxidizer
+
 $(eval HGROOT := $(shell pwd))
 HGPYTHONS ?= $(HGROOT)/build/pythons
 PURE=
@@ -259,9 +261,12 @@
  --resources contrib/packaging/macosx/ \
  "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg
 
+pyoxidizer:
+   $(PYOXIDIZER) build --path ./rust/hgcli --release
+
 .PHONY: help all local build doc cleanbutpackages clean install install-bin \
install-doc install-home install-home-bin install-home-doc \
dist dist-notests check tests rust-tests check-code format-c \
-   update-pot \
+   update-pot pyoxidizer \
$(packaging_targets) \
osx



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


Re: How to get back to a one-file `hg` executable?

2020-11-07 Thread Augie Fackler via Mercurial-devel
Closing the loop on this: Greg helped me out a bunch and we got this
working again. I'll send some patches next week to make pyoxidized `hg` be
one-file on Linux and macOS. :)

On Tue, Nov 3, 2020 at 6:41 PM Augie Fackler  wrote:

> Spent a little more time with the latest pyoxidizer, but started getting
> weird results: complaining from pyoxidizer that it needed a .to_string() in
> the run_command: Some("my string here") value, and if I patch around that
> or comment out run_command I get a panic inside starlark on an optional,
> which I don't think makes sense either.
>
> I guess I need some guidance on how to debug why hgdemandimport thinks it
> can't be loaded from the single-file executable? Any insight?
>
> On Tue, Nov 3, 2020 at 11:11 AM Augie Fackler  wrote:
>
>> Okay, patching up for main, I get this:
>>
>> error[PYOXIDIZER_BUILD]: adding PythonModuleSource
>>
>> Caused by:
>> 0: adding PythonModuleSource
>> 1: resource collector does not allow resources in filesystem-relative
>>   --> ./pyoxidizer.bzl:61:5
>>|
>> 61 | exe.add_python_resources(exe.pip_install(["--verbose", ROOT]))
>>| ^^
>> add_python_resources()
>>
>>
>> error: adding PythonModuleSource
>>
>> Caused by:
>> 0: adding PythonModuleSource
>> 1: resource collector does not allow resources in filesystem-relative
>>
>> so it's sad about hgdemandimport, but I'm not sure what to do with this
>> information. For the record, my patch to pyoxidizer.bzl is this:
>>
>> diff --git a/rust/hgcli/pyoxidizer.bzl b/rust/hgcli/pyoxidizer.bzl
>> --- a/rust/hgcli/pyoxidizer.bzl
>> +++ b/rust/hgcli/pyoxidizer.bzl
>> @@ -40,12 +40,11 @@ def make_exe(dist):
>>  # extensions.
>>  packaging_policy.extension_module_filter = "all"
>>  packaging_policy.resources_location = "in-memory"
>> -packaging_policy.resources_location_fallback =
>> "filesystem-relative:lib"
>>  packaging_policy.register_resource_callback(resource_callback)
>>
>>  config = dist.make_python_interpreter_config()
>>  config.raw_allocator = "system"
>> -config.run_mode = "eval:%s" % RUN_CODE
>> +config.run_command = RUN_CODE
>>  # We want to let the user load extensions from the file system
>>  config.filesystem_importer = True
>>  # We need this to make resourceutil happy, since it looks for
>> sys.frozen.
>>
>>
>> On Tue, Nov 3, 2020 at 9:54 AM Augie Fackler  wrote:
>>
>>> Sigh, you changed the config file again in an incompatible way
>>> (config.run_mode isn't a thing anymore) so I'll use the v0.9.0 tag. It
>>> still fails, but still not helpfully?
>>>
>>> Successfully installed mercurial-5.6-4-8711dc13474c-20201103
>>> Removed build tracker:
>>> '/private/var/folders/cy/2vk7k97j21qd6yr76gp6x5m8001p1v/T/pip-req-tracker-z19m5oxc'
>>> adding 
>>> error[PYOXIDIZER_BUILD]: resource collector does not allow resources in
>>> filesystem-relative
>>>   --> ./pyoxidizer.bzl:63:9
>>>|
>>> 63 | exe.add_python_resource(r)
>>>| ^^ add_python_resource
>>>
>>> error: resource collector does not allow resources in filesystem-relative
>>>
>>> I'll see if I can update the pyoxidizer.bzl in a bit here to work on
>>> main, I guess?
>>>
>>> On Mon, Nov 2, 2020 at 11:06 PM Gregory Szorc 
>>> wrote:
>>>
>>>> I'm unsure what's going on here.
>>>>
>>>> For this to occur, `.resources_location_fallback = None` must hold on
>>>> the policy instance and some resource being added must have its
>>>> `.add_location = "filesystem-relative:..."`.
>>>>
>>>> This error message is horrible. And I just committed a change to the
>>>> `main` branch to print more context about which exact resource is failing.
>>>> If you don't want to run the latest commit from `main`, you can change this
>>>> to something like:
>>>>
>>>> for resource in exe.pip_install["--verbose", ROOT]):
>>>> print("adding %s" % resource)
>>>> exe.add_python_resource(resource)
>>>>
>>>> Or you could look for references to "filesystem-relative" in the
>>>> configuration file. There&#

  1   2   3   4   5   6   7   8   9   10   >