Skip to content
Snippets Groups Projects
  1. Dec 09, 2020
  2. Oct 27, 2020
  3. Dec 11, 2020
  4. Dec 09, 2020
    • muxator's avatar
      gitdirstate: do not crash on hg status with an unreadable dir and no .hgignore · d2ab8d80
      muxator authored
      Now it is possible to invoke hg status in a repo where there is an unreadable
      directory and no .hgignore without crashing.
      
      This probably uncovers another (albeit minor) bug: the "Permission denied"
      message is printed twice.
      d2ab8d80
    • muxator's avatar
      tests: document hg status crash with an unreadable dir and no .hgignore · d27df9cf
      muxator authored
      If a repo has no .hgignore (this happens frequently on repositories that come
      from a git clone, which tend to have a .gitignore but no .hgignore), and a
      directory is not readable by the current user (for example, for a ownership or
      persmission problem), hg-git causes a crash in hg status instead of printing an
      error message.
      
      An almost complete stack trace is:
      
      $ hg status
      ...
      Traceback (most recent call last):
        File "/opt/mercurial/hg-git/hggit/gitdirstate.py", line 99, in _ignore
          fp = open(files[0], 'rb')
      FileNotFoundError: [Errno 2] No such file or directory: b'/tmp/example/.hgignore'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/opt/mercurial/hg-git/hggit/gitdirstate.py", line 182, in _finddotgitignores
          entries = util.listdir(join(nd), stat=True, skip=skip)
      PermissionError: [Errno 13] Permission denied: '/tmp/example/not_readable'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        [...]
        File "/opt/mercurial/hg-git/hggit/gitdirstate.py", line 102, in _ignore
          fns = self._finddotgitignores()
        File "/opt/mercurial/hg-git/hggit/gitdirstate.py", line 185, in _finddotgitignores
          fwarn(nd, inst.strerror)
        File "/opt/mercurial/hg-git/hggit/gitdirstate.py", line 128, in fwarn
          self._ui.warn(b'%s: %s\n' % (self.pathto(f), msg))
      TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'
      d27df9cf
  5. Nov 24, 2020
  6. Nov 22, 2020
  7. Nov 21, 2020
  8. Aug 07, 2020
  9. Aug 04, 2018
    • Dan Villiom Podlaski Christiansen's avatar
      debuggitdir: add new command · 9e47dd10
      Dan Villiom Podlaski Christiansen authored
      This is useful for interacting with the Git repository directly,
      either from shell scripts, the terminal, or perhaps an alias like
      this:
      
      [alias]
      git=!GIT_DIR=$(hg debuggitdir) git "$@"
      
      ...and with that, you can easily access features not offered by
      Dulwich such as `hg git gc`.
      9e47dd10
  10. Oct 23, 2020
  11. Jul 12, 2020
  12. Oct 23, 2020
  13. Aug 13, 2020
  14. Oct 11, 2020
  15. Aug 13, 2020
  16. Aug 06, 2020
  17. Jun 12, 2020
  18. May 10, 2020
    • Manuel Jacob's avatar
      hggit: fix safebranchrevs() for the case when the remote repo is not a gitrepo · 3483dccd
      Manuel Jacob authored
      (folded with intermediate revision with new message by Georges Racinet)
      
      The previous conditional was wrong: in current Mercurial, 'co' is in principle
      not an integer. The condition on integer has been introduced for the port to
      py3, but does not change the fact that changelog.__contains__ is for integers.
      
      The original intent in a90fe3e8a8c3 was probably to exclude local repositories,
      but this had the side effect of setting `co=None` in all cases, hence affecting
      pulls having nothing to do with hg-git, as the new test demontstrates.
      
      What we really want is to force `co=None` only for remote Git repositories,
      for the reasons explained in the comment.
      
      Previous intermediate commit was
      
        cleanup: eliminate if statement with condition that is always true
      
        'co' is never an integer. It’s always None or of type bytes. Apparently 'co'
        was of type int some years ago.
      
        A proper fix would require to fix the lookup() remote command or change hg to
        not require it e.g. when pulling with -r. For now, let’s remove the broken
        code and be honest about that we give up.
      3483dccd
  19. Dec 23, 2019
  20. Mar 06, 2020
  21. May 04, 2020
  22. May 03, 2020
    • Manuel Jacob's avatar
      py3: byteify sources · 86feb288
      Manuel Jacob authored
      These files were byteified using hg’s contrib/byteify-strings.py:
      
      - contrib/hggitperf.py
      - hggit/compat.py
      - hggit/git2hg.py
      - hggit/gitdirstate.py
      - hggit/gitrepo.py
      - hggit/git_handler.py
      - hggit/hg2git.py
      - hggit/hgrepo.py
      - hggit/overlay.py
      - hggit/util.py
      - hggit/verify.py
      - hggit/_ssh.py
      - hggit/__init__.py
      - tests/commitextra.py
      
      Additionally, "--treat-as-kwargs opts kwargs" were passed as arguments.
      
      Some of the changes will be undone later. Because of the large amount of
      literals that should be changed in comparison to the few literals that should
      stay, it seemed better to do it this way around.
      
      Raw literals are not changed by the script. Some of them will be changed
      manually in a separate changeset.
      86feb288
    • Manuel Jacob's avatar
      tests: use $PYTHON instead of python · 0cccb888
      Manuel Jacob authored
      0cccb888
  23. Dec 23, 2019
  24. Mar 05, 2020
    • Manuel Jacob's avatar
      py3: use print as function · 7a13f6fa
      Manuel Jacob authored
      * run `find . -name "*.py" -print0 -o -path ./tests/hghave | xargs -I {} -0 2to3 --fix=print --write {}`
      * run `find . -name "*.py" -print0 -o -path ./tests/hghave | xargs -I {} -0 2to3 --doctests_only --fix=print --write {}`
      * remove extra newline at end of files introduced by last command
      * add `from __future__ import print_function` to Python files
      7a13f6fa
  25. Nov 22, 2019
  26. Mar 05, 2020
  27. Dec 22, 2019
  28. Aug 01, 2019
  29. Feb 23, 2019
Loading