diff --git a/gertty/sync.py b/gertty/sync.py index 0c91998..dcc86f4 100644 --- a/gertty/sync.py +++ b/gertty/sync.py @@ -474,11 +474,7 @@ class SyncChangeTask(Task): for remote_commit, remote_revision in remote_change.get('revisions', {}).items(): revision = session.getRevisionByCommit(remote_commit) # TODO: handle multiple parents - if 'git' in remote_revision['fetch']: - ref = remote_revision['fetch']['git']['ref'] - url = remote_revision['fetch']['git']['url'] - auth = False - elif 'anonymous http' in remote_revision['fetch']: + if 'anonymous http' in remote_revision['fetch']: ref = remote_revision['fetch']['anonymous http']['ref'] url = remote_revision['fetch']['anonymous http']['url'] auth = False @@ -494,14 +490,16 @@ class SyncChangeTask(Task): ref = remote_revision['fetch']['ssh']['ref'] url = remote_revision['fetch']['ssh']['url'] auth = False + elif 'git' in remote_revision['fetch']: + ref = remote_revision['fetch']['git']['ref'] + url = remote_revision['fetch']['git']['url'] + auth = False else: if len(remote_revision['fetch']): - errMessage = 'Don\'t know how to download changes. ' \ - 'Server offered these schemes, but Gertty doesn\'t support any of them: %s' \ - % ', '.join(remote_revision['fetch'].keys()) + errMessage = "No supported fetch method found. Server offers: %s" % ( + ', '.join(remote_revision['fetch'].keys())) else: - errMessage = 'The server is missing the download-commands plugin. ' \ - 'Don\'t know how to download revisions.' + errMessage = "The server is missing the download-commands plugin." raise Exception(errMessage) if (not revision) or self.force_fetch: fetches[url].append('+%(ref)s:%(ref)s' % dict(ref=ref))