Re: D5178: archive: use manifest.matches() to simplify and speed up matching

2018-10-20 Thread Sushil Khanchi
LGTM :)

On Sun, Oct 21, 2018 at 12:05 AM martinvonz (Martin von Zweigbergk) <
phabrica...@mercurial-scm.org> wrote:

> martinvonz created this revision.
> Herald added a subscriber: mercurial-devel.
> Herald added a reviewer: hg-reviewers.
>
> REVISION SUMMARY
>   manifest.matches() can avoid walking paths the user did not want to
>   archive.
>
> REPOSITORY
>   rHG Mercurial
>
> REVISION DETAIL
>   https://phab.mercurial-scm.org/D5178
>
> AFFECTED FILES
>   mercurial/archival.py
>
> CHANGE DETAILS
>
> diff --git a/mercurial/archival.py b/mercurial/archival.py
> --- a/mercurial/archival.py
> +++ b/mercurial/archival.py
> @@ -322,7 +322,7 @@
>  if match(name):
>  write(name, 0o644, False, lambda: buildmetadata(ctx))
>
> -files = [f for f in ctx.manifest().keys() if match(f)]
> +files = [f for f in ctx.manifest().matches(match)]
>  total = len(files)
>  if total:
>  files.sort()
>
>
>
> 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
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D4312: New bookflow extension for bookmark-based branching

2018-10-20 Thread idlsoft (Sandu Turcan)
idlsoft added a comment.


  > Were there particular pain points before?  The list of things to polish 
isn't short, but I don't mind reprioritizing things if it helps.
  
  I submitted a bug report https://bz.mercurial-scm.org/show_bug.cgi?id=5794
  It has a zip file with the repo, although to be honest I'm testing with 
another repo locally. As of 4.7.2 I'm still seeing that stack trace

REPOSITORY
  rHG Mercurial

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

To: idlsoft, #hg-reviewers, pulkit, marcink
Cc: mharbison72, smf, markand, marcink, durin42, jwatt, pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D4312: New bookflow extension for bookmark-based branching

2018-10-20 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  In https://phab.mercurial-scm.org/D4312#77107, @idlsoft wrote:
  
  > I'm actually kinda looking forward to see if `lfs` works better with all 
the new changes.
  
  
  Were there particular pain points before?  The list of things to polish isn't 
short, but I don't mind reprioritizing things if it helps.

REPOSITORY
  rHG Mercurial

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

To: idlsoft, #hg-reviewers, pulkit, marcink
Cc: mharbison72, smf, markand, marcink, durin42, jwatt, pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5176: archive: change "matcnfn" argument to a real matcher

2018-10-20 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  All callers seem to be passing a real matcher, not just a function. We
  were also passing it into match.subdirmatcher(), which assumes it is a
  matcher.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/extdiff.py
  hgext/largefiles/overrides.py
  mercurial/archival.py
  mercurial/hgweb/webcommands.py

CHANGE DETAILS

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1216,8 +1216,7 @@
 
 bodyfh = web.res.getbodyfile()
 
-archival.archive(web.repo, bodyfh, cnode, artype, prefix=name,
- matchfn=match,
+archival.archive(web.repo, bodyfh, cnode, artype, prefix=name, match=match,
  subrepos=web.configbool("web", "archivesubrepos"))
 
 return []
diff --git a/mercurial/archival.py b/mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -274,7 +274,7 @@
 'zip': zipit,
 }
 
