Skip to content
Snippets Groups Projects
Commit 3483dccd45a5 authored by Manuel Jacob's avatar Manuel Jacob
Browse files

hggit: fix safebranchrevs() for the case when the remote repo is not a gitrepo

(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.
parent 2e68868b65e4
Loading
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment