1. 11 Apr, 2021 1 commit
    • Matt Harbison's avatar
      visdiff: filter copy data through the file matcher to hide unrelated changes · dc379588cfc3
      Matt Harbison authored
      I noticed this hacking on some other functionality, but it can be seen with an
      existing command like this when updated to any recent change:
      
          $ python thg vdiff -r 5bfef52bfcc9 tortoisehg/hgqt/qsci.py tortoisehg/hgqt/qtcore.py
      
      All of the subsequent file copies that took place between then and now get
      included in the snapshots, even though they weren't related.  Two files need to
      match to invoke a dirdiff, otherwise the snapshot of the unrelated files occurs,
      but only the named one is diffed.  The same behavior occurs if two of the files
      in the manifest view of that revision are selected and diffed to local.
      
      The filtering might still be a little generous in that it matches either the
      source or destination.  But I'm not sure what the data looks like for a diff
      from new -> old as opposed to old -> new, and order of revision selection might
      be a little too subtle in the GUI.
      dc379588cfc3
  2. 13 Apr, 2021 1 commit
  3. 11 Apr, 2021 2 commits
    • Matt Harbison's avatar
      run: fix the `vdiff` command to work on python3 · 26eb7ee7666b
      Matt Harbison authored
      The --change arg was OK, because that path tests for unicode and conditionally
      converts from it.  The --rev path was broken because it blindly converted,
      resulting in revision values with a `b''` prefix being looked up and failing.
      In this case, there was just an Abort messagebox- no traceback, even with the
      `--traceback` option.
      
      --HG--
      branch : stable
      26eb7ee7666b
    • Matt Harbison's avatar
      update: fix a bad pytype assertion · 4e1f5f9e4fb0
      Matt Harbison authored
      I hit this when cancelling the discard/merge/shelve popup with a dirty wdir,
      instead of selecting one of the other buttons.  This fixes cb5c5a12f06a.
      
      --HG--
      branch : stable
      4e1f5f9e4fb0
  4. 10 Apr, 2021 1 commit
  5. 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.
      b4c2c53d1349
  6. 08 Apr, 2021 1 commit
  7. 09 Apr, 2021 3 commits
  8. 08 Apr, 2021 1 commit
  9. 10 Apr, 2021 1 commit
  10. 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.
      1b2f482953c2
    • 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.
      26fd4ed553f4
  11. 10 Apr, 2021 1 commit
  12. 08 Apr, 2021 3 commits
  13. 07 Apr, 2021 4 commits
    • Matt Harbison's avatar
      typing: add type hints to tortoisehg/hgqt/archive.py · 559bc66678f0
      Matt Harbison authored
      --HG--
      branch : stable
      559bc66678f0
    • 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]`.
      1cc3b9f229be
    • 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
      basectx.
      
      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.
      710c0d416cbd
    • 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.
      3ef8ac3b99a0
  14. 06 Apr, 2021 1 commit
  15. 07 Apr, 2021 1 commit
  16. 06 Apr, 2021 1 commit
  17. 07 Apr, 2021 1 commit
  18. 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.
      16c521048d82
    • 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.
      7993399288f8
    • Matt Harbison's avatar
      138534b06036
    • 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.
      1cf49f54885d
    • 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.
      3324d6521baf
  19. 04 Apr, 2021 1 commit
  20. 01 Apr, 2021 1 commit
  21. 04 Apr, 2021 1 commit
  22. 01 Apr, 2021 5 commits
  23. 31 Mar, 2021 1 commit