Chrome tracing

2017-02-11 Thread Bryan O'Sullivan
I put together a proof of concept patch tonight that adds the ability to
use light(ish)weight instrumentation to generate trace files that the
Chrome trace tool can render.

Here's a local clone --pull of Mercurial itself:
http://i.imgur.com/efWjFyE.png

And the corresponding trace file, so you can mess around with it:
http://pastebin.com/qXGfwQ3j

Here's "log -l100" in an old copy of mozilla-central:
http://i.imgur.com/2pyvT43.png

And its trace file:
http://pastebin.com/k2Q2WiLu

The patch itself reveals how easy this functionality is to use:
http://pastebin.com/7zR61UhB

It's not hard to see how you could e.g. get --profile output into this
format, and with a little massaging get a potentially interesting way of
drilling into performance in detail.

What's interesting about this patch, even in its current very hacky form,
is how amenable to fishing expeditions it is. You can easily add temporary
lightweight instrumentation anywhere. It also seems clear that some of this
kind of instrumentation would be valuable to add permanently. For example,
I noticed tonight, just by looking at a trace, that hg-git takes over a
hundred milliseconds to load.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 7 stable] bundle1: fix bundle1-denied reporting for push over ssh

2017-02-11 Thread Martin von Zweigbergk via Mercurial-devel
On Sat, Feb 11, 2017 at 10:28 AM, Gregory Szorc  wrote:
>
>
>> On Feb 10, 2017, at 15:54, Martin von Zweigbergk via Mercurial-devel 
>>  wrote:
>>
>> On Fri, Feb 10, 2017 at 9:53 AM, Pierre-Yves David
>>  wrote:
>>> # HG changeset patch
>>> # User Pierre-Yves David 
>>> # Date 1486745819 -3600
>>> #  Fri Feb 10 17:56:59 2017 +0100
>>> # Branch stable
>>> # Node ID f319afe9c93cb0cfeeff58f66b1792eb55130ba4
>>> # Parent  a7ded180ddb35dfc0e642e960a59ed475fd9be75
>>> # EXP-Topic getbundleerror
>>> bundle1: fix bundle1-denied reporting for push over ssh
>>>
>>> Changeset b288fb2724bf introduced a config option to have the server deny 
>>> push
>>> using bundle1. The original protocol has not really be design to allow such 
>>> kind
>>> of error reporting so some hack was used. It turned the hack only works on 
>>> HTTP
>>> and that ssh wire peer hangs forever when the same hack is used. After 
>>> further
>>> digging, there is no way to report the error in a unified way. Using 
>>> 'ooberror'
>>> freeze ssh and raising 'Abort' makes HTTP return a HTTP500 without further
>>> details. So with sadness we implement a version that dispatch according to 
>>> the
>>> protocol used.
>>
>> Could we instead raise a custom exception with the appropriate data (a
>> main message and a hint, it seems) that we then could catch in the
>> http and ssh handlers and handle appropriately for each?
>>
>> Even if that's what we want long-term (I don't know if there's a
>> reason not want it long-term), I'm fine with taking your patches for
>> now since they're probably less intrusive and therefore more
>> appropriate for stable.
>
> Ugh. The SSH wire protocol needs to be replaced.
>
> I agree with Martin about wanting a better error handling mechanism. I also 
> agree that it would be too invasive for stable.
>
> The patches as is correct an obvious problem and LGTM. Refinements can occur 
> on default.
>
> FWIW Mozilla sees a lot of these "stream ended unexpectedly" errors. The 
> errors are next to useless and I really wish we printed something more 
> informational. I still suspect we may be swallowing an exception from a 
> low-level network failure somewhere. What I'm trying to say is there is a lot 
> of room for improvement to error handling in the protocol code. But that's 
> for another series.

Series queued for stable. Thanks to Pierre-Yves for patches and thanks
to Greg for review.

