/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/git/remote.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-10-13 19:53:32 UTC
  • mfrom: (7131.7.4 more-git-errors)
  • Revision ID: breezy.the.bot@gmail.com-20181013195332-zswofkblwo1wv5eb
Handle some more Git error strings and convert them to specific exceptions.

Merged from https://code.launchpad.net/~jelmer/brz/more-git-errors/+merge/355811

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
    if message.startswith('access denied or repository not exported:'):
204
204
        extra, path = message.split(': ', 1)
205
205
        return PermissionDenied(path, extra)
 
206
    if message.endswith('You are not allowed to push code to this project.'):
 
207
        return PermissionDenied(url, message)
 
208
    if message.endswith(' does not appear to be a git repository'):
 
209
        return NotBranchError(url, message)
 
210
    m = re.match(r'Permission to ([^ ]+) denied to ([^ ]+)\.', message)
 
211
    if m:
 
212
        return PermissionDenied(m.group(1), 'denied to %s' % m.group(2))
206
213
    # Don't know, just return it to the user as-is
207
214
    return RemoteGitError(message)
208
215
 
350
357
    def progress(self, text):
351
358
        text = text.rstrip(b"\r\n")
352
359
        text = text.decode('utf-8')
353
 
        if text.startswith('error: '):
 
360
        if text.lower().startswith('error: '):
354
361
            trace.show_error('git: %s', text[len(b'error: '):])
355
362
        else:
356
363
            trace.mutter("git: %s", text)