/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/annotate.py

Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    errors,
42
42
    osutils,
43
43
    )
44
 
from .config import extract_email_address
 
44
from .config import (
 
45
    NoEmailInUsername,
 
46
    NoWhoami,
 
47
    extract_email_address,
 
48
    )
45
49
from .repository import _strip_NULL_ghosts
46
50
from .revision import (
47
51
    CURRENT_REVISION,
82
86
        current_rev.parent_ids = tree.get_parent_ids()
83
87
        try:
84
88
            current_rev.committer = branch.get_config_stack().get('email')
85
 
        except errors.NoWhoami:
 
89
        except NoWhoami:
86
90
            current_rev.committer = 'local user'
87
91
        current_rev.message = "?"
88
92
        current_rev.timestamp = round(time.time(), 3)
188
192
        revision_id_to_revno[CURRENT_REVISION] = (
189
193
            "%d?" % (branch.revno() + 1),)
190
194
        revisions[CURRENT_REVISION] = current_rev
191
 
    revision_ids = [o for o in revision_ids if
192
 
                    repository.has_revision(o)]
193
 
    revisions.update((r.revision_id, r) for r in
194
 
                     repository.get_revisions(revision_ids))
 
195
    revisions.update(
 
196
            entry for entry in
 
197
            repository.iter_revisions(revision_ids)
 
198
            if entry[1] is not None)
195
199
    for origin, text in annotations:
196
200
        text = text.rstrip('\r\n')
197
201
        if origin == last_origin:
212
216
            author = rev.get_apparent_authors()[0]
213
217
            try:
214
218
                author = extract_email_address(author)
215
 
            except errors.NoEmailInUsername:
 
219
            except NoEmailInUsername:
216
220
                pass        # use the whole name
217
221
        yield (revno_str, author, date_str, origin, text)
218
222