Skip to content
Snippets Groups Projects
  1. Mar 09, 2021
  2. Mar 08, 2021
  3. Feb 26, 2021
  4. Feb 02, 2021
    • Yuya Nishihara's avatar
      log: fix handling of root (or empty) path provided by matcher (issue6478) · 9842c00f
      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.
      9842c00f
  5. Feb 25, 2021
  6. Feb 19, 2021
  7. Feb 16, 2021
  8. Feb 19, 2021
  9. Feb 24, 2021
  10. Feb 10, 2021
  11. Feb 09, 2021
  12. Jan 18, 2021
  13. Feb 04, 2021
    • Jordi Gutiérrez Hermoso's avatar
      largefiles: properly pass kwargs into url.open · 32da5891
      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.
      32da5891
    • Yuya Nishihara's avatar
  14. Feb 02, 2021
  15. Jan 29, 2021
  16. Feb 01, 2021
  17. Jan 27, 2021
    • Kyle Lippincott's avatar
      wix: tell ComponentSearch that it is finding a directory (not a file) · 8deab876
      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
      8deab876
    • Matt Harbison's avatar
      copyright: update to 2021 · ed43b6fa
      Matt Harbison authored
      Differential Revision: https://phab.mercurial-scm.org/D9885
      ed43b6fa
  18. Jan 28, 2021
  19. Jan 25, 2021
  20. Jan 08, 2021
  21. Jan 22, 2021
  22. Jan 20, 2021
Loading