1. 02 Dec, 2020 2 commits
    • Kyle Lippincott's avatar
      statprof: separate functions and "line", assume 4 digit line numbers · 8b0a3ff5ed12
      Kyle Lippincott authored
      Previously, the profile output looked like this (I've removed many lines that
      are mostly inconsequential):
      
      ```
      | 100.0%  0.02s  hg:             <module>          line 43:  dispatch.run()
      | 100.0%  0.02s  dispatch.py:    run               line 115:  status = dispatch(req)
      | 100.0%  0.02s  dispatch.py:    _runcatchfunc     line 432:  return _dispatch(req)
       \ 50.0%  0.01s  dispatch.py:    _dispatch         line 1228:  return runcommand(
         | 50.0%  0.01s  dispatch.py:    runcommand      line 883:  ret = _runcommand(ui, optio...
         | 50.0%  0.01s  dispatch.py:    _runcommand     line 1240:  return cmdfunc()
         | 50.0%  0.01s  localrepo.py:   __getitem__     line 1670:  quick_access = self._quick_...
         | 50.0%  0.01s  localrepo.py:   _quick_access_changeidline 1650:  return self._quick_access_c...
         | 50.0%  0.01s  localrepo.py:   __get__         line 179:  return getattr(unfi, self.n...
         | 50.0%  0.01s  util.py:        __get__         line 1747:  result = self.func(obj)
         | 50.0%  0.01s  localrepo.py:   _quick_access_changeid_wcline  1611:  cl = self.unfiltered().chan...
         | 50.0%  0.01s  localrepo.py:   __get__         line 110:  return super(_basefilecache...
         | 50.0%  0.01s  util.py:        __getattribute__line 245:  self.__spec__.loader.exec_m...
         | 50.0%  0.01s  <frozen importlib._bootstrap_external>: exec_moduleline            783:
         | 50.0%  0.01s  <frozen importlib._bootstrap>: _call_with_frames_removedline                 219:
         | 50.0%  0.01s  changelog.py:   <module>        line 376:  class changelog(revlog.revl...
         | 50.0%  0.01s  util.py:        __getattribute__line 245:  self.__spec__.loader.exec_m...
         | 50.0%  0.01s  <frozen importlib._bootstrap_external>: exec_moduleline            779:
         | 50.0%  0.01s  <frozen importlib._bootstrap_external>: get_codeline         868:
         | 50.0%  0.01s  <frozen importlib._bootstrap_external>: path_statsline           1012:
         | 50.0%  0.01s  <frozen importlib._bootstrap_external>: _path_statline           87:
      ```
      
      This has a few problems, though I'm only addressing some of them.
      
      1.  If the stuff before "line ###" is long, there's no separation between the
          function name and the "line" string.
      2.  If the stuff before "line ###" is really long, there's excessive separation
          between the "line" string and the line number.
      3.  We frequently have 4-digit line numbers, the code on the right wasn't
          dynamically indented and ended up quite messy looking.
      
      To solve these problems, I've added a ", " prefix before "line" iff it would
      otherwise not have any separation such as spaces. I've added a 'max' so that we
      never use a negative width (which is the cause of problem #2 above), and I've
      added a default assumption of 4 digit line numbers (but again using a 'max' so
      this shouldn't cause problems if we go beyond that.
      
      With these changes, it now looks like this:
      
      ```
      | 100.0%  0.02s  hg:             <module>          line 43:   dispatch.run()
      | 100.0%  0.02s  dispatch.py:    run               line 115:  status = dispatch(req)
      | 100.0%  0.02s  dispatch.py:    _runcatchfunc     line 432:  return _dispatch(req)
       \ 50.0%  0.01s  dispatch.py:    _dispatch         line 1228: return runcommand(
         | 50.0%  0.01s  dispatch.py:    runcommand      line 883:  ret = _runcommand(ui, optio...
         | 50.0%  0.01s  dispatch.py:    _runcommand     line 1240: return cmdfunc()
         | 50.0%  0.01s  localrepo.py:   __getitem__     line 1670: quick_access = self._quick_...
         | 50.0%  0.01s  localrepo.py:   _quick_access_changeid, line 1650: return self._quick_access_c...
         | 50.0%  0.01s  localrepo.py:   __get__         line 179:  return getattr(unfi, self.n...
         | 50.0%  0.01s  util.py:        __get__         line 1747: result = self.func(obj)
         | 50.0%  0.01s  localrepo.py:   _quick_access_changeid_wc, line 1611: cl = self.unfiltered().chan...
         | 50.0%  0.01s  localrepo.py:   __get__         line 110:  return super(_basefilecache...
         | 50.0%  0.01s  util.py:        __getattribute__, line 245:  self.__spec__.loader.exec_m...
         | 50.0%  0.01s  <frozen importlib._bootstrap_external>: exec_module, line 783:
         | 50.0%  0.01s  <frozen importlib._bootstrap>: _call_with_frames_removed, line 219:
         | 50.0%  0.01s  changelog.py:   <module>        line 376:  class changelog(revlog.revl...
         | 50.0%  0.01s  util.py:        __getattribute__, line 245:  self.__spec__.loader.exec_m...
         | 50.0%  0.01s  <frozen importlib._bootstrap_external>: exec_module, line 779:
         | 50.0%  0.01s  <frozen importlib._bootstrap_external>: get_code, line 868:
         | 50.0%  0.01s  <frozen importlib._bootstrap_external>: path_stats, line 1012:
         | 50.0%  0.01s  <frozen importlib._bootstrap_external>: _path_stat, line 87:
      ```
      
      Differential Revision: https://phab.mercurial-scm.org/D9511
      8b0a3ff5ed12
    • Kyle Lippincott's avatar
      statprof: fix off-by-one-line error in output · 068307b638f4
      Kyle Lippincott authored
      martinvonz claims they thought that this was intentional, but couldn't remember
      the reasoning for it. I can't understand why it would be preferable, and I
      didn't see anything in the comments in the file about why this would be useful,
      so I'm hopefully not breaking anything by "fixing" it.
      
      ### Old output
      
      ```
      | 100.0%  0.01s  dispatch.py:    run               line 43:  dispatch.run()
      | 100.0%  0.01s  dispatch.py:    dispatch          line 115:  status = dispatch(req)
      | 100.0%  0.01s  dispatch.py:    _runcatch         line 266:  ret = _runcatch(req) or 0
      | 100.0%  0.01s  dispatch.py:    _callcatch        line 442:  return _callcatch(ui, _runc...
      | 100.0%  0.01s  scmutil.py:     callcatch         line 451:  return scmutil.callcatch(ui...
      | 100.0%  0.01s  dispatch.py:    _runcatchfunc     line 155:  return func()
      | 100.0%  0.01s  dispatch.py:    _dispatch         line 432:  return _dispatch(req)
      | 100.0%  0.01s  hg.py:          repository        line 1179:  repo = hg.repository(
      | 100.0%  0.01s  hg.py:          _peerorrepo       line 221:  peer = _peerorrepo(
      | 100.0%  0.01s  util.py:        __getattribute__  line 188:  obj = _peerlookup(path).ins...
      | 100.0%  0.01s  localrepo.py:   makelocalrepositoryline 3227:  return makelocalrepository(...
      | 100.0%  0.01s  localrepo.py:   __init__          line 683:  return cls(
      | 100.0%  0.01s  util.py:        __getattribute__  line 1262:  self._extrafilterid = repov...
      | 100.0%  0.01s  <frozen importlib._bootstrap_external>: exec_moduleline          245:  self.__spec__.loader.exec_m...
      | 100.0%  0.01s  <frozen importlib._bootstrap_external>: get_codeline       779:
      | 100.0%  0.01s  <frozen importlib._bootstrap_external>: path_statsline         868:
      | 100.0%  0.01s  <frozen importlib._bootstrap_external>: _path_statline         1012:
      ```
      
      ### New output
      
      ```
      | 100.0%  0.01s  hg:             <module>          line 43:  dispatch.run()
      | 100.0%  0.01s  dispatch.py:    run               line 115:  status = dispatch(req)
      | 100.0%  0.01s  dispatch.py:    dispatch          line 266:  ret = _runcatch(req) or 0
      | 100.0%  0.01s  dispatch.py:    _runcatch         line 442:  return _callcatch(ui, _runc...
      | 100.0%  0.01s  dispatch.py:    _callcatch        line 451:  return scmutil.callcatch(ui...
      | 100.0%  0.01s  scmutil.py:     callcatch         line 155:  return func()
      | 100.0%  0.01s  dispatch.py:    _runcatchfunc     line 432:  return _dispatch(req)
      | 100.0%  0.01s  dispatch.py:    _dispatch         line 1179:  repo = hg.repository(
      | 100.0%  0.01s  hg.py:          repository        line 221:  peer = _peerorrepo(
      | 100.0%  0.01s  hg.py:          _peerorrepo       line 188:  obj = _peerlookup(path).ins...
      | 100.0%  0.01s  localrepo.py:   instance          line 3227:  return makelocalrepository(...
      | 100.0%  0.01s  localrepo.py:   makelocalrepositoryline 683:  return cls(
      | 100.0%  0.01s  localrepo.py:   __init__          line 1262:  self._extrafilterid = repov...
      | 100.0%  0.01s  util.py:        __getattribute__  line 245:  self.__spec__.loader.exec_m...
      | 100.0%  0.01s  <frozen importlib._bootstrap_external>: exec_moduleline          779:
      | 100.0%  0.01s  <frozen importlib._bootstrap_external>: get_codeline       868:
      | 100.0%  0.01s  <frozen importlib._bootstrap_external>: path_statsline         1012:
      | 100.0%  0.01s  <frozen importlib._bootstrap_external>: _path_statline         87:
      ```
      
      Differential Revision: https://phab.mercurial-scm.org/D9510
      068307b638f4
  2. 03 Dec, 2020 1 commit
  3. 02 Dec, 2020 7 commits
  4. 27 Nov, 2020 4 commits
  5. 23 Nov, 2020 1 commit
    • Pulkit Goyal's avatar
      share: show warning if share is outdated while source supports share-safe · 49b4ab1d9f5e
      Pulkit Goyal authored
      Previous patches in the series and some which are already committed implements
      share safe functionality where config and requirements will be shared too.
      
      Rolling this feature has a problem that existing shares may never upgrade as
      they will never learn about the new config. To help the transition, we show a
      warning message if the share source supports share-safe mechanism. This provides
      the source repo ability to upgrade and pass on the message to shares that you
      should reshare and upgrade too.
      
      Differential Revision: https://phab.mercurial-scm.org/D9369
      49b4ab1d9f5e
  6. 16 Oct, 2020 1 commit
  7. 25 Jun, 2020 1 commit
  8. 30 Nov, 2020 1 commit
  9. 28 Nov, 2020 1 commit
  10. 30 Nov, 2020 1 commit
    • Kyle Lippincott's avatar
      match: skip walking up the directory hierarchy if the number of pats are small · c4c7a6b61146
      Kyle Lippincott authored
      Previously, we would receive a path like abc/def/ghi and "walk up" the directory
      hierarchy, checking abc/def, abc, and `b''` to see if they were in the set of
      prefixes that this matcher covered. We did this indiscriminately - we generated
      all of these paths even if the set of prefixes the matcher covered was
      completely empty, which is the case for a lot of repos at my company (the narrow
      matcher we use is usually non-recursive).
      
      This brings the time for a rebase in one of my repos from 12.20s to 10.87s. In
      this particular repo, this is entirely due to the `len(prefix_set) == 0` check,
      as I do not have any recursive patterns in the narrowspec.
      
      Differential Revision: https://phab.mercurial-scm.org/D9488
      c4c7a6b61146
  11. 01 Dec, 2020 1 commit
  12. 30 Nov, 2020 2 commits
  13. 01 Dec, 2020 1 commit
  14. 30 Nov, 2020 3 commits
  15. 28 Nov, 2020 2 commits
  16. 30 Nov, 2020 1 commit
  17. 27 Nov, 2020 1 commit
  18. 23 Nov, 2020 1 commit
  19. 20 Nov, 2020 2 commits
  20. 26 Nov, 2020 1 commit
  21. 30 Nov, 2020 1 commit
  22. 26 Nov, 2020 1 commit
    • Matt Harbison's avatar
      packaging: add pygit2 to the py3 Windows installers · d26497811ed9
      Matt Harbison authored
      This is needed to be able to use the git extension.
      
      The extension no longer complains about the library being not installed, but
      `hg log -r .` on a repo that works in WSL yielded a TypeError:
      
            ...
            File "mercurial.hg", line 188, in _peerorrepo
            File "mercurial.localrepo", line 3224, in instance
            File "mercurial.localrepo", line 623, in makelocalrepository
            File "hgext.git", line 117, in _makestore
            File "hgext.git", line 48, in __init__
          TypeError: Repository unable to unpack backend.
      
      Differential Revision: https://phab.mercurial-scm.org/D9405
      d26497811ed9
  23. 30 Nov, 2020 2 commits
  24. 23 Nov, 2020 1 commit