>
>>
>>>
>>> We also add a test for pushing over ssh to make sure we won't regress in the
>>> future. That test show that the hint is missing, this is another bug fixed 
>>> in
>>> the next changeset.
>>>
>>> diff -r a7ded180ddb3 -r f319afe9c93c mercurial/wireproto.py
>>> --- a/mercurial/wireproto.pyFri Feb 10 17:56:47 2017 +0100
>>> +++ b/mercurial/wireproto.pyFri Feb 10 17:56:59 2017 +0100
>>> @@ -33,9 +33,10 @@
>>> urlerr = util.urlerr
>>> urlreq = util.urlreq
>>>
>>> -bundle2required = _(
>>> -'incompatible Mercurial client; bundle2 required\n'
>>> -'(see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n')
>>> +bundle2requiredmain = _('incompatible Mercurial client; bundle2 required')
>>> +bundle2requiredhint = _('see https://www.mercurial-scm.org/wiki/'
>>> +'IncompatibleClient')
>>> +bundle2required = '%s\n(%s)\n' % (bundle2requiredmain, bundle2requiredhint)
>>>
>>> class abstractserverproto(object):
>>> """abstract class that summarizes the protocol API
>>> @@ -948,7 +949,14 @@
>>> gen = exchange.readbundle(repo.ui, fp, None)
>>> if (isinstance(gen, changegroupmod.cg1unpacker)
>>> and not bundle1allowed(repo, 'push')):
>>> -return ooberror(bundle2required)
>>> +if proto.name == 'http':
>>> +# need to special case http because stderr do not get 
>>> to
>>> +# the http client on failed push so we need to abuse 
>>> some
>>> +# other error type to make sure the message get to the
>>> +# user.
>>> +return ooberror(bundle2required)
>>> +raise error.Abort(bundle2requiredmain,
>>> +  hint=bundle2requiredhint)
>>>
>>> r = exchange.unbundle(repo, gen, their_heads, 'serve',
>>>   proto._client())
>>> diff -r a7ded180ddb3 -r f319afe9c93c tests/test-bundle2-exchange.t
>>> --- a/tests/test-bundle2-exchange.t Fri Feb 10 17:56:47 2017 +0100
>>> +++ b/tests/test-bundle2-exchange.t Fri Feb 10 17:56:59 2017 +0100
>>> @@ -1107,6 +1107,14 @@
>>>   (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
>>>   [255]
>>>
>>> +(also check with ssh)
>>> +
>>> +  $ hg --config devel.legacy.exchange=bundle1 push 
>>> ssh://user@dummy/bundle2onlyserver
>>> +  pushing to ssh://user@dummy/bundle2onlyserver
>>> +  

Re: [PATCH 3 of 8 v3] contrib: add a write microbenchmark to perf.py

2017-02-11 Thread Bryan O'Sullivan
On Fri, Feb 10, 2017 at 1:06 PM, Simon Farnsworth  wrote:

> +def write():
> +ui.write(('Testing write performance\n'))
>

You'll want to do this in a loop 10,000 times or something instead of just
once, so that the numbers you get actually give you some idea of what's
going on. When you just measure one call, the cost of the call is probably
lower than the resolution of time.time().
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@30893: 3 new changesets

2017-02-11 Thread Mercurial Commits
3 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/b1b36c6499c2
changeset:   30891:b1b36c6499c2
parent:  30887:a95fc01aaffe
user:Jun Wu 
date:Wed Feb 08 14:45:30 2017 -0800
summary: commandserver: handle backlog before exiting

https://www.mercurial-scm.org/repo/hg/rev/441705506d24
changeset:   30892:441705506d24
user:Pulkit Goyal <7895pul...@gmail.com>
date:Tue Feb 07 22:47:24 2017 +0530
summary: py3: convert os.__file__ to bytes

https://www.mercurial-scm.org/repo/hg/rev/a0e3d808690d
changeset:   30893:a0e3d808690d
bookmark:@
tag: tip
user:Pulkit Goyal <7895pul...@gmail.com>
date:Tue Feb 07 23:25:37 2017 +0530
summary: py3: fix the way we produce bytes list in store.py

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


Re: Google Summer of Code 2017.

2017-02-11 Thread Pulkit Goyal
So I mailed the GSoC people at Python, after waiting for a reply for few
days I talked to "meflin" (he is one those handling GSoC at Python) at IRC
and they are happy to include us but they will add more sub-org once Google
finishes the procedure of organisation selection which will be on 27th Feb.

Let's not wait for that and start with ideas. I have created a ideas page
with previous year leftover ideas.
https://www.mercurial-scm.org/wiki/SummerOfCode/Ideas2017

Regards
Pulkit Goyal

On Tue, Feb 7, 2017 at 12:08 AM, Augie Fackler  wrote:

>
> > On Feb 5, 2017, at 18:45, Pulkit Goyal <7895pul...@gmail.com> wrote:
> >
> > The wiki page for Python GSoC 2017 states that interested organisations
> need to apply as a sub-org before 8th Feb[1]. Taking part under the Python
> Software Foundation umbrella will be good, we participated last time the
> same way. So the deadline is very close.
> >
> > To speed up things, we need an `admin` who can manage GSoC stuff.  I can
> be an admin(yes, I am not participating as a student again :)​ ​) in case
> nobody else is ready.
>
> If you're willing to be admin, then yes, go ahead and reach out to the
> Python people and see if they're willing to have us participate. If you
> need a backup admin (I think you do?), I can probably do that, depending on
> the schedule.
>
> Thanks!
>
> >
> > [1] http://python-gsoc.org/#schedule
> >
> > On Sat, Feb 4, 2017 at 2:26 PM, Pulkit Goyal <7895pul...@gmail.com>
> wrote:
> > Hello everyone,
> >
> > Google Summer of Code 2016 was a good experience for both me and
> > Piotr. We learned a lot. With GSoC 2017 near, students have started
> > asking me about Mercurial taking part in GSoC 2017.
> >
> > Taking part in GSoC is good as we get new contributors (I am one of
> > them). Are we going to take part in GSoC 2017?
> >
> > Regards
> > Pulkit Goyal
> >
> > ___
> > 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 6 of 6 remotenames-ext] selectivepull: support list of default bookmarks

2017-02-11 Thread Gregory Szorc


> On Jan 30, 2017, at 07:56, Stanislau Hlebik  wrote:
> 
> # HG changeset patch
> # User Stanislau Hlebik 
> # Date 1485791649 28800
> #  Mon Jan 30 07:54:09 2017 -0800
> # Node ID 227796849698292c76c70e874179de52b7b688d6
> # Parent  a96117003c763be640a975d8128068d2bd3527c0
> selectivepull: support list of default bookmarks
> 
> The addition is that we now support list of default bookmarks, instead of a
> single default bookmark (the previous behavior).

Cool series!

[paths] entries have sub-options to control push behavior, including which rev 
is pushed by default 
(https://www.mercurial-scm.org/repo/hg/file/a95fc01aaffe/mercurial/help/config.txt#l1348).

So if we wanted to implement selective pull in core, the mechanism to support 
defining the config is there...

> 
> diff --git a/remotenames.py b/remotenames.py
> --- a/remotenames.py
> +++ b/remotenames.py
> @@ -81,14 +81,19 @@
> return ui.configbool('remotenames', 'selectivepull', False)
> 
> def _getselectivepulldefaultbookmarks(ui, remotebookmarks):
> -default_book = ui.config('remotenames', 'selectivepulldefault')
> -if not default_book:
> -raise error.Abort(_('no default bookmark specified for 
> selectivepull'))
> -if default_book in remotebookmarks:
> -return {default_book: remotebookmarks[default_book]}
> -else:
> +default_books = ui.configlist('remotenames', 'selectivepulldefault')
> +if not default_books:
> +raise error.Abort(_('no default bookmarks specified for 
> selectivepull'))
> +
> +result = {}
> +for default_book in default_books:
> +if default_book in remotebookmarks:
> +result[default_book] = remotebookmarks[default_book]
> +
> +if not default_books:
> raise error.Abort(
> -_('default bookmark %s is not found on remote') % default_book)
> +_('default bookmarks %s are not found on remote') % 
> default_books)
> +return result
> 
> def _trypullremotebookmark(mayberemotebookmark, repo, ui):
> ui.warn(_('`%s` not found: assuming it is a remote bookmark '
> diff --git a/tests/test-selective-pull.t b/tests/test-selective-pull.t
> --- a/tests/test-selective-pull.t
> +++ b/tests/test-selective-pull.t
> @@ -227,3 +227,14 @@
>   $ hg pull -q
>   $ hg book --remote
>  default/master2:0238718db2b1
> +
> +Set two bookmarks in selectivepulldefault, make sure both of them were pulled
> +  $ cat >> .hg/hgrc << EOF
> +  > [remotenames]
> +  > selectivepulldefault=master,thirdbook
> +  > EOF
> +  $ rm .hg/selectivepullenabled
> +  $ hg pull -q
> +  $ hg book --remote
> + default/master2:0238718db2b1
> + default/thirdbook 0:1449e7934ec1
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH V2] localrepo: avoid unnecessary conversion from node to rev

2017-02-11 Thread Gregory Szorc


> On Feb 10, 2017, at 05:48, Yuya Nishihara  wrote:
> 
>> On Tue, 7 Feb 2017 13:11:23 -0800, Jun Wu wrote:
>> V1 was accepted and in hg-committed [1] already. I don't know the official
>> recommended workflows but I used to just push follow-up fixes.
> 
> It's at the bottom of the draft stack, so I think follow-ups would be
> preferred.
> 
>> Excerpts from Stanislau Hlebik's message of 2017-02-07 00:52:13 -0800:
>>> # HG changeset patch
>>> # User Stanislau Hlebik 
>>> # Date 1486457478 28800
>>> #  Tue Feb 07 00:51:18 2017 -0800
>>> # Node ID 8614d5d15d6fe47c3bcfdf79823f68f18c7741ae
>>> # Parent  1f51b4658f21bbb797e922d155c1046eddccf91d
>>> localrepo: avoid unnecessary conversion from node to rev
>>> 
>>> changelog.heads() first calls headrevs then converts them to nodes.
>>> localrepo.heads() then sorts them using self.changelog.rev function and 
>>> makes
>>> useless conversion back to revs. Instead let's call changelog.headrevs() 
>>> from
>>> localrepo.heads(), sort the output and then convert to nodes. Because 
>>> headrevs
>>> does not support start parameter this optimization only works if start is 
>>> None.
>>> 
>>> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
>>> --- a/mercurial/localrepo.py
>>> +++ b/mercurial/localrepo.py
>>> @@ -1852,6 +1852,10 @@
>>>   listsubrepos)
>>> 
>>> def heads(self, start=None):
>>> +if start is None:
>>> +headrevs = reversed(self.changelog.headrevs())
>>> +return [self.changelog.node(rev) for rev in headrevs]
> 
> Also, can you check if self.changelog has no visible cost? I'm a bit afraid 
> that
> this patch could actually made heads() slow because of repeated self.changelog
> calls.

Repeated lookups of self.changelog will incur noticeable overhead in loops like 
this. Please follow up with a change to cache the changelog in a local variable.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH STABLE V4] misc: update year in copyright lines

2017-02-11 Thread Augie Fackler
queued for stable, thanks
> On Feb 11, 2017, at 12:25 PM, FUJIWARA Katsunori  
> wrote:
> 
> # HG changeset patch
> # User FUJIWARA Katsunori 
> # Date 1486833813 -32400
> #  Sun Feb 12 02:23:33 2017 +0900
> # Branch stable
> # Node ID 75149f84eac79994b99e159cda8d8f1bec75b5a2
> # Parent  22a4f664c1a5244ea7c40eefce60effc4382ac5b
> misc: update year in copyright lines
> 
> This patch also makes some expected output lines in tests glob-ed for
> persistence of them.
> 
> BTW, files below aren't yet changed in 2017, but this patch also
> updates copyright of them, because:
> 
>- mercurial/help/hg.1.txt
> 
>  almost all of "man hg" output comes from online help of hg
>  command, and is already changed in 2017
> 
>- mercurial/help/hgignore.5.txt
>- mercurial/help/hgrc.5
> 
>  "copyright 2005-201X Matt Mackall" in them mentions about
>  copyright of Mercurial itself
> 
> diff --git a/contrib/win32/ReadMe.html b/contrib/win32/ReadMe.html
> --- a/contrib/win32/ReadMe.html
> +++ b/contrib/win32/ReadMe.html
> @@ -140,7 +140,7 @@ editor = whatever
> 
> 
> 
> -  Mercurial is Copyright 2005-2016 Matt Mackall and others. See
> +  Mercurial is Copyright 2005-2017 Matt Mackall and others. See
>   the Contributors.txt file for a list of contributors.
> 
> 
> diff --git a/contrib/win32/mercurial.iss b/contrib/win32/mercurial.iss
> --- a/contrib/win32/mercurial.iss
> +++ b/contrib/win32/mercurial.iss
> @@ -21,7 +21,7 @@
> #endif
> 
> [Setup]
> -AppCopyright=Copyright 2005-2016 Matt Mackall and others
> +AppCopyright=Copyright 2005-2017 Matt Mackall and others
> AppName=Mercurial
> AppVersion={#VERSION}
> #if ARCH == "x64"
> @@ -45,7 +45,7 @@ AppContact=mercur...@mercurial-scm.org
> DefaultDirName={pf}\Mercurial
> SourceDir=..\..
> VersionInfoDescription=Mercurial distributed SCM (version {#VERSION})
> -VersionInfoCopyright=Copyright 2005-2016 Matt Mackall and others
> +VersionInfoCopyright=Copyright 2005-2017 Matt Mackall and others
> VersionInfoCompany=Matt Mackall and others
> InternalCompressLevel=max
> SolidCompression=true
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -6576,7 +6576,7 @@ def version_(ui, **opts):
>  util.version())
> license = _(
> "(see https://mercurial-scm.org for more information)\n"
> -"\nCopyright (C) 2005-2016 Matt Mackall and others\n"
> +"\nCopyright (C) 2005-2017 Matt Mackall and others\n"
> "This is free software; see the source for copying conditions. "
> "There is NO\nwarranty; "
> "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
> diff --git a/mercurial/help/hg.1.txt b/mercurial/help/hg.1.txt
> --- a/mercurial/help/hg.1.txt
> +++ b/mercurial/help/hg.1.txt
> @@ -112,7 +112,7 @@ Mailing list: https://www.mercurial-scm.
> 
> Copying
> """
> -Copyright (C) 2005-2016 Matt Mackall.
> +Copyright (C) 2005-2017 Matt Mackall.
> Free use of this software is granted under the terms of the GNU General
> Public License version 2 or any later version.
> 
> diff --git a/mercurial/help/hgignore.5.txt b/mercurial/help/hgignore.5.txt
> --- a/mercurial/help/hgignore.5.txt
> +++ b/mercurial/help/hgignore.5.txt
> @@ -26,7 +26,7 @@ See Also
> Copying
> ===
> This manual page is copyright 2006 Vadim Gelfer.
> -Mercurial is copyright 2005-2016 Matt Mackall.
> +Mercurial is copyright 2005-2017 Matt Mackall.
> Free use of this software is granted under the terms of the GNU General
> Public License version 2 or any later version.
> 
> diff --git a/mercurial/help/hgrc.5.txt b/mercurial/help/hgrc.5.txt
> --- a/mercurial/help/hgrc.5.txt
> +++ b/mercurial/help/hgrc.5.txt
> @@ -34,7 +34,7 @@ See Also
> Copying
> ===
> This manual page is copyright 2005 Bryan O'Sullivan.
> -Mercurial is copyright 2005-2016 Matt Mackall.
> +Mercurial is copyright 2005-2017 Matt Mackall.
> Free use of this software is granted under the terms of the GNU General
> Public License version 2 or any later version.
> 
> diff --git a/setup.py b/setup.py
> --- a/setup.py
> +++ b/setup.py
> @@ -664,7 +664,7 @@ extra = {}
> if py2exeloaded:
> extra['console'] = [
> {'script':'hg',
> - 'copyright':'Copyright (C) 2005-2016 Matt Mackall and others',
> + 'copyright':'Copyright (C) 2005-2017 Matt Mackall and others',
>  'product_version':version}]
> # sub command of 'build' because 'py2exe' does not handle sub_commands
> build.sub_commands.insert(0, ('build_hgextindex', None))
> diff --git a/tests/test-help.t b/tests/test-help.t
> --- a/tests/test-help.t
> +++ b/tests/test-help.t
> @@ -445,7 +445,7 @@ Test help option with version option
>   Mercurial Distributed SCM (version *) (glob)
>   (see https://mercurial-scm.org for more information)
> 
> -  Copyright (C) 2005-2016 Matt Mackall and others
> +  Copyright (C) 2005-* Matt Mackall and 

Re: [PATCH 2 of 7 stable] bundle1: fix bundle1-denied reporting for push over ssh

2017-02-11 Thread Gregory Szorc


> On Feb 10, 2017, at 15:54, Martin von Zweigbergk via Mercurial-devel 
>  wrote:
> 
> On Fri, Feb 10, 2017 at 9:53 AM, Pierre-Yves David
>  wrote:
>> # HG changeset patch
>> # User Pierre-Yves David 
>> # Date 1486745819 -3600
>> #  Fri Feb 10 17:56:59 2017 +0100
>> # Branch stable
>> # Node ID f319afe9c93cb0cfeeff58f66b1792eb55130ba4
>> # Parent  a7ded180ddb35dfc0e642e960a59ed475fd9be75
>> # EXP-Topic getbundleerror
>> bundle1: fix bundle1-denied reporting for push over ssh
>> 
>> Changeset b288fb2724bf introduced a config option to have the server deny 
>> push
>> using bundle1. The original protocol has not really be design to allow such 
>> kind
>> of error reporting so some hack was used. It turned the hack only works on 
>> HTTP
>> and that ssh wire peer hangs forever when the same hack is used. After 
>> further
>> digging, there is no way to report the error in a unified way. Using 
>> 'ooberror'
>> freeze ssh and raising 'Abort' makes HTTP return a HTTP500 without further
>> details. So with sadness we implement a version that dispatch according to 
>> the
>> protocol used.
> 
> Could we instead raise a custom exception with the appropriate data (a
> main message and a hint, it seems) that we then could catch in the
> http and ssh handlers and handle appropriately for each?
> 
> Even if that's what we want long-term (I don't know if there's a
> reason not want it long-term), I'm fine with taking your patches for
> now since they're probably less intrusive and therefore more
> appropriate for stable.

