~ubuntu-branches/ubuntu/trusty/bzr-xmloutput/trusty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Description: Use the standard interface for obtaining annotations - the other (private)
 one is likely to go away in bzr 2.4.
Origin: commit, revision id: jelmer@samba.org-20110504132433-950pr6w54y2r5tn4
Author: Jelmer Vernooij <jelmer@samba.org>
Last-Update: 2011-05-04
X-Bzr-Revision-Id: jelmer@samba.org-20110504132433-950pr6w54y2r5tn4

=== modified file 'annotatexml.py'
--- old/annotatexml.py	2010-12-15 18:27:12 +0000
+++ new/annotatexml.py	2011-05-04 13:24:33 +0000
@@ -34,8 +34,8 @@
 except ImportError:
     # to support bzr < 1.8
     from bzrlib.annotate import _annotate_file
+    from bzrlib.annotate import _annotations
 
-from bzrlib.annotate import _annotations
 from bzrlib import osutils
 
 from writer import _escape_cdata
@@ -58,10 +58,12 @@
                   (wt_root_path,
                   'file="%s"' % file_path)).encode(encoding, 'replace'))
 
-    annotations = _annotations(branch.repository, file_id, rev_id)
-    if _annotate_file:
+    if _annotate_file: # bzr < 1.8
+        annotations = _annotations(branch.repository, file_id, rev_id)
         annotation = list(_annotate_file(branch, rev_id, file_id))
     else:
+        tree = branch.repository.revision_tree(rev_id)
+        annotations = tree.annotate_iter(file_id)
         annotation = list(_expand_annotations(annotations, branch))
 
     for (revno_str, author, date_str, line_rev_id,