1. 09 Apr, 2021 1 commit
    • Matt Harbison's avatar
      typing: add type hints to tortoisehg/hgqt/visdiff.py · b4c2c53d1349
      Matt Harbison authored
      There are a handful of `annotation-type-mismatch` suppressions for constructs
      like a function's Text arg being immediately overwritten with the bytes form of
      the argument.  This is an experimental diagnostic that needs to be explicitly
      enabled in pytype (for now), but such uses also seem to confuse PyCharm.  It
      does seem reasonable to overwrite the argument after converting between bytes
      and unicode, but one such overwrite at the end of the function wasn't as
      useful, so it has been elided away.
  2. 08 Apr, 2021 1 commit
  3. 10 Apr, 2021 1 commit
  4. 09 Apr, 2021 2 commits
    • Matt Harbison's avatar
      typing: correct the signature of `hglib.revsymbol()` · 1b2f482953c2
      Matt Harbison authored
      This fixes e98411b0b72e.  First, I confused this with `scmutil.revrange()`,
      which does accept int.  Second, `scmutil.revsymbol()` can't return a `patchctx`
      because it only calls `repo[symbol]` if the symbol is one of a handful of magic
      strings or a stringified revision.  Otherwise, it tries to lookup a node or
      bookmark name.
      This popped up when typing the `visdiff` module, because `patchctx` lacks
      `manifest()` and `ancestor()` functions.  The original `ThgContext` is left for
      the upcoming changes that could also use `patchctx`.  IDK if there's a
      difference between defining these with `TypeVar` or `Union`, but I switched to
      the latter because PyCharm shows that instead of the custom name.  That's
      better, since it hides the names that aren't really descriptive.
    • Matt Harbison's avatar
      typing: add type hints to hglib.difftools() · 26fd4ed553f4
      Matt Harbison authored
      In order to keep an already complicated type for being complicated further, some
      of the dict values stored are changed from list to tuple to align with other
      stored values.
  5. 10 Apr, 2021 1 commit
  6. 09 Apr, 2021 3 commits
  7. 08 Apr, 2021 3 commits
  8. 07 Apr, 2021 4 commits
    • Matt Harbison's avatar
      typing: add type hints to tortoisehg/hgqt/archive.py · 559bc66678f0
      Matt Harbison authored
      branch : stable
    • Matt Harbison's avatar
      grep: avoid a duplicate context lookup · 1cc3b9f229be
      Matt Harbison authored
      I don't see the point, as the `rev` variable is not subsequently used, and
      `revsymbol()` already calls `repo[rev]`.
    • Matt Harbison's avatar
      thg: convert all `scmutil.revsymbol()` uses to `hglib.revsymbol()` · 710c0d416cbd
      Matt Harbison authored
      Since the function could theoretically return a workingctx, there are a couple
      places that need type assertions where attributes are accessed that are not on
      Additionally, pytype flagged the mq module for calling a function on the custom
      context subclass, so that is now suppressed.  I'm assuming these context
      subclass functions would be better off being unbound methods in a `contextutil`
      module or similar, because the hidden subclass is confusing the typing some
      times, and it's weird that some functions on a context return unicode.
    • Matt Harbison's avatar
      hglib: add a typed wrapper for `scmutil.revsymbol()` · 3ef8ac3b99a0
      Matt Harbison authored
      Unfortunately, this core function can't be typed properly because its module
      imports the context module, but the function returns a class in the context
      module.  Using this allowed PyCharm to pick up the unicode being passed to the
      context object in 75a96fd40bde.  Pytype didn't flag that because it seems to
      struggle with recognizing typing on dunder methods, but now knows it is a
      basectx there.
  9. 06 Apr, 2021 1 commit
  10. 07 Apr, 2021 1 commit
  11. 06 Apr, 2021 1 commit
  12. 07 Apr, 2021 1 commit
  13. 05 Apr, 2021 5 commits
    • Matt Harbison's avatar
      resolve: fix the default value for the tool on the merge function · 16c521048d82
      Matt Harbison authored
      No bug here, but PyCharm flagged the caller that passes 'internal:merge' as
      giving the wrong type, as well as the inside of the function itself where the
      value is appended to a str.
    • Matt Harbison's avatar
      typing: add type hints to tortoisehg/hgqt/phabreview.py · 7993399288f8
      Matt Harbison authored
      Rather than complicate the hints for `_writereviewerhistory()`, drop the empty
      list that was returned early, and never used by the caller.
    • Matt Harbison's avatar
    • Matt Harbison's avatar
      thg: disambiguate the `ui` command parameter from the `ui` core module · 1cf49f54885d
      Matt Harbison authored
      I noticed this comparing against `tortoisehg.hgqt.run.run()`.  Since `ui` is
      passed as an argument and there is no `.ui()` on it, this would have crashed.
      The other use is adjusted accordingly.
    • Matt Harbison's avatar
      thg: make the thg extension work on py3 · 3324d6521baf
      Matt Harbison authored
      This is mostly aligning the command with the similar `tortoisehg.hgqt.run.run()`
      implementation.  There's still something wierd here because it seems like
      at least some config options aren't being loaded, resulting in a stacktrace when
      some code unexpectedly gets `None` back.  In order show the window, it needs
      this command line to run with hg 5.7.1 and py 3.8.1:
          hg.exe --config extensions.hgview=hgext3rd\thg.py view --traceback \
                 --config tortoisehg.cmdserver.readtimeout=5 \
                 --config tortoisehg.tasktabs=east \
                 --config extensions.topic=! \
                 --config tortoisehg.graphlimit=100
      Since stderr isn't wrapped on py3, I have no idea how it's supposed to pop up
      the error box, but this is how the workbench component is launched, and the
      popup displays there under py3.
  14. 04 Apr, 2021 1 commit
  15. 01 Apr, 2021 1 commit
  16. 04 Apr, 2021 1 commit
  17. 01 Apr, 2021 5 commits
  18. 31 Mar, 2021 3 commits
  19. 30 Mar, 2021 3 commits
  20. 29 Mar, 2021 1 commit