~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

Make annotate cope better with revisions committed without a valid 
email address.  (Marien Zwart)

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
 
134
134
    def user_email(self):
135
135
        """Return just the email component of a username."""
136
 
        e = self.username()
137
 
        m = re.search(r'[\w+.-]+@[\w+.-]+', e)
138
 
        if not m:
139
 
            raise BzrError("%r doesn't seem to contain "
140
 
                           "a reasonable email address" % e)
141
 
        return m.group(0)
 
136
        return extract_email_address(self.username())
142
137
 
143
138
    def username(self):
144
139
        """Return email-style username.
480
475
    """
481
476
    m = re.search(r'[\w+.-]+@[\w+.-]+', e)
482
477
    if not m:
483
 
        raise BzrError("%r doesn't seem to contain "
484
 
                       "a reasonable email address" % e)
 
478
        raise errors.BzrError("%r doesn't seem to contain "
 
479
                              "a reasonable email address" % e)
485
480
    return m.group(0)
486
481
 
487
482
class TreeConfig(object):