/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-03-05 07:32:38 UTC
  • mto: (7290.1.21 work)
  • mto: This revision was merged to the branch mainline in revision 7311.
  • Revision ID: jelmer@jelmer.uk-20190305073238-zlqn981opwnqsmzi
Add appveyor configuration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""File annotate based on weave storage"""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
# TODO: Choice of more or less verbose formats:
20
22
#
21
23
# interposed: show more details between blocks of modified lines
30
32
 
31
33
from .lazy_import import lazy_import
32
34
lazy_import(globals(), """
33
 
 
34
 
import patiencediff
35
 
 
36
35
from breezy import (
 
36
    patiencediff,
37
37
    tsort,
38
38
    )
39
39
""")
40
40
from . import (
41
 
    config,
42
 
    errors,
43
41
    osutils,
44
42
    )
 
43
from .config import (
 
44
    NoEmailInUsername,
 
45
    NoWhoami,
 
46
    extract_email_address,
 
47
    )
45
48
from .repository import _strip_NULL_ghosts
46
49
from .revision import (
47
50
    CURRENT_REVISION,
83
86
        current_rev.parent_ids = tree.get_parent_ids()
84
87
        try:
85
88
            current_rev.committer = branch.get_config_stack().get('email')
86
 
        except errors.NoWhoami:
 
89
        except NoWhoami:
87
90
            current_rev.committer = 'local user'
88
91
        current_rev.message = "?"
89
92
        current_rev.timestamp = round(time.time(), 3)
216
219
            # a lazy way to get something like the email address
217
220
            # TODO: Get real email address
218
221
            author = rev.get_apparent_authors()[0]
219
 
            _, email = config.parse_username(author)
220
 
            if email:
221
 
                author = email
 
222
            try:
 
223
                author = extract_email_address(author)
 
224
            except NoEmailInUsername:
 
225
                pass        # use the whole name
222
226
        yield (revno_str, author, date_str, origin, text)
223
227
 
224
228