[PATCH] help: minor copy editing for grammar

2017-10-31 Thread Matt Harbison
# HG changeset patch
# User Matt Harbison 
# Date 1509505769 14400
#  Tue Oct 31 23:09:29 2017 -0400
# Branch stable
# Node ID acfcc84e9e4c9ed5b33322250f0268419ffd81d2
# Parent  bf2db35a6fe7a02b69eaa0e35708cf0044d73510
help: minor copy editing for grammar

diff --git a/hgext/share.py b/hgext/share.py
--- a/hgext/share.py
+++ b/hgext/share.py
@@ -34,7 +34,7 @@
 requested in the :hg:`clone` command matches exactly to a repository
 that was cloned before.
 
-The default naming mode is "identity."
+The default naming mode is "identity".
 '''
 
 from __future__ import absolute_import
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2072,7 +2072,7 @@
   (grafted from CHANGESETHASH)
 
 If --force is specified, revisions will be grafted even if they
-are already ancestors of or have been grafted to the destination.
+are already ancestors of, or have been grafted to, the destination.
 This is useful when the revisions have since been backed out.
 
 If a graft merge results in conflicts, the graft process is
@@ -3075,7 +3075,7 @@
 
 Show new changesets found in the specified path/URL or the default
 pull location. These are the changesets that would have been pulled
-if a pull at the time you issued this command.
+by :hg:`pull` at the time you issued this command.
 
 See pull for valid source format details.
 
@@ -3808,8 +3808,8 @@
 With one of -p/--public, -d/--draft or -s/--secret, change the
 phase value of the specified revisions.
 
-Unless -f/--force is specified, :hg:`phase` won't move changeset from a
-lower phase to an higher phase. Phases are ordered as follows::
+Unless -f/--force is specified, :hg:`phase` won't move changesets from a
+lower phase to a higher phase. Phases are ordered as follows::
 
 public < draft < secret
 
diff --git a/mercurial/help/internals/config.txt 
b/mercurial/help/internals/config.txt
--- a/mercurial/help/internals/config.txt
+++ b/mercurial/help/internals/config.txt
@@ -23,7 +23,7 @@
 -
 
 If the default provided is a callable, it is called to retrieve the default
-value when accessing the config option. This is useful for default value that
+value when accessing the config option. This is useful for default values that
 are mutable like the empty list::
 
 coreconfigitem('pager', 'ignore',
@@ -31,8 +31,8 @@
 )
 
 In addition, there are cases where the default is not fixed, but computed from
-other properties. In this case, use the ``dynamicdefault`` object as value for
-the ``default`` parameters. A default value is then explicitly required when
+other properties. In this case, use the ``dynamicdefault`` object as the value
+for the ``default`` parameter. A default value is then explicitly required when
 reading the option::
 
 # registration
@@ -41,7 +41,7 @@
 )
 
 # usage
-ui.config('web', 'name', dirnam)
+ui.config('web', 'name', dirname)
 
 Free form options
 -
@@ -63,7 +63,7 @@
 priority=-1,
 )
 
-The ``priority`` parameter control the order used to match the generic pattern
+The ``priority`` parameter controls the order used to match the generic pattern
 (lower first).
 
 Config Option in Extensions
@@ -85,24 +85,24 @@
 The ``dynamicdefault`` object is then available as
 ``configitem.dynamicdefault``.
 
-Supporting older version
-
+Supporting older versions
+-
 
-The register was introduced in Mercurial 4.3, the ``generic`` parameter was
+The registry was introduced in Mercurial 4.3, and the ``generic`` parameter was
 introduced in 4.4. Starting with Mercurial 4.4, all core options were 
registered
 and developer warnings are emitted when accessing unregistered option.
 
-Extensions supporting version older than Mercurial-4.3 cannot rely on the
-default value registered. The simplest way to register option while still
-supporting older version is to use ``dynamicdefault`` for option requiring a
-default value. The existing code passing an explicit default can then stay in
-use until compatibility to Mercurial 4.2 is dropped.
+Extensions supporting versions older than Mercurial 4.3 cannot rely on the
+default value being registered. The simplest way to register an option while
+still supporting an older version is to use ``dynamicdefault`` for options
+requiring a default value. The existing code passing an explicit default can
+then stay in use until compatibility with Mercurial 4.2 is dropped.
 
-As reminder here are the default value for each config types:
+As reminder, here are the default values for each config type:
 - config:  None
 - configbool:  False
 - configbytes: 0
 - configdate:  None
 - configint:   None
 - configlist:  []
-- configpath: None
+- configpath:  None
diff --git a/mercurial/help/merge-tools.txt b/mercurial/help/merge-tools.txt
--- 

Re: [PATCH remotenames-ext] remotenames: push anonymous head if --force is given

2017-10-31 Thread Sean Farley

Pulkit Goyal <7895pul...@gmail.com> writes:

> # HG changeset patch
> # User Pulkit Goyal <7895pul...@gmail.com>
> # Date 1507153197 -19800
> #  Thu Oct 05 03:09:57 2017 +0530
> # Node ID b3cf58915bc36b7e01470f6a55dc5bd8b8f4cc9a
> # Parent  e7cce2b6198ace7769e2c68a5b67eddde794cfeb
> remotenames: push anonymous head if --force is given
>
> If force is passed, we should not care whether --anon is passed or not as the
> user forced the push and we should push the anonymous head also.
>
> I noticed this when I enabled the extension and got the anonymous head 
> warning.
> Whenever I push to my personal repo and see error while, I just pass -f but
> this time, passing -f didn't work which should.

Sorry for the delay; looks like this dropped through the cracks. Queued,
thanks!


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 remotenames-ext] tests: re-order tags and bookmarks in tracking test

2017-10-31 Thread Sean Farley

Martijn Pieters  writes:

> Review handled on Phabricator, at https://phab.mercurial-scm.org/D830

This was incorrectly pushed it seems. I'll fix it locally and re-push. I
imagine Ryan messed this up due to his extensions that I assume hide
non-bookmarked heads? Anyways, I've fixed it for now.


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


D776: merge: add merge action 'p' to record path conflicts during update

2017-10-31 Thread mbolin (Michael Bolin)
mbolin added a comment.


  What test verifies this behavior? Do we need a new one?

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH STABLE] configitems: relax warning about unwanted default value

2017-10-31 Thread Yuya Nishihara
On Tue, 31 Oct 2017 10:44:42 -0400, Augie Fackler wrote:
> > On Oct 31, 2017, at 10:32, Yuya Nishihara  wrote:
> > # HG changeset patch
> > # User Yuya Nishihara 
> > # Date 1509457050 -32400
> > #  Tue Oct 31 22:37:30 2017 +0900
> > # Branch stable
> > # Node ID 4f00958f5fc9d7ae90468f6159dff7720d0f2b27
> > # Parent  5caae380ff90735b1a1841a4f26147bf0f01351b
> > configitems: relax warning about unwanted default value
> > 
> > The original condition was a bit harsh for extension authors since 
> > third-party
> > extensions need to preserve compatibility with older Mercurial versions, 
> > where
> > no defaults would be loaded from the configtable. So let's silence the 
> > warning
> > if the given default value matches, which should be harmless.
> > 
> > diff --git a/mercurial/ui.py b/mercurial/ui.py
> > --- a/mercurial/ui.py
> > +++ b/mercurial/ui.py
> > @@ -471,12 +471,16 @@ class ui(object):
> > return value
> > 
> > def _config(self, section, name, default=_unset, untrusted=False):
> > -value = default
> > +value = itemdefault = default
> > item = self._knownconfig.get(section, {}).get(name)
> > alternates = [(section, name)]
> > 
> > if item is not None:
> > alternates.extend(item.alias)
> > +if callable(item.default):
> > +itemdefault = item.default()
> > +else:
> > +itemdefault = item.default
> > else:
> > msg = ("accessing unregistered config item: '%s.%s'")
> > msg %= (section, name)
> > @@ -490,12 +494,11 @@ class ui(object):
> > msg = "config item requires an explicit default value: 
> > '%s.%s'"
> > msg %= (section, name)
> > self.develwarn(msg, 2, 'warn-config-default')
> > -elif callable(item.default):
> > -value = item.default()
> > else:
> > -value = item.default
> > +value = itemdefault
> > elif (item is not None
> > -  and item.default is not configitems.dynamicdefault):
> > +  and item.default is not configitems.dynamicdefault
> > +  and default != itemdefault):
> > msg = ("specifying a default value for a registered "
> >"config item: '%s.%s' '%s'")
> 
> nit: should I edit the message to say "mismatched default" since that's what 
> we're really complaining about?

I don't care much about that, but "specifying a mismatched default" sounds
more correct. Can you update it in flight?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH STABLE] configitems: relax warning about unwanted default value

2017-10-31 Thread Augie Fackler

> On Oct 31, 2017, at 10:32, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1509457050 -32400
> #  Tue Oct 31 22:37:30 2017 +0900
> # Branch stable
> # Node ID 4f00958f5fc9d7ae90468f6159dff7720d0f2b27
> # Parent  5caae380ff90735b1a1841a4f26147bf0f01351b
> configitems: relax warning about unwanted default value
> 
> The original condition was a bit harsh for extension authors since third-party
> extensions need to preserve compatibility with older Mercurial versions, where
> no defaults would be loaded from the configtable. So let's silence the warning
> if the given default value matches, which should be harmless.
> 
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -471,12 +471,16 @@ class ui(object):
> return value
> 
> def _config(self, section, name, default=_unset, untrusted=False):
> -value = default
> +value = itemdefault = default
> item = self._knownconfig.get(section, {}).get(name)
> alternates = [(section, name)]
> 
> if item is not None:
> alternates.extend(item.alias)
> +if callable(item.default):
> +itemdefault = item.default()
> +else:
> +itemdefault = item.default
> else:
> msg = ("accessing unregistered config item: '%s.%s'")
> msg %= (section, name)
> @@ -490,12 +494,11 @@ class ui(object):
> msg = "config item requires an explicit default value: 
> '%s.%s'"
> msg %= (section, name)
> self.develwarn(msg, 2, 'warn-config-default')
> -elif callable(item.default):
> -value = item.default()
> else:
> -value = item.default
> +value = itemdefault
> elif (item is not None
> -  and item.default is not configitems.dynamicdefault):
> +  and item.default is not configitems.dynamicdefault
> +  and default != itemdefault):
> msg = ("specifying a default value for a registered "
>"config item: '%s.%s' '%s'")

nit: should I edit the message to say "mismatched default" since that's what 
we're really complaining about?

> msg %= (section, name, default)
> diff --git a/tests/test-devel-warnings.t b/tests/test-devel-warnings.t
> --- a/tests/test-devel-warnings.t
> +++ b/tests/test-devel-warnings.t
> @@ -352,17 +352,21 @@ Test warning on config option access and
>> 
>> configitem('test', 'some', default='foo')
>> configitem('test', 'dynamic', default=configitems.dynamicdefault)
> +  > configitem('test', 'callable', default=list)
>> # overwrite a core config
>> configitem('ui', 'quiet', default=False)
>> configitem('ui', 'interactive', default=None)
>> 
>> @command(b'buggyconfig')
>> def cmdbuggyconfig(ui, repo):
> -  > repo.ui.config('ui', 'quiet', False)
> -  > repo.ui.config('ui', 'interactive', None)
> +  > repo.ui.config('ui', 'quiet', True)
> +  > repo.ui.config('ui', 'interactive', False)
> +  > repo.ui.config('test', 'some', 'bar')
>>repo.ui.config('test', 'some', 'foo')
>>repo.ui.config('test', 'dynamic', 'some-required-default')
>>repo.ui.config('test', 'dynamic')
> +  > repo.ui.config('test', 'callable', [])
> +  > repo.ui.config('test', 'callable', 'foo')
>>repo.ui.config('test', 'unregistered')
>>repo.ui.config('unregistered', 'unregistered')
>> EOF
> @@ -370,10 +374,11 @@ Test warning on config option access and
>   $ hg --config "extensions.buggyconfig=${TESTTMP}/buggyconfig.py" buggyconfig
>   devel-warn: extension 'buggyconfig' overwrite config item 'ui.interactive' 
> at: */mercurial/extensions.py:* (_loadextra) (glob)
>   devel-warn: extension 'buggyconfig' overwrite config item 'ui.quiet' at: 
> */mercurial/extensions.py:* (_loadextra) (glob)
> -  devel-warn: specifying a default value for a registered config item: 
> 'ui.quiet' 'False' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
> -  devel-warn: specifying a default value for a registered config item: 
> 'ui.interactive' 'None' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
> -  devel-warn: specifying a default value for a registered config item: 
> 'test.some' 'foo' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
> +  devel-warn: specifying a default value for a registered config item: 
> 'ui.quiet' 'True' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
> +  devel-warn: specifying a default value for a registered config item: 
> 'ui.interactive' 'False' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
> +  devel-warn: specifying a default value for a registered config item: 
> 'test.some' 'bar' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
>   devel-warn: config item requires an explicit default value: 'test.dynamic' 
> at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) 

[PATCH STABLE] configitems: relax warning about unwanted default value

2017-10-31 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1509457050 -32400
#  Tue Oct 31 22:37:30 2017 +0900
# Branch stable
# Node ID 4f00958f5fc9d7ae90468f6159dff7720d0f2b27
# Parent  5caae380ff90735b1a1841a4f26147bf0f01351b
configitems: relax warning about unwanted default value

The original condition was a bit harsh for extension authors since third-party
extensions need to preserve compatibility with older Mercurial versions, where
no defaults would be loaded from the configtable. So let's silence the warning
if the given default value matches, which should be harmless.

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -471,12 +471,16 @@ class ui(object):
 return value
 
 def _config(self, section, name, default=_unset, untrusted=False):
-value = default
+value = itemdefault = default
 item = self._knownconfig.get(section, {}).get(name)
 alternates = [(section, name)]
 
 if item is not None:
 alternates.extend(item.alias)
+if callable(item.default):
+itemdefault = item.default()
+else:
+itemdefault = item.default
 else:
 msg = ("accessing unregistered config item: '%s.%s'")
 msg %= (section, name)
@@ -490,12 +494,11 @@ class ui(object):
 msg = "config item requires an explicit default value: '%s.%s'"
 msg %= (section, name)
 self.develwarn(msg, 2, 'warn-config-default')
-elif callable(item.default):
-value = item.default()
 else:
-value = item.default
+value = itemdefault
 elif (item is not None
-  and item.default is not configitems.dynamicdefault):
+  and item.default is not configitems.dynamicdefault
+  and default != itemdefault):
 msg = ("specifying a default value for a registered "
"config item: '%s.%s' '%s'")
 msg %= (section, name, default)
diff --git a/tests/test-devel-warnings.t b/tests/test-devel-warnings.t
--- a/tests/test-devel-warnings.t
+++ b/tests/test-devel-warnings.t
@@ -352,17 +352,21 @@ Test warning on config option access and
   > 
   > configitem('test', 'some', default='foo')
   > configitem('test', 'dynamic', default=configitems.dynamicdefault)
+  > configitem('test', 'callable', default=list)
   > # overwrite a core config
   > configitem('ui', 'quiet', default=False)
   > configitem('ui', 'interactive', default=None)
   > 
   > @command(b'buggyconfig')
   > def cmdbuggyconfig(ui, repo):
-  > repo.ui.config('ui', 'quiet', False)
-  > repo.ui.config('ui', 'interactive', None)
+  > repo.ui.config('ui', 'quiet', True)
+  > repo.ui.config('ui', 'interactive', False)
+  > repo.ui.config('test', 'some', 'bar')
   > repo.ui.config('test', 'some', 'foo')
   > repo.ui.config('test', 'dynamic', 'some-required-default')
   > repo.ui.config('test', 'dynamic')
+  > repo.ui.config('test', 'callable', [])
+  > repo.ui.config('test', 'callable', 'foo')
   > repo.ui.config('test', 'unregistered')
   > repo.ui.config('unregistered', 'unregistered')
   > EOF
@@ -370,10 +374,11 @@ Test warning on config option access and
   $ hg --config "extensions.buggyconfig=${TESTTMP}/buggyconfig.py" buggyconfig
   devel-warn: extension 'buggyconfig' overwrite config item 'ui.interactive' 
at: */mercurial/extensions.py:* (_loadextra) (glob)
   devel-warn: extension 'buggyconfig' overwrite config item 'ui.quiet' at: 
*/mercurial/extensions.py:* (_loadextra) (glob)
-  devel-warn: specifying a default value for a registered config item: 
'ui.quiet' 'False' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
-  devel-warn: specifying a default value for a registered config item: 
'ui.interactive' 'None' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
-  devel-warn: specifying a default value for a registered config item: 
'test.some' 'foo' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
+  devel-warn: specifying a default value for a registered config item: 
'ui.quiet' 'True' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
+  devel-warn: specifying a default value for a registered config item: 
'ui.interactive' 'False' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
+  devel-warn: specifying a default value for a registered config item: 
'test.some' 'bar' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
   devel-warn: config item requires an explicit default value: 'test.dynamic' 
at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
+  devel-warn: specifying a default value for a registered config item: 
'test.callable' 'foo' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
   devel-warn: accessing unregistered config item: 'test.unregistered' at: 
$TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
   devel-warn: 

D1270: help: adding a topic on flags

2017-10-31 Thread dlax (Denis Laxalde)
dlax added inline comments.

INLINE COMMENTS

> flags.txt:30
> +In order to set a default value for a flag in an hgrc file, set it under the
> +[defaults] section of the hgrc file::
> +

`hg help config` says that "defaults" are deprecated and that aliases should be 
used instead.

REPOSITORY
  rHG Mercurial

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

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