~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/annotate.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""File annotate based on weave storage"""
18
18
 
19
19
# TODO: Choice of more or less verbose formats:
20
 
 
20
#
21
21
# interposed: show more details between blocks of modified lines
22
22
 
23
23
# TODO: Show which revision caused a line to merge into the parent
24
24
 
25
25
# TODO: perhaps abbreviate timescales depending on how recent they are
26
 
# e.g. "3:12 Tue", "13 Oct", "Oct 2005", etc.  
 
26
# e.g. "3:12 Tue", "13 Oct", "Oct 2005", etc.
27
27
 
28
28
import sys
29
29
import time
168
168
def _annotations(repo, file_id, rev_id):
169
169
    """Return the list of (origin_revision_id, line_text) for a revision of a file in a repository."""
170
170
    annotations = repo.texts.annotate((file_id, rev_id))
171
 
    # 
 
171
    #
172
172
    return [(key[-1], line) for (key, line) in annotations]
173
173
 
174
174
 
210
210
        revision_id_to_revno[CURRENT_REVISION] = (
211
211
            "%d?" % (branch.revno() + 1),)
212
212
        revisions[CURRENT_REVISION] = current_rev
213
 
    revision_ids = [o for o in revision_ids if 
 
213
    revision_ids = [o for o in revision_ids if
214
214
                    repository.has_revision(o)]
215
 
    revisions.update((r.revision_id, r) for r in 
 
215
    revisions.update((r.revision_id, r) for r in
216
216
                     repository.get_revisions(revision_ids))
217
217
    for origin, text in annotations:
218
218
        text = text.rstrip('\r\n')
231
231
                                     time.gmtime(rev.timestamp + tz))
232
232
            # a lazy way to get something like the email address
233
233
            # TODO: Get real email address
234
 
            author = rev.get_apparent_author()
 
234
            author = rev.get_apparent_authors()[0]
235
235
            try:
236
236
                author = extract_email_address(author)
237
237
            except errors.NoEmailInUsername:
243
243
               _left_matching_blocks=None,
244
244
               heads_provider=None):
245
245
    """Create a new annotated version from new lines and parent annotations.
246
 
    
 
246
 
247
247
    :param parents_lines: List of annotated lines for all parents
248
248
    :param new_lines: The un-annotated new lines
249
249
    :param new_revision_id: The revision-id to associate with new lines