Re: [PATCH 9 of 9] color: drop the now useless color extension

2017-07-17 Thread David Demelier
2017-07-17 6:40 GMT+02:00 David Demelier :
> And what about our strong backward compatibility?

Ignore my mail, I thought having a stale 'color =' in the hgrc would
cause an error.

I also vote for removal then.

Regards,

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


Re: [PATCH V2] commandserver: do not handle EINTR for selector.select

2017-07-17 Thread Yuya Nishihara
On Sun, 16 Jul 2017 11:23:40 -0700, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu 
> # Date 1500229020 25200
> #  Sun Jul 16 11:17:00 2017 -0700
> # Node ID 3fce51f52763323f1ff2e233e44aa926c2095d05
> # Parent  d09de637cbc88ed2db989298115d0c0cb6cc6f27
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #  hg pull https://bitbucket.org/quark-zju/hg-draft -r 
> 3fce51f52763
> commandserver: do not handle EINTR for selector.select

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


Re: [PATCH 1 of 2] archive: use a templater to build the metadata file

2017-07-17 Thread Yuya Nishihara
On Mon, 17 Jul 2017 00:57:38 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1500241236 14400
> #  Sun Jul 16 17:40:36 2017 -0400
> # Node ID 4d37def90ad5e0196dadb9bc2c9e62effad63691
> # Parent  d09de637cbc88ed2db989298115d0c0cb6cc6f27
> archive: use a templater to build the metadata file

Queued, thanks.

> +default = (
> +r'repo: {root}\n'
> +r'node: {ifcontains(rev, revset("wdir()"),'
> +r'"{p1node}{dirty}", "{node}")}\n'
> +r'branch: {branch|utf8}\n'
>  
> -base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
> -_rootctx(repo).hex(), hex, encoding.fromlocal(ctx.branch()))
> +# {tags} on ctx includes local tags and 'tip', with no current way to
> +# limit that to global tags.  Therefore, use {latesttag} as a 
> substitute
> +# when the distance is 0, since that will be the list of global tags 
> on
> +# ctx.
> +r'{ifeq(latesttagdistance, 0, latesttag % "tag: {tag}\n",'
> +   r'"{latesttag % "latesttag: {tag}\n"}'
> +   r'latesttagdistance: {latesttagdistance}\n'
> +   r'changessincelatesttag: {changessincelatesttag}\n")}'

You could use {separate('', '', ...)} to eliminate these weird indents.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH v3] releasenotes: add custom admonitions support for release notes

2017-07-17 Thread Yuya Nishihara
On Sun, 16 Jul 2017 11:58:28 -0400, Augie Fackler wrote:
> 
> > On Jul 16, 2017, at 10:30 AM, Yuya Nishihara  wrote:
> > 
> > On Sun, 16 Jul 2017 14:25:28 +0200, Rishabh Madan wrote:
> >> On Sun, Jul 16, 2017 at 2:20 PM, Rishabh Madan 
> >> wrote:
> >>> On Sat, Jul 15, 2017 at 4:13 AM, Yuya Nishihara  wrote:
>  On Sun, 09 Jul 2017 19:04:33 +0200, Rishabh Madan wrote:
> > # HG changeset patch
> > # User Rishabh Madan 
> > # Date 1499619850 -7200
> > #  Sun Jul 09 19:04:10 2017 +0200
> > # Node ID 5f22d3d43d36d46cea98c86b2a49eee2d323fd9e
> > # Parent  4672db164c986da4442bd864cd044512d975c3f2
> > releasenotes: add custom admonitions support for release notes
>  
>  Do you have time to make V4 in this weekend? If you don't, I'll queue 
>  this
>  version as it seems good enough.
>  
> >>> 
> >>> Really sorry. I am travelling back home so I guess I won't be able to
> >>> complete v4 by the weekend. I'll reach on Monday and I can submit the new
> >>> patch by then if it is okay.
> >> 
> >> Actually, I already have the patch for custom admonitions. But I was
> >> planning to send the similarity function patches along with it as a series.
> > 
> > Okay then, it's probably better to not take the current version. Thanks for
> > the status updates.
> 
> It’s also fine with me to keep iterating on this during the freeze, given 
> that it’s still experimental and I don’t want to take two weeks of 
> productivity away from a GSoC student.

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


Re: [PATCH 2 of 2] archive: add an experimental config to control the metadata file template

2017-07-17 Thread Yuya Nishihara
On Mon, 17 Jul 2017 00:57:39 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1500266969 14400
> #  Mon Jul 17 00:49:29 2017 -0400
> # Node ID a85b7c754630cb4ac49b2cebea0ceca3d2f2eaaa
> # Parent  4d37def90ad5e0196dadb9bc2c9e62effad63691
> archive: add an experimental config to control the metadata file template
> 
> Experimental because given the possible complexity, it may be worth figuring 
> out
> how to load this from a file, similar to the style files for the log command,
> instead of trying to stuff it on the command line.

Maybe we'll want to save it in [templates] section, and specify it in a similar
way to -T option?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 9 of 9] color: drop the now useless color extension

2017-07-17 Thread Augie Fackler
On Sun, Jul 16, 2017 at 03:27:31PM -0700, Sean Farley wrote:
>
> Boris Feld  writes:
>
> > # HG changeset patch
> > # User Boris Feld 
> > # Date 1500121055 -7200
> > #  Sat Jul 15 14:17:35 2017 +0200
> > # Node ID bb3703129b5035a162fd8ad8eee364295b9ce9d0
> > # Parent  f170c4ba9c21f40248b83b511e064474080a0060
> > # EXP-Topic cleanup.color
> > color: drop the now useless color extension
> >
> > all the extension features are provided by core since 4.2.
>
> Not sure we should drop this so soon. I'll defer on this one since it's
> close to the freeze (and there's no harm leaving it in).

Eh, it's dropping a noop in the way we've dropped other dead
extensions, it's relatively low risk. We can always back it out in the
unlikely event we see a problem.

Queued.

> ___
> 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 4 of 4] demandimport: prefer loaded module over package attribute (issue5617)

2017-07-17 Thread Augie Fackler
On Sun, Jul 16, 2017 at 11:41:51PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1500194319 -32400
> #  Sun Jul 16 17:38:39 2017 +0900
> # Node ID 6ab37703424f873c658309e9dfcc0ccb311ef655
> # Parent  f74cef39afa518f5b7a3e5770b9988d24f99fc24
> demandimport: prefer loaded module over package attribute (issue5617)

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


Re: Potential BC changes to sparse before freeze

2017-07-17 Thread Augie Fackler
On Sat, Jul 15, 2017 at 03:15:08PM -0700, Sean Farley wrote:
>
> Gregory Szorc  writes:
>
> > On Sat, Jul 15, 2017 at 1:28 PM, Sean Farley  wrote:
> >
> >>
> >> Martin von Zweigbergk via Mercurial-devel  >> scm.org> writes:
> >>
> > It's worth noting that sparse profiles today can contain "set:" entries to
> > yield the power of filesets (the matcher constructor automatically
> > recognizes the type of pattern). What we can't do is change how [include]
> > and [exclude] interact with each other.
>
> Perhaps this is specialized / nuanced enough that I don't quite follow;
> but that's fine. All I wanted to do is point out similar, existing
> behavior. If that's already been considered and deemed not suitable,
> then ok with me.

We tried using straight filesets for narrowhg's include/exclude logic,
and it was thornier than we'd have liked. So far being a little more
restrictive has simplified both server implementations *and* not
caused any end-user problems.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2 V3] commitextras: move fb extension to core which add extras to a commit

2017-07-17 Thread Yuya Nishihara
On Sat, 15 Jul 2017 01:31:23 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pul...@gmail.com>
> # Date 1499799225 -19800
> #  Wed Jul 12 00:23:45 2017 +0530
> # Node ID e51d188da49636884ae6c0df94f501e84436b857
> # Parent  80e1331a7fe970f3e56fde9044949d72d3afdf30
> # EXP-Topic fbext
> commitextras: move fb extension to core which add extras to a commit

I think it's okay to start this as an extension, but I don't think this
extension should be advertised. So +1 for queueing this and marking it as
EXPERIMENTAL or ADVANCED as follow-up.

I'm also fine with adding a hidden config knob to unblock this feature.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2 V3] commitextras: move fb extension to core which add extras to a commit

2017-07-17 Thread Augie Fackler
On Mon, Jul 17, 2017 at 11:10:02PM +0900, Yuya Nishihara wrote:
> On Sat, 15 Jul 2017 01:31:23 +0530, Pulkit Goyal wrote:
> > # HG changeset patch
> > # User Pulkit Goyal <7895pul...@gmail.com>
> > # Date 1499799225 -19800
> > #  Wed Jul 12 00:23:45 2017 +0530
> > # Node ID e51d188da49636884ae6c0df94f501e84436b857
> > # Parent  80e1331a7fe970f3e56fde9044949d72d3afdf30
> > # EXP-Topic fbext
> > commitextras: move fb extension to core which add extras to a commit
>
> I think it's okay to start this as an extension, but I don't think this
> extension should be advertised. So +1 for queueing this and marking it as
> EXPERIMENTAL or ADVANCED as follow-up.
>
> I'm also fine with adding a hidden config knob to unblock this feature.

I'm also fine with either approach. It makes me nervous, but we
already should be robust to corrupt extras entries in the name of
being futureproof, so let's just proceed instead of being afraid and
letting that hinder potential nice things.

> ___
> 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 8 of 8] share: share 'cachevfs' with the source clone (issue5108)

2017-07-17 Thread Augie Fackler
On Sun, Jul 16, 2017 at 10:47:53AM +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld 
> # Date 1500155362 -7200
> #  Sat Jul 15 23:49:22 2017 +0200
> # Node ID 18baeb5c7d7358d87097fbee9b5b370ff4a55f76
> # Parent  ade3b656f808205bbe66f8a18bef34d545ad03f3
> # EXP-Topic cachevfs
> share: share 'cachevfs' with the source clone (issue5108)

queued, thanks

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


Re: [PATCH 2 of 3] transaction-summary: display the summary for all transactions

2017-07-17 Thread Augie Fackler
On Sun, Jul 16, 2017 at 11:21:42AM +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld 
> # Date 1500164406 -7200
> #  Sun Jul 16 02:20:06 2017 +0200
> # Node ID 8df908eb63b41ebef19e71f4f3f0085be4e6f8b3
> # Parent  ed5dfde9455a023b9b26152ee55ade0085b5516a
> # EXP-Topic tr.report
> transaction-summary: display the summary for all transactions

Queued the series, thanks.

>
> Now that we records "all" changes happening in a transaction (in tr.changes)
> we will be able to provide better report on various changes (phases turned
> public, changeset obsoleted, branch merged or created, etc..)
>
> This is far too late in the cycle to play with this, but having this existing
> method called more widely will help extensions to play around with various
> options during the 4.4 cycle.
>
> Instead of calling registersummarycallback only for transactions we want, we
> always call it and use the transaction name to decide when to report (eg: we
> do not want `hg amend` to report new obsoleted changesets). Filtering on
> transaction name does not seems great, but seems good enough for the moment.
> We can change the API during the next cycle.

Indeed, let's see what we can figure out to improve this.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH v2] run-tests: also color the summary messages (skipped, failed...)

2017-07-17 Thread Augie Fackler
On Sun, Jul 16, 2017 at 03:12:21PM +0900, mlaneuvi...@gmail.com wrote:
> # HG changeset patch
> # User Matthieu Laneuville 
> # Date 1500185462 -32400
> #  Sun Jul 16 15:11:02 2017 +0900
> # Node ID 9722bfa929b50e7ad87e0561f8d5fdd8e928d755
> # Parent  97ec8637d261a97c30944d9242ee1ccdbf536cb3
> run-tests: also color the summary messages (skipped, failed...)

This isn't applying for me, could you rebase and resend?


>
> diff -r 97ec8637d261 -r 9722bfa929b5 tests/run-tests.py
> --- a/tests/run-tests.py  Sun Jul 16 14:03:58 2017 +0900
> +++ b/tests/run-tests.py  Sun Jul 16 15:11:02 2017 +0900
> @@ -96,12 +96,46 @@
>  try: # is pygments installed
>  import pygments
>  import pygments.lexers as lexers
> +import pygments.lexer as lexer
>  import pygments.formatters as formatters
> +import pygments.token as token
> +import pygments.style as style
>  with_color = True
>  with_pygments = True
>  except ImportError:
>  pass
>
> +class TestRunnerStyle(style.Style):
> +default_style = ""
> +skipped = token.string_to_tokentype("Token.Generic.Skipped")
> +failed = token.string_to_tokentype("Token.Generic.Failed")
> +error = token.string_to_tokentype("Token.Generic.Error")
> +skippedname = token.string_to_tokentype("Token.Generic.SName")
> +failedname = token.string_to_tokentype("Token.Generic.FName")
> +styles = {
> +skipped: '#ansilightgray',
> +skippedname: '#ansidarkgray',
> +failed:  '#ansidarkred',
> +failedname:  '#ansired',
> +}
> +
> +class TestRunnerLexer(lexer.RegexLexer):
> +tokens = {
> +'root': [
> +(r'^Skipped', token.Generic.Skipped, 'skipped'),
> +(r'^Failed ', token.Generic.Failed, 'failed'),
> +(r'^ERROR: ', token.Generic.Failed, 'failed'),
> +],
> +'skipped': [
> +(r'[\w-]+\.t', token.Generic.SName),
> +(r':.*', token.Generic.Skipped),
> +],
> +'failed': [
> +(r'[\w-]+\.t', token.Generic.FName),
> +(r'(:| ).*', token.Generic.Failed),
> +]
> +}
> +
>  if sys.version_info > (3, 5, 0):
>  PYTHON3 = True
>  xrange = range # we use xrange in one place, and we'd rather not use 
> range
> @@ -1587,7 +1621,14 @@
>  self.stream.write('t')
>  else:
>  if not self._options.nodiff:
> -self.stream.write('\nERROR: %s output changed\n' % 
> test)
> +formatted = '\nERROR: %s output changed\n' % test
> +if with_color and with_pygments:
> +formatted = pygments.highlight(
> +formatted,
> +TestRunnerLexer(),
> +formatters.Terminal256Formatter(
> +
> style=TestRunnerStyle)).strip("\n")
> +self.stream.write(formatted)
>  self.stream.write('!')
>
>  self.stream.flush()
> @@ -1990,9 +2031,23 @@
>
>  if not self._runner.options.noskips:
>  for test, msg in result.skipped:
> -self.stream.writeln('Skipped %s: %s' % (test.name, msg))
> +formatted = 'Skipped %s: %s' % (test.name, msg)
> +if with_color and with_pygments:
> +formatted = pygments.highlight(
> +formatted,
> +TestRunnerLexer(),
> +formatters.Terminal256Formatter(
> +
> style=TestRunnerStyle)).strip("\n")
> +self.stream.writeln(formatted)
>  for test, msg in result.failures:
> -self.stream.writeln('Failed %s: %s' % (test.name, msg))
> +formatted = 'Failed %s: %s' % (test.name, msg)
> +if with_color and with_pygments:
> +formatted = pygments.highlight(
> +formatted,
> +TestRunnerLexer(),
> +formatters.Terminal256Formatter(
> +style=TestRunnerStyle)).strip("\n")
> +self.stream.writeln(formatted)
>  for test, msg in result.errors:
>  self.stream.writeln('Errored %s: %s' % (test.name, msg))
>
> diff -r 97ec8637d261 -r 9722bfa929b5 tests/test-run-tests.t
> --- a/tests/test-run-tests.t  Sun Jul 16 14:03:58 2017 +0900
> +++ b/tests/test-run-tests.t  Sun Jul 16 15:11:02 2017 +0900
> @@ -132,10 +132,8 @@
>\x1b[38;5;34m+  bar*baz (glob)\x1b[39m (esc)
>   bar*bad (glob)
>\x1b[38;5;124m-  bar*baz (glob)\x1b[39m (esc)
> -
> -  ERROR: test-failure.t output changed
> -  !
> -  Failed test-failure.t: output changed

Re: [PATCH] run-tests: make sure to check if pygments is installed before using it

2017-07-17 Thread Augie Fackler
On Sat, Jul 15, 2017 at 02:35:28AM +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pul...@gmail.com>
> # Date 1500065225 -19800
> #  Sat Jul 15 02:17:05 2017 +0530
> # Node ID 07928a5240e51e2cd44f7e05fccda32053ee0133
> # Parent  2cbccf36af1bd0d9ae9df1ad5fd4a7f8d870ae6c
> run-tests: make sure to check if pygments is installed before using it

This collided with mharbison's checks for Windows. Could you rebase
and resend?

>
> e80041832e introduced support to color the output of tests but used pygments
> without checking whether it's installed or not. That breaks test-run-tests.t 
> for
> machines which don't have pygments installed. This patch conditionalize the
> color test in test-run-tests.t and also add a check to make sure pygments is
> installed before using that.
>
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -89,10 +89,12 @@
>  processlock = threading.Lock()
>
>  with_color = False
> +pygmentspresent = False
>  try: # is pygments installed
>  import pygments
>  import pygments.lexers as lexers
>  import pygments.formatters as formatters
> +pygmentspresent = True
>  with_color = True
>  except ImportError:
>  pass
> @@ -1647,7 +1649,7 @@
>  else:
>  self.stream.write('\n')
>  for line in lines:
> -if with_color:
> +if with_color and pygmentspresent:
>  line = pygments.highlight(
>  line,
>  lexers.DiffLexer(),
> diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
> --- a/tests/test-run-tests.t
> +++ b/tests/test-run-tests.t
> @@ -121,6 +121,8 @@
>
>  test diff colorisation
>
> +#if pygments
> +
>$ rt test-failure.t --color always
>
>\x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc)
> @@ -138,6 +140,8 @@
>python hash seed: * (glob)
>[1]
>
> +#endif
> +
>$ rt test-failure.t 2> tmp.log
>[1]
>$ cat tmp.log
> ___
> 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 2 V3] commitextras: move fb extension to core which add extras to a commit

2017-07-17 Thread Yuya Nishihara
On Mon, 17 Jul 2017 10:17:38 -0400, Augie Fackler wrote:
> On Mon, Jul 17, 2017 at 11:10:02PM +0900, Yuya Nishihara wrote:
> > On Sat, 15 Jul 2017 01:31:23 +0530, Pulkit Goyal wrote:
> > > # HG changeset patch
> > > # User Pulkit Goyal <7895pul...@gmail.com>
> > > # Date 1499799225 -19800
> > > #  Wed Jul 12 00:23:45 2017 +0530
> > > # Node ID e51d188da49636884ae6c0df94f501e84436b857
> > > # Parent  80e1331a7fe970f3e56fde9044949d72d3afdf30
> > > # EXP-Topic fbext
> > > commitextras: move fb extension to core which add extras to a commit
> >
> > I think it's okay to start this as an extension, but I don't think this
> > extension should be advertised. So +1 for queueing this and marking it as
> > EXPERIMENTAL or ADVANCED as follow-up.
> >
> > I'm also fine with adding a hidden config knob to unblock this feature.
> 
> I'm also fine with either approach. It makes me nervous, but we
> already should be robust to corrupt extras entries in the name of
> being futureproof, so let's just proceed instead of being afraid and
> letting that hinder potential nice things.

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


Re: [PATCH 2 of 2 V3] commitextras: check the format of the arguments and no internal key is used

2017-07-17 Thread Yuya Nishihara
On Sat, 15 Jul 2017 01:31:24 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pul...@gmail.com>
> # Date 1499856010 -19800
> #  Wed Jul 12 16:10:10 2017 +0530
> # Node ID 2cbccf36af1bd0d9ae9df1ad5fd4a7f8d870ae6c
> # Parent  e51d188da49636884ae6c0df94f501e84436b857
> # EXP-Topic fbext
> commitextras: check the format of the arguments and no internal key is used

> +usedinternally = set(['amend_source', 'branch', 'histedit_source', 'topic',
> +'rebase_source', 'intermediate-source', 
> '__touch-noise__',
> +'source', 'transplant_source'])

Updated to a set literal. I found one more internal key, 'close', so added it
in flight.

>  def extsetup(ui):
>  entry = extensions.wrapcommand(commands.table, 'commit', _commit)
>  options = entry[1]
> @@ -33,7 +38,15 @@
>  extras = opts.get('extra')
>  if extras:
>  for raw in extras:
> +if '=' not in raw:
> +msg = _("unable to parse '%s', should follow "
> +"KEY=VALUE format")
> +raise error.Abort(msg % raw)
>  k, v = raw.split('=', 1)
> +if k in usedinternally:
> +msg = _("key '%s' is used internally, can't be set "
> +"manually")
> +raise error.Abort(msg % k)

Perhaps it's better to restrict k to non-empty ASCII word.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2 V3] commitextras: move fb extension to core which add extras to a commit

2017-07-17 Thread Yuya Nishihara
On Sat, 15 Jul 2017 01:31:23 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pul...@gmail.com>
> # Date 1499799225 -19800
> #  Wed Jul 12 00:23:45 2017 +0530
> # Node ID e51d188da49636884ae6c0df94f501e84436b857
> # Parent  80e1331a7fe970f3e56fde9044949d72d3afdf30
> # EXP-Topic fbext
> commitextras: move fb extension to core which add extras to a commit

> +def _commit(orig, ui, repo, *pats, **opts):
> +origcommit = repo.commit
> +try:
> +def _wrappedcommit(*innerpats, **inneropts):
> +extras = opts.get('extra')
> +if extras:
> +for raw in extras:
> +k, v = raw.split('=', 1)
> +inneropts['extra'][k] = v
> +return origcommit(*innerpats, **inneropts)
> +
> +# This __dict__ logic is needed because the normal
> +# extension.wrapfunction doesn't seem to work.
> +repo.__dict__['commit'] = _wrappedcommit
> +return orig(ui, repo, *pats, **opts)

Perhaps we'll need a hook point in command layer.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH v2] run-tests: also color the summary messages (skipped, failed...)

2017-07-17 Thread Yuya Nishihara
On Sun, 16 Jul 2017 15:12:21 +0900, mlaneuvi...@gmail.com wrote:
> # HG changeset patch
> # User Matthieu Laneuville 
> # Date 1500185462 -32400
> #  Sun Jul 16 15:11:02 2017 +0900
> # Node ID 9722bfa929b50e7ad87e0561f8d5fdd8e928d755
> # Parent  97ec8637d261a97c30944d9242ee1ccdbf536cb3
> run-tests: also color the summary messages (skipped, failed...)
> 
> diff -r 97ec8637d261 -r 9722bfa929b5 tests/run-tests.py
> --- a/tests/run-tests.py  Sun Jul 16 14:03:58 2017 +0900
> +++ b/tests/run-tests.py  Sun Jul 16 15:11:02 2017 +0900
> @@ -96,12 +96,46 @@
>  try: # is pygments installed
>  import pygments
>  import pygments.lexers as lexers
> +import pygments.lexer as lexer
>  import pygments.formatters as formatters
> +import pygments.token as token
> +import pygments.style as style
>  with_color = True
>  with_pygments = True
>  except ImportError:
>  pass
>  
> +class TestRunnerStyle(style.Style):

Still an issue. The error was that the style module was missing if pygments
couldn't be loaded.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] test-phase-exchange: stabilize for Windows

2017-07-17 Thread FUJIWARA Katsunori
At Sat, 15 Jul 2017 23:49:54 -0400,
Matt Harbison wrote:
> 
> # HG changeset patch
> # User Matt Harbison 
> # Date 1500176793 14400
> #  Sat Jul 15 23:46:33 2017 -0400
> # Node ID 21904723f1ce9ea0fc6541ee48611ba3ef7128fb
> # Parent  389536aff376d32d38f13305021c127245d4126a
> test-phase-exchange: stabilize for Windows
> 
> diff --git a/tests/test-phases-exchange.t b/tests/test-phases-exchange.t
> --- a/tests/test-phases-exchange.t
> +++ b/tests/test-phases-exchange.t
> @@ -1298,11 +1298,17 @@
>  
>  #endif
>  
> -Test that clone behaves like pull and doesn't
> -publish changesets as plain push does
> +Test that clone behaves like pull and doesn't publish changesets as plain 
> push
> +does.  The conditional output accounts for changes in the conditional block
> +above.
>  
>$ hg -R Upsilon phase -q --force --draft 2
>test-debug-phase: move rev 2: 0 -> 1
> +  test-debug-phase: move rev 3: 0 -> 1 (unix-permissions no-root !)
> +  test-debug-phase: move rev 7: 0 -> 1 (unix-permissions no-root !)
> +  test-debug-phase: move rev 8: 0 -> 1 (unix-permissions no-root !)
> +  test-debug-phase: move rev 9: 0 -> 1 (unix-permissions no-root !)
> +

According to commit log of 4eec2f04a672, "(unix-permissions no-root !)"
marking means:

  - this line is required, if "unix-permissions no-root" is satisfied
  - this line is optional, otherwise

AFAIK, additional lines above appear:

  - not on POSIX, on which "unix-permissions no-root" is satisfied
  - but on windows, on which it isn't

Therefore, I expect this change to cause:

  - failure on POSIX, because all required lines disappear
  - success on Windows, because all optional lines appear

But in practice, this change doesn't cause failure on POSIX.

For more simple example, I expect that test script below fails,
because "true" command generate no output, even though "foobar" output
is always expected ("true" feature is always available). But it
doesn't fail in practice.

  
$ true
foobar (true !)
  

What do I misunderstand about "(feature !)" ?


BTW, it seems bug of run-tests.py that "(unknown-feature !)" doesn't
cause failure.


>$ hg clone -q Upsilon Pi -r 7
>test-debug-phase: new rev 0:  x -> 0
>test-debug-phase: new rev 1:  x -> 0
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

-- 
--
[FUJIWARA Katsunori] fo...@lares.dti.ne.jp
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH V4] status: add a flag to terse the output (issue4119)

2017-07-17 Thread Augie Fackler
On Fri, Jul 14, 2017 at 12:28:17AM +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pul...@gmail.com>
> # Date 1497710422 -19800
> #  Sat Jun 17 20:10:22 2017 +0530
> # Node ID d2f046b37522465606f3824d663ece2608f0a23d
> # Parent  50243c975fc2ee605ebac493f4ab18d37117e46a
> # EXP-Topic tersestatus
> status: add a flag to terse the output (issue4119)

queued, thanks

I'm a little bummed at how complicated this turned out to be, but I'm
not convinced that only supporting tersing of unknown states (which I
suspect is the only common use case of this feature) would be
significantly simpler. :/ If we end up figuring out a better tradeoff
that requires removing some functionality, I'm fine with that given
the experimental nature of the feature.

One thing that'd be glorious to thread through in the future would be
a way to elide walking directories that we know will be shown as ? as
soon as we find a ? file in a directory that can't have any other
status (eg no tracked files in that dir and --ignore not set), as that
could stand to be an _enormous_ performance win for `hg status` when
ignores are incomplete.

>
> This adds an experimental flag -t/--terse which will terse the output. The 
> terse flag
> will respect other flags which filters the output. The flag takes a string
> whose value can be a subsequence of "marduic" (the order does not matter 
> here.)
>
> Ignored files are not considered while tersing unless -i flag is passed or 'i'
> is there is the terse flag value.
>
> The flag is experimental for testing as there may be cases which will produce
> strange results with the flag. We can set the terse on by default by simply
> passing 'u' to the cmdutil.tersestatus().
>
> This patch also adds a test file with tests covering the new feature.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: Community video chats?

2017-07-17 Thread Durham Goode

Yep, I'll attend.

On 7/15/17 11:02 PM, Phillip Cohen wrote:

I'll be on PTO in the mountains then (and I think Durham is in London,
but he might still be able to attend), but I hope it goes well (and
hopefully somebody takes notes :).

On Sat, Jul 15, 2017 at 3:25 AM, Boris Feld  wrote:

I've put a reminder in my calendar for 19pm paris time.

On Fri, 2017-07-14 at 20:00 -0400, Augie Fackler wrote:

Yes, that's right.

On Jul 14, 2017 7:40 PM, "Sean Farley"  wrote:


Augie Fackler  writes:


On Jul 13, 2017, at 04:17, Boris Feld  wrote:

On Tue, 2017-07-11 at 16:08 -0400, Augie Fackler wrote:

On Jul 11, 2017, at 15:47, Phillip Cohen 
wrote:

Great, glad there's interest.

How would Thursday at 10am PST / 1pm EST  / 6pm UTC work? This is
early enough for London to join, but not too early that California
won't. Friday mornings are less desirable (because that's Friday
evening in London) but Monday and Tuesday morning could work as
well.


I can't do 1300-1500 America/New_York on Thursdays. Pretty much any
other time in the week would work. Maybe shoot for Tuesdays?



I'm also interested, 6pm UTC (5pm or 7pm could works too) on every day
except Tuesdays would works for me with a preference for Thursday.


I've blocked off 1300-1430 America/New_York on the 19th for a test run of
this.


That's 10am-11:30am for us in San Francisco, right? If so, then I've
also put this in my calendar.


___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=nuarHzhP1wi1T9iURRCj1A&m=N9nEb_0zJwOjAlQrnQ2UvU_XmsRXCwQxbcVKXOxv0kY&s=CQDg7IFNYr5XEOubKwm8xnbUEGJRcaffQFB1EaGeJHM&e=


___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=nuarHzhP1wi1T9iURRCj1A&m=N9nEb_0zJwOjAlQrnQ2UvU_XmsRXCwQxbcVKXOxv0kY&s=CQDg7IFNYr5XEOubKwm8xnbUEGJRcaffQFB1EaGeJHM&e=


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


Re: Potential BC changes to sparse before freeze

2017-07-17 Thread Gregory Szorc


> On Jul 17, 2017, at 07:10, Augie Fackler  wrote:
> 
>> On Sat, Jul 15, 2017 at 03:15:08PM -0700, Sean Farley wrote:
>> 
>> Gregory Szorc  writes:
>> 
 On Sat, Jul 15, 2017 at 1:28 PM, Sean Farley  wrote:
 
 
 Martin von Zweigbergk via Mercurial-devel >>> scm.org> writes:
 
>>> It's worth noting that sparse profiles today can contain "set:" entries to
>>> yield the power of filesets (the matcher constructor automatically
>>> recognizes the type of pattern). What we can't do is change how [include]
>>> and [exclude] interact with each other.
>> 
>> Perhaps this is specialized / nuanced enough that I don't quite follow;
>> but that's fine. All I wanted to do is point out similar, existing
>> behavior. If that's already been considered and deemed not suitable,
>> then ok with me.
> 
> We tried using straight filesets for narrowhg's include/exclude logic,
> and it was thornier than we'd have liked. So far being a little more
> restrictive has simplified both server implementations *and* not
> caused any end-user problems.

Would the concerns apply if the fileset were limited to basic operators (+ - & 
!) and pattern matching (glob and re)?

That's a good point on server implementations: reinventing a query language 
parser is a bit of scope bloat.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: Potential BC changes to sparse before freeze

2017-07-17 Thread Martin von Zweigbergk via Mercurial-devel
On Mon, Jul 17, 2017 at 8:58 AM, Gregory Szorc  wrote:
>
>
>> On Jul 17, 2017, at 07:10, Augie Fackler  wrote:
>>
>>> On Sat, Jul 15, 2017 at 03:15:08PM -0700, Sean Farley wrote:
>>>
>>> Gregory Szorc  writes:
>>>
> On Sat, Jul 15, 2017 at 1:28 PM, Sean Farley  wrote:
>
>
> Martin von Zweigbergk via Mercurial-devel  scm.org> writes:
>
 It's worth noting that sparse profiles today can contain "set:" entries to
 yield the power of filesets (the matcher constructor automatically
 recognizes the type of pattern). What we can't do is change how [include]
 and [exclude] interact with each other.
>>>
>>> Perhaps this is specialized / nuanced enough that I don't quite follow;
>>> but that's fine. All I wanted to do is point out similar, existing
>>> behavior. If that's already been considered and deemed not suitable,
>>> then ok with me.
>>
>> We tried using straight filesets for narrowhg's include/exclude logic,
>> and it was thornier than we'd have liked. So far being a little more
>> restrictive has simplified both server implementations *and* not
>> caused any end-user problems.
>
> Would the concerns apply if the fileset were limited to basic operators (+ - 
> & !) and pattern matching (glob and re)?

I think we can use the same syntax for sparse and narrow but have
different restrictions on allowed patterns. Narrow should probably not
support glob and re.

Concerns that narrowhg has that sparse doesn't:

* The required parent directories needs to be well-defined. The client
and server need to agree on what parent directories are needed. This
means that patterns like "**/*.c" will work for reducing number of
filelogs, but not manifest logs. That can still be useful, depending
on how many directories you have. Importantly, the server and client
also need to not change their opinion about what directories are
needed over time. Specifically, if a visitdir() is not currently
optimized for a certain pattern, it can never be in the future either
(if it was one of the patterns we supported with narrow). Therefore, I
think we should be careful to explicitly support a very limited subset
of patterns once we add support for narrow in core. Regular
expressions and globs should probably not be allowed.

* The patterns have to be consistent across all versions (narrowhg
doesn't support having a the manifest/file at a on revision and not at
another). If we want to read patterns from versioned files, we'd
probably want to union the includes and across all versions.

>
> That's a good point on server implementations: reinventing a query language 
> parser is a bit of scope bloat.
> ___
> 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: Experimenting with Phabricator for reviews

2017-07-17 Thread Kevin Bullock
> On Jul 15, 2017, at 11:42, Augie Fackler  wrote:
> 
>> On Jul 14, 2017, at 7:30 PM, Sean Farley  wrote:
>> 
>> Jun Wu  writes:
>> 
>>> Excerpts from Sean Farley's message of 2017-07-14 16:26:34 -0700:
 Huh? But that's the thing, isn't it? Previously, comments about code
 review are on the list. One can peruse them at leisure or archive /
 skip, etc. What you're saying, if I'm not mistaken, is that some
 comments (no matter the content) will no longer be on the list. That
 makes perusing them now split into two locations.
>>> 
>>> I think what I suggested is to move those emails to another list. So if
>>> people want to read them in an email client, they will still be able to.
>> 
>> Ah, yes, I was confused about your /dev/null comment. I see now; sorry
>> for the confusion.
>> 
>> Though, I'm not thrilled about the idea of another list but that's
>> another discussion.
> 
> I’m extremely resistant to the idea that we should move the phabricator 
> emails - I’d rather we figure out how to get them to behave so that we don’t 
> fracture our review community.

I've just made some tweaks to the mercurial-devel e-mail notification settings 
in Phabricator to have it add Re: to comments, and remove the annoying 
[Commented On], [Accepted], etc. from the subject lines. I think it will still 
add [Differential] to the subject line; if I can convince it to stop doing that 
too, I will.

To clarify, the only e-mails Phabricator should currently be sending to the 
list are when a review is opened, commented on, updated (new diff uploaded), or 
closed. (This was already the case before the tweaks I made today.) I'd prefer 
to keep all of those e-mails coming to the list, because it exactly mirrors 
what happens with e-mail-based patch review. As long as we can tune the format 
of the notifications, I think it's reasonable to have that set come to the list.

To select what e-mails you personally want to receive from Phabricator, go to 
"Email Preferences" in your settings: 


pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

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


Re: [Differential] D107: util: remove dead code which used to be for old python2 versions

2017-07-17 Thread alex_gaynor (Alex Gaynor)
alex_gaynor created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS

Index: mercurial/util.py
===
--- mercurial/util.py
+++ mercurial/util.py
@@ -295,16 +295,10 @@
 try:
 buffer = buffer
 except NameError:
-if not pycompat.ispy3:
-def buffer(sliceable, offset=0, length=None):
-if length is not None:
-return sliceable[offset:offset + length]
-return sliceable[offset:]
-else:
-def buffer(sliceable, offset=0, length=None):
-if length is not None:
-return memoryview(sliceable)[offset:offset + length]
-return memoryview(sliceable)[offset:]
+def buffer(sliceable, offset=0, length=None):
+if length is not None:
+return memoryview(sliceable)[offset:offset + length]
+return memoryview(sliceable)[offset:]
 
 closefds = pycompat.osname == 'posix'
 


EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: Potential BC changes to sparse before freeze

2017-07-17 Thread Gregory Szorc


> On Jul 11, 2017, at 11:01, Gregory Szorc  wrote:
> 
> Durham, et al:
> 
> 4.3 freeze is in a few days. While we have declared sparse as an experimental 
> feature and not subject to BC, shipping in 4.3 means someone will inevitably 
> use it and be impacted by future BC. (Probably Mozilla for Firefox CI). I'd 
> like to get in as much BC before 4.3 as possible.
> 
> Here are some changes I'm proposing. Are any of them too controversial?
> 
> * Require a [section] in sparse config files. Right now, if there is no 
> section, entries go in [includes]. I think less magic is better. This could 
> break sparse profiles in old revisions in repos using sparse today. Should be 
> easy to monkeypatch over in an extension if you need old behavior. Or we 
> could add a function argument to control parsing strictness.
> 
> * Remove requirement that [excludes] come after [includes]. This seems 
> arbitrary. Requirement may stem from implicit default [includes] section. I 
> doubt this will cause real world bustage.
> 
> * Add a repo requirement to use sparse and add the requirement when sparse is 
> activated on a repo. The way it is today, if you enable sparse then use an 
> old hg or an hg without sparse enabled, the sparse-less hg sees an incomplete 
> working directory and reports a bunch of missing files. Not cool. It feels 
> like we need to lock out clients that aren't sparse aware from interacting 
> with a working directory that has sparse enabled.

I didn't have time for implementing the requirement last week or over the 
weekend. But I think it is critical we ship sparse with it. I'll try to hack up 
patches today. If I don't make it before freeze, expect patches against stable.

> 
> I'm also thinking about potentially massive changes to how sparse configs 
> work. Namely, I'd like to unify the file format with hgrc so we don't have 
> N+1 config file formats. That's obviously a massive BC break. And I'm not 
> sure we could land a refactor before the freeze. So we may have to deal with 
> the BC hit in the future.
> 
> Again, I'm trying to walk a tight rope between what is best for Mercurial and 
> that doesn't inconvenience existing sparse users (notably Facebook). I'll try 
> to formulate any patches that make BC changes in such a way that old behavior 
> can be restored easily via an extension.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: Potential BC changes to sparse before freeze

2017-07-17 Thread Augie Fackler

> On Jul 17, 2017, at 12:57, Gregory Szorc  wrote:
> 
> 
> 
>> On Jul 11, 2017, at 11:01, Gregory Szorc  wrote:
>> 
>> Durham, et al:
>> 
>> 4.3 freeze is in a few days. While we have declared sparse as an 
>> experimental feature and not subject to BC, shipping in 4.3 means someone 
>> will inevitably use it and be impacted by future BC. (Probably Mozilla for 
>> Firefox CI). I'd like to get in as much BC before 4.3 as possible.
>> 
>> Here are some changes I'm proposing. Are any of them too controversial?
>> 
>> * Require a [section] in sparse config files. Right now, if there is no 
>> section, entries go in [includes]. I think less magic is better. This could 
>> break sparse profiles in old revisions in repos using sparse today. Should 
>> be easy to monkeypatch over in an extension if you need old behavior. Or we 
>> could add a function argument to control parsing strictness.
>> 
>> * Remove requirement that [excludes] come after [includes]. This seems 
>> arbitrary. Requirement may stem from implicit default [includes] section. I 
>> doubt this will cause real world bustage.
>> 
>> * Add a repo requirement to use sparse and add the requirement when sparse 
>> is activated on a repo. The way it is today, if you enable sparse then use 
>> an old hg or an hg without sparse enabled, the sparse-less hg sees an 
>> incomplete working directory and reports a bunch of missing files. Not cool. 
>> It feels like we need to lock out clients that aren't sparse aware from 
>> interacting with a working directory that has sparse enabled.
> 
> I didn't have time for implementing the requirement last week or over the 
> weekend. But I think it is critical we ship sparse with it. I'll try to hack 
> up patches today. If I don't make it before freeze, expect patches against 
> stable.

Agreed that this is important. Freeze is later today probably, but I'll 
definitely queue this afterwards if need be.

> 
>> 
>> I'm also thinking about potentially massive changes to how sparse configs 
>> work. Namely, I'd like to unify the file format with hgrc so we don't have 
>> N+1 config file formats. That's obviously a massive BC break. And I'm not 
>> sure we could land a refactor before the freeze. So we may have to deal with 
>> the BC hit in the future.
>> 
>> Again, I'm trying to walk a tight rope between what is best for Mercurial 
>> and that doesn't inconvenience existing sparse users (notably Facebook). 
>> I'll try to formulate any patches that make BC changes in such a way that 
>> old behavior can be restored easily via an extension.
> ___
> 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: Potential BC changes to sparse before freeze

2017-07-17 Thread Martin von Zweigbergk via Mercurial-devel
On Mon, Jul 17, 2017 at 9:57 AM, Gregory Szorc  wrote:
>
>
>> On Jul 11, 2017, at 11:01, Gregory Szorc  wrote:
>>
>> Durham, et al:
>>
>> 4.3 freeze is in a few days. While we have declared sparse as an 
>> experimental feature and not subject to BC, shipping in 4.3 means someone 
>> will inevitably use it and be impacted by future BC. (Probably Mozilla for 
>> Firefox CI). I'd like to get in as much BC before 4.3 as possible.
>>
>> Here are some changes I'm proposing. Are any of them too controversial?
>>
>> * Require a [section] in sparse config files. Right now, if there is no 
>> section, entries go in [includes]. I think less magic is better. This could 
>> break sparse profiles in old revisions in repos using sparse today. Should 
>> be easy to monkeypatch over in an extension if you need old behavior. Or we 
>> could add a function argument to control parsing strictness.
>>
>> * Remove requirement that [excludes] come after [includes]. This seems 
>> arbitrary. Requirement may stem from implicit default [includes] section. I 
>> doubt this will cause real world bustage.
>>
>> * Add a repo requirement to use sparse and add the requirement when sparse 
>> is activated on a repo. The way it is today, if you enable sparse then use 
>> an old hg or an hg without sparse enabled, the sparse-less hg sees an 
>> incomplete working directory and reports a bunch of missing files. Not cool. 
>> It feels like we need to lock out clients that aren't sparse aware from 
>> interacting with a working directory that has sparse enabled.
>
> I didn't have time for implementing the requirement last week or over the 
> weekend. But I think it is critical we ship sparse with it. I'll try to hack 
> up patches today. If I don't make it before freeze, expect patches against 
> stable.

I spent some minutes trying to see if I could make an empty sparse
config imply matching of no files, but it was unclear how to
distinguish empty config from "sparse not used". That will be clear
after you add the repo requirement. If you don't do it as part of your
series, I'll do it on top.

>
>>
>> I'm also thinking about potentially massive changes to how sparse configs 
>> work. Namely, I'd like to unify the file format with hgrc so we don't have 
>> N+1 config file formats. That's obviously a massive BC break. And I'm not 
>> sure we could land a refactor before the freeze. So we may have to deal with 
>> the BC hit in the future.
>>
>> Again, I'm trying to walk a tight rope between what is best for Mercurial 
>> and that doesn't inconvenience existing sparse users (notably Facebook). 
>> I'll try to formulate any patches that make BC changes in such a way that 
>> old behavior can be restored easily via an extension.
> ___
> 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@33491: 12 new changesets

2017-07-17 Thread Mercurial Commits
12 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/ef54789a947d
changeset:   33480:ef54789a947d
user:Boris Feld 
date:Mon Jul 10 17:01:34 2017 +0200
summary: bookmark: introduce a 'applychanges' function to gather bookmark 
movement

https://www.mercurial-scm.org/repo/hg/rev/67b5f81f17cf
changeset:   33481:67b5f81f17cf
user:Boris Feld 
date:Mon Jul 10 17:04:16 2017 +0200
summary: bookmark: use 'applychanges' for bookmark deletion

https://www.mercurial-scm.org/repo/hg/rev/916d4cde530e
changeset:   33482:916d4cde530e
user:Boris Feld 
date:Mon Jul 10 17:08:20 2017 +0200
summary: bookmark: use 'applychanges' for bookmark renaming

https://www.mercurial-scm.org/repo/hg/rev/146c0371eadf
changeset:   33483:146c0371eadf
user:Boris Feld 
date:Mon Jul 10 17:10:56 2017 +0200
summary: bookmark: use 'applychanges' for adding new bookmark

https://www.mercurial-scm.org/repo/hg/rev/2a8ce4e79a47
changeset:   33484:2a8ce4e79a47
user:Boris Feld 
date:Mon Jul 10 17:22:17 2017 +0200
summary: bookmark: use 'applychanges' when updating from a remote

https://www.mercurial-scm.org/repo/hg/rev/505021482541
changeset:   33485:505021482541
user:Boris Feld 
date:Mon Jul 10 17:24:28 2017 +0200
summary: bookmark: use 'applychanges' when updating a bookmark through 
pushkey

https://www.mercurial-scm.org/repo/hg/rev/af402f11cb9d
changeset:   33486:af402f11cb9d
user:Boris Feld 
date:Mon Jul 10 17:28:53 2017 +0200
summary: bookmark: use 'applychanges' when updating bookmark in histedit

https://www.mercurial-scm.org/repo/hg/rev/a050d37c2c70
changeset:   33487:a050d37c2c70
user:Boris Feld 
date:Mon Jul 10 17:30:20 2017 +0200
summary: bookmark: use 'applychanges' in the convert extension

https://www.mercurial-scm.org/repo/hg/rev/eb344bbac18c
changeset:   33488:eb344bbac18c
user:Boris Feld 
date:Mon Jul 10 17:37:48 2017 +0200
summary: bookmark: use 'applychanges' when stripping

https://www.mercurial-scm.org/repo/hg/rev/870560c759ed
changeset:   33489:870560c759ed
user:Boris Feld 
date:Mon Jul 10 17:44:25 2017 +0200
summary: bookmark: use 'applychanges' in the mq extension

https://www.mercurial-scm.org/repo/hg/rev/902fe63954a9
changeset:   33490:902fe63954a9
user:Boris Feld 
date:Mon Jul 10 17:46:47 2017 +0200
summary: bookmark: use 'applychanges' in 'repair.strip'

https://www.mercurial-scm.org/repo/hg/rev/1adcb594eb6b
changeset:   33491:1adcb594eb6b
bookmark:@
tag: tip
user:Boris Feld 
date:Mon Jul 10 19:40:23 2017 +0200
summary: bookmarks: use 'applychanges' for bookmark update

-- 
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: [Differential] D107: util: remove dead code which used to be for old python2 versions

2017-07-17 Thread indygreg (Gregory Szorc)
indygreg added a comment.


  It's worth noting that in theory it should be possible to transition from 
buffer to memoryview. However, there are various bugs in various Python 2 
versions where memoryview isn't accepted. Most notable is that the zlib module 
doesn't accept memoryview until Python 3 IIRC. So we're stuck with buffer for a 
while :/

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: [PATCH 2 of 3] transaction-summary: display the summary for all transactions

2017-07-17 Thread Martin von Zweigbergk via Mercurial-devel
On Sun, Jul 16, 2017 at 2:21 AM, Boris Feld  wrote:
> # HG changeset patch
> # User Boris Feld 
> # Date 1500164406 -7200
> #  Sun Jul 16 02:20:06 2017 +0200
> # Node ID 8df908eb63b41ebef19e71f4f3f0085be4e6f8b3
> # Parent  ed5dfde9455a023b9b26152ee55ade0085b5516a
> # EXP-Topic tr.report
> transaction-summary: display the summary for all transactions
>
> Now that we records "all" changes happening in a transaction (in tr.changes)
> we will be able to provide better report on various changes (phases turned
> public, changeset obsoleted, branch merged or created, etc..)
>
> This is far too late in the cycle to play with this, but having this existing
> method called more widely will help extensions to play around with various
> options during the 4.4 cycle.
>
> Instead of calling registersummarycallback only for transactions we want, we
> always call it and use the transaction name to decide when to report (eg: we
> do not want `hg amend` to report new obsoleted changesets). Filtering on
> transaction name does not seems great, but seems good enough for the moment.
> We can change the API during the next cycle.

changegroup.apply() uses tr.hookargs['source'] for this. Should we add
a "source" argument to localrepo.transaction() and maybe store it on
the transaction object itself, so we don't have to do this weird
prefix matching here and reaching into hookargs in cg.apply()? OTOH, I
think behaving differently depending on who your caller is is a little
unusual too, so maybe we should find a better way of passing down the
information of what the caller wants (not who the caller is). But I do
see the simplicity of the current approach, so I'm not sure.

>
> The previous manual call during unbundling of the bundle2 "obsmarkers" part is
> no longer necessary and has been dropped.
>
> diff -r ed5dfde9455a -r 8df908eb63b4 mercurial/bundle2.py
> --- a/mercurial/bundle2.py  Sun Jul 16 02:38:14 2017 +0200
> +++ b/mercurial/bundle2.py  Sun Jul 16 02:20:06 2017 +0200
> @@ -161,7 +161,6 @@
>  phases,
>  pushkey,
>  pycompat,
> -scmutil,
>  tags,
>  url,
>  util,
> @@ -1814,7 +1813,6 @@
>  if new:
>  op.repo.ui.status(_('%i new obsolescence markers\n') % new)
>  op.records.add('obsmarkers', {'new': new})
> -scmutil.registersummarycallback(op.repo, tr)
>  if op.reply is not None:
>  rpart = op.reply.newpart('reply:obsmarkers')
>  rpart.addparam('in-reply-to', str(inpart.id), mandatory=False)
> diff -r ed5dfde9455a -r 8df908eb63b4 mercurial/localrepo.py
> --- a/mercurial/localrepo.pySun Jul 16 02:38:14 2017 +0200
> +++ b/mercurial/localrepo.pySun Jul 16 02:20:06 2017 +0200
> @@ -1092,6 +1092,7 @@
>  raise error.ProgrammingError('transaction requires locking')
>  tr = self.currenttransaction()
>  if tr is not None:
> +scmutil.registersummarycallback(self, tr, desc)
>  return tr.nest()
>
>  # abort here if the journal already exists
> @@ -1247,6 +1248,7 @@
>  # to stored data if transaction has no error.
>  tr.addpostclose('refresh-filecachestats', 
> self._refreshfilecachestats)
>  self._transref = weakref.ref(tr)
> +scmutil.registersummarycallback(self, tr, desc)
>  return tr
>
>  def _journalfiles(self):
> diff -r ed5dfde9455a -r 8df908eb63b4 mercurial/scmutil.py
> --- a/mercurial/scmutil.py  Sun Jul 16 02:38:14 2017 +0200
> +++ b/mercurial/scmutil.py  Sun Jul 16 02:20:06 2017 +0200
> @@ -1080,14 +1080,25 @@
>  with self.vfs(self.path, mode='wb', atomictemp=True) as fp:
>  fp.write(''.join(lines))
>
> -def registersummarycallback(repo, otr):
> +_reportobsoletedsource = [
> +'pull',
> +'push',
> +'serve',
> +'unbundle',
> +]
> +
> +def registersummarycallback(repo, otr, txnname=''):
>  """register a callback to issue a summary after the transaction is closed
>  """
> -reporef = weakref.ref(repo)
> -def reportsummary(tr):
> -"""the actual callback reporting the summary"""
> -repo = reporef()
> -obsoleted = obsutil.getobsoleted(repo, tr)
> -if obsoleted:
> -repo.ui.status(_('obsoleted %i changesets\n') % len(obsoleted))
> -otr.addpostclose('00-txnreport', reportsummary)
> +for source in _reportobsoletedsource:
> +if txnname.startswith(source):
> +reporef = weakref.ref(repo)
> +def reportsummary(tr):
> +"""the actual callback reporting the summary"""
> +repo = reporef()
> +obsoleted = obsutil.getobsoleted(repo, tr)
> +if obsoleted:
> +repo.ui.status(_('obsoleted %i changesets\n')
> +   % len(obsoleted))
> +otr.addpostclose('00-txnreport', reportsummary)
> +break
> ___
> Mercurial-devel mailing list
> Mercurial-de

Re: [Differential] D107: util: remove dead code which used to be for old python2 versions

2017-07-17 Thread alex_gaynor (Alex Gaynor)
alex_gaynor added a comment.


  @indygreg good flag, @durin42 and I had been discussing the "always use 
`memoryview`" as a potential follow up patch.
  
  For now this just deletes some dead code.

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: [PATCH 2 of 3] transaction-summary: display the summary for all transactions

2017-07-17 Thread Martin von Zweigbergk via Mercurial-devel
On Mon, Jul 17, 2017 at 10:35 AM, Martin von Zweigbergk
 wrote:
> On Sun, Jul 16, 2017 at 2:21 AM, Boris Feld  wrote:
>> # HG changeset patch
>> # User Boris Feld 
>> # Date 1500164406 -7200
>> #  Sun Jul 16 02:20:06 2017 +0200
>> # Node ID 8df908eb63b41ebef19e71f4f3f0085be4e6f8b3
>> # Parent  ed5dfde9455a023b9b26152ee55ade0085b5516a
>> # EXP-Topic tr.report
>> transaction-summary: display the summary for all transactions
>>
>> Now that we records "all" changes happening in a transaction (in tr.changes)
>> we will be able to provide better report on various changes (phases turned
>> public, changeset obsoleted, branch merged or created, etc..)
>>
>> This is far too late in the cycle to play with this, but having this existing
>> method called more widely will help extensions to play around with various
>> options during the 4.4 cycle.
>>
>> Instead of calling registersummarycallback only for transactions we want, we
>> always call it and use the transaction name to decide when to report (eg: we
>> do not want `hg amend` to report new obsoleted changesets). Filtering on
>> transaction name does not seems great, but seems good enough for the moment.
>> We can change the API during the next cycle.
>
> changegroup.apply() uses tr.hookargs['source'] for this. Should we add
> a "source" argument to localrepo.transaction() and maybe store it on
> the transaction object itself, so we don't have to do this weird
> prefix matching here and reaching into hookargs in cg.apply()? OTOH, I
> think behaving differently depending on who your caller is is a little
> unusual too, so maybe we should find a better way of passing down the
> information of what the caller wants (not who the caller is). But I do
> see the simplicity of the current approach, so I'm not sure.

Concretely, I suppose the current approach means that any extensions
that start a transaction and then run e.g. unbundle will no longer get
the summary report. They can of course easily add themselves to
_reportobsoletedsource if they do want that report, so it's not a big
deal.

>
>>
>> The previous manual call during unbundling of the bundle2 "obsmarkers" part 
>> is
>> no longer necessary and has been dropped.
>>
>> diff -r ed5dfde9455a -r 8df908eb63b4 mercurial/bundle2.py
>> --- a/mercurial/bundle2.py  Sun Jul 16 02:38:14 2017 +0200
>> +++ b/mercurial/bundle2.py  Sun Jul 16 02:20:06 2017 +0200
>> @@ -161,7 +161,6 @@
>>  phases,
>>  pushkey,
>>  pycompat,
>> -scmutil,
>>  tags,
>>  url,
>>  util,
>> @@ -1814,7 +1813,6 @@
>>  if new:
>>  op.repo.ui.status(_('%i new obsolescence markers\n') % new)
>>  op.records.add('obsmarkers', {'new': new})
>> -scmutil.registersummarycallback(op.repo, tr)
>>  if op.reply is not None:
>>  rpart = op.reply.newpart('reply:obsmarkers')
>>  rpart.addparam('in-reply-to', str(inpart.id), mandatory=False)
>> diff -r ed5dfde9455a -r 8df908eb63b4 mercurial/localrepo.py
>> --- a/mercurial/localrepo.pySun Jul 16 02:38:14 2017 +0200
>> +++ b/mercurial/localrepo.pySun Jul 16 02:20:06 2017 +0200
>> @@ -1092,6 +1092,7 @@
>>  raise error.ProgrammingError('transaction requires locking')
>>  tr = self.currenttransaction()
>>  if tr is not None:
>> +scmutil.registersummarycallback(self, tr, desc)
>>  return tr.nest()
>>
>>  # abort here if the journal already exists
>> @@ -1247,6 +1248,7 @@
>>  # to stored data if transaction has no error.
>>  tr.addpostclose('refresh-filecachestats', 
>> self._refreshfilecachestats)
>>  self._transref = weakref.ref(tr)
>> +scmutil.registersummarycallback(self, tr, desc)
>>  return tr
>>
>>  def _journalfiles(self):
>> diff -r ed5dfde9455a -r 8df908eb63b4 mercurial/scmutil.py
>> --- a/mercurial/scmutil.py  Sun Jul 16 02:38:14 2017 +0200
>> +++ b/mercurial/scmutil.py  Sun Jul 16 02:20:06 2017 +0200
>> @@ -1080,14 +1080,25 @@
>>  with self.vfs(self.path, mode='wb', atomictemp=True) as fp:
>>  fp.write(''.join(lines))
>>
>> -def registersummarycallback(repo, otr):
>> +_reportobsoletedsource = [
>> +'pull',
>> +'push',
>> +'serve',
>> +'unbundle',
>> +]
>> +
>> +def registersummarycallback(repo, otr, txnname=''):
>>  """register a callback to issue a summary after the transaction is 
>> closed
>>  """
>> -reporef = weakref.ref(repo)
>> -def reportsummary(tr):
>> -"""the actual callback reporting the summary"""
>> -repo = reporef()
>> -obsoleted = obsutil.getobsoleted(repo, tr)
>> -if obsoleted:
>> -repo.ui.status(_('obsoleted %i changesets\n') % len(obsoleted))
>> -otr.addpostclose('00-txnreport', reportsummary)
>> +for source in _reportobsoletedsource:
>> +if txnname.startswith(source):
>> +reporef = weakref.ref(repo)
>> +def reportsummary(tr):
>> +"""the actual

Re: [PATCH 9 of 9] color: drop the now useless color extension

2017-07-17 Thread Sean Farley

Augie Fackler  writes:

> On Sun, Jul 16, 2017 at 03:27:31PM -0700, Sean Farley wrote:
>>
>> Boris Feld  writes:
>>
>> > # HG changeset patch
>> > # User Boris Feld 
>> > # Date 1500121055 -7200
>> > #  Sat Jul 15 14:17:35 2017 +0200
>> > # Node ID bb3703129b5035a162fd8ad8eee364295b9ce9d0
>> > # Parent  f170c4ba9c21f40248b83b511e064474080a0060
>> > # EXP-Topic cleanup.color
>> > color: drop the now useless color extension
>> >
>> > all the extension features are provided by core since 4.2.
>>
>> Not sure we should drop this so soon. I'll defer on this one since it's
>> close to the freeze (and there's no harm leaving it in).
>
> Eh, it's dropping a noop in the way we've dropped other dead
> extensions, it's relatively low risk. We can always back it out in the
> unlikely event we see a problem.
>
> Queued.

Fair enough :-)


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


Re: [PATCH 2 of 2] archive: add an experimental config to control the metadata file template

2017-07-17 Thread Martin von Zweigbergk via Mercurial-devel
On Sun, Jul 16, 2017 at 9:57 PM, Matt Harbison  wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1500266969 14400
> #  Mon Jul 17 00:49:29 2017 -0400
> # Node ID a85b7c754630cb4ac49b2cebea0ceca3d2f2eaaa
> # Parent  4d37def90ad5e0196dadb9bc2c9e62effad63691
> archive: add an experimental config to control the metadata file template
>
> Experimental because given the possible complexity, it may be worth figuring 
> out
> how to load this from a file, similar to the style files for the log command,
> instead of trying to stuff it on the command line.
>
> diff --git a/mercurial/archival.py b/mercurial/archival.py
> --- a/mercurial/archival.py
> +++ b/mercurial/archival.py
> @@ -99,7 +99,8 @@
>  )
>
>  opts = {
> -'template': default
> +'template': repo.ui.config('experimental', 'archivemetatemplate',
> +   default)

I think this should be registered with the new coreconfigitem() method
(other experimental options are).
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH] win32: copy-edit debugssl messages to match prevailing style

2017-07-17 Thread Kevin Bullock
# HG changeset patch
# User Kevin Bullock 
# Date 1500315779 18000
#  Mon Jul 17 13:22:59 2017 -0500
# Node ID dcd0c87ef9e443e612e3b7eb4e1d7406df9549be
# Parent  9a2ee9591acc4d5f5ab6bbb7054cb62cb5f29a62
win32: copy-edit debugssl messages to match prevailing style

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -2074,7 +2074,7 @@ def debugssl(ui, repo, source=None, **op
 of the SSL error is likely another issue.
 '''
 if pycompat.osname != 'nt':
-raise error.Abort(_('Certificate chain building is only possible on '
+raise error.Abort(_('certificate chain building is only possible on '
 'Windows'))
 
 if not source:
@@ -2092,7 +2092,7 @@ def debugssl(ui, repo, source=None, **op
 elif url.scheme == 'ssh':
 addr = (url.host, url.port or 22)
 else:
-raise error.Abort(_("Only https and ssh connections are supported"))
+raise error.Abort(_("only https and ssh connections are supported"))
 
 from . import win32
 
@@ -2103,19 +2103,19 @@ def debugssl(ui, repo, source=None, **op
 s.connect(addr)
 cert = s.getpeercert(True)
 
-ui.status(_('Checking the certificate chain for %s.\n') % url.host)
+ui.status(_('checking the certificate chain for %s\n') % url.host)
 
 complete = win32.checkcertificatechain(cert, build=False)
 
 if not complete:
-ui.status(_('The certificate chain is incomplete.  Updating... '))
+ui.status(_('certificate chain is incomplete, updating... '))
 
 if not win32.checkcertificatechain(cert):
-ui.status(_('Failed.\n'))
+ui.status(_('failed.\n'))
 else:
-ui.status(_('Done.\n'))
+ui.status(_('done.\n'))
 else:
-ui.status(_('The full certificate chain is available.\n'))
+ui.status(_('full certificate chain is available\n'))
 finally:
 s.close()
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D59: sparse: override dirstate.walk() instead of dirstate._ignore

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG258298f4712b: sparse: override dirstate.walk() instead of 
dirstate._ignore (authored by martinvonz).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D59?vs=77&id=206

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

AFFECTED FILES
  hgext/sparse.py
  tests/test-sparse.t

CHANGE DETAILS

diff --git a/tests/test-sparse.t b/tests/test-sparse.t
--- a/tests/test-sparse.t
+++ b/tests/test-sparse.t
@@ -144,10 +144,15 @@
   M show
 
   $ hg up -qC .
+TODO: add an option to purge to also purge files outside the sparse config?
   $ hg purge --all --config extensions.purge=
   $ ls
+  hide
+  hide3
   show
   show2
+For now, manually remove the files
+  $ rm hide hide3
 
 Verify rebase temporarily includes excluded files
 
diff --git a/hgext/sparse.py b/hgext/sparse.py
--- a/hgext/sparse.py
+++ b/hgext/sparse.py
@@ -192,36 +192,11 @@
 and to prevent modifications to files outside the checkout.
 """
 
