Skip to content

Commit

Permalink
Merge lp:brz/3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Sep 27, 2023
2 parents 9a8d066 + 36b67f7 commit 83bef7e
Show file tree
Hide file tree
Showing 45 changed files with 8,495 additions and 9,517 deletions.
19 changes: 13 additions & 6 deletions breezy/plugins/gitlab/forge.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def store_gitlab_token(name, url, private_token):
from ...config import AuthenticationConfig
auth_config = AuthenticationConfig()
auth_config._set_option(name, 'url', url)
auth_config._set_option(name, 'forge', 'gitlab')
auth_config._set_option(name, 'private_token', private_token)


Expand All @@ -175,17 +176,25 @@ def iter_tokens():
[os.path.expanduser(p) for p in _DEFAULT_FILES] +
# backwards compatibility
[os.path.join(bedding.config_dir(), 'gitlab.conf')])
yield from config.items()
for name, creds in config.items():
if 'url' not in creds:
continue
yield name, creds

from ...config import AuthenticationConfig
auth_config = AuthenticationConfig()
yield from auth_config._get_config().iteritems()
for name, creds in auth_config._get_config().iteritems():
if creds.get("forge") == "gitlab":
yield name, creds
else:
url = creds.get("url")
# Hack for those without forge set
if url and url.startswith('https://gitlab.com/'):
yield name, creds


def get_credentials_by_url(url):
for _name, credentials in iter_tokens():
if 'url' not in credentials:
continue
if credentials['url'].rstrip('/') == url.rstrip('/'):
return credentials
else:
Expand Down Expand Up @@ -829,8 +838,6 @@ def probe_from_url(cls, url, possible_transports=None):
@classmethod
def iter_instances(cls):
for _name, credentials in iter_tokens():
if 'url' not in credentials:
continue
yield cls(
get_transport(credentials['url']),
private_token=credentials.get('private_token'))
Expand Down
17 changes: 16 additions & 1 deletion doc/en/release-notes/brz-3.3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,25 @@ Breezy Release Notes
.. toctree::
:maxdepth: 1

brz 3.3.5
#########

:3.3.5: UNRELEASED

brz 3.3.4
#########

:3.3.4: UNRELEASED
:3.3.4: 2023-09-04

* Improve handling of lp: URLs when lp: insteadOf is set in gitconfig.
(Jelmer Vernooij)

* Allow setting _ConnectRequestor.selector. (Jelmer Vernooij)

* Fix brz-email bug on Python 3. (Triss)

* Fix compatibility with newer versions of dulwich.
(Jelmer Vernooij)

brz 3.3.3
#########
Expand Down
Loading

0 comments on commit 83bef7e

Please sign in to comment.