Ugh. The SSH wire protocol needs to be replaced.

I agree with Martin about wanting a better error handling mechanism. I also 
agree that it would be too invasive for stable.

The patches as is correct an obvious problem and LGTM. Refinements can occur on 
default.

FWIW Mozilla sees a lot of these "stream ended unexpectedly" errors. The errors 
are next to useless and I really wish we printed something more informational. 
I still suspect we may be swallowing an exception from a low-level network 
failure somewhere. What I'm trying to say is there is a lot of room for 
improvement to error handling in the protocol code. But that's for another 
series.

> 
>> 
>> We also add a test for pushing over ssh to make sure we won't regress in the
>> future. That test show that the hint is missing, this is another bug fixed in
>> the next changeset.
>> 
>> diff -r a7ded180ddb3 -r f319afe9c93c mercurial/wireproto.py
>> --- a/mercurial/wireproto.pyFri Feb 10 17:56:47 2017 +0100
>> +++ b/mercurial/wireproto.pyFri Feb 10 17:56:59 2017 +0100
>> @@ -33,9 +33,10 @@
>> urlerr = util.urlerr
>> urlreq = util.urlreq
>> 
>> -bundle2required = _(
>> -'incompatible Mercurial client; bundle2 required\n'
>> -'(see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n')
>> +bundle2requiredmain = _('incompatible Mercurial client; bundle2 required')
>> +bundle2requiredhint = _('see https://www.mercurial-scm.org/wiki/'
>> +'IncompatibleClient')
>> +bundle2required = '%s\n(%s)\n' % (bundle2requiredmain, bundle2requiredhint)
>> 
>> class abstractserverproto(object):
>> """abstract class that summarizes the protocol API
>> @@ -948,7 +949,14 @@
>> gen = exchange.readbundle(repo.ui, fp, None)
>> if (isinstance(gen, changegroupmod.cg1unpacker)
>> and not bundle1allowed(repo, 'push')):
>> -return ooberror(bundle2required)
>> +if proto.name == 'http':
>> +# need to special case http because stderr do not get to
>> +# the http client on failed push so we need to abuse 
>> some
>> +# other error type to make sure the message get to the
>> +# user.
>> +return ooberror(bundle2required)
>> +raise error.Abort(bundle2requiredmain,
>> +  hint=bundle2requiredhint)
>> 
>> r = exchange.unbundle(repo, gen, their_heads, 'serve',
>>   proto._client())
>> diff -r a7ded180ddb3 -r f319afe9c93c tests/test-bundle2-exchange.t
>> --- a/tests/test-bundle2-exchange.t Fri Feb 10 17:56:47 2017 +0100
>> +++ b/tests/test-bundle2-exchange.t Fri Feb 10 17:56:59 2017 +0100
>> @@ -1107,6 +1107,14 @@
>>   (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
>>   [255]
>> 
>> +(also check with ssh)
>> +
>> +  $ hg --config devel.legacy.exchange=bundle1 push 
>> ssh://user@dummy/bundle2onlyserver
>> +  pushing to ssh://user@dummy/bundle2onlyserver
>> +  searching for changes
>> +  remote: abort: incompatible Mercurial client; bundle2 required
>> +  [1]
>> +
>>   $ hg push
>>   pushing to http://localhost:$HGPORT/
>>   searching for changes
>> ___
>> Mercurial-devel mailing list
>> 

mercurial@30890: 3 new changesets (3 on stable)

2017-02-11 Thread Mercurial Commits
3 new changesets (3 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/561a019c0268
changeset:   30888:561a019c0268
branch:  stable
parent:  30874:af3b5aa61fc0
user:FUJIWARA Katsunori 
date:Sat Feb 11 00:23:53 2017 +0900
summary: misc: replace domain of mercurial ML address by mercurial-scm.org

https://www.mercurial-scm.org/repo/hg/rev/4acf569facef
changeset:   30889:4acf569facef
branch:  stable
user:FUJIWARA Katsunori 
date:Sat Feb 11 00:23:55 2017 +0900
summary: i18n: update Report-Msgid-Bugs-To property of *.po files

https://www.mercurial-scm.org/repo/hg/rev/22a4f664c1a5
changeset:   30890:22a4f664c1a5
branch:  stable
tag: tip
user:FUJIWARA Katsunori 
date:Sat Feb 11 00:23:55 2017 +0900
summary: misc: replace domain of mercurial-devel ML address by 
mercurial-scm.org

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


Re: [PATCH] pager: exit cleanly on SIGPIPE (BC)

2017-02-11 Thread Yuya Nishihara
On Wed, 8 Feb 2017 07:47:39 -0800, Simon Farnsworth wrote:
> # HG changeset patch
> # User Simon Farnsworth 
> # Date 1486568650 28800
> #  Wed Feb 08 07:44:10 2017 -0800
> # Node ID d50cda2a403786836d1f0d5c99401599dc4f43ec
> # Parent  1f51b4658f21bbb797e922d155c1046eddccf91d
> pager: exit cleanly on SIGPIPE (BC)

Queued per reviews, thanks.

> Changeset aaa751585325 removes SIGPIPE handling completely. This is wrong,
> as it means that Mercurial does not exit when the pager does. Instead, raise
> SignalInterrupt when SIGPIPE happens with a pager attached, to trigger the
> normal exit path.

Your comment on V1 "it breaks `hg serve`" reminded me of the weirdness of
SIGPIPE. If we did send() in paged hg process for example, the process could
be killed by SIGPIPE. With this patch, we still have a similar problem, but
the process should exit cleanly.

http://stackoverflow.com/questions/108183/
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 4 STABLE V3] misc: update year in copyright lines

2017-02-11 Thread FUJIWARA Katsunori
At Fri, 10 Feb 2017 16:03:53 -0500,
Augie Fackler wrote:
> 
> On Sat, Feb 11, 2017 at 12:30:03AM +0900, FUJIWARA Katsunori wrote:
> > # HG changeset patch
> > # User FUJIWARA Katsunori 
> > # Date 1486740233 -32400
> > #  Sat Feb 11 00:23:53 2017 +0900
> > # Branch stable
> > # Node ID f4dcd9cdb900f46557c9bd15abb73b0c5f03403b
> > # Parent  af3b5aa61fc05a124697809bf472a5592f38489c
> > misc: update year in copyright lines
> > 
> > This patch also does below:
> > 
> >  - add new check-code.py pattern to detect outdated copyright year
> >according to the date at testing
> > 
> >  - make some expected output lines in tests glob-ed for persistence
> 
> I've queued the other patches in this series, but am dropping this
> one, because it's only sort of
> correct. https://news.ycombinator.com/item?id=8809853 for details
> (DannyBee is an Actual Lawyer who also is an engineer), but the short
> version is we don't actually /want/ to update copyright on files
> unless they're updated.
>
> As far as the copyright on the entire program (eg in the .iss file)
> and in setup.py, that's probably the right thing to do, but I'm not
> sure if we should have a test that goes red when the year changes
> (which, keep in mind, varies a bit on timezone, so we'd have a 24 hour
> period where the tests necessarily did not pass for everyone). I guess
> let's do the html/iss/setup.py whole-app lines and ignore the test?

OK, I'll send revised patch without testing.

> 
> > diff --git a/contrib/check-code.py b/contrib/check-code.py
> > --- a/contrib/check-code.py
> > +++ b/contrib/check-code.py
> > @@ -20,6 +20,7 @@ when a rule triggers wrong, do one of th
> > """
> > 
> > from __future__ import absolute_import, print_function
> > +import datetime
> > import glob
> > import keyword
> > import optparse
> > @@ -448,10 +449,18 @@ webtemplatepats = [
> > 
> > allfilesfilters = []
> > 
> > +# to check outdated copyright year according to the date at testing
> > +thisyear = int(datetime.date.today().strftime('%Y'))
> > +
> > allfilespats = [
> >   [
> > (r'(http|https)://[a-zA-Z0-9./]*selenic.com/',
> >  'use mercurial-scm.org domain URL'),
> > +(r'(?i)(? > + (thisyear - 1, thisyear - 2),
> > + # for safety, "thisyear - 2" is also checked (this can cover the
> > + # issue fixed in af3b5aa61fc0)
> > + 'outdated copyright year'),
> >   ],
> >   # warnings
> >   [],
> > diff --git a/contrib/win32/ReadMe.html b/contrib/win32/ReadMe.html
> > --- a/contrib/win32/ReadMe.html
> > +++ b/contrib/win32/ReadMe.html
> > @@ -140,7 +140,7 @@ editor = whatever
> > 
> > 
> > 
> > -  Mercurial is Copyright 2005-2016 Matt Mackall and others. See
> > +  Mercurial is Copyright 2005-2017 Matt Mackall and others. See
> >   the Contributors.txt file for a list of contributors.
> > 
> > 
> > diff --git a/contrib/win32/mercurial.iss b/contrib/win32/mercurial.iss
> > --- a/contrib/win32/mercurial.iss
> > +++ b/contrib/win32/mercurial.iss
> > @@ -21,7 +21,7 @@
> > #endif
> > 
> > [Setup]
> > -AppCopyright=Copyright 2005-2016 Matt Mackall and others
> > +AppCopyright=Copyright 2005-2017 Matt Mackall and others
> > AppName=Mercurial
> > AppVersion={#VERSION}
> > #if ARCH == "x64"
> > @@ -45,7 +45,7 @@ AppContact=mercur...@selenic.com
> > DefaultDirName={pf}\Mercurial
> > SourceDir=..\..
> > VersionInfoDescription=Mercurial distributed SCM (version {#VERSION})
> > -VersionInfoCopyright=Copyright 2005-2016 Matt Mackall and others
> > +VersionInfoCopyright=Copyright 2005-2017 Matt Mackall and others
> > VersionInfoCompany=Matt Mackall and others
> > InternalCompressLevel=max
> > SolidCompression=true
> > diff --git a/mercurial/commands.py b/mercurial/commands.py
> > --- a/mercurial/commands.py
> > +++ b/mercurial/commands.py
> > @@ -6576,7 +6576,7 @@ def version_(ui, **opts):
> >  util.version())
> > license = _(
> > "(see https://mercurial-scm.org for more information)\n"
> > -"\nCopyright (C) 2005-2016 Matt Mackall and others\n"
> > +"\nCopyright (C) 2005-2017 Matt Mackall and others\n"
> > "This is free software; see the source for copying conditions. "
> > "There is NO\nwarranty; "
> > "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
> > PURPOSE.\n"
> > diff --git a/mercurial/help/hg-ssh.8.txt b/mercurial/help/hg-ssh.8.txt
> > --- a/mercurial/help/hg-ssh.8.txt
> > +++ b/mercurial/help/hg-ssh.8.txt
> > @@ -64,7 +64,7 @@ Mailing list: https://www.mercurial-scm.
> > 
> > Copying
> > """
> > -Copyright (C) 2005-2016 Matt Mackall.
> > +Copyright (C) 2005-2017 Matt Mackall.
> > Free use of this software is granted under the terms of the GNU General
> > Public License version 2 or any later version.
> > 
> > diff --git a/mercurial/help/hg.1.txt b/mercurial/help/hg.1.txt
> > --- a/mercurial/help/hg.1.txt
> > +++ b/mercurial/help/hg.1.txt
> > @@ -112,7 +112,7 @@ Mailing list: https://www.mercurial-scm.
> > 
> > Copying
> 

Re: [PATCH] config: add extension point for extracting all included files

2017-02-11 Thread Yuya Nishihara
On Tue, 7 Feb 2017 15:31:02 +, De Mare, Mathias (Nokia - BE) wrote:
> > > On Feb 3, 2017, at 09:56, Mathias De Maré 
> > wrote:
> > >
> > > # HG changeset patch
> > > # User Mathias De Mare  # Date
> > 1486132049
> > > -3600
> > > #  Fri Feb 03 15:27:29 2017 +0100
> > > # Node ID ea2e95febfeff39377c878fa05cc853832bc3b2a
> > > # Parent  eb78ec9e97b70310e2944f72c29463bedfc21442
> > > config: add extension point for extracting all included files
> > 
> > Hmm... for those of us who haven't been paying close attention, can you say
> > more about why this is desirable? Generally we don't add an extension point
> > unless at least an in-tree extension uses it. (It's possible there are 
> > historical
> > exceptions to this.)
> 
> Pierre-Yves and myself spent some time working on an extension that would 
> allow users to share their configuration with a server and allow a server to 
> send configuration suggestions to a client. The work so far is available at 
> https://bitbucket.org/Mathiasdm/hg-configexpress/overview
> One of the possible suggestions to clients would be to add specific includes, 
> and this extension point allows checking if these includes are present.

Can it be done by using/extending config._source dict?

I don't think hooking config method is a good idea because config object
may be used to parse template maps, .hgsub, etc.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel