1. 08 Mar, 2021 3 commits
  2. 26 Feb, 2021 1 commit
  3. 02 Feb, 2021 1 commit
    • Yuya Nishihara's avatar
      log: fix handling of root (or empty) path provided by matcher (issue6478) · 9842c00f0252
      Yuya Nishihara authored
      Since 27d6956d386b "match: use '' instead of '.' for root directory",
      '.' should be translated to ''. We can't blame repo.file() about this because
      an empty string is invalid as a file path, but I found at least two callers
      (_makematcher() and revset.filelog()) would crash because of this path[0].
      
      So let's make repo.file() accept an empty string. path[0] == b'/' wouldn't
      work on Python 3 anyways.
      9842c00f0252
  4. 25 Feb, 2021 1 commit
  5. 19 Feb, 2021 1 commit
  6. 16 Feb, 2021 2 commits
  7. 19 Feb, 2021 1 commit
  8. 24 Feb, 2021 1 commit
  9. 10 Feb, 2021 7 commits
  10. 09 Feb, 2021 1 commit
  11. 18 Jan, 2021 1 commit
  12. 04 Feb, 2021 2 commits
    • Jordi Gutiérrez Hermoso's avatar
      largefiles: properly pass kwargs into url.open · 32da58916fd0
      Jordi Gutiérrez Hermoso authored
      The url.open function has acquired a lot of kwargs over the years.
      When running `hg import http://example.com/hg/diff/1`, since at least
      a708e1e4d7a8 in March, 2018, the calling sites for url.open try to
      pass a `sendaccept` parameter that largefiles' override doesn't accept.
      
      Currently that stack traces something like this:
      
        Traceback (most recent call last):
          File "/tmp/hgtests.sv744r5t/install/bin/hg", line 59, in <module>
            dispatch.run()
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 143, in run
            status = dispatch(req)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 245, in dispatch
            status = _rundispatch(req)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 289, in _rundispatch
            ret = _runcatch(req) or 0
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 465, in _runcatch
            return _callcatch(ui, _runcatchfunc)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 475, in _callcatch
            return scmutil.callcatch(ui, func)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/scmutil.py", line 155, in callcatch
            return func()
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 455, in _runcatchfunc
            return _dispatch(req)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 1259, in _dispatch
            lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 913, in runcommand
            ret = _runcommand(ui, options, cmd, d)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 1270, in _runcommand
            return cmdfunc()
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 1256, in <lambda>
            d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/util.py", line 1867, in check
            return func(*args, **kwargs)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/commands.py", line 4184, in import_
            patchfile = hg.openpath(ui, patchurl, sendaccept=False)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/hg.py", line 181, in openpath
            return url.open(ui, path, sendaccept=sendaccept)
        TypeError: openlargefile() got an unexpected keyword argument 'sendaccept'
      
      So, just accept and pass along any kwargs of the overridden function.
      32da58916fd0
    • Yuya Nishihara's avatar
      128a17d8436f
  13. 02 Feb, 2021 2 commits
  14. 29 Jan, 2021 1 commit
  15. 01 Feb, 2021 2 commits
  16. 27 Jan, 2021 2 commits
    • Kyle Lippincott's avatar
      wix: tell ComponentSearch that it is finding a directory (not a file) · 8deab876fb59
      Kyle Lippincott authored
      This is to fix an issue we've noticed where fresh installations start at
      `C:\Program Files\Mercurial`, and then upgrades "walk up" the tree and end up in
      `C:\Program Files` and finally `C:\` (where they stay).
      
      ComponentSearch defaults to finding files, which I think means "it produces a
      string like `C:\Program Files\Mercurial`", whereas with the type being
      explicitly a directory, it would return `C:\Program Files\Mercurial\` (note the
      final trailing backslash). Presumably, a latter step then tries to turn that
      file name into a proper directory, by removing everything after the last `\`.
      
      This could likely also be fixed by actually searching for the component for
      hg.exe itself. That seemed a lot more complicated, as the GUID for hg.exe isn't
      known in this file (it's one of the "auto-derived" ones). We could also consider
      adding a Condition that I think could check the Property and ensure it's either
      empty or ends in a trailing slash, but that would be an installer runtime check
      and I'm not convinced it'd actually be useful.
      
      This will *not* cause existing installations that are in one of the bad
      directories to fix themselves. Doing that would require a fair amount more
      understanding of wix and windows installer than I have, and it *probably*
      wouldn't be possible to be 100% correct about it either (there's nothing
      preventing a user from intentionally installing it in C:\, though I don't know
      why they would do so).
      
      If someone wants to tackle fixing existing installations, I think that the first
      installation is actually the only one that shows up in "Add or Remove Programs",
      and that its registry keys still exist. You might be able to find something
      under HKEY_USERS that lists both the "good" and the "bad" InstallDirs. Mine was
      under `HKEY_USERS\S-1-5-18\Software\Mercurial\InstallDir` (C:\), and
      `HKEY_USERS\S-1-5-21-..numbers..\Software\Mercurial\InstallDir` (C:\Program
      Files\Mercurial). If you find exactly two, with one being the default path, and
      the other being a prefix of it, the user almost certainly hit this bug :D
      
      We had originally thought that this bug might be due to unattended
      installations/upgrades, but I no longer think that's the case. We were able to
      reproduce the issue by uninstalling all copies of Mercurial I could find,
      installing one version (it chose the correct location), and then starting the
      installer for a different version (higher or lower didn't matter). I did not
      need to deal with an unattended or headless installation/upgrade to trigger the
      issue, but it's possible that my system was "primed" for this bug to happen
      because of a previous unattended installation/upgrade.
      
      Differential Revision: https://phab.mercurial-scm.org/D9891
      8deab876fb59
    • Matt Harbison's avatar
      copyright: update to 2021 · ed43b6fa847e
      Matt Harbison authored
      Differential Revision: https://phab.mercurial-scm.org/D9885
      ed43b6fa847e
  17. 28 Jan, 2021 2 commits
  18. 25 Jan, 2021 3 commits
  19. 08 Jan, 2021 1 commit
  20. 22 Jan, 2021 3 commits
  21. 20 Jan, 2021 2 commits