mercurial@42683: 18 new changesets (3 on stable)

2019-08-03 Thread Mercurial Commits
18 new changesets (3 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/cfb774aae660
changeset:   42666:cfb774aae660
parent:  42663:4b04244f2d5f
user:Pulkit Goyal 
date:Mon Jul 29 13:25:05 2019 +0300
summary: tests: sort imports in test-bookmarks-corner-case.t

https://www.mercurial-scm.org/repo/hg/rev/6d50a7ebf7e0
changeset:   42667:6d50a7ebf7e0
user:Pulkit Goyal 
date:Mon Jul 29 13:22:52 2019 +0300
summary: py3: add one more test to list of passing tests

https://www.mercurial-scm.org/repo/hg/rev/52a383451739
changeset:   42668:52a383451739
user:Navaneeth Suresh 
date:Tue Jul 30 21:36:15 2019 +0530
summary: unshelve: add abort on using continue and interactive together

https://www.mercurial-scm.org/repo/hg/rev/36c692eb28d3
changeset:   42669:36c692eb28d3
user:Martin von Zweigbergk 
date:Sun Jul 21 07:59:16 2019 -0700
summary: transaction: leave unfinished without crashing when not properly 
released

https://www.mercurial-scm.org/repo/hg/rev/a7f1a0b3f461
changeset:   42670:a7f1a0b3f461
user:Raphaël Gomès 
date:Tue Jul 23 11:12:36 2019 +0200
summary: module-policy: update rust extension import to use the new module 
policy

https://www.mercurial-scm.org/repo/hg/rev/e77be7e2109f
changeset:   42671:e77be7e2109f
parent:  42670:a7f1a0b3f461
parent:  42665:39b98107773a
user:Augie Fackler 
date:Thu Aug 01 12:23:07 2019 -0400
summary: merge with stable

https://www.mercurial-scm.org/repo/hg/rev/51a2e3102db2
changeset:   42672:51a2e3102db2
user:Navaneeth Suresh 
date:Thu Aug 01 22:03:52 2019 +0530
summary: config: add defaultvalue template keyword

https://www.mercurial-scm.org/repo/hg/rev/74b4cd091e0d
changeset:   42673:74b4cd091e0d
user:Danny Hooper 
date:Wed May 22 16:22:06 2019 -0700
summary: fix: run fixer tools in the repo root as cwd so they can use the 
working copy

https://www.mercurial-scm.org/repo/hg/rev/70bd1965bd07
changeset:   42674:70bd1965bd07
user:Raphaël Gomès 
date:Fri Aug 02 09:44:11 2019 +0200
summary: byteify-strings: handle multi-line strings in _ensuresysstr

https://www.mercurial-scm.org/repo/hg/rev/e9592e113c31
changeset:   42675:e9592e113c31
user:Raphaël Gomès 
date:Fri Aug 02 09:48:13 2019 +0200
summary: byteify-strings: handle triple quoted strings if they are not 
docstrings

https://www.mercurial-scm.org/repo/hg/rev/b9a200477edf
changeset:   42676:b9a200477edf
user:Raphaël Gomès 
date:Fri Aug 02 09:55:32 2019 +0200
summary: byteify-strings: add support for ignore comments

https://www.mercurial-scm.org/repo/hg/rev/c9fd8163131f
changeset:   42677:c9fd8163131f
user:Raphaël Gomès 
date:Fri Aug 02 10:10:23 2019 +0200
summary: byteify-strings: add helpers to check for item access or method 
call

https://www.mercurial-scm.org/repo/hg/rev/f95b59ffc307
changeset:   42678:f95b59ffc307
user:Raphaël Gomès 
date:Fri Aug 02 10:18:22 2019 +0200
summary: byteify-strings: add --treat-as-kwargs argument to handle 
kwargs-like objects

https://www.mercurial-scm.org/repo/hg/rev/5e296f618920
changeset:   42679:5e296f618920
user:Raphaël Gomès 
date:Fri Aug 02 16:14:00 2019 +0200
summary: byteify-strings: simplify default value for `--treat-as-kwargs`

https://www.mercurial-scm.org/repo/hg/rev/90d8a2a42d5c
changeset:   42680:90d8a2a42d5c
branch:  stable
parent:  42665:39b98107773a
user:Pierre-Yves David 
date:Thu Aug 01 15:59:52 2019 +0200
summary: test: use a more verbose output in the test

https://www.mercurial-scm.org/repo/hg/rev/a1f10edcf6a6
changeset:   42681:a1f10edcf6a6
branch:  stable
user:Pierre-Yves David 
date:Thu Aug 01 16:22:47 2019 +0200
summary: strip: access bookmark before getting a reference to changelog

https://www.mercurial-scm.org/repo/hg/rev/e0cf09bc35ef
changeset:   42682:e0cf09bc35ef
branch:  stable
user:Pierre-Yves David 
date:Fri Jun 21 03:50:40 2019 +0200
summary: bookmarks: actual fix for race condition deleting bookmark

https://www.mercurial-scm.org/repo/hg/rev/bbb002b378f3
changeset:   42683:bbb002b378f3
bookmark:@
tag: tip
parent:  42679:5e296f618920
user:Raphaël Gomès 
date:Fri Aug 02 16:17:02 2019 +0200
summary: byteify-strings: add cli argument to handle `attr*()` when they 
are methods

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


D6664: transaction: leave unfinished without crashing when not properly released

2019-08-03 Thread indygreg (Gregory Szorc)
indygreg added a comment.


  The presence of `__del__` is a bit dangerous and I've debugged a handful of 
issues related to having `__del__` on `transaction`. We still leak repo objects 
in places due to circular references. It's super annoying.
  
  Ideally we would use context managers everywhere and we could remove 
`__del__` completely. I would strongly suggest that we make `__del__` 
deprecated and emit a warning if it is doing something meaningful, as I view 
the lack of the caller cleaning up state as a bug. Then we can remove `__del__` 
in some future release.

REPOSITORY
  rHG Mercurial

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

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

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


[PATCH STABLE] automation: push changes affecting .hgtags

2019-08-03 Thread Gregory Szorc
# HG changeset patch
# User Gregory Szorc 
# Date 1564859631 25200
#  Sat Aug 03 12:13:51 2019 -0700
# Branch stable
# Node ID fcf8e489d6a667bfd2fcf066b545e52519309ee1
# Parent  e0cf09bc35ef6d7e8554e5be98441e995c856759
automation: push changes affecting .hgtags

When I went to build the 5.1 tag using the in-repo automation, the
automatic version calculation failed to deduce the clean 5.1 version
string because we had only pushed the changeset corresponding to the 5.1
tag and not the changeset containing the 5.1 tag. So from the
perspective of the remote repo, the 5.1 tag didn't exist yet and
automatic version deduction failed.

This commit changes the `hg push` to also push all changesets affecting
the .hgtags file, ensuring the remote has up-to-date tags information.

I tested this by creating a local draft changeset with a dummy tag
value on a different DAG head and instructed the automation to build
a revision that didn't have this change to .hgtags. The tag was
successfully pushed and the built package had a version number
incorporating that tag.

Sending this to stable so the 5.1.1 automation hopefully "just works."

diff --git a/contrib/automation/hgautomation/linux.py 
b/contrib/automation/hgautomation/linux.py
--- a/contrib/automation/hgautomation/linux.py
+++ b/contrib/automation/hgautomation/linux.py
@@ -485,7 +485,9 @@ def synchronize_hg(source_path: pathlib.
 'python2.7', str(hg_bin),
 '--config', 'ui.ssh=ssh -F %s' % ssh_config,
 '--config', 'ui.remotecmd=/hgdev/venv-bootstrap/bin/hg',
-'push', '-f', '-r', full_revision,
+# Also ensure .hgtags changes are present so auto version
+# calculation works.
+'push', '-f', '-r', full_revision, '-r', 'file(.hgtags)',
 'ssh://%s//hgwork/src' % public_ip,
 ]
 
diff --git a/contrib/automation/hgautomation/windows.py 
b/contrib/automation/hgautomation/windows.py
--- a/contrib/automation/hgautomation/windows.py
+++ b/contrib/automation/hgautomation/windows.py
@@ -176,7 +176,9 @@ def synchronize_hg(hg_repo: pathlib.Path
 'python2.7', hg_bin,
 '--config', 'ui.ssh=ssh -F %s' % ssh_config,
 '--config', 'ui.remotecmd=c:/hgdev/venv-bootstrap/Scripts/hg.exe',
-'push', '-f', '-r', full_revision,
+# Also ensure .hgtags changes are present so auto version
+# calculation works.
+'push', '-f', '-r', full_revision, '-r', 'file(.hgtags)',
 'ssh://%s/c:/hgdev/src' % public_ip,
 ]
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6709: config: add --registered flag to show all known configs

2019-08-03 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh retitled this revision from "config: add --all flag to show 
all known configs" to "config: add --registered flag to show all known configs".
navaneeth.suresh edited the summary of this revision.
navaneeth.suresh marked an inline comment as done.
navaneeth.suresh updated this revision to Diff 16119.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6709?vs=16117=16119

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

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/ui.py
  tests/test-completion.t
  tests/test-config.t

CHANGE DETAILS

diff --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -222,3 +222,824 @@
   > done
   $ HGRCPATH=configs hg config section.key
   99
+
+test --registered flag
+
+  $ hg showconfig --registered
+  annotate.git=False
+  annotate.ignoreblanklines=False
+  annotate.ignorews=False
+  annotate.ignorewsamount=False
+  annotate.ignorewseol=False
+  annotate.nobinary=False
+  annotate.nodates=False
+  annotate.noprefix=False
+  annotate.showfunc=False
+  annotate.unified=None
+  annotate.word-diff=False
+  auth.cookiefile=None
+  bookmarks.pushing=[]
+  bundle.mainreporoot=$TESTTMP
+  censor.policy=abort
+  chgserver.idletimeout=3600
+  chgserver.skiphash=False
+  cmdserver.log=None
+  cmdserver.max-log-files=7
+  cmdserver.max-log-size=1 MB
+  cmdserver.max-repo-cache=0
+  cmdserver.message-encodings=[]
+  cmdserver.track-log=['chgserver', 'cmdserver', 'repocache']
+  color..*=None
+  color.mode=auto
+  commands.commit.interactive.git=False
+  commands.commit.interactive.ignoreblanklines=False
+  commands.commit.interactive.ignorews=False
+  commands.commit.interactive.ignorewsamount=False
+  commands.commit.interactive.ignorewseol=False
+  commands.commit.interactive.nobinary=False
+  commands.commit.interactive.nodates=False
+  commands.commit.interactive.noprefix=False
+  commands.commit.interactive.showfunc=False
+  commands.commit.interactive.unified=None
+  commands.commit.interactive.word-diff=False
+  commands.commit.post-status=False
+  commands.grep.all-files=False
+  commands.rebase.requiredest=False
+  commands.resolve.confirm=False
+  commands.resolve.explicit-re-merge=False
+  commands.resolve.mark-check=none
+  commands.revert.interactive.git=False
+  commands.revert.interactive.ignoreblanklines=False
+  commands.revert.interactive.ignorews=False
+  commands.revert.interactive.ignorewsamount=False
+  commands.revert.interactive.ignorewseol=False
+  commands.revert.interactive.nobinary=False
+  commands.revert.interactive.nodates=False
+  commands.revert.interactive.noprefix=False
+  commands.revert.interactive.showfunc=False
+  commands.revert.interactive.unified=None
+  commands.revert.interactive.word-diff=False
+  commands.show.aliasprefix=[]
+  commands.status.relative=False
+  commands.status.skipstates=[]
+  commands.status.terse=
+  commands.status.verbose=False
+  commands.update.check=None
+  commands.update.requiredest=False
+  committemplate..*=None
+  convert.bzr.saverev=True
+  convert.cvsps.cache=True
+  convert.cvsps.fuzz=60
+  convert.cvsps.logencoding=None
+  convert.cvsps.mergefrom=None
+  convert.cvsps.mergeto=None
+  convert.git.committeractions=['messagedifferent']
+  convert.git.extrakeys=[]
+  convert.git.findcopiesharder=False
+  convert.git.remoteprefix=remote
+  convert.git.renamelimit=400
+  convert.git.saverev=True
+  convert.git.similarity=50
+  convert.git.skipsubmodules=False
+  convert.hg.clonebranches=False
+  convert.hg.ignoreerrors=False
+  convert.hg.preserve-hash=False
+  convert.hg.revs=None
+  convert.hg.saverev=False
+  convert.hg.sourcename=None
+  convert.hg.startrev=None
+  convert.hg.tagsbranch=default
+  convert.hg.usebranchnames=True
+  convert.ignoreancestorcheck=False
+  convert.localtimezone=False
+  convert.p4.startrev=0
+  convert.skiptags=False
+  convert.svn.branches=None
+  convert.svn.debugsvnlog=True
+  convert.svn.startrev=0
+  convert.svn.tags=None
+  convert.svn.trunk=None
+  debug.dirstate.delaywrite=0
+  defaults..*=None
+  devel.all-warnings=true
+  devel.bundle.delta=
+  devel.bundle2.debug=False
+  devel.cache-vfs=None
+  devel.check-locks=False
+  devel.check-relroot=False
+  devel.debug.copies=False
+  devel.debug.extensions=False
+  devel.debug.peer-request=False
+  devel.default-date=0 0
+  devel.deprec-warn=False
+  devel.disableloaddefaultcerts=False
+  devel.legacy.exchange=[]
+  devel.servercafile=
+  devel.serverexactprotocol=
+  devel.serverrequirecert=False
+  devel.strip-obsmarkers=True
+  devel.user.obsmarker=None
+  devel.warn-config=None
+  devel.warn-config-default=None
+  devel.warn-config-unknown=None
+  devel.warn-empty-changegroup=False
+  diff.git=False
+  diff.ignoreblanklines=False
+  diff.ignorews=False
+  diff.ignorewsamount=False
+  diff.ignorewseol=False
+  diff.nobinary=False
+  

[Bug 6182] New: changelog and manifest file timestamps are not kept up to date on Windows.

2019-08-03 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6182

Bug ID: 6182
   Summary: changelog and manifest file timestamps are not kept up
to date on Windows.
   Product: Mercurial
   Version: 4.9
  Hardware: PC
OS: Windows
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: m...@eandem.co.uk
CC: mercurial-devel@mercurial-scm.org

This was noticed using the standalone web server viewing a tree of repositories
on a Windows box.  Each repository's last modified date is a lot older than the
last actual update to the repo.

My investigation led me to find that the last modified date shown by the web
server is based on the 00changelog.i file in the .hg/store directory.  Checking
the last write date for this file shows that the web server is correctly
reporting the last modified date based on this file.

Testing with a trial repo with a changelog file several weeks old and
committing a new change shows that the changelog file last write date advances
by one second from the previous date, it is not updated to the date and time
that the commit happens.

This appears to be the result of the call avoidambig() in util.py.  I
temporarily modified this function to call os.utime(path, None) and the last
write date on the changelog file was updated to the current date time on a
commit.  I tried to work why it was using just adding one second to the
original mtime and not a current date time but got lost in a maze of twisty
little passages, sorry.

I investigated this using 4.9.1 as that was the last Python module install
available for Windows that I am aware of.  I have checked that the behaviour
has not changed with a MSI install of 5.1 on a different Windows box.  The
issue does not occur on the various unixen I have access to.

Here is a simple sequence to show that the changelog and manifest file times
are only being advanced by 1 second.  The file system is Windows NTFS.

PS F:\hg\utime> hg init
   
PS F:\hg\utime> echo "hi" > a  
   
PS F:\hg\utime> hg commit -Am "init"   
   
adding a
PS F:\hg\utime> gci .hg\store\*.i | select Name,LastWriteTime   
Name  LastWriteTime
  -
00changelog.i 03/08/2019 13:42:22
00manifest.i  03/08/2019 13:42:23


PS F:\hg\utime> date
03 August 2019 13:43:01


PS F:\hg\utime> echo " world" >> a 
   
PS F:\hg\utime> hg commit -m "more"
   
PS F:\hg\utime> gci .hg\store\*.i |
select Name,LastWriteTime   
Name  LastWriteTime
  -
00changelog.i 03/08/2019 13:42:23
00manifest.i  03/08/2019 13:42:24

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6711: branchheads: store wdir-dependent caches in wcache (issue6181)

2019-08-03 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  The change looks good to me, However we probably want to introduce a new 
filter level 'wdir-independent-visible' to ensure we a good branchcache cache 
in .hg/cache that most share can use and that will be kept up to date. This 
also means we need to make sure it is warmed after transaction.

REPOSITORY
  rHG Mercurial

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

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

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


D6710: branchmap: properly refresh/warm all branchmap caches

2019-08-03 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  Overall principle seems good. I made couple of inline comment.

INLINE COMMENTS

> localrepo.py:2200
>  self.ui.debug('updating the branch cache\n')
> -self.filtered('served').branchmap()
> -self.filtered('served.hidden').branchmap()
> +for filt in ['visible', 'visible-hidden', 'served.hidden']:
> +self.filtered(filt).branchmap()

Should we have this list explicitly stored in a list next to the filtermap ? 
That would seems more robust to future changes.

> localrepo.py:2224
> +filtered = self.filtered(filt)
> +filtered.branchmap().write(filtered)
> +

Why the explicite write here ? We don't seems to need it for the previous 
section. Is this because if the cache of the previous subset is valid, the 
write would be skipped ?
If so, consider clarifying it in your comment.

REPOSITORY
  rHG Mercurial

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

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

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


Re: D6709: config: add --all flag to show all known configs

2019-08-03 Thread Pierre-Yves David

Interesting feature for sure. Thanks for looking into it.

The `--all` flag might be a bit too generic/vague. Maybe --known, 
--registered  or --default ?


We should skip experimental and deprecated configuration unless 
--verbose is specified. And we should flag them as deprecated/experimental.


For config that has multiple alias, it could be a good idea to display 
this information too (probably with --verbose)


On 8/2/19 11:50 AM, navaneeth.suresh (Navaneeth Suresh) wrote:

navaneeth.suresh created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
   This patch fixes one of the issues in issue6014. This adds an `--all`
   flag to `hg showconfig` to show all known config options.

REPOSITORY
   rHG Mercurial

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

AFFECTED FILES
   mercurial/commands.py
   mercurial/ui.py
   tests/test-config.t

CHANGE DETAILS

diff --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -222,3 +222,507 @@
> done
$ HGRCPATH=configs hg config section.key
99
+
+test --all flag
+
+  $ hg showconfig --all
+  chgserver.idletimeout=3600
+  chgserver.skiphash=False
+  fsmonitor.warn_when_unused=True
+  fsmonitor.warn_update_file_count=5
+  progress.assume-tty=False
+  progress.clear-complete=True
+  progress.refresh=0.1
+  progress.debug=False
+  progress.format=['topic', 'bar', 'number', 'estimate']
+  devel-warn: config item requires an explicit default value: 'progress.width' 
at: /tmp/hgtests.Ps_zAY/install/lib/python/mercurial/commands.py:1876 (config)
+  progress.width=None
+  progress.changedelay=1
+  progress.estimateinterval=60.0
+  progress.delay=3
+  progress.disable=False
+  sparse.missingwarning=True
+  devel-warn: config item requires an explicit default value: 'alias..*' at: 
/tmp/hgtests.Ps_zAY/install/lib/python/mercurial/commands.py:1876 (config)
+  alias..*=None
+  merge.followcopies=True
+  merge.preferancestor=['*']
+  merge.on-failure=continue
+  merge.checkunknown=abort
+  merge.checkignored=abort
+  merge.strict-capability-check=False
+  email.cc=None
+  email.reply-to=None
+  email.bcc=None
+  email.charsets=[]
+  email.from=None
+  email.method=smtp
+  email.to=None
+  format.generaldelta=False
+  format.usefncache=True
+  format.obsstore-version=None
+  devel-warn: config item requires an explicit default value: 
'format.maxchainlen' at: 
/tmp/hgtests.Ps_zAY/install/lib/python/mercurial/commands.py:1876 (config)
+  format.maxchainlen=None
+  format.internal-phase=False
+  format.revlog-compression=$BUNDLE2_COMPRESSIONS$
+  format.manifestcachesize=None
+  format.bookmarks-in-store=False
+  format.usestore=True
+  format.chunkcachesize=None
+  format.usegeneraldelta=True
+  format.dotencode=True
+  format.sparse-revlog=True
+  profiling.nested=0
+  profiling.output=None
+  profiling.enabled=False
+  devel-warn: config item requires an explicit default value: 
'profiling.time-track' at: 
/tmp/hgtests.Ps_zAY/install/lib/python/mercurial/commands.py:1876 (config)
+  profiling.time-track=None
+  profiling.freq=1000
+  profiling.format=text
+  profiling.statformat=hotpath
+  profiling.type=stat
+  profiling.showmax=0.999
+  devel-warn: config item requires an explicit default value: 
'profiling.showmin' at: 
/tmp/hgtests.Ps_zAY/install/lib/python/mercurial/commands.py:1876 (config)
+  profiling.showmin=None
+  profiling.limit=30
+  profiling.showtime=True
+  profiling.sort=inlinetime
+  cmdserver.max-repo-cache=0
+  cmdserver.message-encodings=[]
+  cmdserver.max-log-files=7
+  cmdserver.track-log=['chgserver', 'cmdserver', 'repocache']
+  cmdserver.max-log-size=1 MB
+  cmdserver.log=None
+  push.pushvars.server=False
+  bookmarks.pushing=[]
+  devel-warn: config item requires an explicit default value: 
'pager.attend-.*' at: 
/tmp/hgtests.Ps_zAY/install/lib/python/mercurial/commands.py:1876 (config)
+  pager.attend-.*=None
+  devel-warn: config item requires an explicit default value: 'pager.pager' 
at: /tmp/hgtests.Ps_zAY/install/lib/python/mercurial/commands.py:1876 (config)
+  pager.pager=None
+  pager.ignore=[]
+  web.deny_push=[]
+  web.maxfiles=10
+  devel-warn: config item requires an explicit default value: 'web.name' at: 
/tmp/hgtests.Ps_zAY/install/lib/python/mercurial/commands.py:1876 (config)
+  web.name=None
+  web.contact=None
+  web.allow-pull=True
+  web.port=8000
+  web.errorlog=-
+  web.comparisoncontext=5
+  web.archivesubrepos=False
+  web.templates=None
+  web.logourl=https://mercurial-scm.org/
+  web.refreshinterval=20
+  web.cacerts=None
+  web.allowgz=False
+  web.allowbz2=False
+  web.collapse=False
+  web.server-header=testing stub value
+  web.labels=[]
+  web.csp=None
+  web.ipv6=False
+  web.accesslog=-
+  web.allow-archive=[]
+  web.guessmime=False
+  web.prefix=
+  web.cache=True
+  web.push_ssl=True
+  web.allow-push=[]
+  web.logoimg=hglogo.png
+  web.allowzip=False
+  

Re: D6712: config: fix defaultvalue template keyword

2019-08-03 Thread Pierre-Yves David



On 8/3/19 8:52 AM, navaneeth.suresh (Navaneeth Suresh) wrote:

navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
   This is a follow-up patch to 51a2e3102db2 
. 
This does three things.


If this does three thing, it should probably be three patch.


   - Shows a warning on `configitems.dynamicdefault`.


Why are we adding a warning ? The API usage seems valid.


   - Removes `pycompat.bytestr` to preserve `None`.
   - Moves `pycompat.bytestr` out of the if loop.

REPOSITORY
   rHG Mercurial

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

AFFECTED FILES
   mercurial/commands.py
   mercurial/ui.py
   tests/test-config.t

CHANGE DETAILS

diff --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -57,11 +57,13 @@
$ hg showconfig Section -Tjson
[
 {
+"defaultvalue": null,
  "name": "Section.KeY",
  "source": "*.hgrc:*", (glob)
  "value": "Case Sensitive"
 },
 {
+"defaultvalue": null,
  "name": "Section.key",
  "source": "*.hgrc:*", (glob)
  "value": "lower case"
@@ -70,15 +72,15 @@
$ hg showconfig Section.KeY -Tjson
[
 {
-"defaultvalue": "None",
+"defaultvalue": null,
  "name": "Section.KeY",
  "source": "*.hgrc:*", (glob)
  "value": "Case Sensitive"
 }
]
$ hg showconfig -Tjson | tail -7
-   },
 {
+"defaultvalue": null,
  "name": "*", (glob)
  "source": "*", (glob)
  "value": "*" (glob)
@@ -103,7 +105,7 @@
$ hg config empty.source -Tjson
[
 {
-"defaultvalue": "None",
+"defaultvalue": null,
  "name": "empty.source",
  "source": "",
  "value": "value"
@@ -170,15 +172,19 @@
  config affected by environment variables
  
$ EDITOR=e1 VISUAL=e2 hg config --debug | grep 'ui\.editor'

+  config item requires an explicit default value: 'ui.editor'
$VISUAL: ui.editor=e2
  
$ VISUAL=e2 hg config --debug --config ui.editor=e3 | grep 'ui\.editor'

+  config item requires an explicit default value: 'ui.editor'
--config: ui.editor=e3
  
$ PAGER=p1 hg config --debug | grep 'pager\.pager'

+  config item requires an explicit default value: 'pager.pager'
$PAGER: pager.pager=p1
  
$ PAGER=p1 hg config --debug --config pager.pager=p2 | grep 'pager\.pager'

+  config item requires an explicit default value: 'pager.pager'
--config: pager.pager=p2
  
  verify that aliases are evaluated as well

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -792,7 +792,10 @@
  itemdefault = item.default()
  else:
  itemdefault = item.default
-return itemdefault
+if item.default is configitems.dynamicdefault:
+self.warn(_("config item requires an explicit default value: "
+"'%s.%s'\n" % (section, name)))
+return itemdefault
  
  def hasconfig(self, section, name, untrusted=False):

  return self._data(untrusted).hasitem(section, name)
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1872,7 +1872,7 @@
  for section, name, value in ui.walkconfig(untrusted=untrusted):
  source = ui.configsource(section, name, untrusted)
  value = pycompat.bytestr(value)
-defaultvalue = pycompat.bytestr(ui.configdefault(section, name))
+defaultvalue = ui.configdefault(section, name)
  if fm.isplain():
  source = source or 'none'
  value = value.replace('\n', '\\n')
@@ -1881,8 +1881,8 @@
  continue
  fm.startitem()
  fm.condwrite(ui.debugflag, 'source', '%s: ', source)
+fm.data(name=entryname, defaultvalue=defaultvalue)
  if uniquesel:
-fm.data(name=entryname, defaultvalue=defaultvalue)
  fm.write('value', '%s\n', value)
  else:
  fm.write('name value', '%s=%s\n', entryname, value)



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



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


D6712: config: fix defaultvalue template keyword

2019-08-03 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is a follow-up patch to 51a2e3102db2 
. 
This does three things.
  
  - Shows a warning on `configitems.dynamicdefault`.
  - Removes `pycompat.bytestr` to preserve `None`.
  - Moves `pycompat.bytestr` out of the if loop.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/ui.py
  tests/test-config.t

CHANGE DETAILS

diff --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -57,11 +57,13 @@
   $ hg showconfig Section -Tjson
   [
{
+"defaultvalue": null,
 "name": "Section.KeY",
 "source": "*.hgrc:*", (glob)
 "value": "Case Sensitive"
},
{
+"defaultvalue": null,
 "name": "Section.key",
 "source": "*.hgrc:*", (glob)
 "value": "lower case"
@@ -70,15 +72,15 @@
   $ hg showconfig Section.KeY -Tjson
   [
{
-"defaultvalue": "None",
+"defaultvalue": null,
 "name": "Section.KeY",
 "source": "*.hgrc:*", (glob)
 "value": "Case Sensitive"
}
   ]
   $ hg showconfig -Tjson | tail -7
-   },
{
+"defaultvalue": null,
 "name": "*", (glob)
 "source": "*", (glob)
 "value": "*" (glob)
@@ -103,7 +105,7 @@
   $ hg config empty.source -Tjson
   [
{
-"defaultvalue": "None",
+"defaultvalue": null,
 "name": "empty.source",
 "source": "",
 "value": "value"
@@ -170,15 +172,19 @@
 config affected by environment variables
 
   $ EDITOR=e1 VISUAL=e2 hg config --debug | grep 'ui\.editor'
+  config item requires an explicit default value: 'ui.editor'
   $VISUAL: ui.editor=e2
 
   $ VISUAL=e2 hg config --debug --config ui.editor=e3 | grep 'ui\.editor'
+  config item requires an explicit default value: 'ui.editor'
   --config: ui.editor=e3
 
   $ PAGER=p1 hg config --debug | grep 'pager\.pager'
+  config item requires an explicit default value: 'pager.pager'
   $PAGER: pager.pager=p1
 
   $ PAGER=p1 hg config --debug --config pager.pager=p2 | grep 'pager\.pager'
+  config item requires an explicit default value: 'pager.pager'
   --config: pager.pager=p2
 
 verify that aliases are evaluated as well
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -792,7 +792,10 @@
 itemdefault = item.default()
 else:
 itemdefault = item.default
-return itemdefault
+if item.default is configitems.dynamicdefault:
+self.warn(_("config item requires an explicit default value: "
+"'%s.%s'\n" % (section, name)))
+return itemdefault
 
 def hasconfig(self, section, name, untrusted=False):
 return self._data(untrusted).hasitem(section, name)
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1872,7 +1872,7 @@
 for section, name, value in ui.walkconfig(untrusted=untrusted):
 source = ui.configsource(section, name, untrusted)
 value = pycompat.bytestr(value)
-defaultvalue = pycompat.bytestr(ui.configdefault(section, name))
+defaultvalue = ui.configdefault(section, name)
 if fm.isplain():
 source = source or 'none'
 value = value.replace('\n', '\\n')
@@ -1881,8 +1881,8 @@
 continue
 fm.startitem()
 fm.condwrite(ui.debugflag, 'source', '%s: ', source)
+fm.data(name=entryname, defaultvalue=defaultvalue)
 if uniquesel:
-fm.data(name=entryname, defaultvalue=defaultvalue)
 fm.write('value', '%s\n', value)
 else:
 fm.write('name value', '%s=%s\n', entryname, value)



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


D6704: config: add defaultvalue template keyword

2019-08-03 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh added a comment.


  @yuja Thanks for the review. Will send a follow-up soon.

REPOSITORY
  rHG Mercurial

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

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

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


D6709: config: add --all flag to show all known configs

2019-08-03 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh added inline comments.
navaneeth.suresh marked an inline comment as done.

INLINE COMMENTS

> av6 wrote in commands.py:1774
> This needs a better description to differentiate this flag and the default 
> mode (see line 1786).

Could you please suggest something better?

> av6 wrote in test-config.t:238
> Certainly a good way to find all config options without default values, but 
> in the final implementation of `showconfig -a` it should not produce any 
> warnings (especially not developer warnings).
> 
> It's probably possible to add default values to some of the items this test 
> found, but I think some of them are missing defaults by design (an obvious 
> example being `alias..*`). In that case it might be better to just skip them.

I have ignored the cases with `dynamicdefault`. But, there are three cases 
showing a `devel-warn: accessing unregistered config item` message. Couldn't 
figure out why it is coming.

REPOSITORY
  rHG Mercurial

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

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

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