-# The atrocity below is needed to wrap dirstate._ignore. It is a cached
-# property, which means normal function wrapping doesn't work.
-class ignorewrapper(object):
-def __init__(self, orig):
-self.orig = orig
-self.origignore = None
-self.func = None
-self.sparsematch = None
-
-def __get__(self, obj, type=None):
-origignore = self.orig.__get__(obj)
+def walk(orig, self, match, subrepos, unknown, ignored, full=True):
+match = matchmod.intersectmatchers(match, self._sparsematcher)
+return orig(self, match, subrepos, unknown, ignored, full)
 
-sparsematch = obj._sparsematcher
-if sparsematch.always():
-return origignore
-
-if self.sparsematch != sparsematch or self.origignore != 
origignore:
-self.func = matchmod.unionmatcher([
-origignore, matchmod.negatematcher(sparsematch)])
-self.sparsematch = sparsematch
-self.origignore = origignore
-return self.func
-
-def __set__(self, obj, value):
-return self.orig.__set__(obj, value)
-
-def __delete__(self, obj):
-return self.orig.__delete__(obj)
-
-replacefilecache(dirstate.dirstate, '_ignore', ignorewrapper)
+extensions.wrapfunction(dirstate.dirstate, 'walk', walk)
 
 # dirstate.rebuild should not add non-matching files
 def _rebuild(orig, self, parent, allfiles, changedfiles=None):



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D60: match: remove unused negatematcher

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG80e1331a7fe9: match: remove unused negatematcher (authored 
by martinvonz).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D60?vs=130&id=205

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

AFFECTED FILES
  mercurial/match.py

CHANGE DETAILS

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -679,16 +679,6 @@
 def __repr__(self):
 return ('' % self._matchers)
 
-class negatematcher(basematcher):
-def __init__(self, matcher):
-self._matcher = matcher
-
-def matchfn(self, f):
-return not self._matcher(f)
-
-def __repr__(self):
-return ('' % self._matcher)
-
 def patkind(pattern, default=None):
 '''If pattern is 'kind:pat' with a known kind, return kind.'''
 return _patsplit(pattern, default)[0]



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D38: phabricator: allow specifying reviewers on phabsend

2017-07-17 Thread quark (Jun Wu)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb7a75b9a3386: phabricator: allow specifying reviewers on 
phabsend (authored by quark).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D38?vs=54&id=207

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

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -236,14 +236,17 @@
 }
 callconduit(ctx.repo(), 'differential.setdiffproperty', params)
 
-def createdifferentialrevision(ctx, revid=None, parentrevid=None, 
oldnode=None):
+def createdifferentialrevision(ctx, revid=None, parentrevid=None, oldnode=None,
+   actions=None):
 """create or update a Differential Revision
 
 If revid is None, create a new Differential Revision, otherwise update
 revid. If parentrevid is not None, set it as a dependency.
 
 If oldnode is not None, check if the patch content (without commit message
 and metadata) has changed before creating another diff.
+
+If actions is not None, they will be appended to the transaction.
 """
 repo = ctx.repo()
 if oldnode:
@@ -268,6 +271,9 @@
 transactions += [{'type': 'summary', 'value': summary},
  {'type': 'summary', 'value': ' '}]
 