-def archive(repo, dest, node, kind, decode=True, matchfn=None,
+def archive(repo, dest, node, kind, decode=True, match=None,
 prefix='', mtime=None, subrepos=False):
 '''create archive of repo as it was at node.
 
@@ -286,7 +286,7 @@
 decode tells whether to put files through decode filters from
 hgrc.
 
-matchfn is function to filter names of files to write to archive.
+match is a matcher to filter names of files to write to archive.
 
 prefix is name of path to put before every archive member.
 
@@ -315,11 +315,11 @@
 
 if repo.ui.configbool("ui", "archivemeta"):
 name = '.hg_archival.txt'
-if not matchfn or matchfn(name):
+if not match or match(name):
 write(name, 0o644, False, lambda: buildmetadata(ctx))
 
-if matchfn:
-files = [f for f in ctx.manifest().keys() if matchfn(f)]
+if match:
+files = [f for f in ctx.manifest().keys() if match(f)]
 else:
 files = ctx.manifest().keys()
 total = len(files)
@@ -339,7 +339,7 @@
 if subrepos:
 for subpath in sorted(ctx.substate):
 sub = ctx.workingsub(subpath)
-submatch = matchmod.subdirmatcher(subpath, matchfn)
+submatch = matchmod.subdirmatcher(subpath, match)
 total += sub.archive(archiver, prefix, submatch, decode)
 
 if total == 0:
diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -929,12 +929,12 @@
 finally:
 web.repo.lfstatus = False
 
-def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
+def overridearchive(orig, repo, dest, node, kind, decode=True, match=None,
 prefix='', mtime=None, subrepos=None):
 # For some reason setting repo.lfstatus in hgwebarchive only changes the
 # unfiltered repo's attr, so check that as well.
 if not repo.lfstatus and not repo.unfiltered().lfstatus:
-return orig(repo, dest, node, kind, decode, matchfn, prefix, mtime,
+return orig(repo, dest, node, kind, decode, match, prefix, mtime,
 subrepos)
 
 # No need to lock because we are only reading history and
@@ -955,7 +955,7 @@
 prefix = archival.tidyprefix(dest, kind, prefix)
 
 def write(name, mode, islink, getdata):
-if matchfn and not matchfn(name):
+if match and not match(name):
 return
 data = getdata()
 if decode:
@@ -991,7 +991,7 @@
 if subrepos:
 for subpath in sorted(ctx.substate):
 sub = ctx.workingsub(subpath)
-submatch = matchmod.subdirmatcher(subpath, matchfn)
+submatch = matchmod.subdirmatcher(subpath, match)
 sub._repo.lfstatus = True
 sub.archive(archiver, prefix, submatch)
 
diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -139,7 +139,7 @@
 repo.ui.setconfig("ui", "archivemeta", False)
 
 archival.archive(repo, base, node, 'files',
- matchfn=scmutil.matchfiles(repo, files),
+ match=scmutil.matchfiles(repo, files),
  subrepos=listsubrepos)
 
 for fn in sorted(files):



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


D5178: archive: use manifest.matches() to simplify and speed up matching

2018-10-20 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  manifest.matches() can avoid walking paths the user did not want to
  archive.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/archival.py

CHANGE DETAILS

diff --git a/mercurial/archival.py b/mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -322,7 +322,7 @@
 if match(name):
 write(name, 0o644, False, lambda: buildmetadata(ctx))
 
-files = [f for f in ctx.manifest().keys() if match(f)]
+files = [f for f in ctx.manifest().matches(match)]
 total = len(files)
 if total:
 files.sort()



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


D5177: archive: create alwaysmatcher when no matcher provided

2018-10-20 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/D5177

AFFECTED FILES
  mercurial/archival.py

CHANGE DETAILS

diff --git a/mercurial/archival.py b/mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -27,6 +27,7 @@
 pycompat,
 scmutil,
 util,
+scmutil,
 vfs as vfsmod,
 )
 stringio = util.stringio
@@ -313,15 +314,15 @@
 ctx = repo[node]
 archiver = archivers[kind](dest, mtime or ctx.date()[0])
 
+if not match:
+match = scmutil.matchall(repo)
+
 if repo.ui.configbool("ui", "archivemeta"):
 name = '.hg_archival.txt'
-if not match or match(name):
+if match(name):
 write(name, 0o644, False, lambda: buildmetadata(ctx))
 
-if match:
-files = [f for f in ctx.manifest().keys() if match(f)]
-else:
-files = ctx.manifest().keys()
+files = [f for f in ctx.manifest().keys() if match(f)]
 total = len(files)
 if total:
 files.sort()



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


[PATCH 2 of 2] statprof: fix overflow while skipping boilerplate parts

2018-10-20 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1540034756 -32400
#  Sat Oct 20 20:25:56 2018 +0900
# Node ID cc4586749c8c99885619eaaa17e3157176c4523c
# Parent  fc4c598dd4a0443977aff8c1b5d77c6377bd30cc
statprof: fix overflow while skipping boilerplate parts

I got IndexError randomly because of stack[i] where i = len(stack).

diff --git a/mercurial/statprof.py b/mercurial/statprof.py
--- a/mercurial/statprof.py
+++ b/mercurial/statprof.py
@@ -257,6 +257,9 @@ class CodeSite(object):
 def filename(self):
 return os.path.basename(self.path)
 
+def skipname(self):
+return r'%s:%s' % (self.filename(), self.function)
+
 class Sample(object):
 __slots__ = (u'stack', u'time')
 
@@ -661,10 +664,8 @@ def display_hotpath(data, fp, limit=0.05
 if len(stack) > 1:
 i = 1
 # Skip boiler plate parts of the stack
-name = r'%s:%s' % (stack[i].filename(), stack[i].function)
-while i < len(stack) and name in skips:
+while i < len(stack) and stack[i].skipname() in skips:
 i += 1
-name = r'%s:%s' % (stack[i].filename(), stack[i].function)
 if i < len(stack):
 child.add(stack[i:], time)
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 2] statprof: fix indent level of fp.write() (issue6004)

2018-10-20 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1540034148 -32400
#  Sat Oct 20 20:15:48 2018 +0900
# Node ID fc4c598dd4a0443977aff8c1b5d77c6377bd30cc
# Parent  a9e303dcd1e1f22e9930fe745aee21674cf209c0
statprof: fix indent level of fp.write() (issue6004)

It was changed at 9d3034348c4f by mistake.

diff --git a/mercurial/statprof.py b/mercurial/statprof.py
--- a/mercurial/statprof.py
+++ b/mercurial/statprof.py
@@ -704,7 +704,7 @@ def display_hotpath(data, fp, limit=0.05
 # Make frames that didn't actually perform work dark grey
 elif node.count - childrensamples == 0:
 finalstring = '\033[90m' + finalstring + '\033[0m'
-fp.write(finalstring + b'\n')
+fp.write(finalstring + b'\n')
 
 newdepth = depth
 if len(visiblechildren) > 1 or multiple_siblings:
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH PoC] filecache: unimplement __set__() and __delete__() DO NOT PUSH

2018-10-20 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1540025760 -32400
#  Sat Oct 20 17:56:00 2018 +0900
# Node ID d8f825e87202c31a8e65b41c405e804b2e25195b
# Parent  a9e303dcd1e1f22e9930fe745aee21674cf209c0
filecache: unimplement __set__() and __delete__() DO NOT PUSH

Implementing __set__() implies that the descriptor can't be overridden by
obj.__dict__, which means any property access involves slow function call.

  "Data descriptors with __set__() and __get__() defined always override
  a redefinition in an instance dictionary. In contrast, non-data descriptors
  can be overridden by instances."

  https://docs.python.org/2.7/reference/datamodel.html#invoking-descriptors

This patch basically backs out 236bb604dc39, "scmutil: update cached copy
when filecached attribute is assigned (issue3263)." The problem described
in issue3263 (which is #3264 in Bugzilla) should no longer happen since
repo._bookmarkcurrent has been moved to repo._bookmarks.active. We still
have a risk of introducing similar bugs, but I think that's the cost we
have to pay.

  $ hg perfrevset 'branch(tip)' -R mercurial
  (orig) wall 0.134997 comb 0.13 user 0.13 sys 0.00 (best of 69)
  (this) wall 0.099038 comb 0.11 user 0.10 sys 0.01 (best of 93)

TODO: fix test-filecache.py failure

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -318,6 +318,9 @@ class dirstate(object):
 
 def setbranch(self, branch):
 self._branch = encoding.fromlocal(branch)
+ce = self._filecache.get('_branch')
+if ce:
+ce.obj = self._branch
 f = self._opener('branch', 'w', atomictemp=True, checkambig=True)
 try:
 f.write(self._branch + '\n')
@@ -325,7 +328,6 @@ class dirstate(object):
 
 # make sure filecache has the correct stat info for _branch after
 # replacing the underlying file
-ce = self._filecache['_branch']
 if ce:
 ce.refresh()
 except: # re-raises
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -91,11 +91,12 @@ class _basefilecache(scmutil.filecache):
 def __get__(self, repo, type=None):
 if repo is None:
 return self
-return super(_basefilecache, self).__get__(repo.unfiltered(), type)
-def __set__(self, repo, value):
-return super(_basefilecache, self).__set__(repo.unfiltered(), value)
-def __delete__(self, repo):
-return super(_basefilecache, self).__delete__(repo.unfiltered())
+# filtered repo has no entry in its __dict__
+unfi = repo.unfiltered()
+try:
+return unfi.__dict__[self.sname]
+except KeyError:
+return super(_basefilecache, self).__get__(unfi, type)
 
 class repofilecache(_basefilecache):
 """filecache for files in .hg but outside of .hg/store"""
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1247,16 +1247,14 @@ class filecache(object):
 results cached. The decorated function is called. The results are stashed
 away in a ``_filecache`` dict on the object whose method is decorated.
 
-On subsequent access, the cached result is returned.
-
-On external property set operations, stat() calls are performed and the new
-value is cached.
+On subsequent access, the cached result is used as it is set to the
+instance dictionary.
 
-On property delete operations, cached data is removed.
+On external property set/delete operations, the caller must update the
+corresponding _filecache entry appropriately.
 
-When using the property API, cached data is always returned, if available:
-no stat() is performed to check if the file has changed and if the function
-needs to be called to reflect file changes.
+When using the property API, the cached data is always used if available.
+No stat() is performed to check if the file has changed.
 
 Others can muck about with the state of the ``_filecache`` dict. e.g. they
 can populate an entry before the property's getter is called. In this case,
@@ -1289,10 +1287,8 @@ class filecache(object):
 # if accessed on the class, return the descriptor itself.
 if obj is None:
 return self
-# do we need to check if the file changed?
-if self.sname in obj.__dict__:
-assert self.name in obj._filecache, self.name
-return obj.__dict__[self.sname]
+
+assert self.sname not in obj.__dict__
 
 entry = obj._filecache.get(self.name)
 
@@ -1312,24 +1308,8 @@ class filecache(object):
 obj.__dict__[self.sname] = entry.obj
 return entry.obj
 
-def __set__(self, obj, value):
-if self.name not in obj._filecache:
-# we add an entry for the missing value because X in 

Re: D5170: branchmap: pass changelog into revbranchcache.branchinfo()

2018-10-20 Thread Yuya Nishihara
On Sat, 20 Oct 2018 16:18:13 +0900, Yuya Nishihara wrote:
> >   ! wall 0.133497 comb 0.14 user 0.13 sys 0.01 (best of 64)
> >   ! wall 0.139459 comb 0.15 user 0.15 sys 0.00 (best of 57)
> >   
> >   After
> >   ! wall 0.106518 comb 0.11 user 0.10 sys 0.01 (best of 77)
> >   ! wall 0.106157 comb 0.11 user 0.10 sys 0.01 (best of 83)

Okay, it's purely the cost of function calls. If I remove __set__() from
filecache, the number dropped from 0.134997 to 0.099038.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5170: branchmap: pass changelog into revbranchcache.branchinfo()

2018-10-20 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >>  rbc = self.revbranchcache()
  >  > +cl = self.changelog
  > 
  > Perhaps it has to be self.unfiltered().changelog because revbranchcache is
  >  initialized with the unfiltered repo.
  
  Never mind. It doesn't matter so long as the passed rev isn't filtered.

REPOSITORY
  rHG Mercurial

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

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


Re: D5170: branchmap: pass changelog into revbranchcache.branchinfo()

2018-10-20 Thread Yuya Nishihara
> >  rbc = self.revbranchcache()
> > +cl = self.changelog
> 
> Perhaps it has to be self.unfiltered().changelog because revbranchcache is
> initialized with the unfiltered repo.

Never mind. It doesn't matter so long as the passed rev isn't filtered.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5170: branchmap: pass changelog into revbranchcache.branchinfo()

2018-10-20 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   ! wall 0.133497 comb 0.14 user 0.13 sys 0.01 (best of 64)
  >   ! wall 0.139459 comb 0.15 user 0.15 sys 0.00 (best of 57)
  >   
  >   After
  >   ! wall 0.106518 comb 0.11 user 0.10 sys 0.01 (best of 77)
  >   ! wall 0.106157 comb 0.11 user 0.10 sys 0.01 (best of 83)
  
  I'm surprised that `unfilteredrepo.changelog` is also slow.
  
  > - a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2037,8 +2037,9 
@@
  > 
  >   if full: rbc = self.revbranchcache() +cl = self.changelog
  
  Perhaps it has to be self.unfiltered().changelog because revbranchcache is
  initialized with the unfiltered repo.
  
  >   for r in self.changelog:
  > 
  > - rbc.branchinfo(r) +rbc.branchinfo(r, changelog=cl)
  
  Can't we just make revbranchcache keep repo.changelog reference? It doesn't
  make sense to pass in repo.changelog as an argument, whereas the repo is
  held by revbranchcache.

REPOSITORY
  rHG Mercurial

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

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


Re: D5170: branchmap: pass changelog into revbranchcache.branchinfo()

2018-10-20 Thread Yuya Nishihara
>   ! wall 0.133497 comb 0.14 user 0.13 sys 0.01 (best of 64)
>   ! wall 0.139459 comb 0.15 user 0.15 sys 0.00 (best of 57)
>   
>   After
>   ! wall 0.106518 comb 0.11 user 0.10 sys 0.01 (best of 77)
>   ! wall 0.106157 comb 0.11 user 0.10 sys 0.01 (best of 83)

I'm surprised that `unfilteredrepo.changelog` is also slow.

> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -2037,8 +2037,9 @@
>  
>  if full:
>  rbc = self.revbranchcache()
> +cl = self.changelog

Perhaps it has to be self.unfiltered().changelog because revbranchcache is
initialized with the unfiltered repo.

>  for r in self.changelog:
> -rbc.branchinfo(r)
> +rbc.branchinfo(r, changelog=cl)

Can't we just make revbranchcache keep repo.changelog reference? It doesn't
make sense to pass in repo.changelog as an argument, whereas the repo is
held by revbranchcache.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5174: py3: make sure we pass sysstr in sqlite3.connect()

2018-10-20 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   def makedb(path):
  >   """Construct a database handle for a database at path."""
  > 
  > 
  > - db = sqlite3.connect(path) +db = 
sqlite3.connect(pycompat.sysstr(path))
  
  Perhaps, `encoding.strfromlocal()`.

REPOSITORY
  rHG Mercurial

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

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


Re: D5174: py3: make sure we pass sysstr in sqlite3.connect()

2018-10-20 Thread Yuya Nishihara
>  def makedb(path):
>  """Construct a database handle for a database at path."""
>  
> -db = sqlite3.connect(path)
> +db = sqlite3.connect(pycompat.sysstr(path))

Perhaps, `encoding.strfromlocal()`.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5173: py3: make debugindexstats output printing compatible

2018-10-20 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   - a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ 
-1172,7 +1172,7 @@ if not util.safehasattr(index, 'stats'): raise 
error.Abort(_('debugindexstats only works with native code')) for k, v in 
sorted(index.stats().items()):
  > - ui.write('%s: %s\n' % (k, v)) +ui.write('%s: %d\n' % 
(pycompat.bytestr(k), v))
  
  Bad luck, we're no longer able to use PyDict_SetItemString().
  
  Can you add TODO comment here? This is a bug of the C extension, and 
`sysstr()`
  should be removed if it get fixed.

REPOSITORY
  rHG Mercurial

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

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


Re: D5173: py3: make debugindexstats output printing compatible

2018-10-20 Thread Yuya Nishihara
> --- a/mercurial/debugcommands.py
> +++ b/mercurial/debugcommands.py
> @@ -1172,7 +1172,7 @@
>  if not util.safehasattr(index, 'stats'):
>  raise error.Abort(_('debugindexstats only works with native code'))
>  for k, v in sorted(index.stats().items()):
> -ui.write('%s: %s\n' % (k, v))
> +ui.write('%s: %d\n' % (pycompat.bytestr(k), v))

Bad luck, we're no longer able to use PyDict_SetItemString().

Can you add TODO comment here? This is a bug of the C extension, and `sysstr()`
should be removed if it get fixed.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5172: statprof: update the name as the i increases (issue6003)

2018-10-20 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4613f9274fc0: statprof: update the name as the i increases 
(issue6003) (authored by pulkit, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D5172?vs=12280&id=12289#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5172?vs=12280&id=12289

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

AFFECTED FILES
  mercurial/statprof.py
  tests/test-profile.t

CHANGE DETAILS

diff --git a/tests/test-profile.t b/tests/test-profile.t
--- a/tests/test-profile.t
+++ b/tests/test-profile.t
@@ -89,6 +89,8 @@
   $ hg --profile --config profiling.statformat=byline sleep 2>../out
   $ head -n 3 ../out
 %   cumulative  self  
+   timeseconds   seconds  name
+   * sleepext.py:*:sleep (glob)
   $ cat ../out | statprofran
 
   $ hg --profile --config profiling.statformat=bymethod sleep 2>../out
diff --git a/mercurial/statprof.py b/mercurial/statprof.py
--- a/mercurial/statprof.py
+++ b/mercurial/statprof.py
@@ -664,6 +664,7 @@
 name = r'%s:%s' % (stack[i].filename(), stack[i].function)
 while i < len(stack) and name in skips:
 i += 1
+name = r'%s:%s' % (stack[i].filename(), stack[i].function)
 if i < len(stack):
 child.add(stack[i:], time)
 



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


D5171: test: show more profile lines in test-profile.t

2018-10-20 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1ce4fe0603a6: test: show more profile lines in 
test-profile.t (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5171?vs=12279&id=12288

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

AFFECTED FILES
  tests/test-profile.t

CHANGE DETAILS

diff --git a/tests/test-profile.t b/tests/test-profile.t
--- a/tests/test-profile.t
+++ b/tests/test-profile.t
@@ -87,7 +87,7 @@
 Various statprof formatters work
 
   $ hg --profile --config profiling.statformat=byline sleep 2>../out
-  $ head -n 1 ../out
+  $ head -n 3 ../out
 %   cumulative  self  
   $ cat ../out | statprofran
 



To: pulkit, #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] py3: stringify setupversion on Windows

2018-10-20 Thread Yuya Nishihara
On Fri, 19 Oct 2018 22:37:42 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1540002707 14400
> #  Fri Oct 19 22:31:47 2018 -0400
> # Node ID 9a6381bc4f3274cef01128948b9afb94f97e67f7
> # Parent  e2173cfb0be91129c66d499e2449f06e4d4b8eec
> py3: stringify setupversion on Windows

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


Re: [PATCH] tests: add coverage for some untested areas of hgweb

2018-10-20 Thread Yuya Nishihara
On Sat, 20 Oct 2018 00:10:57 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1540007258 14400
> #  Fri Oct 19 23:47:38 2018 -0400
> # Node ID b7d23a3d999bd32b81bbdc11e2f332edc54b02ec
> # Parent  41506e3b04ee8b34cc1ef81758d651cad9ed4c8c
> tests: add coverage for some untested areas of hgweb

Queued, thanks.

> +  $TESTTMP\test: sub/binary.bin annotate

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


D5172: statprof: update the name as the i increases (issue6003)

2018-10-20 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >> +   timeseconds   seconds  name
  >  > +   92.55  0.02  0.02  sleepext.py:7:sleep
  >  >$ cat ../out | statprofran
  > 
  > I tried to glob this one by putting * at various places but I failed. Any 
help/suggestion on how to glob this will be helpful.
  
  Fixed this as `* sleepext.py:*:sleep (glob)` and queued, thanks.

REPOSITORY
  rHG Mercurial

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

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


Re: D5172: statprof: update the name as the i increases (issue6003)

2018-10-20 Thread Yuya Nishihara
> > +   timeseconds   seconds  name
> > +   92.55  0.02  0.02  sleepext.py:7:sleep
> >$ cat ../out | statprofran
> 
> I tried to glob this one by putting * at various places but I failed. Any 
> help/suggestion on how to glob this will be helpful.

Fixed this as `* sleepext.py:*:sleep (glob)` and queued, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel