/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/annotate.py

  • Committer: Jelmer Vernooij
  • Date: 2019-05-20 03:57:29 UTC
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190520035729-9rxvefxkvbbivygy
use default_user_agent function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
from .lazy_import import lazy_import
34
34
lazy_import(globals(), """
35
 
 
36
 
import patiencediff
37
 
 
38
35
from breezy import (
 
36
    patiencediff,
39
37
    tsort,
40
38
    )
41
39
""")
42
40
from . import (
43
 
    config,
44
 
    errors,
45
41
    osutils,
46
42
    )
 
43
from .config import (
 
44
    NoEmailInUsername,
 
45
    NoWhoami,
 
46
    extract_email_address,
 
47
    )
47
48
from .repository import _strip_NULL_ghosts
48
49
from .revision import (
49
50
    CURRENT_REVISION,
85
86
        current_rev.parent_ids = tree.get_parent_ids()
86
87
        try:
87
88
            current_rev.committer = branch.get_config_stack().get('email')
88
 
        except errors.NoWhoami:
 
89
        except NoWhoami:
89
90
            current_rev.committer = 'local user'
90
91
        current_rev.message = "?"
91
92
        current_rev.timestamp = round(time.time(), 3)
218
219
            # a lazy way to get something like the email address
219
220
            # TODO: Get real email address
220
221
            author = rev.get_apparent_authors()[0]
221
 
            _, email = config.parse_username(author)
222
 
            if email:
223
 
                author = email
 
222
            try:
 
223
                author = extract_email_address(author)
 
224
            except NoEmailInUsername:
 
225
                pass        # use the whole name
224
226
        yield (revno_str, author, date_str, origin, text)
225
227
 
226
228