[x] I've followed the PEP8 style guides for Python code.
Do not change the order of the remotes by using the default value from the Conan API instead of -1 in add_remotes_to_conan -> _add_remote
Probably in Remotesmanager._add_remote the default argument of insert should be changed to None instead of False. The ConanAPI uses None as a the default value.
The default value False gets treated differently then None . False gets interpreted as not None , hence we go in the insert_by_index case. index = int(False) = 0`` Hence it will put always to the beginning. The current version usesindex=-1` which does *not* push to the end. It pushes toend -1, i.e. 1 BEFORE the last element. None` has it's own handling and adds the remote to the end of the remotes OrderedDict which should be the correct behavior [see remote_registry.py : Remotes._remotes].
Changelog: (Bugfix):
Fixes #613
Do not change the order of the remotes by using the default value from the Conan API instead of -1 in
add_remotes_to_conan -> _add_remote
Probably in Remotesmanager._add_remote the default argument of
insert
should be changed toNone
instead ofFalse
. The ConanAPI usesNone
as a the default value. The default valueFalse
gets treated differently thenNone
.False
gets interpreted as notNone
, hence we go in the insert_by_index case.index = int(False) = 0`` Hence it will put always to the beginning. The current version uses
index=-1` which does *not* push to the end. It pushes to
end -1, i.e. 1 BEFORE the last element.
None` has it's own handling and adds the remote to the end of the remotes OrderedDict which should be the correct behavior [see remote_registry.py : Remotes._remotes].