/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: Martin
  • Date: 2019-06-16 01:03:51 UTC
  • mto: This revision was merged to the branch mainline in revision 7340.
  • Revision ID: gzlist@googlemail.com-20190616010351-uz89ydnwdoal4ve4
Split non-ini config methods to bedding

Functions that determine filesystem paths to use for config and default
username are now outside of the main (large) config module.

Also move cache_dir function from osutils and normalise logic.

Show diffs side-by-side

added added

removed removed

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