+if actions:
+transactions += actions
+
 # Parse commit message and update related fields.
 desc = ctx.description()
 info = callconduit(repo, 'differential.parsecommitmessage',
@@ -287,8 +293,23 @@
 
 return revision
 
+def userphids(repo, names):
+"""convert user names to PHIDs"""
+query = {'constraints': {'usernames': names}}
+result = callconduit(repo, 'user.search', query)
+# username not found is not an error of the API. So check if we have missed
+# some names here.
+data = result[r'data']
+resolved = set(entry[r'fields'][r'username'] for entry in data)
+unresolved = set(names) - resolved
+if unresolved:
+raise error.Abort(_('unknown username: %s')
+  % ' '.join(sorted(unresolved)))
+return [entry[r'phid'] for entry in data]
+
 @command('phabsend',
- [('r', 'rev', [], _('revisions to send'), _('REV'))],
+ [('r', 'rev', [], _('revisions to send'), _('REV')),
+  ('', 'reviewer', [], _('specify reviewers'))],
  _('REV [OPTIONS]'))
 def phabsend(ui, repo, *revs, **opts):
 """upload changesets to Phabricator
@@ -308,6 +329,12 @@
 if not revs:
 raise error.Abort(_('phabsend requires at least one changeset'))
 
+actions = []
+reviewers = opts.get('reviewer', [])
+if reviewers:
+phids = userphids(repo, reviewers)
+actions.append({'type': 'reviewers.add', 'value': phids})
+
 oldnodedrev = getoldnodedrevmap(repo, [repo[r].node() for r in revs])
 
 # Send patches one by one so we know their Differential Revision IDs and
@@ -322,7 +349,7 @@
 if oldnode != ctx.node():
 # Create or update Differential Revision
 revision = createdifferentialrevision(ctx, revid, lastrevid,
-  oldnode)
+  oldnode, actions)
 newrevid = int(revision[r'object'][r'id'])
 if revid:
 action = _('updated')



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D107: util: remove dead code which used to be for old python2 versions

2017-07-17 Thread alex_gaynor (Alex Gaynor)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9a2ee9591acc: util: remove dead code which used to be for 
old python2 versions (authored by alex_gaynor).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D107?vs=204&id=208

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

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -295,16 +295,10 @@
 try:
 buffer = buffer
 except NameError:
-if not pycompat.ispy3:
-def buffer(sliceable, offset=0, length=None):
-if length is not None:
-return sliceable[offset:offset + length]
-return sliceable[offset:]
-else:
-def buffer(sliceable, offset=0, length=None):
-if length is not None:
-return memoryview(sliceable)[offset:offset + length]
-return memoryview(sliceable)[offset:]
+def buffer(sliceable, offset=0, length=None):
+if length is not None:
+return memoryview(sliceable)[offset:offset + length]
+return memoryview(sliceable)[offset:]
 
 closefds = pycompat.osname == 'posix'
 



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


[PATCH resend] run-tests: make sure to check if pygments is installed before using it

2017-07-17 Thread Pulkit Goyal
# HG changeset patch
# User Pulkit Goyal <7895pul...@gmail.com>
# Date 1500065225 -19800
#  Sat Jul 15 02:17:05 2017 +0530
# Node ID 37df34ca705cf68eef4fa6b4087eb039f775d4e6
# Parent  0353c051d54702a960e4efba1eea6fbc13ad401a
run-tests: make sure to check if pygments is installed before using it

e80041832e introduced support to color the output of tests but used pygments
without checking whether it's installed or not. That breaks test-run-tests.t for
machines which don't have pygments installed. This patch conditionalize the
color test in test-run-tests.t and also add a check to make sure pygments is
installed before using that.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -89,7 +89,7 @@
 processlock = threading.Lock()
 
 with_color = False
-
+pygmentspresent = False
 # ANSI color is unsupported prior to Windows 10
 if os.name != 'nt':
 try: # is pygments installed
@@ -97,6 +97,7 @@
 import pygments.lexers as lexers
 import pygments.formatters as formatters
 with_color = True
+pygmentspresent = True
 except ImportError:
 pass
 
@@ -1650,7 +1651,7 @@
 else:
 self.stream.write('\n')
 for line in lines:
-if with_color:
+if with_color and pygmentspresent:
 line = pygments.highlight(
 line,
 lexers.DiffLexer(),
diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -121,7 +121,7 @@
 
 test diff colorisation
 
-#if no-windows
+#if no-windows pygments
   $ rt test-failure.t --color always
   
   \x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc)
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D109: sparse: consolidate common code for writing sparse config

2017-07-17 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  In 3 functions we were writing the sparse config and updating the
  working directory. In two of them we had a transaction-like process
  for restoring the sparse config in case of wdir update fail.
  
  Because the pattern is common, we've already made mistakes, and the
  complexity will increase in the near future, let's consolidate the
  code into a reusable function.
  
  As part of this refactor, we end up reading the "sparse" file twice
  when updating it. This is a bit sub-optimal. But I don't think it
  is worth the code complexity to pass around the variables to avoid
  the redundancy.

REPOSITORY
  rHG Mercurial

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

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
@@ -521,6 +521,31 @@
 
 prunetemporaryincludes(repo)
 
+def _updateconfigandrefreshwdir(repo, includes, excludes, profiles,
+force=False):
+"""Update the sparse config and working directory state."""
+raw = repo.vfs.tryread('sparse')
+oldincludes, oldexcludes, oldprofiles = parseconfig(repo.ui, raw)
+
+oldstatus = repo.status()
+oldmatch = matcher(repo)
+
+# TODO remove this try..except once the matcher integrates better
+# with dirstate. We currently have to write the updated config
+# because that will invalidate the matcher cache and force a
+# re-read. We ideally want to update the cached matcher on the
+# repo instance then flush the new config to disk once wdir is
+# updated. But this requires massive rework to matcher() and its
+# consumers.
+
+writeconfig(repo, includes, excludes, profiles)
+
+try:
+return refreshwdir(repo, oldstatus, oldmatch, force=force)
+except Exception:
+writeconfig(repo, oldincludes, oldexcludes, oldprofiles)
+raise
+
 def clearrules(repo, force=False):
 """Clears include/exclude rules from the sparse config.
 
@@ -534,10 +559,7 @@
 if not includes and not excludes:
 return
 
-oldstatus = repo.status()
-oldmatch = matcher(repo)
-writeconfig(repo, set(), set(), profiles)
-refreshwdir(repo, oldstatus, oldmatch, force=force)
+_updateconfigandrefreshwdir(repo, set(), set(), profiles, force=force)
 
 def importfromfiles(repo, opts, paths, force=False):
 """Import sparse config rules from files.
@@ -548,10 +570,7 @@
 with repo.wlock():
 # read current configuration
 raw = repo.vfs.tryread('sparse')
-oincludes, oexcludes, oprofiles = parseconfig(repo.ui, raw)
-includes, excludes, profiles = map(
-set, (oincludes, oexcludes, oprofiles))
-
+includes, excludes, profiles = parseconfig(repo.ui, raw)
 aincludes, aexcludes, aprofiles = activeconfig(repo)
 
 # Import rules on top; only take in rules that are not yet
@@ -577,25 +596,8 @@
 includecount = len(includes - aincludes)
 excludecount = len(excludes - aexcludes)
 
-oldstatus = repo.status()
-oldsparsematch = matcher(repo)
-
-# TODO remove this try..except once the matcher integrates better
-# with dirstate. We currently have to write the updated config
-# because that will invalidate the matcher cache and force a
-# re-read. We ideally want to update the cached matcher on the
-# repo instance then flush the new config to disk once wdir is
-# updated. But this requires massive rework to matcher() and its
-# consumers.
-writeconfig(repo, includes, excludes, profiles)
-
-try:
-fcounts = map(
-len,
-refreshwdir(repo, oldstatus, oldsparsematch, force=force))
-except Exception:
-writeconfig(repo, oincludes, oexcludes, oprofiles)
-raise
+fcounts = map(len, _updateconfigandrefreshwdir(
+repo, includes, excludes, profiles, force=force))
 
 printchanges(repo.ui, opts, profilecount, includecount, excludecount,
  *fcounts)
@@ -610,8 +612,6 @@
 The new config is written out and a working directory refresh is performed.
 """
 with repo.wlock():
-oldmatcher = matcher(repo)
-
 raw = repo.vfs.tryread('sparse')
 oldinclude, oldexclude, oldprofiles = parseconfig(repo.ui, raw)
 
@@ -624,8 +624,6 @@
 newexclude = set(oldexclude)
 newprofiles = set(oldprofiles)
 
-oldstatus = repo.status()
-
 if any(pat.startswith('/') for pat in pats):
 repo.ui.warn(_('warning: paths cannot start with /, ignoring: 
%s\n')
  % ([pat 

Re: D110: sparse: add a requirement when a repository uses sparse (BC)

2017-07-17 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The presence of a sparse checkout can confuse legacy clients or
  clients without sparse enabled for reasons that should be obvious.
  
  This commit introduces a new repository requirement that tracks
  whether sparse is enabled. The requirement is added when a sparse
  config is activated and removed when the sparse config is reset.
  
  The localrepository constructor has been taught to not open repos
  with this requirement unless the sparse feature is enabled. It yields
  a more actionable error message than what you would get if the
  lockout were handled strictly at the requirements verification phase.
  Old clients that aren't sparse aware will see the generic
  "repository requires features unknown to this Mercurial" error,
  however.
  
  The new requirement has "exp" in its name to reflect the
  experimental nature of sparse. There's a chance that the eventual
  non-experimental feature won't change significantly and we could
  have squatted on the "sparse" requirement without ill effect. If
  that happens, we can teach new clients to still recognize the old
  name. But I suspect we'll sneak in some BC and we'll want a new
  requirement to convey new meaning.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/help/internals/requirements.txt
  mercurial/localrepo.py
  mercurial/sparse.py
  tests/test-sparse-requirement.t

CHANGE DETAILS

diff --git a/tests/test-sparse-requirement.t b/tests/test-sparse-requirement.t
new file mode 100644
--- /dev/null
+++ b/tests/test-sparse-requirement.t
@@ -0,0 +1,65 @@
+  $ hg init repo
+  $ cd repo
+
+  $ touch a.html b.html c.py d.py
+
+  $ cat > frontend.sparse << EOF
+  > [include]
+  > *.html
+  > EOF
+
+  $ hg -q commit -A -m initial
+
+  $ echo 1 > a.html
+  $ echo 1 > c.py
+  $ hg commit -m 'commit 1'
+
+Enable sparse profile
+
+  $ cat .hg/requires
+  dotencode
+  fncache
+  generaldelta
+  revlogv1
+  store
+
+  $ hg debugsparse --config extensions.sparse= --enable-profile frontend.sparse
+  $ ls
+  a.html
+  b.html
+
+Requirement for sparse added when sparse is enabled
+
+  $ cat .hg/requires
+  dotencode
+  exp-sparse
+  fncache
+  generaldelta
+  revlogv1
+  store
+
+Client without sparse enabled reacts properly
+
+  $ hg files
+  abort: repository is using sparse feature but sparse is not enabled; enable 
the "sparse" extensions to access!
+  [255]
+
+Requirement for sparse is removed when sparse is disabled
+
+  $ hg debugsparse --reset --config extensions.sparse=
+
+  $ cat .hg/requires
+  dotencode
+  fncache
+  generaldelta
+  revlogv1
+  store
+
+And client without sparse can access
+
+  $ hg files
+  a.html
+  b.html
+  c.py
+  d.py
+  frontend.sparse
diff --git a/mercurial/sparse.py b/mercurial/sparse.py
--- a/mercurial/sparse.py
+++ b/mercurial/sparse.py
@@ -18,6 +18,7 @@
 match as matchmod,
 merge as mergemod,
 pycompat,
+scmutil,
 util,
 )
 
@@ -522,13 +523,14 @@
 prunetemporaryincludes(repo)
 
 def _updateconfigandrefreshwdir(repo, includes, excludes, profiles,
-force=False):
+force=False, removing=False):
 """Update the sparse config and working directory state."""
 raw = repo.vfs.tryread('sparse')
 oldincludes, oldexcludes, oldprofiles = parseconfig(repo.ui, raw)
 
 oldstatus = repo.status()
 oldmatch = matcher(repo)
+oldrequires = set(repo.requirements)
 
 # TODO remove this try..except once the matcher integrates better
 # with dirstate. We currently have to write the updated config
@@ -538,11 +540,21 @@
 # updated. But this requires massive rework to matcher() and its
 # consumers.
 
-writeconfig(repo, includes, excludes, profiles)
+if 'exp-sparse' in oldrequires and removing:
+repo.requirements.discard('exp-sparse')
+scmutil.writerequires(repo.vfs, repo.requirements)
+elif 'exp-sparse' not in oldrequires:
+repo.requirements.add('exp-sparse')
+scmutil.writerequires(repo.vfs, repo.requirements)
 
 try:
+writeconfig(repo, includes, excludes, profiles)
 return refreshwdir(repo, oldstatus, oldmatch, force=force)
 except Exception:
+if repo.requirements != oldrequires:
+repo.requirements.clear()
+repo.requirements |= oldrequires
+scmutil.writerequires(repo.vfs, repo.requirements)
 writeconfig(repo, oldincludes, oldexcludes, oldprofiles)
 raise
 
@@ -647,7 +659,8 @@
 len(oldexclude - newexclude))
 
 fcounts = map(len, _updateconfigandrefreshwdir(
-repo, newinclude, newexclude, newprofiles, force=force))
+repo, newinclude, newexclude, newprofiles, force=force,
+removing=reset))
 
 printchanges(repo.ui, opts, profilecount, 

mercurial@33549: 58 new changesets

2017-07-17 Thread Mercurial Commits
58 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/14af04391fb9
changeset:   33492:14af04391fb9
user:Matt Harbison 
date:Wed Mar 29 23:45:23 2017 -0400
summary: win32: add a method to trigger the Crypto API to complete a 
certificate chain

https://www.mercurial-scm.org/repo/hg/rev/9a9f95214f46
changeset:   33493:9a9f95214f46
user:Matt Harbison 
date:Thu Mar 30 00:27:46 2017 -0400
summary: debug: add a method to check the state of, and built an SSL cert 
chain

https://www.mercurial-scm.org/repo/hg/rev/30f2715be123
changeset:   33494:30f2715be123
user:Matt Harbison 
date:Wed Jul 12 18:37:13 2017 -0400
summary: sslutil: inform the user about how to fix an incomplete 
certificate chain

https://www.mercurial-scm.org/repo/hg/rev/d78b7d734b63
changeset:   33495:d78b7d734b63
user:Jun Wu 
date:Wed Jul 12 15:24:47 2017 -0700
summary: patch: use devel.all-warnings to replace devel.all

https://www.mercurial-scm.org/repo/hg/rev/258298f4712b
changeset:   33496:258298f4712b
user:Martin von Zweigbergk 
date:Tue Jul 11 10:46:35 2017 -0700
summary: sparse: override dirstate.walk() instead of dirstate._ignore

https://www.mercurial-scm.org/repo/hg/rev/80e1331a7fe9
changeset:   33497:80e1331a7fe9
user:Martin von Zweigbergk 
date:Tue Jul 11 10:46:55 2017 -0700
summary: match: remove unused negatematcher

https://www.mercurial-scm.org/repo/hg/rev/b7a75b9a3386
changeset:   33498:b7a75b9a3386
user:Jun Wu 
date:Tue Jul 11 08:52:55 2017 -0700
summary: phabricator: allow specifying reviewers on phabsend

https://www.mercurial-scm.org/repo/hg/rev/0407a51b9d8c
changeset:   33499:0407a51b9d8c
user:Jun Wu 
date:Fri Jul 14 14:22:40 2017 -0700
summary: codemod: register core configitems using a script

https://www.mercurial-scm.org/repo/hg/rev/9c6e64911de0
changeset:   33500:9c6e64911de0
user:Matt Harbison 
date:Sat Jul 15 00:52:36 2017 -0400
summary: run-tests: disable color on Windows

https://www.mercurial-scm.org/repo/hg/rev/7008f6819002
changeset:   33501:7008f6819002
user:Matt Harbison 
date:Tue Jul 11 00:40:29 2017 -0400
summary: context: name files relative to cwd in warning messages

https://www.mercurial-scm.org/repo/hg/rev/5d0c0c8d2929
changeset:   33502:5d0c0c8d2929
user:Jun Wu 
date:Fri Jul 14 20:19:46 2017 -0700
summary: selector2: vendor selector2 library

https://www.mercurial-scm.org/repo/hg/rev/27d23fe32887
changeset:   33503:27d23fe32887
user:Jun Wu 
date:Fri Jul 14 20:26:21 2017 -0700
summary: commandserver: use selectors2

https://www.mercurial-scm.org/repo/hg/rev/5d3ba4395288
changeset:   33504:5d3ba4395288
user:Jun Wu 
date:Sun Jun 04 10:02:09 2017 -0700
summary: obsstore: let read marker API take a range of offsets

https://www.mercurial-scm.org/repo/hg/rev/389536aff376
changeset:   33505:389536aff376
user:Yuya Nishihara 
date:Sat Jul 15 15:01:29 2017 +0900
summary: scmutil: remove duplicated import of i18n._()

https://www.mercurial-scm.org/repo/hg/rev/8a1a7935c047
changeset:   33506:8a1a7935c047
user:Jun Wu 
date:Sun Jul 16 04:39:32 2017 -0700
summary: commandserver: close selector explicitly

https://www.mercurial-scm.org/repo/hg/rev/e9672de52a23
changeset:   33507:e9672de52a23
user:Matt Harbison 
date:Sat Jul 15 15:23:29 2017 -0400
summary: debugignore: eliminate inconsistencies with `hg status` (issue5222)

https://www.mercurial-scm.org/repo/hg/rev/d09de637cbc8
changeset:   33508:d09de637cbc8
user:Matt Harbison 
date:Sat Jul 15 23:46:33 2017 -0400
summary: test-phase-exchange: stabilize for Windows

https://www.mercurial-scm.org/repo/hg/rev/a3acacbd0ff3
changeset:   33509:a3acacbd0ff3
user:Boris Feld 
date:Mon Jul 10 17:48:33 2017 +0200
summary: bookmark: remove a useless 'recordchange' in the amend code

https://www.mercurial-scm.org/repo/hg/rev/07b556d1b74e
changeset:   33510:07b556d1b74e
user:Boris Feld 
date:Mon Jul 10 19:08:17 2017 +0200
summary: bookmark: split out target computation from 'deletedivergent'

https://www.mercurial-scm.org/repo/hg/rev/9689239d7c2b
changeset:   33511:9689239d7c2b
user:Boris Feld 
date:Mon Jul 10 19:10:13 2017 +0200
summary: bookmark: use 'divergent2delete' in 'scmutil.cleanupnode'

https://www.mercurial-scm.org/repo/hg/rev/1424a769f31b
changeset:   33512:1424a769f31b
user:Boris Feld 
date:Mon Jul 10 19:12:25 2017 +0200
summary: bookmark: use 'divergent2delete' when updating a bookmark

https://www.mercurial-scm.org/repo/hg/rev/904894edb205
changeset:   33513:904894edb205
user:Boris Feld 
date:Mon Jul 10 20:02:32 2017 +0200
summary: bookmark: use 'divergent2delete' in checkconflict

https://www.mercurial-scm.org/repo

Re: [PATCH] win32: copy-edit debugssl messages to match prevailing style

2017-07-17 Thread Jun Wu
Looks an easy win to me.

Excerpts from Kevin Bullock's message of 2017-07-17 13:23:55 -0500:
> # HG changeset patch
> # User Kevin Bullock 
> # Date 1500315779 18000
> #  Mon Jul 17 13:22:59 2017 -0500
> # Node ID dcd0c87ef9e443e612e3b7eb4e1d7406df9549be
> # Parent  9a2ee9591acc4d5f5ab6bbb7054cb62cb5f29a62
> win32: copy-edit debugssl messages to match prevailing style
> 
> diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
> --- a/mercurial/debugcommands.py
> +++ b/mercurial/debugcommands.py
> @@ -2074,7 +2074,7 @@ def debugssl(ui, repo, source=None, **op
>  of the SSL error is likely another issue.
>  '''
>  if pycompat.osname != 'nt':
> -raise error.Abort(_('Certificate chain building is only possible on '
> +raise error.Abort(_('certificate chain building is only possible on '
>  'Windows'))
>  
>  if not source:
> @@ -2092,7 +2092,7 @@ def debugssl(ui, repo, source=None, **op
>  elif url.scheme == 'ssh':
>  addr = (url.host, url.port or 22)
>  else:
> -raise error.Abort(_("Only https and ssh connections are supported"))
> +raise error.Abort(_("only https and ssh connections are supported"))
>  
>  from . import win32
>  
> @@ -2103,19 +2103,19 @@ def debugssl(ui, repo, source=None, **op
>  s.connect(addr)
>  cert = s.getpeercert(True)
>  
> -ui.status(_('Checking the certificate chain for %s.\n') % url.host)
> +ui.status(_('checking the certificate chain for %s\n') % url.host)
>  
>  complete = win32.checkcertificatechain(cert, build=False)
>  
>  if not complete:
> -ui.status(_('The certificate chain is incomplete.  Updating... 
> '))
> +ui.status(_('certificate chain is incomplete, updating... '))
>  
>  if not win32.checkcertificatechain(cert):
> -ui.status(_('Failed.\n'))
> +ui.status(_('failed.\n'))
>  else:
> -ui.status(_('Done.\n'))
> +ui.status(_('done.\n'))
>  else:
> -ui.status(_('The full certificate chain is available.\n'))
> +ui.status(_('full certificate chain is available\n'))
>  finally:
>  s.close()
>  
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH resend] run-tests: make sure to check if pygments is installed before using it

2017-07-17 Thread Jun Wu
LGTM.

Excerpts from Pulkit Goyal's message of 2017-07-18 00:07:32 +0530:
> # HG changeset patch
> # User Pulkit Goyal <7895pul...@gmail.com>
> # Date 1500065225 -19800
> #  Sat Jul 15 02:17:05 2017 +0530
> # Node ID 37df34ca705cf68eef4fa6b4087eb039f775d4e6
> # Parent  0353c051d54702a960e4efba1eea6fbc13ad401a
> run-tests: make sure to check if pygments is installed before using it
> 
> e80041832e introduced support to color the output of tests but used pygments
> without checking whether it's installed or not. That breaks test-run-tests.t 
> for
> machines which don't have pygments installed. This patch conditionalize the
> color test in test-run-tests.t and also add a check to make sure pygments is
> installed before using that.
> 
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -89,7 +89,7 @@
>  processlock = threading.Lock()
>  
>  with_color = False
> -
> +pygmentspresent = False
>  # ANSI color is unsupported prior to Windows 10
>  if os.name != 'nt':
>  try: # is pygments installed
> @@ -97,6 +97,7 @@
>  import pygments.lexers as lexers
>  import pygments.formatters as formatters
>  with_color = True
> +pygmentspresent = True
>  except ImportError:
>  pass
>  
> @@ -1650,7 +1651,7 @@
>  else:
>  self.stream.write('\n')
>  for line in lines:
> -if with_color:
> +if with_color and pygmentspresent:
>  line = pygments.highlight(
>  line,
>  lexers.DiffLexer(),
> diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
> --- a/tests/test-run-tests.t
> +++ b/tests/test-run-tests.t
> @@ -121,7 +121,7 @@
>  
>  test diff colorisation
>  
> -#if no-windows
> +#if no-windows pygments
>$ rt test-failure.t --color always
>
>\x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc)
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] run-tests: make sure to check if pygments is installed before using it

2017-07-17 Thread Augie Fackler
On Sun, Jul 16, 2017 at 02:07:03PM +0900, mlaneuvi...@gmail.com wrote:
> # HG changeset patch
> # User Matthieu Laneuville 
> # Date 1500181438 -32400
> #  Sun Jul 16 14:03:58 2017 +0900
> # Node ID 97ec8637d261a97c30944d9242ee1ccdbf536cb3
> # Parent  389536aff376d32d38f13305021c127245d4126a
> run-tests: make sure to check if pygments is installed before using it
>
> Makes sure color is never used if pygments is not available by conditioning
> test-run-tests.t and checking if self.stream is a tty instead of stderr only.
>
> Built upon:
> https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-July/101785.html
>
> diff -r 389536aff376 -r 97ec8637d261 tests/run-tests.py
> --- a/tests/run-tests.py  Sat Jul 15 15:01:29 2017 +0900
> +++ b/tests/run-tests.py  Sun Jul 16 14:03:58 2017 +0900
> @@ -89,6 +89,7 @@
>  processlock = threading.Lock()
>
>  with_color = False
> +with_pygments = False
>
>  # ANSI color is unsupported prior to Windows 10
>  if os.name != 'nt':
> @@ -97,12 +98,10 @@
>  import pygments.lexers as lexers
>  import pygments.formatters as formatters
>  with_color = True
> +with_pygments = True
>  except ImportError:
>  pass
>
> -if not sys.stderr.isatty(): # check if the terminal is capable
> -with_color = False
> -
>  if sys.version_info > (3, 5, 0):
>  PYTHON3 = True
>  xrange = range # we use xrange in one place, and we'd rather not use 
> range
> @@ -415,13 +414,6 @@
>  parser.error('--chg does not work when --with-hg is specified '
>   '(use --with-chg instead)')
>
> -global with_color
> -if options.color != 'auto':
> -if options.color == 'never':
> -with_color = False
> -else: # 'always', for testing purposes
> -with_color = True
> -
>  global useipv6
>  if options.ipv6:
>  useipv6 = checksocketfamily('AF_INET6')
> @@ -1573,6 +1565,17 @@
>  self.successes = []
>  self.faildata = {}
>
> +global with_color
> +if not self.stream.isatty(): # check if the terminal is capable
> +with_color = False
> +
> +if options.color != 'auto':
> +if options.color == 'never':
> +with_color = False
> +else: # 'always', for testing purposes
> +if with_pygments:
> +with_color = True
> +
>  def addFailure(self, test, reason):
>  self.failures.append((test, reason))
>
> @@ -1650,7 +1653,7 @@
>  else:
>  self.stream.write('\n')
>  for line in lines:
> -if with_color:
> +if with_color and with_pygments:
>  line = pygments.highlight(
>  line,
>  lexers.DiffLexer(),
> diff -r 389536aff376 -r 97ec8637d261 tests/test-run-tests.t
> --- a/tests/test-run-tests.t  Sat Jul 15 15:01:29 2017 +0900
> +++ b/tests/test-run-tests.t  Sun Jul 16 14:03:58 2017 +0900
> @@ -122,6 +122,7 @@
>  test diff colorisation
>
>  #if no-windows
> +#require pygments

I suspect this needs to be embedded in the #if, not done as #require,
otherwise tests for run-tests won't run at all if pygments is missing.

>$ rt test-failure.t --color always
>
>\x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc)
> ___
> 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] win32: copy-edit debugssl messages to match prevailing style

2017-07-17 Thread Augie Fackler
On Mon, Jul 17, 2017 at 12:22:45PM -0700, Jun Wu wrote:
> Looks an easy win to me.

queued, thanks

>
> Excerpts from Kevin Bullock's message of 2017-07-17 13:23:55 -0500:
> > # HG changeset patch
> > # User Kevin Bullock 
> > # Date 1500315779 18000
> > #  Mon Jul 17 13:22:59 2017 -0500
> > # Node ID dcd0c87ef9e443e612e3b7eb4e1d7406df9549be
> > # Parent  9a2ee9591acc4d5f5ab6bbb7054cb62cb5f29a62
> > win32: copy-edit debugssl messages to match prevailing style
> >
> > diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
> > --- a/mercurial/debugcommands.py
> > +++ b/mercurial/debugcommands.py
> > @@ -2074,7 +2074,7 @@ def debugssl(ui, repo, source=None, **op
> >  of the SSL error is likely another issue.
> >  '''
> >  if pycompat.osname != 'nt':
> > -raise error.Abort(_('Certificate chain building is only possible 
> > on '
> > +raise error.Abort(_('certificate chain building is only possible 
> > on '
> >  'Windows'))
> >
> >  if not source:
> > @@ -2092,7 +2092,7 @@ def debugssl(ui, repo, source=None, **op
> >  elif url.scheme == 'ssh':
> >  addr = (url.host, url.port or 22)
> >  else:
> > -raise error.Abort(_("Only https and ssh connections are 
> > supported"))
> > +raise error.Abort(_("only https and ssh connections are 
> > supported"))
> >
> >  from . import win32
> >
> > @@ -2103,19 +2103,19 @@ def debugssl(ui, repo, source=None, **op
> >  s.connect(addr)
> >  cert = s.getpeercert(True)
> >
> > -ui.status(_('Checking the certificate chain for %s.\n') % url.host)
> > +ui.status(_('checking the certificate chain for %s\n') % url.host)
> >
> >  complete = win32.checkcertificatechain(cert, build=False)
> >
> >  if not complete:
> > -ui.status(_('The certificate chain is incomplete.  Updating... 
> > '))
> > +ui.status(_('certificate chain is incomplete, updating... '))
> >
> >  if not win32.checkcertificatechain(cert):
> > -ui.status(_('Failed.\n'))
> > +ui.status(_('failed.\n'))
> >  else:
> > -ui.status(_('Done.\n'))
> > +ui.status(_('done.\n'))
> >  else:
> > -ui.status(_('The full certificate chain is available.\n'))
> > +ui.status(_('full certificate chain is available\n'))
> >  finally:
> >  s.close()
> >
> ___
> 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 resend] run-tests: make sure to check if pygments is installed before using it

2017-07-17 Thread Augie Fackler
On Mon, Jul 17, 2017 at 12:24:26PM -0700, Jun Wu wrote:
> LGTM.

Queued, thanks.

>
> Excerpts from Pulkit Goyal's message of 2017-07-18 00:07:32 +0530:
> > # HG changeset patch
> > # User Pulkit Goyal <7895pul...@gmail.com>
> > # Date 1500065225 -19800
> > #  Sat Jul 15 02:17:05 2017 +0530
> > # Node ID 37df34ca705cf68eef4fa6b4087eb039f775d4e6
> > # Parent  0353c051d54702a960e4efba1eea6fbc13ad401a
> > run-tests: make sure to check if pygments is installed before using it
> >
> > e80041832e introduced support to color the output of tests but used pygments
> > without checking whether it's installed or not. That breaks 
> > test-run-tests.t for
> > machines which don't have pygments installed. This patch conditionalize the
> > color test in test-run-tests.t and also add a check to make sure pygments is
> > installed before using that.
> >
> > diff --git a/tests/run-tests.py b/tests/run-tests.py
> > --- a/tests/run-tests.py
> > +++ b/tests/run-tests.py
> > @@ -89,7 +89,7 @@
> >  processlock = threading.Lock()
> >
> >  with_color = False
> > -
> > +pygmentspresent = False
> >  # ANSI color is unsupported prior to Windows 10
> >  if os.name != 'nt':
> >  try: # is pygments installed
> > @@ -97,6 +97,7 @@
> >  import pygments.lexers as lexers
> >  import pygments.formatters as formatters
> >  with_color = True
> > +pygmentspresent = True
> >  except ImportError:
> >  pass
> >
> > @@ -1650,7 +1651,7 @@
> >  else:
> >  self.stream.write('\n')
> >  for line in lines:
> > -if with_color:
> > +if with_color and pygmentspresent:
> >  line = pygments.highlight(
> >  line,
> >  lexers.DiffLexer(),
> > diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
> > --- a/tests/test-run-tests.t
> > +++ b/tests/test-run-tests.t
> > @@ -121,7 +121,7 @@
> >
> >  test diff colorisation
> >
> > -#if no-windows
> > +#if no-windows pygments
> >$ rt test-failure.t --color always
> >
> >\x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc)
> ___
> 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: D97: revset: pass repo when passing ui

2017-07-17 Thread durin42 (Augie Fackler)
durin42 accepted this revision.
durin42 added a comment.
This revision is now accepted and ready to land.


  Taking this one, but going to punt on https://phab.mercurial-scm.org/D98 per 
the "consider this an RFC" comment I saw.

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D95: sparse: use set for capturing profiles

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> sparse.py:96
>  profile = profiles.pop()
>  if profile in visited:
>  continue

This can no longer happen. Will you or send a follow-up?

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


[PATCH v2] templates: add substring and string length operations

2017-07-17 Thread Rodrigo Damazio Bovendorp via Mercurial-devel
# HG changeset patch
# User Rodrigo Damazio Bovendorp 
# Date 1500075683 25200
#  Fri Jul 14 16:41:23 2017 -0700
# Node ID c4bac4ea7b1ea923d6ba4299cd9c974469b39cb0
# Parent  c0d8de2724ce6240d2a4241aff78ce2ee92359c2
templates: add substring and string length operations

This will allow substr(text, start, end) and strlen(text) in templates,
permitting various text formatting, such as making a (non-graphing) log line be
limited to terminal width ("substr(desc, 0, termwidth)")

diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py
--- a/mercurial/templatefilters.py
+++ b/mercurial/templatefilters.py
@@ -362,6 +362,11 @@
 return ""
 return pycompat.bytestr(thing)
 
+@templatefilter('strlen')
+def stringlen(text):
+"""Any text. Turns the value into its length."""
+return len(text)
+
 @templatefilter('stripdir')
 def stripdir(text):
 """Treat the text as path and strip a directory level, if
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -1015,6 +1015,25 @@
 # i18n: "sub" is a keyword
 raise error.ParseError(_("sub got an invalid replacement: %s") % rpl)
 
+@templatefunc('substr(text, start[, end])')
+def substring(context, mapping, args):
+"""Returns a substring of the given text. Negative indices reference the 
end
+of the string."""
+if len(args) < 2 or len(args) > 3:
+raise error.ParseError(
+_("substring expects two or three arguments, got %d") % len(args))
+
+text = evalstring(context, mapping, args[0])
+start = evalinteger(context, mapping, args[1],
+  _("start expects an integer index"))
+end = len(text)
+if len(args) > 2:
+end = evalinteger(context, mapping, args[2],
+  _("end expects an integer index"))
+
+# Python's [] already handles start and end boundary conditions.
+return text[start:end]
+
 @templatefunc('startswith(pattern, text)')
 def startswith(context, mapping, args):
 """Returns the value from the "text" argument
diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -4011,6 +4011,39 @@
   o  line 1
  line 2
 
+Test stringlen and substring
+Full desc is "Modify, add, remove, rename".
+String idxs:  012345678901
+Reverse string idxs:  10987654321
+
+  $ hg log -R a -r . --template '{desc|strlen}\n'
+  27
+  $ hg log -R a -r . --template '{substr(desc, 5)}\n'
+  y, add, remove, rename
+  $ hg log -R a -r . --template '{substr(desc, -10)}\n'
+  ve, rename
+  $ hg log -R a -r . --template '{substr(desc, 5, 10)}\n'
+  y, ad
+  $ hg log -R a -r . --template '{substr(desc, 5, -10)}\n'
+  y, add, remo
+  $ hg log -R a -r . --template '{substr(desc, 5, strlen(desc) - 10)}\n'
+  y, add, remo
+  $ hg log -R a -r . --template '{substr(desc, -10, -3)}\n'
+  ve, ren
+
+Test substr with invalid indices
+
+  $ hg log -R a -r . --template '{substr(desc, 5, 200)}\n'
+  y, add, remove, rename
+  $ hg log -R a -r . --template '{substr(desc, 10, 5)}\n'
+  
+  $ hg log -R a -r . --template '{substr(desc, 100, 200)}\n'
+  
+  $ hg log -R a -r . --template '{substr(desc, -100, -50)}\n'
+  
+  $ hg log -R a -r . --template '{substr(desc, -50, -100)}\n'
+  
+
 Test bad template with better error message
 
   $ hg log -Gv -R a --template '{desc|user()}'
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D110: sparse: add a requirement when a repository uses sparse (BC)

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> sparse.py:526
>  def _updateconfigandrefreshwdir(repo, includes, excludes, profiles,
> -force=False):
> +force=False, removing=False):
>  """Update the sparse config and working directory state."""

It feels like this would be clearer as two method: the old one and a new one 
that just turns sparse off. That would ideally unlink .hg/sparse, no? The new 
method would not accept includes, excludes, or profiles, and force also doesn't 
seem relevant as far as I can tell.

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D95: sparse: use set for capturing profiles

2017-07-17 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG32f348d741e5: sparse: use set for capturing profiles 
(authored by indygreg).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D95?vs=179&id=220

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

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
@@ -34,16 +34,16 @@
 includes = set()
 excludes = set()
 current = includes
-profiles = []
+profiles = set()
 for line in raw.split('\n'):
 line = line.strip()
 if not line or line.startswith('#'):
 # empty or comment line, skip
 continue
 elif line.startswith('%include '):
 line = line[9:].strip()
 if line:
-profiles.append(line)
+profiles.add(line)
 elif line == '[include]':
 if current != includes:
 # TODO pass filename into this API so we can report it.
@@ -76,11 +76,11 @@
 """
 # Feature isn't enabled. No-op.
 if not enabled:
-return set(), set(), []
+return set(), set(), set()
 
 raw = repo.vfs.tryread('sparse')
 if not raw:
-return set(), set(), []
+return set(), set(), set()
 
 if rev is None:
 raise error.Abort(_('cannot parse sparse patterns from working '
@@ -115,8 +115,7 @@
 pincludes, pexcludes, subprofs = parseconfig(repo.ui, raw)
 includes.update(pincludes)
 excludes.update(pexcludes)
-for subprofile in subprofs:
-profiles.append(subprofile)
+profiles.update(subprofs)
 
 profiles = visited
 
@@ -142,7 +141,7 @@
 includes, excludes, profiles = patternsforrev(repo, rev)
 allincludes |= includes
 allexcludes |= excludes
-allprofiles |= set(profiles)
+allprofiles |= profiles
 
 return allincludes, allexcludes, allprofiles
 
@@ -504,7 +503,7 @@
 profiles = patternsforrev(repo, ctx.rev())[2]
 
 # profiles will only have data if sparse is enabled.
-if set(profiles) & set(ctx.files()):
+if profiles & set(ctx.files()):
 origstatus = repo.status()
 origsparsematch = matcher(repo)
 refreshwdir(repo, origstatus, origsparsematch, force=True)
@@ -555,7 +554,7 @@
 oldsize = len(includes) + len(excludes) + len(profiles)
 includes.update(iincludes - aincludes)
 excludes.update(iexcludes - aexcludes)
-profiles.update(set(iprofiles) - aprofiles)
+profiles.update(iprofiles - aprofiles)
 if len(includes) + len(excludes) + len(profiles) > oldsize:
 changed = True
 
@@ -604,7 +603,6 @@
 
 raw = repo.vfs.tryread('sparse')
 oldinclude, oldexclude, oldprofiles = parseconfig(repo.ui, raw)
-oldprofiles = set(oldprofiles)
 
 if reset:
 newinclude = set()



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D96: sparse: require [section] in sparse config files (BC)

2017-07-17 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1d1779734c99: sparse: require [section] in sparse config 
files (BC) (authored by indygreg).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D96?vs=180&id=221

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

AFFECTED FILES
  hgext/sparse.py
  mercurial/sparse.py
  tests/test-sparse-profiles.t

CHANGE DETAILS

diff --git a/tests/test-sparse-profiles.t b/tests/test-sparse-profiles.t
--- a/tests/test-sparse-profiles.t
+++ b/tests/test-sparse-profiles.t
@@ -10,6 +10,18 @@
   > rebase=
   > EOF
 
+Config file without [section] is rejected
+
+  $ cat > bad.sparse < *.html
+  > EOF
+
+  $ hg debugsparse --import-rules bad.sparse
+  abort: sparse config entry outside of section: *.html
+  (add an [include] or [exclude] line to declare the entry type)
+  [255]
+  $ rm bad.sparse
+
   $ echo a > index.html
   $ echo x > data.py
   $ echo z > readme.txt
@@ -257,6 +269,7 @@
   > EOF
   $ touch a b
   $ cat > .hgsparse < [include]
   > a
   > EOF
   $ hg commit -Aqm 'initial'
diff --git a/mercurial/sparse.py b/mercurial/sparse.py
--- a/mercurial/sparse.py
+++ b/mercurial/sparse.py
@@ -33,8 +33,10 @@
 """
 includes = set()
 excludes = set()
-current = includes
 profiles = set()
+current = None
+havesection = False
+
 for line in raw.split('\n'):
 line = line.strip()
 if not line or line.startswith('#'):
@@ -45,14 +47,23 @@
 if line:
 profiles.add(line)
 elif line == '[include]':
-if current != includes:
+if havesection and current != includes:
 # TODO pass filename into this API so we can report it.
 raise error.Abort(_('sparse config cannot have includes ' +
 'after excludes'))
+havesection = True
+current = includes
 continue
 elif line == '[exclude]':
+havesection = True
 current = excludes
 elif line:
+if current is None:
+raise error.Abort(_('sparse config entry outside of '
+'section: %s') % line,
+  hint=_('add an [include] or [exclude] line '
+ 'to declare the entry type'))
+
 if line.strip().startswith('/'):
 ui.warn(_('warning: sparse profile cannot use' +
   ' paths starting with /, ignoring %s\n') % line)
diff --git a/hgext/sparse.py b/hgext/sparse.py
--- a/hgext/sparse.py
+++ b/hgext/sparse.py
@@ -35,8 +35,7 @@
 
 The special lines ``[include]`` and ``[exclude]`` denote the section
 for includes and excludes that follow, respectively. It is illegal to
-have ``[include]`` after ``[exclude]``. If no sections are defined,
-entries are assumed to be in the ``[include]`` section.
+have ``[include]`` after ``[exclude]``.
 
 Non-special lines resemble file patterns to be added to either includes
 or excludes. The syntax of these lines is documented by :hg:`help patterns`.



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


[PATCH v3] run-tests: make sure to check if pygments is installed before using it

2017-07-17 Thread mlaneuville
# HG changeset patch
# User Matthieu Laneuville 
# Date 1500181438 -32400
#  Sun Jul 16 14:03:58 2017 +0900
# Node ID 6254e8515425dd54f6200a6231f2d45f86d5a060
# Parent  389536aff376d32d38f13305021c127245d4126a
run-tests: make sure to check if pygments is installed before using it

Makes sure color is never used if pygments is not available by conditioning
test-run-tests.t and checking if self.stream is a tty instead of stderr only.

Built upon:
https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-July/101785.html

diff -r 389536aff376 -r 6254e8515425 tests/run-tests.py
--- a/tests/run-tests.pySat Jul 15 15:01:29 2017 +0900
+++ b/tests/run-tests.pySun Jul 16 14:03:58 2017 +0900
@@ -89,6 +89,7 @@
 processlock = threading.Lock()
 
 with_color = False
+with_pygments = False
 
 # ANSI color is unsupported prior to Windows 10
 if os.name != 'nt':
@@ -97,12 +98,10 @@
 import pygments.lexers as lexers
 import pygments.formatters as formatters
 with_color = True
+with_pygments = True
 except ImportError:
 pass
 
-if not sys.stderr.isatty(): # check if the terminal is capable
-with_color = False
-
 if sys.version_info > (3, 5, 0):
 PYTHON3 = True
 xrange = range # we use xrange in one place, and we'd rather not use range
@@ -415,13 +414,6 @@
 parser.error('--chg does not work when --with-hg is specified '
  '(use --with-chg instead)')
 
-global with_color
-if options.color != 'auto':
-if options.color == 'never':
-with_color = False
-else: # 'always', for testing purposes
-with_color = True
-
 global useipv6
 if options.ipv6:
 useipv6 = checksocketfamily('AF_INET6')
@@ -1573,6 +1565,17 @@
 self.successes = []
 self.faildata = {}
 
+global with_color
+if not self.stream.isatty(): # check if the terminal is capable
+with_color = False
+
+if options.color != 'auto':
+if options.color == 'never':
+with_color = False
+else: # 'always', for testing purposes
+if with_pygments:
+with_color = True
+
 def addFailure(self, test, reason):
 self.failures.append((test, reason))
 
@@ -1650,7 +1653,7 @@
 else:
 self.stream.write('\n')
 for line in lines:
-if with_color:
+if with_color and with_pygments:
 line = pygments.highlight(
 line,
 lexers.DiffLexer(),
diff -r 389536aff376 -r 6254e8515425 tests/test-run-tests.t
--- a/tests/test-run-tests.tSat Jul 15 15:01:29 2017 +0900
+++ b/tests/test-run-tests.tSun Jul 16 14:03:58 2017 +0900
@@ -121,7 +121,7 @@
 
 test diff colorisation
 
-#if no-windows
+#if no-windows pygments
   $ rt test-failure.t --color always
   
   \x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc)
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@33551: 2 new changesets

2017-07-17 Thread Mercurial Commits
2 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/32f348d741e5
changeset:   33550:32f348d741e5
user:Gregory Szorc 
date:Sat Jul 15 13:07:57 2017 -0700
summary: sparse: use set for capturing profiles

https://www.mercurial-scm.org/repo/hg/rev/1d1779734c99
changeset:   33551:1d1779734c99
bookmark:@
tag: tip
user:Gregory Szorc 
date:Sat Jul 15 13:21:23 2017 -0700
summary: sparse: require [section] in sparse config files (BC)

-- 
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 resend] run-tests: make sure to check if pygments is installed before using it

2017-07-17 Thread Martin von Zweigbergk via Mercurial-devel
On Mon, Jul 17, 2017 at 1:07 PM, Augie Fackler  wrote:
> On Mon, Jul 17, 2017 at 12:24:26PM -0700, Jun Wu wrote:
>> LGTM.
>
> Queued, thanks.
>
>>
>> Excerpts from Pulkit Goyal's message of 2017-07-18 00:07:32 +0530:
>> > # HG changeset patch
>> > # User Pulkit Goyal <7895pul...@gmail.com>
>> > # Date 1500065225 -19800
>> > #  Sat Jul 15 02:17:05 2017 +0530
>> > # Node ID 37df34ca705cf68eef4fa6b4087eb039f775d4e6
>> > # Parent  0353c051d54702a960e4efba1eea6fbc13ad401a
>> > run-tests: make sure to check if pygments is installed before using it

This means that "run-tests.py --color=always" still gives no color. Do
the tests still fail if we take only the tests/test-run-tests.t part
of the patch?

>> >
>> > e80041832e introduced support to color the output of tests but used 
>> > pygments
>> > without checking whether it's installed or not. That breaks 
>> > test-run-tests.t for
>> > machines which don't have pygments installed. This patch conditionalize the
>> > color test in test-run-tests.t and also add a check to make sure pygments 
>> > is
>> > installed before using that.
>> >
>> > diff --git a/tests/run-tests.py b/tests/run-tests.py
>> > --- a/tests/run-tests.py
>> > +++ b/tests/run-tests.py
>> > @@ -89,7 +89,7 @@
>> >  processlock = threading.Lock()
>> >
>> >  with_color = False
>> > -
>> > +pygmentspresent = False
>> >  # ANSI color is unsupported prior to Windows 10
>> >  if os.name != 'nt':
>> >  try: # is pygments installed
>> > @@ -97,6 +97,7 @@
>> >  import pygments.lexers as lexers
>> >  import pygments.formatters as formatters
>> >  with_color = True
>> > +pygmentspresent = True
>> >  except ImportError:
>> >  pass
>> >
>> > @@ -1650,7 +1651,7 @@
>> >  else:
>> >  self.stream.write('\n')
>> >  for line in lines:
>> > -if with_color:
>> > +if with_color and pygmentspresent:
>> >  line = pygments.highlight(
>> >  line,
>> >  lexers.DiffLexer(),
>> > diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
>> > --- a/tests/test-run-tests.t
>> > +++ b/tests/test-run-tests.t
>> > @@ -121,7 +121,7 @@
>> >
>> >  test diff colorisation
>> >
>> > -#if no-windows
>> > +#if no-windows pygments
>> >$ rt test-failure.t --color always
>> >
>> >\x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc)
>> ___
>> 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: D95: sparse: use set for capturing profiles

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> martinvonz wrote in sparse.py:96
> This can no longer happen. Will you or send a follow-up?

Never mind, I didn't notice it expands the subprofiles and updated the profiles 
set in the loop, so the check is necessary.

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D110: sparse: add a requirement when a repository uses sparse (BC)

2017-07-17 Thread indygreg (Gregory Szorc)
indygreg added inline comments.

INLINE COMMENTS

> martinvonz wrote in sparse.py:526
> It feels like this would be clearer as two method: the old one and a new one 
> that just turns sparse off. That would ideally unlink .hg/sparse, no? The new 
> method would not accept includes, excludes, or profiles, and force also 
> doesn't seem relevant as far as I can tell.

Yes, it would be cleaner to have a dedicated function to turn off sparse. Yes, 
it would unlink .hg/sparse. I was being a bit lazy when I wrote this patch 
because I wanted to get something in before the freeze :)

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: [PATCH v3] run-tests: make sure to check if pygments is installed before using it

2017-07-17 Thread Jun Wu
Pulkit's fix was just queued [1]. You might want to follow the hg-committed
repo to get the latest before sending patches.

[1]: https://www.mercurial-scm.org/repo/hg-committed/rev/754569f5e999

Excerpts from mlaneuville's message of 2017-07-18 07:08:49 +0900:
> # HG changeset patch
> # User Matthieu Laneuville 
> # Date 1500181438 -32400
> #  Sun Jul 16 14:03:58 2017 +0900
> # Node ID 6254e8515425dd54f6200a6231f2d45f86d5a060
> # Parent  389536aff376d32d38f13305021c127245d4126a
> run-tests: make sure to check if pygments is installed before using it
> 
> Makes sure color is never used if pygments is not available by conditioning
> test-run-tests.t and checking if self.stream is a tty instead of stderr only.
> 
> Built upon:
> https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-July/101785.html 
> 
> diff -r 389536aff376 -r 6254e8515425 tests/run-tests.py
> --- a/tests/run-tests.pySat Jul 15 15:01:29 2017 +0900
> +++ b/tests/run-tests.pySun Jul 16 14:03:58 2017 +0900
> @@ -89,6 +89,7 @@
>  processlock = threading.Lock()
>  
>  with_color = False
> +with_pygments = False
>  
>  # ANSI color is unsupported prior to Windows 10
>  if os.name != 'nt':
> @@ -97,12 +98,10 @@
>  import pygments.lexers as lexers
>  import pygments.formatters as formatters
>  with_color = True
> +with_pygments = True
>  except ImportError:
>  pass
>  
> -if not sys.stderr.isatty(): # check if the terminal is capable
> -with_color = False
> -
>  if sys.version_info > (3, 5, 0):
>  PYTHON3 = True
>  xrange = range # we use xrange in one place, and we'd rather not use 
> range
> @@ -415,13 +414,6 @@
>  parser.error('--chg does not work when --with-hg is specified '
>   '(use --with-chg instead)')
>  
> -global with_color
> -if options.color != 'auto':
> -if options.color == 'never':
> -with_color = False
> -else: # 'always', for testing purposes
> -with_color = True
> -
>  global useipv6
>  if options.ipv6:
>  useipv6 = checksocketfamily('AF_INET6')
> @@ -1573,6 +1565,17 @@
>  self.successes = []
>  self.faildata = {}
>  
> +global with_color
> +if not self.stream.isatty(): # check if the terminal is capable
> +with_color = False
> +
> +if options.color != 'auto':
> +if options.color == 'never':
> +with_color = False
> +else: # 'always', for testing purposes
> +if with_pygments:
> +with_color = True
> +
>  def addFailure(self, test, reason):
>  self.failures.append((test, reason))
>  
> @@ -1650,7 +1653,7 @@
>  else:
>  self.stream.write('\n')
>  for line in lines:
> -if with_color:
> +if with_color and with_pygments:
>  line = pygments.highlight(
>  line,
>  lexers.DiffLexer(),
> diff -r 389536aff376 -r 6254e8515425 tests/test-run-tests.t
> --- a/tests/test-run-tests.tSat Jul 15 15:01:29 2017 +0900
> +++ b/tests/test-run-tests.tSun Jul 16 14:03:58 2017 +0900
> @@ -121,7 +121,7 @@
>  
>  test diff colorisation
>  
> -#if no-windows
> +#if no-windows pygments
>$ rt test-failure.t --color always
>
>\x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc)
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH] run-tests: check if stream is a tty before using color

2017-07-17 Thread mlaneuville
# HG changeset patch
# User Matthieu Laneuville 
# Date 1500329966 -32400
#  Tue Jul 18 07:19:26 2017 +0900
# Node ID 7f5f97697162331b5acf78aef091ae3fd341e308
# Parent  9b2647a7a70a270e85457ea55583b6eba0551258
run-tests: check if stream is a tty before using color

Previous implementation (e80041832eec) checked only if sys.stderr was a tty
which was less general. Also makes sure that colors is never used if pygments is
not available, irrespective of --color flag value.

diff -r 9b2647a7a70a -r 7f5f97697162 tests/run-tests.py
--- a/tests/run-tests.pyMon Jul 17 11:45:38 2017 -0700
+++ b/tests/run-tests.pyTue Jul 18 07:19:26 2017 +0900
@@ -101,8 +101,6 @@
 except ImportError:
 pass
 
-if not sys.stderr.isatty(): # check if the terminal is capable
-with_color = False
 
 if sys.version_info > (3, 5, 0):
 PYTHON3 = True
@@ -416,13 +414,6 @@
 parser.error('--chg does not work when --with-hg is specified '
  '(use --with-chg instead)')
 
-global with_color
-if options.color != 'auto':
-if options.color == 'never':
-with_color = False
-else: # 'always', for testing purposes
-with_color = True
-
 global useipv6
 if options.ipv6:
 useipv6 = checksocketfamily('AF_INET6')
@@ -1574,6 +1565,17 @@
 self.successes = []
 self.faildata = {}
 
+global with_color
+if not self.stream.isatty(): # check if the terminal is capable
+with_color = False
+
+if options.color != 'auto':
+if options.color == 'never':
+with_color = False
+else: # 'always', for testing purposes
+if pygmentspresent:
+with_color = True
+
 def addFailure(self, test, reason):
 self.failures.append((test, reason))
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH v3] run-tests: also color the summary messages (skipped, failed...)

2017-07-17 Thread mlaneuville
# HG changeset patch
# User Matthieu Laneuville 
# Date 1500330427 -32400
#  Tue Jul 18 07:27:07 2017 +0900
# Node ID 14c07f0460918fe57b1c2709fe3ea3f071a95659
# Parent  7f5f97697162331b5acf78aef091ae3fd341e308
run-tests: also color the summary messages (skipped, failed...)

diff -r 7f5f97697162 -r 14c07f046091 tests/run-tests.py
--- a/tests/run-tests.pyTue Jul 18 07:19:26 2017 +0900
+++ b/tests/run-tests.pyTue Jul 18 07:27:07 2017 +0900
@@ -95,12 +95,46 @@
 try: # is pygments installed
 import pygments
 import pygments.lexers as lexers
+import pygments.lexer as lexer
 import pygments.formatters as formatters
+import pygments.token as token
+import pygments.style as style
 with_color = True
 pygmentspresent = True
 except ImportError:
 pass
 
+if pygmentspresent:
+class TestRunnerStyle(style.Style):
+default_style = ""
+skipped = token.string_to_tokentype("Token.Generic.Skipped")
+failed = token.string_to_tokentype("Token.Generic.Failed")
+error = token.string_to_tokentype("Token.Generic.Error")
+skippedname = token.string_to_tokentype("Token.Generic.SName")
+failedname = token.string_to_tokentype("Token.Generic.FName")
+styles = {
+skipped: '#ansilightgray',
+skippedname: '#ansidarkgray',
+failed:  '#ansidarkred',
+failedname:  '#ansired',
+}
+
+class TestRunnerLexer(lexer.RegexLexer):
+tokens = {
+'root': [
+(r'^Skipped', token.Generic.Skipped, 'skipped'),
+(r'^Failed ', token.Generic.Failed, 'failed'),
+(r'^ERROR: ', token.Generic.Failed, 'failed'),
+],
+'skipped': [
+(r'[\w-]+\.t', token.Generic.SName),
+(r':.*', token.Generic.Skipped),
+],
+'failed': [
+(r'[\w-]+\.t', token.Generic.FName),
+(r'(:| ).*', token.Generic.Failed),
+]
+}
 
 if sys.version_info > (3, 5, 0):
 PYTHON3 = True
@@ -1587,7 +1621,14 @@
 self.stream.write('t')
 else:
 if not self._options.nodiff:
-self.stream.write('\nERROR: %s output changed\n' % 
test)
+formatted = '\nERROR: %s output changed\n' % test
+if with_color and pygmentspresent:
+formatted = pygments.highlight(
+formatted,
+TestRunnerLexer(),
+formatters.Terminal256Formatter(
+style=TestRunnerStyle)).strip("\n")
+self.stream.write(formatted)
 self.stream.write('!')
 
 self.stream.flush()
@@ -1990,9 +2031,23 @@
 
 if not self._runner.options.noskips:
 for test, msg in result.skipped:
-self.stream.writeln('Skipped %s: %s' % (test.name, msg))
+formatted = 'Skipped %s: %s' % (test.name, msg)
+if with_color and pygmentspresent:
+formatted = pygments.highlight(
+formatted,
+TestRunnerLexer(),
+formatters.Terminal256Formatter(
+style=TestRunnerStyle)).strip("\n")
+self.stream.writeln(formatted)
 for test, msg in result.failures:
-self.stream.writeln('Failed %s: %s' % (test.name, msg))
+formatted = 'Failed %s: %s' % (test.name, msg)
+if with_color and pygmentspresent:
+formatted = pygments.highlight(
+formatted,
+TestRunnerLexer(),
+formatters.Terminal256Formatter(
+style=TestRunnerStyle)).strip("\n")
+self.stream.writeln(formatted)
 for test, msg in result.errors:
 self.stream.writeln('Errored %s: %s' % (test.name, msg))
 
diff -r 7f5f97697162 -r 14c07f046091 tests/test-run-tests.t
--- a/tests/test-run-tests.tTue Jul 18 07:19:26 2017 +0900
+++ b/tests/test-run-tests.tTue Jul 18 07:27:07 2017 +0900
@@ -131,10 +131,8 @@
   \x1b[38;5;34m+  bar*baz (glob)\x1b[39m (esc)
  bar*bad (glob)
   \x1b[38;5;124m-  bar*baz (glob)\x1b[39m (esc)
-  
-  ERROR: test-failure.t output changed
-  !
-  Failed test-failure.t: output changed
+  \x1b[31mERROR: \x1b[39m\x1b[31;01mtest-failure.t\x1b[39;00m\x1b[31m output 
changed\x1b[39m! (esc)
+  \x1b[31mFailed \x1b[39m\x1b[31;01mtest-failure.t\x1b[39;00m\x1b[31m: output 
changed\x1b[39m (esc)
   # Ran 1 tests, 0 skipped, 1 failed.
   python hash seed: * (glob)
   [1]

Re: [PATCH resend] run-tests: make sure to check if pygments is installed before using it

2017-07-17 Thread Jun Wu
Excerpts from Martin von Zweigbergk's message of 2017-07-17 15:17:40 -0700:
> On Mon, Jul 17, 2017 at 1:07 PM, Augie Fackler  wrote:
> > On Mon, Jul 17, 2017 at 12:24:26PM -0700, Jun Wu wrote:
> >> LGTM.
> >
> > Queued, thanks.
> >
> >>
> >> Excerpts from Pulkit Goyal's message of 2017-07-18 00:07:32 +0530:
> >> > # HG changeset patch
> >> > # User Pulkit Goyal <7895pul...@gmail.com>
> >> > # Date 1500065225 -19800
> >> > #  Sat Jul 15 02:17:05 2017 +0530
> >> > # Node ID 37df34ca705cf68eef4fa6b4087eb039f775d4e6
> >> > # Parent  0353c051d54702a960e4efba1eea6fbc13ad401a
> >> > run-tests: make sure to check if pygments is installed before using it
> 
> This means that "run-tests.py --color=always" still gives no color. Do
> the tests still fail if we take only the tests/test-run-tests.t part
> of the patch?

Good catch. I think --color=always prints warning or errors out is desirable
when pygements is not available. So taking only the .t part makes sense to
me.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D113: gitweb: preserve whitespace in description

2017-07-17 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Without this, multiple spaces or tabs in the commit message aren't
  preserved and things like tables don't align properly.
  
  As part of adding the CSS rule, we had to cuddle the content
  with the  to not introduce leading and trailing whitespace.
  The "addbreaks" filter was also removed because it would insert
  an additional newline, effectively double spacing content.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/templates/gitweb/changelogentry.tmpl
  mercurial/templates/gitweb/changeset.tmpl
  mercurial/templates/gitweb/fileannotate.tmpl
  mercurial/templates/gitweb/filerevision.tmpl
  mercurial/templates/static/style-gitweb.css
  tests/test-hgweb.t

CHANGE DETAILS

diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -340,7 +340,7 @@
 
   $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - 
date etag server
   200 Script output follows
-  content-length: 8985
+  content-length: 9007
   content-type: text/css
   
   body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; 
border-width:1px; margin:10px; background: white; color: black; }
@@ -520,6 +520,7 @@
   
   .description {
   font-family: monospace;
+  white-space: pre;
   }
   
   /* Followlines */
diff --git a/mercurial/templates/static/style-gitweb.css 
b/mercurial/templates/static/style-gitweb.css
--- a/mercurial/templates/static/style-gitweb.css
+++ b/mercurial/templates/static/style-gitweb.css
@@ -175,6 +175,7 @@
 
 .description {
 font-family: monospace;
+white-space: pre;
 }
 
 /* Followlines */
diff --git a/mercurial/templates/gitweb/filerevision.tmpl 
b/mercurial/templates/gitweb/filerevision.tmpl
--- a/mercurial/templates/gitweb/filerevision.tmpl
+++ b/mercurial/templates/gitweb/filerevision.tmpl
@@ -61,9 +61,7 @@
 
 
 
-
-{desc|strip|escape|websub|addbreaks|nonempty}
-
+{desc|strip|escape|websub|nonempty}
 
 
 
 
 
-
-{desc|strip|escape|websub|addbreaks|nonempty}
-
+{desc|strip|escape|websub|nonempty}
 
 
 
 
-
-{desc|strip|escape|websub|addbreaks|nonempty}
-
+{desc|strip|escape|websub|nonempty}
 
 
 
diff --git a/mercurial/templates/gitweb/changelogentry.tmpl 
b/mercurial/templates/gitweb/changelogentry.tmpl
--- a/mercurial/templates/gitweb/changelogentry.tmpl
+++ b/mercurial/templates/gitweb/changelogentry.tmpl
@@ -7,8 +7,6 @@
 
 {author|obfuscate} [{date|rfc822date}] rev {rev}
 
-
-{desc|strip|escape|websub|addbreaks|nonempty}
-
-
+{desc|strip|escape|websub|nonempty}
+
 



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D110: sparse: add a requirement when a repository uses sparse (BC)

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> indygreg wrote in sparse.py:526
> Yes, it would be cleaner to have a dedicated function to turn off sparse. 
> Yes, it would unlink .hg/sparse. I was being a bit lazy when I wrote this 
> patch because I wanted to get something in before the freeze :)

I've accepted this version, but please send a follow-up (probably after the 
freeze), because this got pretty hard to read (relative to what it could be).

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: [PATCH resend] run-tests: make sure to check if pygments is installed before using it

2017-07-17 Thread Martin von Zweigbergk via Mercurial-devel
On Mon, Jul 17, 2017 at 3:38 PM, Jun Wu  wrote:
> Excerpts from Martin von Zweigbergk's message of 2017-07-17 15:17:40 -0700:
>> On Mon, Jul 17, 2017 at 1:07 PM, Augie Fackler  wrote:
>> > On Mon, Jul 17, 2017 at 12:24:26PM -0700, Jun Wu wrote:
>> >> LGTM.
>> >
>> > Queued, thanks.
>> >
>> >>
>> >> Excerpts from Pulkit Goyal's message of 2017-07-18 00:07:32 +0530:
>> >> > # HG changeset patch
>> >> > # User Pulkit Goyal <7895pul...@gmail.com>
>> >> > # Date 1500065225 -19800
>> >> > #  Sat Jul 15 02:17:05 2017 +0530
>> >> > # Node ID 37df34ca705cf68eef4fa6b4087eb039f775d4e6
>> >> > # Parent  0353c051d54702a960e4efba1eea6fbc13ad401a
>> >> > run-tests: make sure to check if pygments is installed before using it
>>
>> This means that "run-tests.py --color=always" still gives no color. Do
>> the tests still fail if we take only the tests/test-run-tests.t part
>> of the patch?
>
> Good catch. I think --color=always prints warning or errors out is desirable
> when pygements is not available. So taking only the .t part makes sense to
> me.

I'll accept Pulkit's version so I don't have to mess with it without
his approval. I'll back out the run-tests.py changes in a followup
instead
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D118: run-tests: remove unnecessary 'with_color' variable

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Its value is always the same as that of 'pygmentspresent'.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -88,15 +88,13 @@
 osenvironb = getattr(os, 'environb', os.environ)
 processlock = threading.Lock()
 
-with_color = False
 pygmentspresent = False
 # ANSI color is unsupported prior to Windows 10
 if os.name != 'nt':
 try: # is pygments installed
 import pygments
 import pygments.lexers as lexers
 import pygments.formatters as formatters
-with_color = True
 pygmentspresent = True
 except ImportError:
 pass
@@ -414,16 +412,16 @@
  '(use --with-chg instead)')
 
 if options.color == 'auto':
-options.color = with_color
+options.color = pygmentspresent
 if not sys.stderr.isatty(): # check if the terminal is capable
 options.color = False
 elif options.color == 'never':
 options.color = False
 else: # 'always', for testing purposes
 options.color = pygmentspresent
 if not pygmentspresent:
 sys.stderr.write('warning: --color=always ignored because'
- 'pygments is not installed\n')
+ 'pygment is not installed\n')
 
 global useipv6
 if options.ipv6:



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D115: run-tests: move check isatty() check for color inside parseargs()

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This will help with removing the global variables by making sure
  'pygmentspresent' always has the same value as 'with_color'.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -101,9 +101,6 @@
 except ImportError:
 pass
 
-if not sys.stderr.isatty(): # check if the terminal is capable
-with_color = False
-
 if sys.version_info > (3, 5, 0):
 PYTHON3 = True
 xrange = range # we use xrange in one place, and we'd rather not use range
@@ -418,6 +415,8 @@
 
 if options.color == 'auto':
 options.color = with_color
+if not sys.stderr.isatty(): # check if the terminal is capable
+options.color = False
 elif options.color == 'never':
 options.color = False
 else: # 'always', for testing purposes



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D117: run-tests: warn if --color=always and no pygments installed

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -421,6 +421,9 @@
 options.color = False
 else: # 'always', for testing purposes
 options.color = pygmentspresent
+if not pygmentspresent:
+sys.stderr.write('warning: --color=always ignored because'
+ 'pygments is not installed\n')
 
 global useipv6
 if options.ipv6:



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D116: run-tests: check pygmentspresent in parseargs()

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Checking earlier if it's installed means we can remove the check
  later.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -420,7 +420,7 @@
 elif options.color == 'never':
 options.color = False
 else: # 'always', for testing purposes
-options.color = True
+options.color = pygmentspresent
 
 global useipv6
 if options.ipv6:
@@ -1650,7 +1650,7 @@
 else:
 self.stream.write('\n')
 for line in lines:
-if self._options.color and pygmentspresent:
+if self._options.color:
 line = pygments.highlight(
 line,
 lexers.DiffLexer(),



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D114: run-tests: pass color option via options object, not global var

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  There are already other attributes on the options object that are not
  directly outputs from command line parsing, so this doesn't seem too
  bad to me.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -416,12 +416,12 @@
 parser.error('--chg does not work when --with-hg is specified '
  '(use --with-chg instead)')
 
-global with_color
-if options.color != 'auto':
-if options.color == 'never':
-with_color = False
-else: # 'always', for testing purposes
-with_color = True
+if options.color == 'auto':
+options.color = with_color
+elif options.color == 'never':
+options.color = False
+else: # 'always', for testing purposes
+options.color = True
 
 global useipv6
 if options.ipv6:
@@ -1651,7 +1651,7 @@
 else:
 self.stream.write('\n')
 for line in lines:
-if with_color and pygmentspresent:
+if self._options.color and pygmentspresent:
 line = pygments.highlight(
 line,
 lexers.DiffLexer(),



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D118: run-tests: remove unnecessary 'with_color' variable

2017-07-17 Thread quark (Jun Wu)
quark added inline comments.

INLINE COMMENTS

> run-tests.py:424
>  sys.stderr.write('warning: --color=always ignored because'
> - 'pygments is not installed\n')
> + 'pygment is not installed\n')
>  

Seems like a wrong spellchecker?

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


[PATCH] templates: add substring and string length operations

2017-07-17 Thread Rodrigo Damazio Bovendorp via Mercurial-devel
# HG changeset patch
# User Rodrigo Damazio Bovendorp 
# Date 1500072378 25200
#  Fri Jul 14 15:46:18 2017 -0700
# Node ID 0ccebbd04efbd672fc71df7f52ec243057cbed7d
# Parent  c0d8de2724ce6240d2a4241aff78ce2ee92359c2
templates: add substring and string length operations

This will allow substr(text, start, end) and strlen(text) in templates,
permitting various text formatting, such as making a (non-graphing) log line be
limited to terminal width ("substr(desc, 0, termwidth)")

diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py
--- a/mercurial/templatefilters.py
+++ b/mercurial/templatefilters.py
@@ -362,6 +362,11 @@
 return ""
 return pycompat.bytestr(thing)
 
+@templatefilter('strlen')
+def stringlen(text):
+"""Any text. Turns the value into its length."""
+return len(text)
+
 @templatefilter('stripdir')
 def stripdir(text):
 """Treat the text as path and strip a directory level, if
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -1015,6 +1015,25 @@
 # i18n: "sub" is a keyword
 raise error.ParseError(_("sub got an invalid replacement: %s") % rpl)
 
+@templatefunc('substr(text, start[, end])')
+def substring(context, mapping, args):
+"""Returns a substring of the given text. Negative indices reference the 
end
+of the string."""
+if len(args) < 2 or len(args) > 3:
+  raise error.ParseError(_("substring takes 2 or 3 arguments"))
+
+text = evalstring(context, mapping, args[0])
+textlen = len(text)
+start = evalinteger(context, mapping, args[1],
+  _("start expects an integer index"))
+end = -1
+if len(args) > 2:
+  end = evalinteger(context, mapping, args[2],
+_("end expects an integer index"))
+
+# Python's [] already handles start and end boundary conditions.
+return text[start:end]
+
 @templatefunc('startswith(pattern, text)')
 def startswith(context, mapping, args):
 """Returns the value from the "text" argument
diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -4011,6 +4011,35 @@
   o  line 1
  line 2
 
+Test stringlen and substring
+Full desc is "Modify, add, remove, rename".
+String idxs:  012345678901
+Reverse string idxs:  10987654321
+
+  $ hg log -R a -r . --template '{desc|strlen}\n'
+  27
+  $ hg log -R a -r . --template '{substr(desc, 5, 10)}\n'
+  y, ad
+  $ hg log -R a -r . --template '{substr(desc, 5, -10)}\n'
+  y, add, remo
+  $ hg log -R a -r . --template '{substr(desc, 5, strlen(desc) - 10)}\n'
+  y, add, remo
+  $ hg log -R a -r . --template '{substr(desc, -10, -3)}\n'
+  ve, ren
+
+Test substr with invalid indices
+
+  $ hg log -R a -r . --template '{substr(desc, 5, 200)}\n'
+  y, add, remove, rename
+  $ hg log -R a -r . --template '{substr(desc, 10, 5)}\n'
+  
+  $ hg log -R a -r . --template '{substr(desc, 100, 200)}\n'
+  
+  $ hg log -R a -r . --template '{substr(desc, -100, -50)}\n'
+  
+  $ hg log -R a -r . --template '{substr(desc, -50, -100)}\n'
+  
+
 Test bad template with better error message
 
   $ hg log -Gv -R a --template '{desc|user()}'
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2] archive: use a templater to build the metadata file

2017-07-17 Thread Matt Harbison

On Mon, 17 Jul 2017 09:53:12 -0400, Yuya Nishihara  wrote:


On Mon, 17 Jul 2017 00:57:38 -0400, Matt Harbison wrote:

# HG changeset patch
# User Matt Harbison 
# Date 1500241236 14400
#  Sun Jul 16 17:40:36 2017 -0400
# Node ID 4d37def90ad5e0196dadb9bc2c9e62effad63691
# Parent  d09de637cbc88ed2db989298115d0c0cb6cc6f27
archive: use a templater to build the metadata file


Queued, thanks.


+default = (
+r'repo: {root}\n'
+r'node: {ifcontains(rev, revset("wdir()"),'
+r'"{p1node}{dirty}", "{node}")}\n'
+r'branch: {branch|utf8}\n'

-base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
-_rootctx(repo).hex(), hex, encoding.fromlocal(ctx.branch()))
+# {tags} on ctx includes local tags and 'tip', with no current  
way to
+# limit that to global tags.  Therefore, use {latesttag} as a  
substitute
+# when the distance is 0, since that will be the list of  
global tags on

+# ctx.
+r'{ifeq(latesttagdistance, 0, latesttag % "tag: {tag}\n",'
+   r'"{latesttag % "latesttag: {tag}\n"}'
+   r'latesttagdistance: {latesttagdistance}\n'
+   r'changessincelatesttag:  
{changessincelatesttag}\n")}'


You could use {separate('', '', ...)} to eliminate these weird indents.


I'm not sure what you mean.  I indented like this to vertically line up  
the true and false args to ifeq() for readability.  (Originally I used  
'tags' as the first arg, and it all lined up until I figured out how to  
hack around local tags in the {tags} keyword.  So that was a failure.)

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


Re: [PATCH 2 of 2] archive: add an experimental config to control the metadata file template

2017-07-17 Thread Matt Harbison

On Mon, 17 Jul 2017 09:56:25 -0400, Yuya Nishihara  wrote:


On Mon, 17 Jul 2017 00:57:39 -0400, Matt Harbison wrote:

# HG changeset patch
# User Matt Harbison 
# Date 1500266969 14400
#  Mon Jul 17 00:49:29 2017 -0400
# Node ID a85b7c754630cb4ac49b2cebea0ceca3d2f2eaaa
# Parent  4d37def90ad5e0196dadb9bc2c9e62effad63691
archive: add an experimental config to control the metadata file  
template


Experimental because given the possible complexity, it may be worth  
figuring out
how to load this from a file, similar to the style files for the log  
command,

instead of trying to stuff it on the command line.


Maybe we'll want to save it in [templates] section, and specify it in a  
similar

way to -T option?


Yes.  I didn't realize [templates] could hold a filename like that.  I'll  
follow up next cycle.

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


Re: D119: color: add autoterminfo option to prefer terminfo over ansi for non-windows

2017-07-17 Thread spectral (Kyle Lippincott)
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  If color.mode=auto in the config (this is the default) then color.py currently
  checks if using windows, and if not, uses 'ansi'.  This means that to get
  terminfo-based terminal support, one has to specify color.mode=terminfo
  explicitly; this enables several warnings if a user's terminal does not 
actually
  have support for terminfo (for example, we failed to load curses, or the
  terminal does not have a 'setaf' entry).
  
  If color.autoterminfo is True, we will attempt to use terminfo, and *silently*
  fallback to 'ansi' if it is not viable.
  
  This patch does nothing to change the ui.debug messages that are output if
  terminfo is chosen but the terminal does not support one of the "default"
  features, such as 'dim' or 'invis'.  Therefore, the fallback to 'ansi' if
  terminfo is not available will be silent, but if terminfo *is* available but
  does not support every feature, invocations with --debug will still see/start
  to see "no terminfo entry for " messages.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/color.py
  mercurial/help/config.txt
  tests/hgterm-dumb.ti
  tests/test-status-color.t

CHANGE DETAILS

diff --git a/tests/test-status-color.t b/tests/test-status-color.t
--- a/tests/test-status-color.t
+++ b/tests/test-status-color.t
@@ -256,6 +256,49 @@
   \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88m.hgignore\x1b[30m (esc)
   \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88mmodified\x1b[30m (esc)
 
+color.autoterminfo chooses terminfo if it's viable:
+
+  $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config 
color.mode=auto --config color.autoterminfo=1 --config color.status.clean=dim -A
+  \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2madded\x1b[30m (esc)
+  \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2mcopied\x1b[30m (esc)
+  \x1b[30m\x1b[30m  modified\x1b[30m (esc)
+  \x1b[30m\x1b[31m\x1b[2mR \x1b[30m\x1b[30m\x1b[31m\x1b[2mremoved\x1b[30m (esc)
+  \x1b[30m\x1b[36m\x1b[2m\x1b[4m! 
\x1b[30m\x1b[30m\x1b[36m\x1b[2m\x1b[4mdeleted\x1b[30m (esc)
+  \x1b[30m\x1b[35m\x1b[2m\x1b[4m? 
\x1b[30m\x1b[30m\x1b[35m\x1b[2m\x1b[4munknown\x1b[30m (esc)
+  \x1b[30m\x1b[30m\x1b[2mI \x1b[30m\x1b[30m\x1b[30m\x1b[2mignored\x1b[30m (esc)
+  \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88m.hgignore\x1b[30m (esc)
+  \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88mmodified\x1b[30m (esc)
+
+ECMA fallback warning with mode=terminfo explicit:
+
+  $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm-dumb.ti"
+  $ TERM=hgterm-dumb TERMINFO="$TESTTMP/terminfo" hg status --config 
color.mode=terminfo -A
+  no terminfo entry for setab/setaf: reverting to ECMA-48 color
+  no terminfo entry for setab/setaf: reverting to ECMA-48 color
+  no terminfo entry for setab/setaf: reverting to ECMA-48 color
+  \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
+  \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
+  \x1b[0;0m  modified\x1b[0m (esc)
+  \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
+  \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
+  \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
+  \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc)
+  \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc)
+  \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc)
+
+No fallback warning with autoterminfo:
+
+  $ TERM=hgterm-dumb TERMINFO="$TESTTMP/terminfo" hg status --config 
color.mode=auto --config color.autoterminfo=1 -A
+  \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
+  \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
+  \x1b[0;0m  modified\x1b[0m (esc)
+  \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
+  \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
+  \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
+  \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc)
+  \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc)
+  \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc)
+
 #endif
 
 
diff --git a/tests/hgterm-dumb.ti b/tests/hgterm-dumb.ti
new file mode 100644
--- /dev/null
+++ b/tests/hgterm-dumb.ti
@@ -0,0 +1,4 @@
+hgterm-dumb,
+   am,
+   cols#80,
+   bel=^G, cr=^M, cud1=^J, ind=^J,
diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
--- a/mercurial/help/config.txt
+++ b/mercurial/help/config.txt
@@ -412,22 +412,26 @@
 Configure the Mercurial color mode. For details about how to define your custom
 effect and style see :hg:`help color`.
 
+``autoterminfo``
+Make ``color.mode=auto`` attempt ``terminfo`` before falling back to
+``ansi``. Does not have an effect on Windows systems. (default: False)
+
 ``mode``
 String: control the method used to output color. One of ``auto``, ``ansi``,
-``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
-use ANSI mode by default (or win32 mode prior to Windows 10) if it detects

Re: [PATCH] test-phase-exchange: stabilize for Windows

2017-07-17 Thread Matt Harbison
On Mon, 17 Jul 2017 11:05:27 -0400, FUJIWARA Katsunori  
 wrote:



At Sat, 15 Jul 2017 23:49:54 -0400,
Matt Harbison wrote:


# HG changeset patch
# User Matt Harbison 
# Date 1500176793 14400
#  Sat Jul 15 23:46:33 2017 -0400
# Node ID 21904723f1ce9ea0fc6541ee48611ba3ef7128fb
# Parent  389536aff376d32d38f13305021c127245d4126a
test-phase-exchange: stabilize for Windows

diff --git a/tests/test-phases-exchange.t b/tests/test-phases-exchange.t
--- a/tests/test-phases-exchange.t
+++ b/tests/test-phases-exchange.t
@@ -1298,11 +1298,17 @@

 #endif

-Test that clone behaves like pull and doesn't
-publish changesets as plain push does
+Test that clone behaves like pull and doesn't publish changesets as  
plain push
+does.  The conditional output accounts for changes in the conditional  
block

+above.

   $ hg -R Upsilon phase -q --force --draft 2
   test-debug-phase: move rev 2: 0 -> 1
+  test-debug-phase: move rev 3: 0 -> 1 (unix-permissions no-root !)
+  test-debug-phase: move rev 7: 0 -> 1 (unix-permissions no-root !)
+  test-debug-phase: move rev 8: 0 -> 1 (unix-permissions no-root !)
+  test-debug-phase: move rev 9: 0 -> 1 (unix-permissions no-root !)
+


According to commit log of 4eec2f04a672, "(unix-permissions no-root !)"
marking means:

  - this line is required, if "unix-permissions no-root" is satisfied
  - this line is optional, otherwise

AFAIK, additional lines above appear:

  - not on POSIX, on which "unix-permissions no-root" is satisfied
  - but on windows, on which it isn't

Therefore, I expect this change to cause:

  - failure on POSIX, because all required lines disappear
  - success on Windows, because all optional lines appear

But in practice, this change doesn't cause failure on POSIX.

For more simple example, I expect that test script below fails,
because "true" command generate no output, even though "foobar" output
is always expected ("true" feature is always available). But it
doesn't fail in practice.

  
$ true
foobar (true !)
  

What do I misunderstand about "(feature !)" ?


Nice catch.  I think I see what's going on here, and another bug around  
(?).  I should have a fix tonight or tomorrow.




BTW, it seems bug of run-tests.py that "(unknown-feature !)" doesn't
cause failure.


Agreed.  I thought I remembered there being a test for a missing feature,  
and it complaining in that case, so I thought this was covered.  How  
should it fail?  Dropping the line seems too subtle.





   $ hg clone -q Upsilon Pi -r 7
   test-debug-phase: new rev 0:  x -> 0
   test-debug-phase: new rev 1:  x -> 0
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

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


Re: [PATCH 2 of 2] archive: add an experimental config to control the metadata file template

2017-07-17 Thread Matt Harbison
On Mon, 17 Jul 2017 13:54:29 -0400, Martin von Zweigbergk  
 wrote:


On Sun, Jul 16, 2017 at 9:57 PM, Matt Harbison   
wrote:

# HG changeset patch
# User Matt Harbison 
# Date 1500266969 14400
#  Mon Jul 17 00:49:29 2017 -0400
# Node ID a85b7c754630cb4ac49b2cebea0ceca3d2f2eaaa
# Parent  4d37def90ad5e0196dadb9bc2c9e62effad63691
archive: add an experimental config to control the metadata file  
template


Experimental because given the possible complexity, it may be worth  
figuring out
how to load this from a file, similar to the style files for the log  
command,

instead of trying to stuff it on the command line.

diff --git a/mercurial/archival.py b/mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -99,7 +99,8 @@
 )

 opts = {
-'template': default
+'template': repo.ui.config('experimental',  
'archivemetatemplate',

+   default)


I think this should be registered with the new coreconfigitem() method
(other experimental options are).


I actually started out that way, but given how cryptic the default value  
is, I wasn't sure it was a good idea.  I've only been skimming the  
configitem patches, but I could see maybe adding the registered default to  
the help text automatically.  I don't think we want to display this one  
for simplicity.  I also didn't see anything nearly this complex.


Alternately, we could move this string out to a template file, and the  
default is the filename (but I wonder if there will be platform  
differences when listing it).  Or we could set the default to None, and  
document that the default is the legacy content.  But I guess that  
undermines having the defaults in one place, and isn't much different than  
this.


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


Re: D121: phabricator: use Phabricator's last node information

2017-07-17 Thread quark (Jun Wu)
quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This makes it more strict when checking whether or not we should update a
  Differential Revision. For example,
  
a) Alice updates D1 to content 1.
b) Bob updates D1 to content 2.
c) Alice tries to update D1 to content 1.
  
  Previously, `c)` will do nothing because `phabsend` detects the patch is not
  changed. A more correct behavior is to override Bob's update here, hence the
  patch.
  
  This also makes it possible to return a reaonsable "last node" when there is
  no tags but only `Differential Revision` commit messages.

TEST PLAN
for i in A B C; do echo $i > $i; hg ci -m $i -A $i; done

hg phabsend 0::
# D40: created
# D41: created
# D42: created

echo 3 >> C; hg amend; hg phabsend .
# D42: updated

hg tag --local --hidden -r 2 -f D42
# move tag to the previous version

hg phabsend .
# D42: skipped (previously it would be "updated")

rm -rf .hg; hg init
hg phabread --stack D42 | hg import -
hg phabsend .
# D42: updated
hg tag --local --remove D42
hg commit --amend
hg phabsend .
# D42: updated (no new diff uploaded, previously it will update new diff)

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -147,19 +147,22 @@
 for node in nodelist with known previous sent versions, or associated
 Differential Revision IDs.
 
-Examines all precursors and their tags. Tags with format like "D1234" are
-considered a match and the node with that tag, and the number after "D"
-(ex. 1234) will be returned.
+Examines commit messages like "Differential Revision:" to get the
+association information.
 
-If tags are not found, examine commit message. The "Differential Revision:"
-line could associate this changeset to a Differential Revision.
+If such commit message line is not found, examines all precursors and their
+tags. Tags with format like "D1234" are considered a match and the node
+with that tag, and the number after "D" (ex. 1234) will be returned.
+
+The ``old node``, if not None, is guaranteed to be the last diff of
+corresponding Differential Revision, and exist in the repo.
 """
 url, token = readurltoken(repo)
 unfi = repo.unfiltered()
 nodemap = unfi.changelog.nodemap
 
 result = {} # {node: (oldnode or None, drev)}
-toconfirm = {} # {node: (oldnode, {precnode}, drev)}
+toconfirm = {} # {node: (force, {precnode}, drev)}
 for node in nodelist:
 ctx = unfi[node]
 # For tags like "D123", put them into "toconfirm" to verify later
@@ -169,35 +172,48 @@
 for tag in unfi.nodetags(n):
 m = _differentialrevisiontagre.match(tag)
 if m:
-toconfirm[node] = (n, set(precnodes), int(m.group(1)))
+toconfirm[node] = (0, set(precnodes), int(m.group(1)))
 continue
 
-# Check commit message
+# Check commit message. If "Differential Revision:" exists and matches
+# the URL. Trust it blindly even if precursors do not match.
 m = _differentialrevisiondescre.search(ctx.description())
 if m:
-result[node] = (None, int(m.group(1)))
+toconfirm[node] = (1, set(precnodes), int(m.group(1)))
 
 # Double check if tags are genuine by collecting all old nodes from
 # Phabricator, and expect precursors overlap with it.
 if toconfirm:
-confirmed = {} # {drev: {oldnode}}
-drevs = [drev for n, precs, drev in toconfirm.values()]
-diffs = callconduit(unfi, 'differential.querydiffs',
-{'revisionIDs': drevs})
-for diff in diffs.values():
-drev = int(diff[r'revisionID'])
-oldnode = bin(encoding.unitolocal(getdiffmeta(diff).get(r'node')))
-if node:
-confirmed.setdefault(drev, set()).add(oldnode)
-for newnode, (oldnode, precset, drev) in toconfirm.items():
-if bool(precset & confirmed.get(drev, set())):
-result[newnode] = (oldnode, drev)
-else:
+drevs = [drev for force, precs, drev in toconfirm.values()]
+alldiffs = callconduit(unfi, 'differential.querydiffs',
+   {'revisionIDs': drevs})
+getnode = lambda d: bin(encoding.unitolocal(
+getdiffmeta(d).get(r'node', ''))) or None
+for newnode, (force, precset, drev) in toconfirm.items():
+diffs = [d for d in alldiffs.values()
+ if int(d[r'revisionID']) == drev]
+
+# "precursors" as

Re: D122: phabricator: add --amend option to phabsend

2017-07-17 Thread quark (Jun Wu)
quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Previously `hg phabsend` was imitating `hg email` and won't mutate
  changesets. That works fine with reviewer-push workflow, reviewers run
  `phabread`, `import`.
  
  However, it does not work well with author-push workflow. Namely, the author
  needs to run extra commands to get the right commit message, and remove the
  local tag after push.
  
  This patch solves those issues by adding the `--amend` option, so local
  changesets will have the right commit message, and tags become unnecessary.

TEST PLAN
  Given the following DAG:
  
o  17
o  16
| o  15
| @  14
|/
o  13
o  12
  
  Run `hg phabsend '(13::)-17'  --amend`, check the new DAG looks like:
  
o  21
| o  20
| @  19
|/
o  18
| o  17
| x  16
| x  13
|/
o  12
  
  And commit messages are updated to contain the `Differential Revision` lines.
  
  Also check `phabsend .` followed by a `phabsend . --amend`, the commit
  message will be updated and the tag will be removed.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -38,6 +38,8 @@
 from mercurial.node import bin, nullid
 from mercurial.i18n import _
 from mercurial import (
+cmdutil,
+context,
 encoding,
 error,
 mdiff,
@@ -325,6 +327,7 @@
 
 @command('phabsend',
  [('r', 'rev', [], _('revisions to send'), _('REV')),
+  ('', 'amend', False, _('update commit messages')),
   ('', 'reviewer', [], _('specify reviewers'))],
  _('REV [OPTIONS]'))
 def phabsend(ui, repo, *revs, **opts):
@@ -334,16 +337,21 @@
 with a linear dependencies relationship using the order specified by the
 revset.
 
-For the first time uploading changesets, local tags will be created to
-maintain the association. After the first time, phabsend will check
-obsstore and tags information so it can figure out whether to update an
-existing Differential Revision, or create a new one.
+If --amend is set, update commit messages so they have the
+``Differential Revision`` URL, remove related tags. This is similar to what
+arcanist will do, and is more desired in author-push workflows. Otherwise,
+use local tags to record the ``Differential Revision`` association.
+
+phabsend will check obsstore and the above association to decide whether to
+update an existing Differential Revision, or create a new one.
 """
 revs = list(revs) + opts.get('rev', [])
 revs = scmutil.revrange(repo, revs)
 
 if not revs:
 raise error.Abort(_('phabsend requires at least one changeset'))
+if opts.get('amend'):
+cmdutil.checkunfinished(repo)
 
 actions = []
 reviewers = opts.get('reviewer', [])
@@ -355,6 +363,7 @@
 
 # Send patches one by one so we know their Differential Revision IDs and
 # can provide dependency relationship
+drevids = []
 lastrevid = None
 for rev in revs:
 ui.debug('sending rev %d\n' % rev)
@@ -372,20 +381,55 @@
 else:
 action = _('created')
 
-# Create a local tag to note the association
-tagname = 'D%d' % newrevid
-tags.tag(repo, tagname, ctx.node(), message=None, user=None,
- date=None, local=True)
+# Create a local tag to note the association, if commit message
+# does not have it already
+m = _differentialrevisiondescre.search(ctx.description())
+if not m or int(m.group(1)) != newrevid:
+tagname = 'D%d' % newrevid
+tags.tag(repo, tagname, ctx.node(), message=None, user=None,
+ date=None, local=True)
 else:
 # Nothing changed. But still set "newrevid" so the next revision
 # could depend on this one.
 newrevid = revid
 action = _('skipped')
 
 ui.write(_('D%s: %s - %s: %s\n') % (newrevid, action, ctx,
 ctx.description().split('\n')[0]))
+drevids.append(newrevid)
 lastrevid = newrevid
 
+# Update commit messages and remove tags
+if opts.get('amend'):
+unfi = repo.unfiltered()
+drevs = callconduit(repo, 'differential.query', {'ids': drevids})
+with repo.wlock(), repo.lock(), repo.transaction('phabsend'):
+wnode = unfi['.'].node()
+mapping = {} # {oldnode: newnode}
+for i, rev in enumerate(revs):
+old = unfi[rev]
+drevid = drevids[i]
+drev = [d for d in drevs if int(d[r'id']) == drevid][0]
+newdesc = getdescfromdrev(drev)
+   

Re: D120: phabricator: add --status option to phabread

2017-07-17 Thread quark (Jun Wu)
quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The --status option filters Differential Revisions by their status, like
  "Opened", "Accetped" etc. It could be useful to skip certain revisions.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -526,12 +526,19 @@
 meta[r'parent'] = commit[r'parents'][0]
 return meta or {}
 
-def readpatch(repo, params, write, stack=False):
+def _normalizestatus(name):
+"""normalize status name: remove spaces and convert to lower case"""
+return name.replace(' ', '').lower()
+
+def readpatch(repo, params, write, stack=False, status=None):
 """generate plain-text patch readable by 'hg import'
 
 write is usually ui.write. params is passed to "differential.query". If
-stack is True, also write dependent patches.
+stack is True, also write dependent patches. If status is not None, it's a
+list of strings and Differential Revision outside them will be skipped.
 """
+statusset = set(_normalizestatus(s) for s in status or ())
+
 # Differential Revisions
 drevs = querydrev(repo, params, stack)
 
@@ -541,6 +548,9 @@
 
 # Generate patch for each drev
 for drev in drevs:
+if statusset and _normalizestatus(drev[r'statusName']) not in 
statusset:
+continue
+
 repo.ui.note(_('reading D%s\n') % drev[r'id'])
 
 diffid = max(int(v) for v in drev[r'diffs'])
@@ -559,18 +569,24 @@
 write(('%s%s\n%s') % (header, desc, body))
 
 @command('phabread',
- [('', 'stack', False, _('read dependencies'))],
+ [('', 'stack', False, _('read dependencies')),
+  ('', 'status', [], _('filter patches by status'))],
  _('REVID [OPTIONS]'))
 def phabread(ui, repo, revid, **opts):
 """print patches from Phabricator suitable for importing
 
 REVID could be a Differential Revision identity, like ``D123``, or just the
 number ``123``, or a full URL like ``https://phab.example.com/D123``.
 
 If --stack is given, follow dependencies information and read all patches.
+
+If --status is given, only print Differential Revisions matching one of the
+given statuses. Statuses could be ``Accepted``, ``NeedsReview``,
+``NeedsRevision``, ``Closed``, ``Abandoned``.
 """
 try:
 revid = int(revid.split('/')[-1].replace('D', ''))
 except ValueError:
 raise error.Abort(_('invalid Revision ID: %s') % revid)
-readpatch(repo, {'ids': [revid]}, ui.write, opts.get('stack'))
+readpatch(repo, {'ids': [revid]}, ui.write, opts.get('stack'),
+  opts.get('status'))



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: [PATCH 2 of 2] archive: add an experimental config to control the metadata file template

2017-07-17 Thread Martin von Zweigbergk via Mercurial-devel
On Mon, Jul 17, 2017 at 8:29 PM, Matt Harbison  wrote:
> On Mon, 17 Jul 2017 13:54:29 -0400, Martin von Zweigbergk
>  wrote:
>
>> On Sun, Jul 16, 2017 at 9:57 PM, Matt Harbison 
>> wrote:
>>>
>>> # HG changeset patch
>>> # User Matt Harbison 
>>> # Date 1500266969 14400
>>> #  Mon Jul 17 00:49:29 2017 -0400
>>> # Node ID a85b7c754630cb4ac49b2cebea0ceca3d2f2eaaa
>>> # Parent  4d37def90ad5e0196dadb9bc2c9e62effad63691
>>> archive: add an experimental config to control the metadata file template
>>>
>>> Experimental because given the possible complexity, it may be worth
>>> figuring out
>>> how to load this from a file, similar to the style files for the log
>>> command,
>>> instead of trying to stuff it on the command line.
>>>
>>> diff --git a/mercurial/archival.py b/mercurial/archival.py
>>> --- a/mercurial/archival.py
>>> +++ b/mercurial/archival.py
>>> @@ -99,7 +99,8 @@
>>>  )
>>>
>>>  opts = {
>>> -'template': default
>>> +'template': repo.ui.config('experimental',
>>> 'archivemetatemplate',
>>> +   default)
>>
>>
>> I think this should be registered with the new coreconfigitem() method
>> (other experimental options are).
>
>
> I actually started out that way, but given how cryptic the default value is,
> I wasn't sure it was a good idea.

You mean because the it's nice to have the default value close to the
code that uses it? Yeah, I've felt that too.

> I've only been skimming the configitem
> patches, but I could see maybe adding the registered default to the help
> text automatically.  I don't think we want to display this one for
> simplicity.  I also didn't see anything nearly this complex.

You could perhaps use (abuse?) the "dynamicdefault" for this.

>
> Alternately, we could move this string out to a template file, and the
> default is the filename (but I wonder if there will be platform differences
> when listing it).  Or we could set the default to None, and document that
> the default is the legacy content.  But I guess that undermines having the
> defaults in one place, and isn't much different than this.
>
> Thoughts?

I'd just leave it as is for now.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D118: run-tests: remove unnecessary 'with_color' variable

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> quark wrote in run-tests.py:424
> Seems like a wrong spellchecker?

Oops, thanks for spotting that. It was a rebase artifact.

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D118: run-tests: remove unnecessary 'with_color' variable

2017-07-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 234.
martinvonz marked an inline comment as done.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D118?vs=229&id=234

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -88,15 +88,13 @@
 osenvironb = getattr(os, 'environb', os.environ)
 processlock = threading.Lock()
 
-with_color = False
 pygmentspresent = False
 # ANSI color is unsupported prior to Windows 10
 if os.name != 'nt':
 try: # is pygments installed
 import pygments
 import pygments.lexers as lexers
 import pygments.formatters as formatters
-with_color = True
 pygmentspresent = True
 except ImportError:
 pass
@@ -414,15 +412,15 @@
  '(use --with-chg instead)')
 
 if options.color == 'auto':
-options.color = with_color
+options.color = pygmentspresent
 if not sys.stderr.isatty(): # check if the terminal is capable
 options.color = False
 elif options.color == 'never':
 options.color = False
 else: # 'always', for testing purposes
 options.color = pygmentspresent
 if not pygmentspresent:
-sys.stderr.write('warning: --color=always ignored because'
+sys.stderr.write('warning: --color=always ignored because '
  'pygments is not installed\n')
 
 global useipv6



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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


Re: D120: phabricator: add --status option to phabread

2017-07-17 Thread quark (Jun Wu)
quark abandoned this revision.
quark added a comment.


  Have a better idea about how to do this.

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

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