~bzr/ubuntu/lucid/bzr/beta-ppa

« back to all changes in this revision

Viewing changes to bzrlib/_annotator_pyx.c

  • Committer: Martin Pool
  • Date: 2010-07-02 07:29:40 UTC
  • mfrom: (129.1.7 packaging-karmic)
  • Revision ID: mbp@sourcefrog.net-20100702072940-hpzq5elg8wjve8rh
* PPA rebuild.
* PPA rebuild for Karmic.
* PPA rebuild for Jaunty.
* PPA rebuild for Hardy.
* From postinst, actually remove the example bash completion scripts.
  (LP: #249452)
* New upstream release.
* New upstream release.
* New upstream release.
* Revert change to Build-depends: Dapper does not have python-central.
  Should be python-support..
* Target ppa..
* Target ppa..
* Target ppa..
* Target ppa..
* New upstream release.
* Switch to dpkg-source 3.0 (quilt) format.
* Bump standards version to 3.8.4.
* Remove embedded copy of python-configobj. Closes: #555336
* Remove embedded copy of python-elementtree. Closes: #555343
* Change section from 'Devel' to 'Vcs'..
* Change section from 'Devel' to 'Vcs'..
* Change section from 'Devel' to 'Vcs'..
* Change section from 'Devel' to 'Vcs'..
* Change section from 'Devel' to 'Vcs'..
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* debian/control: Fix obsolete-relation-form-in-source
  lintian warning. 
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* Split out docs into bzr-doc package.
* New upstream release.
* Added John Francesco Ferlito to Uploaders.
* Fix install path to quick-reference guide
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* Fix FTBFS due to path changes, again.
* Fix FTBFS due to doc paths changing
* New upstream release.
* Fix FTBFS due to path changes, again.
* Fix FTBFS due to doc paths changing
* New upstream release.
* Fix FTBFS due to path changes, again.
* Fix FTBFS due to doc paths changing
* New upstream release.
* Fix FTBFS due to path changes, again, again.
* Fix FTBFS due to path changes, again.
* Fix FTBFS due to path changes.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* Bump standards version to 3.8.3.
* Remove unused patch system.
* New upstream release.
* New upstream release.
* New upstream release.
* Fix copy and paste tab error in .install file
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
 + Fixes compatibility with Python 2.4. Closes: #537708
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream version.
* Bump standards version to 3.8.2.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* Add python-pyrex to build-deps to ensure C extensions are always build.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* Split documentation into bzr-doc package. ((LP: #385074)
* Multiple packaging changes to make us more linitan clean.
* New upstream release.
* Split documentation into bzr-doc package. ((LP: #385074)
* Multiple packaging changes to make us more linitan clean.
* New upstream release.
* Split documentation into bzr-doc package. ((LP: #385074)
* Multiple packaging changes to make us more linitan clean.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* Fix API compatibility version. (Closes: #526233)
* New upstream release.
  + Fixes default format for upgrade command. (Closes: #464688)
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* Add missing dependency on zlib development library. (Closes:
  #523595)
* Add zlib build-depends.
* Add zlib build-depends.
* Add zlib build-depends.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* Move to section vcs.
* Bump standards version to 3.8.1.
* New upstream release.
* Remove temporary patch for missing .c files from distribution
* New upstream release.
* Remove temporary patch for missing .c files from distribution
* New upstream release.
* Remove temporary patch for missing .c files from distribution
* Add temporary patch for missing .c files from distribution
* Add temporary patch for missing .c files from distribution
* Add temporary patch for missing .c files from distribution
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* Recommend ca-certificates. (Closes: #452024)
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* Update watch file. bazaar now uses launchpad to host its sources.
* Remove patch for inventory root revision copy, applied upstream.
* New upstream release.
* New upstream release.
* New upstream release
* Force removal of files installed in error to /etc/bash_completion.d/
  (LP: #249452)
* New upstream release.
* New upstream release
* New upstream release.
* Bump standards version.
* Include patch for inventory root revision copy, required for bzr-svn.
* New upstream release.
* Remove unused lintian overrides.
* Correct the package version not to be native.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* New upstream release.
* Final 1.5 release.
* New upstream release.
* New upstream release.
* New upstream release.
* Add myself as a co-maintainer.
* Add a Dm-Upload-Allowed: yes header.
* New upstream bugfix release.
* New upstream release.
* Final 1.3 release.
* New upstream release.
* First release candidate of the upcoming 1.3 release.
* Rebuild to fix the problem caused by a build with a broken python-central.
* New upstream release.
* Rebuild for dapper PPA.
* Apply Lamont's patches to fix build-dependencies on dapper.
  (See: https://bugs.launchpad.net/bzr/+bug/189915)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Generated by Pyrex 0.9.8.5 on Fri May 28 05:01:38 2010 */
 
2
 
 
3
#define PY_SSIZE_T_CLEAN
 
4
#include "Python.h"
 
5
#include "structmember.h"
 
6
#ifndef PY_LONG_LONG
 
7
  #define PY_LONG_LONG LONG_LONG
 
8
#endif
 
9
#if PY_VERSION_HEX < 0x02050000
 
10
  typedef int Py_ssize_t;
 
11
  #define PY_SSIZE_T_MAX INT_MAX
 
12
  #define PY_SSIZE_T_MIN INT_MIN
 
13
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
 
14
  #define PyInt_AsSsize_t(o)    PyInt_AsLong(o)
 
15
#endif
 
16
#if !defined(WIN32) && !defined(MS_WINDOWS)
 
17
  #ifndef __stdcall
 
18
    #define __stdcall
 
19
  #endif
 
20
  #ifndef __cdecl
 
21
    #define __cdecl
 
22
  #endif
 
23
#endif
 
24
#ifdef __cplusplus
 
25
#define __PYX_EXTERN_C extern "C"
 
26
#else
 
27
#define __PYX_EXTERN_C extern
 
28
#endif
 
29
#include <math.h>
 
30
#include "python-compat.h"
 
31
 
 
32
 
 
33
typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
 
34
 
 
35
static PyObject *__pyx_m;
 
36
static PyObject *__pyx_b;
 
37
static int __pyx_lineno;
 
38
static char *__pyx_filename;
 
39
static char **__pyx_f;
 
40
 
 
41
static char __pyx_mdoc[] = "Functionality for doing annotations in the \'optimal\' way";
 
42
 
 
43
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
44
 
 
45
static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/
 
46
static int __Pyx_EndUnpack(PyObject *); /*proto*/
 
47
 
 
48
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
 
49
 
 
50
static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i); /*proto*/
 
51
 
 
52
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
 
53
 
 
54
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
55
 
 
56
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
 
57
 
 
58
static void __Pyx_AddTraceback(char *funcname); /*proto*/
 
59
 
 
60
/* Declarations from bzrlib._annotator_pyx */
 
61
 
 
62
 
 
63
/* Declarations from implementation of bzrlib._annotator_pyx */
 
64
 
 
65
static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *,PyObject *); /*proto*/
 
66
static int __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(PyObject *,PyObject *,Py_ssize_t,Py_ssize_t,Py_ssize_t); /*proto*/
 
67
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *,Py_ssize_t *); /*proto*/
 
68
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *,PyObject *,PyObject *); /*proto*/
 
69
static int __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(PyObject *,PyObject *,PyObject *); /*proto*/
 
70
static int __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(PyObject *,PyObject *,PyObject *,PyObject *,PyObject *); /*proto*/
 
71
 
 
72
static char __pyx_k1[] = "annotations must be a list";
 
73
static char __pyx_k2[] = "parent_annotations must be a list";
 
74
static char __pyx_k3[] = "Match length exceeds len of parent_annotations %s > %s";
 
75
static char __pyx_k4[] = "Match length exceeds len of annotations %s > %s";
 
76
static char __pyx_k5[] = "annotations must be tuples";
 
77
static char __pyx_k6[] = "_get_parent_annotations_and_matches";
 
78
static char __pyx_k7[] = "_ann_tuple_cache";
 
79
static char __pyx_k8[] = "bzrlib";
 
80
static char __pyx_k9[] = "annotate";
 
81
static char __pyx_k10[] = "_break_annotation_tie";
 
82
static char __pyx_k11[] = "_get_heads_provider";
 
83
static char __pyx_k12[] = "heads";
 
84
static char __pyx_k13[] = "_resolve_annotation_tie";
 
85
static char __pyx_k14[] = "_annotator_py";
 
86
static char __pyx_k15[] = "Annotator";
 
87
static char __pyx_k16[] = "Class that drives performing annotations.";
 
88
static char __pyx_k17[] = "_update_from_first_parent";
 
89
static char __pyx_k18[] = "_update_from_other_parents";
 
90
static char __pyx_k19[] = "annotate_flat";
 
91
 
 
92
static PyObject *__pyx_n_Annotator;
 
93
static PyObject *__pyx_n__ann_tuple_cache;
 
94
static PyObject *__pyx_n__annotator_py;
 
95
static PyObject *__pyx_n__break_annotation_tie;
 
96
static PyObject *__pyx_n__get_heads_provider;
 
97
static PyObject *__pyx_n__resolve_annotation_tie;
 
98
static PyObject *__pyx_n__update_from_first_parent;
 
99
static PyObject *__pyx_n__update_from_other_parents;
 
100
static PyObject *__pyx_n_annotate;
 
101
static PyObject *__pyx_n_annotate_flat;
 
102
static PyObject *__pyx_n_bzrlib;
 
103
static PyObject *__pyx_n_heads;
 
104
 
 
105
static PyObject *__pyx_k1p;
 
106
static PyObject *__pyx_k2p;
 
107
static PyObject *__pyx_k3p;
 
108
static PyObject *__pyx_k4p;
 
109
static PyObject *__pyx_k5p;
 
110
static PyObject *__pyx_k6p;
 
111
static PyObject *__pyx_k16p;
 
112
 
 
113
static __Pyx_StringTabEntry __pyx_string_tab[] = {
 
114
  {&__pyx_n_Annotator, 1, __pyx_k15, sizeof(__pyx_k15)},
 
115
  {&__pyx_n__ann_tuple_cache, 1, __pyx_k7, sizeof(__pyx_k7)},
 
116
  {&__pyx_n__annotator_py, 1, __pyx_k14, sizeof(__pyx_k14)},
 
117
  {&__pyx_n__break_annotation_tie, 1, __pyx_k10, sizeof(__pyx_k10)},
 
118
  {&__pyx_n__get_heads_provider, 1, __pyx_k11, sizeof(__pyx_k11)},
 
119
  {&__pyx_n__resolve_annotation_tie, 1, __pyx_k13, sizeof(__pyx_k13)},
 
120
  {&__pyx_n__update_from_first_parent, 1, __pyx_k17, sizeof(__pyx_k17)},
 
121
  {&__pyx_n__update_from_other_parents, 1, __pyx_k18, sizeof(__pyx_k18)},
 
122
  {&__pyx_n_annotate, 1, __pyx_k9, sizeof(__pyx_k9)},
 
123
  {&__pyx_n_annotate_flat, 1, __pyx_k19, sizeof(__pyx_k19)},
 
124
  {&__pyx_n_bzrlib, 1, __pyx_k8, sizeof(__pyx_k8)},
 
125
  {&__pyx_n_heads, 1, __pyx_k12, sizeof(__pyx_k12)},
 
126
  {&__pyx_k1p, 0, __pyx_k1, sizeof(__pyx_k1)},
 
127
  {&__pyx_k2p, 0, __pyx_k2, sizeof(__pyx_k2)},
 
128
  {&__pyx_k3p, 0, __pyx_k3, sizeof(__pyx_k3)},
 
129
  {&__pyx_k4p, 0, __pyx_k4, sizeof(__pyx_k4)},
 
130
  {&__pyx_k5p, 0, __pyx_k5, sizeof(__pyx_k5)},
 
131
  {&__pyx_k6p, 0, __pyx_k6, sizeof(__pyx_k6)},
 
132
  {&__pyx_k16p, 0, __pyx_k16, sizeof(__pyx_k16)},
 
133
  {0, 0, 0, 0}
 
134
};
 
135
 
 
136
 
 
137
 
 
138
/* Implementation of bzrlib._annotator_pyx */
 
139
 
 
140
static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *__pyx_v_annotations,PyObject *__pyx_v_parent_annotations) {
 
141
  int __pyx_r;
 
142
  int __pyx_1;
 
143
  PyObject *__pyx_2 = 0;
 
144
  PyObject *__pyx_3 = 0;
 
145
  Py_INCREF(__pyx_v_annotations);
 
146
  Py_INCREF(__pyx_v_parent_annotations);
 
147
 
 
148
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":63 */
 
149
  __pyx_1 = (!PyList_CheckExact(__pyx_v_annotations));
 
150
  if (__pyx_1) {
 
151
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
 
152
    Py_INCREF(__pyx_k1p);
 
153
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k1p);
 
154
    __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
 
155
    Py_DECREF(__pyx_2); __pyx_2 = 0;
 
156
    __Pyx_Raise(__pyx_3, 0, 0);
 
157
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
158
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
 
159
    goto __pyx_L2;
 
160
  }
 
161
  __pyx_L2:;
 
162
 
 
163
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":65 */
 
164
  __pyx_1 = (!PyList_CheckExact(__pyx_v_parent_annotations));
 
165
  if (__pyx_1) {
 
166
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
 
167
    Py_INCREF(__pyx_k2p);
 
168
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k2p);
 
169
    __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
 
170
    Py_DECREF(__pyx_2); __pyx_2 = 0;
 
171
    __Pyx_Raise(__pyx_3, 0, 0);
 
172
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
173
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
 
174
    goto __pyx_L3;
 
175
  }
 
176
  __pyx_L3:;
 
177
 
 
178
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":67 */
 
179
  __pyx_r = 0;
 
180
  goto __pyx_L0;
 
181
 
 
182
  __pyx_r = 0;
 
183
  goto __pyx_L0;
 
184
  __pyx_L1:;
 
185
  Py_XDECREF(__pyx_2);
 
186
  Py_XDECREF(__pyx_3);
 
187
  __Pyx_AddTraceback("bzrlib._annotator_pyx._check_annotations_are_lists");
 
188
  __pyx_r = (-1);
 
189
  __pyx_L0:;
 
190
  Py_DECREF(__pyx_v_annotations);
 
191
  Py_DECREF(__pyx_v_parent_annotations);
 
192
  return __pyx_r;
 
193
}
 
194
 
 
195
static int __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(PyObject *__pyx_v_parent_annotations,PyObject *__pyx_v_annotations,Py_ssize_t __pyx_v_parent_idx,Py_ssize_t __pyx_v_lines_idx,Py_ssize_t __pyx_v_match_len) {
 
196
  int __pyx_r;
 
197
  int __pyx_1;
 
198
  PyObject *__pyx_2 = 0;
 
199
  PyObject *__pyx_3 = 0;
 
200
  PyObject *__pyx_4 = 0;
 
201
  Py_INCREF(__pyx_v_parent_annotations);
 
202
  Py_INCREF(__pyx_v_annotations);
 
203
 
 
204
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":73 */
 
205
  __pyx_1 = ((__pyx_v_parent_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_parent_annotations));
 
206
  if (__pyx_1) {
 
207
    __pyx_2 = PyInt_FromSsize_t((__pyx_v_parent_idx + __pyx_v_match_len)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}
 
208
    __pyx_3 = PyInt_FromSsize_t(PyList_GET_SIZE(__pyx_v_parent_annotations)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;}
 
209
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}
 
210
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
 
211
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
 
212
    __pyx_2 = 0;
 
213
    __pyx_3 = 0;
 
214
    __pyx_2 = PyNumber_Remainder(__pyx_k3p, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}
 
215
    Py_DECREF(__pyx_4); __pyx_4 = 0;
 
216
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
 
217
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
 
218
    __pyx_2 = 0;
 
219
    __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
 
220
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
221
    __Pyx_Raise(__pyx_4, 0, 0);
 
222
    Py_DECREF(__pyx_4); __pyx_4 = 0;
 
223
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
 
224
    goto __pyx_L2;
 
225
  }
 
226
  __pyx_L2:;
 
227
 
 
228
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":78 */
 
229
  __pyx_1 = ((__pyx_v_lines_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_annotations));
 
230
  if (__pyx_1) {
 
231
    __pyx_2 = PyInt_FromSsize_t((__pyx_v_lines_idx + __pyx_v_match_len)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
 
232
    __pyx_3 = PyInt_FromSsize_t(PyList_GET_SIZE(__pyx_v_annotations)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;}
 
233
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
 
234
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
 
235
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
 
236
    __pyx_2 = 0;
 
237
    __pyx_3 = 0;
 
238
    __pyx_2 = PyNumber_Remainder(__pyx_k4p, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
 
239
    Py_DECREF(__pyx_4); __pyx_4 = 0;
 
240
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
 
241
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
 
242
    __pyx_2 = 0;
 
243
    __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
 
244
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
245
    __Pyx_Raise(__pyx_4, 0, 0);
 
246
    Py_DECREF(__pyx_4); __pyx_4 = 0;
 
247
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
 
248
    goto __pyx_L3;
 
249
  }
 
250
  __pyx_L3:;
 
251
 
 
252
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":83 */
 
253
  __pyx_r = 0;
 
254
  goto __pyx_L0;
 
255
 
 
256
  __pyx_r = 0;
 
257
  goto __pyx_L0;
 
258
  __pyx_L1:;
 
259
  Py_XDECREF(__pyx_2);
 
260
  Py_XDECREF(__pyx_3);
 
261
  Py_XDECREF(__pyx_4);
 
262
  __Pyx_AddTraceback("bzrlib._annotator_pyx._check_match_ranges");
 
263
  __pyx_r = (-1);
 
264
  __pyx_L0:;
 
265
  Py_DECREF(__pyx_v_parent_annotations);
 
266
  Py_DECREF(__pyx_v_annotations);
 
267
  return __pyx_r;
 
268
}
 
269
 
 
270
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *__pyx_v_tpl,Py_ssize_t *__pyx_v_pos) {
 
271
  PyObject *__pyx_r;
 
272
  int __pyx_1;
 
273
  Py_INCREF(__pyx_v_tpl);
 
274
 
 
275
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":94 */
 
276
  (__pyx_v_pos[0]) = ((__pyx_v_pos[0]) + 1);
 
277
 
 
278
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":95 */
 
279
  __pyx_1 = ((__pyx_v_pos[0]) >= PyTuple_GET_SIZE(__pyx_v_tpl));
 
280
  if (__pyx_1) {
 
281
    __pyx_r = NULL;
 
282
    goto __pyx_L0;
 
283
    goto __pyx_L2;
 
284
  }
 
285
  __pyx_L2:;
 
286
 
 
287
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":97 */
 
288
  __pyx_r = PyTuple_GET_ITEM(__pyx_v_tpl,(__pyx_v_pos[0]));
 
289
  goto __pyx_L0;
 
290
 
 
291
  __pyx_r = 0;
 
292
  __pyx_L0:;
 
293
  Py_DECREF(__pyx_v_tpl);
 
294
  return __pyx_r;
 
295
}
 
296
 
 
297
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *__pyx_v_ann_one,PyObject *__pyx_v_ann_two,PyObject *__pyx_v_cache) {
 
298
  Py_ssize_t __pyx_v_pos_one;
 
299
  Py_ssize_t __pyx_v_pos_two;
 
300
  Py_ssize_t __pyx_v_out_pos;
 
301
  PyObject *__pyx_v_temp;
 
302
  PyObject *__pyx_v_left;
 
303
  PyObject *__pyx_v_right;
 
304
  PyObject *__pyx_v_cache_key;
 
305
  PyObject *__pyx_v_new_ann;
 
306
  PyObject *__pyx_r;
 
307
  int __pyx_1;
 
308
  PyObject *__pyx_2 = 0;
 
309
  PyObject *__pyx_3 = 0;
 
310
  Py_INCREF(__pyx_v_ann_one);
 
311
  Py_INCREF(__pyx_v_ann_two);
 
312
  Py_INCREF(__pyx_v_cache);
 
313
  __pyx_v_cache_key = Py_None; Py_INCREF(Py_None);
 
314
  __pyx_v_new_ann = Py_None; Py_INCREF(Py_None);
 
315
 
 
316
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":106 */
 
317
  __pyx_1 = PyObject_RichCompareBool(__pyx_v_ann_one,__pyx_v_ann_two,Py_LT); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;}
 
318
  if (__pyx_1) {
 
319
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
 
320
    Py_INCREF(__pyx_v_ann_one);
 
321
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ann_one);
 
322
    Py_INCREF(__pyx_v_ann_two);
 
323
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_ann_two);
 
324
    Py_DECREF(__pyx_v_cache_key);
 
325
    __pyx_v_cache_key = __pyx_2;
 
326
    __pyx_2 = 0;
 
327
    goto __pyx_L2;
 
328
  }
 
329
  /*else*/ {
 
330
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;}
 
331
    Py_INCREF(__pyx_v_ann_two);
 
332
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ann_two);
 
333
    Py_INCREF(__pyx_v_ann_one);
 
334
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_ann_one);
 
335
    Py_DECREF(__pyx_v_cache_key);
 
336
    __pyx_v_cache_key = __pyx_2;
 
337
    __pyx_2 = 0;
 
338
  }
 
339
  __pyx_L2:;
 
340
 
 
341
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":110 */
 
342
  __pyx_v_temp = PyDict_GetItem(__pyx_v_cache,__pyx_v_cache_key);
 
343
 
 
344
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":111 */
 
345
  __pyx_1 = (__pyx_v_temp != NULL);
 
346
  if (__pyx_1) {
 
347
    Py_INCREF(((PyObject *)__pyx_v_temp));
 
348
    __pyx_r = ((PyObject *)__pyx_v_temp);
 
349
    goto __pyx_L0;
 
350
    goto __pyx_L3;
 
351
  }
 
352
  __pyx_L3:;
 
353
 
 
354
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":114 */
 
355
  __pyx_1 = (!PyTuple_CheckExact(__pyx_v_ann_one));
 
356
  if (!__pyx_1) {
 
357
    __pyx_1 = (!PyTuple_CheckExact(__pyx_v_ann_two));
 
358
  }
 
359
  if (__pyx_1) {
 
360
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
 
361
    Py_INCREF(__pyx_k5p);
 
362
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k5p);
 
363
    __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
 
364
    Py_DECREF(__pyx_2); __pyx_2 = 0;
 
365
    __Pyx_Raise(__pyx_3, 0, 0);
 
366
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
367
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
 
368
    goto __pyx_L4;
 
369
  }
 
370
  __pyx_L4:;
 
371
 
 
372
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":118 */
 
373
  __pyx_v_pos_one = (-1);
 
374
 
 
375
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":119 */
 
376
  __pyx_v_pos_two = (-1);
 
377
 
 
378
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":120 */
 
379
  __pyx_v_out_pos = 0;
 
380
 
 
381
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":121 */
 
382
  __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one));
 
383
 
 
384
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":122 */
 
385
  __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two));
 
386
 
 
387
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":123 */
 
388
  __pyx_2 = PyTuple_New((PyTuple_GET_SIZE(__pyx_v_ann_one) + PyTuple_GET_SIZE(__pyx_v_ann_two))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
 
389
  Py_DECREF(__pyx_v_new_ann);
 
390
  __pyx_v_new_ann = __pyx_2;
 
391
  __pyx_2 = 0;
 
392
 
 
393
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":125 */
 
394
  while (1) {
 
395
    __pyx_1 = (__pyx_v_left != NULL);
 
396
    if (__pyx_1) {
 
397
      __pyx_1 = (__pyx_v_right != NULL);
 
398
    }
 
399
    if (!__pyx_1) break;
 
400
 
 
401
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":129 */
 
402
    __pyx_1 = (__pyx_v_left == __pyx_v_right);
 
403
    if (!__pyx_1) {
 
404
      __pyx_1 = PyObject_RichCompareBool(__pyx_v_left,__pyx_v_right,Py_EQ);
 
405
    }
 
406
    if (__pyx_1) {
 
407
 
 
408
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":132 */
 
409
      Py_INCREF(__pyx_v_left);
 
410
 
 
411
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":133 */
 
412
      PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left);
 
413
 
 
414
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":134 */
 
415
      __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one));
 
416
 
 
417
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":135 */
 
418
      __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two));
 
419
      goto __pyx_L7;
 
420
    }
 
421
    __pyx_1 = PyObject_RichCompareBool(__pyx_v_left,__pyx_v_right,Py_LT);
 
422
    if (__pyx_1) {
 
423
 
 
424
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":138 */
 
425
      Py_INCREF(__pyx_v_left);
 
426
 
 
427
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":139 */
 
428
      PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left);
 
429
 
 
430
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":140 */
 
431
      __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one));
 
432
      goto __pyx_L7;
 
433
    }
 
434
    /*else*/ {
 
435
 
 
436
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":142 */
 
437
      Py_INCREF(__pyx_v_right);
 
438
 
 
439
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":143 */
 
440
      PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_right);
 
441
 
 
442
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":144 */
 
443
      __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two));
 
444
    }
 
445
    __pyx_L7:;
 
446
 
 
447
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":145 */
 
448
    __pyx_v_out_pos = (__pyx_v_out_pos + 1);
 
449
  }
 
450
 
 
451
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":146 */
 
452
  while (1) {
 
453
    __pyx_1 = (__pyx_v_left != NULL);
 
454
    if (!__pyx_1) break;
 
455
 
 
456
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":147 */
 
457
    Py_INCREF(__pyx_v_left);
 
458
 
 
459
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":148 */
 
460
    PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left);
 
461
 
 
462
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":149 */
 
463
    __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one));
 
464
 
 
465
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":150 */
 
466
    __pyx_v_out_pos = (__pyx_v_out_pos + 1);
 
467
  }
 
468
 
 
469
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":151 */
 
470
  while (1) {
 
471
    __pyx_1 = (__pyx_v_right != NULL);
 
472
    if (!__pyx_1) break;
 
473
 
 
474
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":152 */
 
475
    Py_INCREF(__pyx_v_right);
 
476
 
 
477
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":153 */
 
478
    PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_right);
 
479
 
 
480
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":154 */
 
481
    __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two));
 
482
 
 
483
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":155 */
 
484
    __pyx_v_out_pos = (__pyx_v_out_pos + 1);
 
485
  }
 
486
 
 
487
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":156 */
 
488
  __pyx_1 = (__pyx_v_out_pos != PyTuple_GET_SIZE(__pyx_v_new_ann));
 
489
  if (__pyx_1) {
 
490
    __pyx_3 = PySequence_GetSlice(__pyx_v_new_ann, 0, __pyx_v_out_pos); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L1;}
 
491
    Py_DECREF(__pyx_v_new_ann);
 
492
    __pyx_v_new_ann = __pyx_3;
 
493
    __pyx_3 = 0;
 
494
    goto __pyx_L12;
 
495
  }
 
496
  __pyx_L12:;
 
497
 
 
498
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":160 */
 
499
  __pyx_1 = PyDict_SetItem(__pyx_v_cache,__pyx_v_cache_key,__pyx_v_new_ann); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}
 
500
 
 
501
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":161 */
 
502
  Py_INCREF(__pyx_v_new_ann);
 
503
  __pyx_r = __pyx_v_new_ann;
 
504
  goto __pyx_L0;
 
505
 
 
506
  __pyx_r = Py_None; Py_INCREF(Py_None);
 
507
  goto __pyx_L0;
 
508
  __pyx_L1:;
 
509
  Py_XDECREF(__pyx_2);
 
510
  Py_XDECREF(__pyx_3);
 
511
  __Pyx_AddTraceback("bzrlib._annotator_pyx._combine_annotations");
 
512
  __pyx_r = 0;
 
513
  __pyx_L0:;
 
514
  Py_DECREF(__pyx_v_cache_key);
 
515
  Py_DECREF(__pyx_v_new_ann);
 
516
  Py_DECREF(__pyx_v_ann_one);
 
517
  Py_DECREF(__pyx_v_ann_two);
 
518
  Py_DECREF(__pyx_v_cache);
 
519
  return __pyx_r;
 
520
}
 
521
 
 
522
static int __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(PyObject *__pyx_v_annotations,PyObject *__pyx_v_parent_annotations,PyObject *__pyx_v_matching_blocks) {
 
523
  Py_ssize_t __pyx_v_parent_idx;
 
524
  Py_ssize_t __pyx_v_lines_idx;
 
525
  Py_ssize_t __pyx_v_match_len;
 
526
  Py_ssize_t __pyx_v_idx;
 
527
  PyListObject *__pyx_v_par_list;
 
528
  PyListObject *__pyx_v_ann_list;
 
529
  PyObject **__pyx_v_par_temp;
 
530
  PyObject **__pyx_v_ann_temp;
 
531
  int __pyx_r;
 
532
  int __pyx_1;
 
533
  PyObject *__pyx_2 = 0;
 
534
  PyObject *__pyx_3 = 0;
 
535
  PyObject *__pyx_4 = 0;
 
536
  Py_ssize_t __pyx_5;
 
537
  Py_INCREF(__pyx_v_annotations);
 
538
  Py_INCREF(__pyx_v_parent_annotations);
 
539
  Py_INCREF(__pyx_v_matching_blocks);
 
540
 
 
541
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":174 */
 
542
  __pyx_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(__pyx_v_annotations,__pyx_v_parent_annotations); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
 
543
 
 
544
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":175 */
 
545
  __pyx_v_par_list = ((PyListObject *)__pyx_v_parent_annotations);
 
546
 
 
547
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":176 */
 
548
  __pyx_v_ann_list = ((PyListObject *)__pyx_v_annotations);
 
549
 
 
550
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":181 */
 
551
  __pyx_2 = PyObject_GetIter(__pyx_v_matching_blocks); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
 
552
  for (;;) {
 
553
    __pyx_3 = PyIter_Next(__pyx_2);
 
554
    if (!__pyx_3) {
 
555
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
 
556
      break;
 
557
    }
 
558
    __pyx_4 = PyObject_GetIter(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
 
559
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
560
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
 
561
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
 
562
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
563
    __pyx_v_parent_idx = __pyx_5;
 
564
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
 
565
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
 
566
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
567
    __pyx_v_lines_idx = __pyx_5;
 
568
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
 
569
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
 
570
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
571
    __pyx_v_match_len = __pyx_5;
 
572
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
 
573
    Py_DECREF(__pyx_4); __pyx_4 = 0;
 
574
 
 
575
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":182 */
 
576
    __pyx_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(__pyx_v_parent_annotations,__pyx_v_annotations,__pyx_v_parent_idx,__pyx_v_lines_idx,__pyx_v_match_len); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
 
577
 
 
578
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":184 */
 
579
    __pyx_v_par_temp = (__pyx_v_par_list->ob_item + __pyx_v_parent_idx);
 
580
 
 
581
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":185 */
 
582
    __pyx_v_ann_temp = (__pyx_v_ann_list->ob_item + __pyx_v_lines_idx);
 
583
 
 
584
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":186 */
 
585
    for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_v_match_len; ++__pyx_v_idx) {
 
586
 
 
587
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":187 */
 
588
      Py_INCREF((__pyx_v_par_temp[__pyx_v_idx]));
 
589
 
 
590
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":188 */
 
591
      Py_DECREF((__pyx_v_ann_temp[__pyx_v_idx]));
 
592
 
 
593
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":189 */
 
594
      (__pyx_v_ann_temp[__pyx_v_idx]) = (__pyx_v_par_temp[__pyx_v_idx]);
 
595
    }
 
596
  }
 
597
  Py_DECREF(__pyx_2); __pyx_2 = 0;
 
598
 
 
599
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":190 */
 
600
  __pyx_r = 0;
 
601
  goto __pyx_L0;
 
602
 
 
603
  __pyx_r = 0;
 
604
  goto __pyx_L0;
 
605
  __pyx_L1:;
 
606
  Py_XDECREF(__pyx_2);
 
607
  Py_XDECREF(__pyx_3);
 
608
  Py_XDECREF(__pyx_4);
 
609
  __Pyx_AddTraceback("bzrlib._annotator_pyx._apply_parent_annotations");
 
610
  __pyx_r = (-1);
 
611
  __pyx_L0:;
 
612
  Py_DECREF(__pyx_v_annotations);
 
613
  Py_DECREF(__pyx_v_parent_annotations);
 
614
  Py_DECREF(__pyx_v_matching_blocks);
 
615
  return __pyx_r;
 
616
}
 
617
 
 
618
static int __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(PyObject *__pyx_v_this_annotation,PyObject *__pyx_v_annotations,PyObject *__pyx_v_parent_annotations,PyObject *__pyx_v_matching_blocks,PyObject *__pyx_v_ann_cache) {
 
619
  Py_ssize_t __pyx_v_parent_idx;
 
620
  Py_ssize_t __pyx_v_ann_idx;
 
621
  Py_ssize_t __pyx_v_lines_idx;
 
622
  Py_ssize_t __pyx_v_match_len;
 
623
  Py_ssize_t __pyx_v_idx;
 
624
  PyObject *__pyx_v_ann_temp;
 
625
  PyObject *__pyx_v_par_temp;
 
626
  PyObject *__pyx_v_last_ann;
 
627
  PyObject *__pyx_v_last_parent;
 
628
  PyObject *__pyx_v_last_res;
 
629
  PyObject *__pyx_v_par_ann;
 
630
  PyObject *__pyx_v_ann;
 
631
  PyObject *__pyx_v_new_ann;
 
632
  int __pyx_r;
 
633
  int __pyx_1;
 
634
  PyObject *__pyx_2 = 0;
 
635
  PyObject *__pyx_3 = 0;
 
636
  PyObject *__pyx_4 = 0;
 
637
  Py_ssize_t __pyx_5;
 
638
  Py_INCREF(__pyx_v_this_annotation);
 
639
  Py_INCREF(__pyx_v_annotations);
 
640
  Py_INCREF(__pyx_v_parent_annotations);
 
641
  Py_INCREF(__pyx_v_matching_blocks);
 
642
  Py_INCREF(__pyx_v_ann_cache);
 
643
  __pyx_v_last_ann = Py_None; Py_INCREF(Py_None);
 
644
  __pyx_v_last_parent = Py_None; Py_INCREF(Py_None);
 
645
  __pyx_v_last_res = Py_None; Py_INCREF(Py_None);
 
646
  __pyx_v_par_ann = Py_None; Py_INCREF(Py_None);
 
647
  __pyx_v_ann = Py_None; Py_INCREF(Py_None);
 
648
  __pyx_v_new_ann = Py_None; Py_INCREF(Py_None);
 
649
 
 
650
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":199 */
 
651
  __pyx_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(__pyx_v_annotations,__pyx_v_parent_annotations); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
 
652
 
 
653
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":200 */
 
654
  Py_INCREF(Py_None);
 
655
  Py_DECREF(__pyx_v_last_ann);
 
656
  __pyx_v_last_ann = Py_None;
 
657
 
 
658
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":201 */
 
659
  Py_INCREF(Py_None);
 
660
  Py_DECREF(__pyx_v_last_parent);
 
661
  __pyx_v_last_parent = Py_None;
 
662
 
 
663
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":202 */
 
664
  Py_INCREF(Py_None);
 
665
  Py_DECREF(__pyx_v_last_res);
 
666
  __pyx_v_last_res = Py_None;
 
667
 
 
668
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":203 */
 
669
  __pyx_2 = PyObject_GetIter(__pyx_v_matching_blocks); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
 
670
  for (;;) {
 
671
    __pyx_3 = PyIter_Next(__pyx_2);
 
672
    if (!__pyx_3) {
 
673
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
 
674
      break;
 
675
    }
 
676
    __pyx_4 = PyObject_GetIter(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
 
677
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
678
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
 
679
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
 
680
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
681
    __pyx_v_parent_idx = __pyx_5;
 
682
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
 
683
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
 
684
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
685
    __pyx_v_lines_idx = __pyx_5;
 
686
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
 
687
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
 
688
    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
689
    __pyx_v_match_len = __pyx_5;
 
690
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
 
691
    Py_DECREF(__pyx_4); __pyx_4 = 0;
 
692
 
 
693
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":204 */
 
694
    __pyx_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(__pyx_v_parent_annotations,__pyx_v_annotations,__pyx_v_parent_idx,__pyx_v_lines_idx,__pyx_v_match_len); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;}
 
695
 
 
696
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":208 */
 
697
    for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_v_match_len; ++__pyx_v_idx) {
 
698
 
 
699
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":209 */
 
700
      __pyx_v_ann_idx = (__pyx_v_lines_idx + __pyx_v_idx);
 
701
 
 
702
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":210 */
 
703
      __pyx_v_ann_temp = PyList_GET_ITEM(__pyx_v_annotations,__pyx_v_ann_idx);
 
704
 
 
705
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":211 */
 
706
      __pyx_v_par_temp = PyList_GET_ITEM(__pyx_v_parent_annotations,(__pyx_v_parent_idx + __pyx_v_idx));
 
707
 
 
708
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":212 */
 
709
      __pyx_1 = (__pyx_v_ann_temp == __pyx_v_par_temp);
 
710
      if (__pyx_1) {
 
711
        goto __pyx_L4;
 
712
        goto __pyx_L6;
 
713
      }
 
714
      __pyx_L6:;
 
715
 
 
716
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":221 */
 
717
      Py_INCREF(((PyObject *)__pyx_v_par_temp));
 
718
      Py_DECREF(__pyx_v_par_ann);
 
719
      __pyx_v_par_ann = ((PyObject *)__pyx_v_par_temp);
 
720
 
 
721
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":222 */
 
722
      Py_INCREF(((PyObject *)__pyx_v_ann_temp));
 
723
      Py_DECREF(__pyx_v_ann);
 
724
      __pyx_v_ann = ((PyObject *)__pyx_v_ann_temp);
 
725
 
 
726
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":223 */
 
727
      __pyx_1 = __pyx_v_ann == __pyx_v_this_annotation;
 
728
      if (__pyx_1) {
 
729
 
 
730
        /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":226 */
 
731
        Py_INCREF(__pyx_v_par_ann);
 
732
 
 
733
        /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":227 */
 
734
        __pyx_1 = PyList_SetItem(__pyx_v_annotations,__pyx_v_ann_idx,__pyx_v_par_ann); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}
 
735
 
 
736
        /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":228 */
 
737
        goto __pyx_L4;
 
738
        goto __pyx_L7;
 
739
      }
 
740
      __pyx_L7:;
 
741
 
 
742
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":231 */
 
743
      __pyx_1 = __pyx_v_ann == __pyx_v_last_ann;
 
744
      if (__pyx_1) {
 
745
        __pyx_1 = __pyx_v_par_ann == __pyx_v_last_parent;
 
746
      }
 
747
      if (__pyx_1) {
 
748
 
 
749
        /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":232 */
 
750
        Py_INCREF(__pyx_v_last_res);
 
751
 
 
752
        /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":233 */
 
753
        __pyx_1 = PyList_SetItem(__pyx_v_annotations,__pyx_v_ann_idx,__pyx_v_last_res); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;}
 
754
        goto __pyx_L8;
 
755
      }
 
756
      /*else*/ {
 
757
 
 
758
        /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":235 */
 
759
        __pyx_3 = __pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(__pyx_v_ann,__pyx_v_par_ann,__pyx_v_ann_cache); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;}
 
760
        Py_DECREF(__pyx_v_new_ann);
 
761
        __pyx_v_new_ann = __pyx_3;
 
762
        __pyx_3 = 0;
 
763
 
 
764
        /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":236 */
 
765
        Py_INCREF(__pyx_v_new_ann);
 
766
 
 
767
        /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":237 */
 
768
        __pyx_1 = PyList_SetItem(__pyx_v_annotations,__pyx_v_ann_idx,__pyx_v_new_ann); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
 
769
 
 
770
        /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":238 */
 
771
        Py_INCREF(__pyx_v_ann);
 
772
        Py_DECREF(__pyx_v_last_ann);
 
773
        __pyx_v_last_ann = __pyx_v_ann;
 
774
 
 
775
        /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":239 */
 
776
        Py_INCREF(__pyx_v_par_ann);
 
777
        Py_DECREF(__pyx_v_last_parent);
 
778
        __pyx_v_last_parent = __pyx_v_par_ann;
 
779
 
 
780
        /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":240 */
 
781
        Py_INCREF(__pyx_v_new_ann);
 
782
        Py_DECREF(__pyx_v_last_res);
 
783
        __pyx_v_last_res = __pyx_v_new_ann;
 
784
      }
 
785
      __pyx_L8:;
 
786
      __pyx_L4:;
 
787
    }
 
788
  }
 
789
  Py_DECREF(__pyx_2); __pyx_2 = 0;
 
790
 
 
791
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":241 */
 
792
  __pyx_r = 0;
 
793
  goto __pyx_L0;
 
794
 
 
795
  __pyx_r = 0;
 
796
  goto __pyx_L0;
 
797
  __pyx_L1:;
 
798
  Py_XDECREF(__pyx_2);
 
799
  Py_XDECREF(__pyx_3);
 
800
  Py_XDECREF(__pyx_4);
 
801
  __Pyx_AddTraceback("bzrlib._annotator_pyx._merge_annotations");
 
802
  __pyx_r = (-1);
 
803
  __pyx_L0:;
 
804
  Py_DECREF(__pyx_v_last_ann);
 
805
  Py_DECREF(__pyx_v_last_parent);
 
806
  Py_DECREF(__pyx_v_last_res);
 
807
  Py_DECREF(__pyx_v_par_ann);
 
808
  Py_DECREF(__pyx_v_ann);
 
809
  Py_DECREF(__pyx_v_new_ann);
 
810
  Py_DECREF(__pyx_v_this_annotation);
 
811
  Py_DECREF(__pyx_v_annotations);
 
812
  Py_DECREF(__pyx_v_parent_annotations);
 
813
  Py_DECREF(__pyx_v_matching_blocks);
 
814
  Py_DECREF(__pyx_v_ann_cache);
 
815
  return __pyx_r;
 
816
}
 
817
 
 
818
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
819
static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent[] = "Reannotate this text relative to its first parent.";
 
820
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent = {"_update_from_first_parent", (PyCFunction)__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent};
 
821
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
822
  PyObject *__pyx_v_self = 0;
 
823
  PyObject *__pyx_v_key = 0;
 
824
  PyObject *__pyx_v_annotations = 0;
 
825
  PyObject *__pyx_v_lines = 0;
 
826
  PyObject *__pyx_v_parent_key = 0;
 
827
  PyObject *__pyx_v_parent_annotations;
 
828
  PyObject *__pyx_v_matching_blocks;
 
829
  PyObject *__pyx_r;
 
830
  PyObject *__pyx_1 = 0;
 
831
  PyObject *__pyx_2 = 0;
 
832
  PyObject *__pyx_3 = 0;
 
833
  int __pyx_4;
 
834
  static char *__pyx_argnames[] = {"self","key","annotations","lines","parent_key",0};
 
835
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOO", __pyx_argnames, &__pyx_v_self, &__pyx_v_key, &__pyx_v_annotations, &__pyx_v_lines, &__pyx_v_parent_key)) return 0;
 
836
  Py_INCREF(__pyx_v_self);
 
837
  Py_INCREF(__pyx_v_key);
 
838
  Py_INCREF(__pyx_v_annotations);
 
839
  Py_INCREF(__pyx_v_lines);
 
840
  Py_INCREF(__pyx_v_parent_key);
 
841
  __pyx_v_parent_annotations = Py_None; Py_INCREF(Py_None);
 
842
  __pyx_v_matching_blocks = Py_None; Py_INCREF(Py_None);
 
843
 
 
844
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":250 */
 
845
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_k6p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
 
846
  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
 
847
  Py_INCREF(__pyx_v_key);
 
848
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_key);
 
849
  Py_INCREF(__pyx_v_lines);
 
850
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_lines);
 
851
  Py_INCREF(__pyx_v_parent_key);
 
852
  PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_parent_key);
 
853
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
 
854
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
855
  Py_DECREF(__pyx_2); __pyx_2 = 0;
 
856
  __pyx_1 = PyObject_GetIter(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
 
857
  Py_DECREF(__pyx_3); __pyx_3 = 0;
 
858
  __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
 
859
  Py_DECREF(__pyx_v_parent_annotations);
 
860
  __pyx_v_parent_annotations = __pyx_2;
 
861
  __pyx_2 = 0;
 
862
  __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
 
863
  Py_DECREF(__pyx_v_matching_blocks);
 
864
  __pyx_v_matching_blocks = __pyx_3;
 
865
  __pyx_3 = 0;
 
866
  if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
 
867
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
868
 
 
869
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":253 */
 
870
  __pyx_4 = __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(__pyx_v_annotations,__pyx_v_parent_annotations,__pyx_v_matching_blocks); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;}
 
871
 
 
872
  __pyx_r = Py_None; Py_INCREF(Py_None);
 
873
  goto __pyx_L0;
 
874
  __pyx_L1:;
 
875
  Py_XDECREF(__pyx_1);
 
876
  Py_XDECREF(__pyx_2);
 
877
  Py_XDECREF(__pyx_3);
 
878
  __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_first_parent");
 
879
  __pyx_r = 0;
 
880
  __pyx_L0:;
 
881
  Py_DECREF(__pyx_v_parent_annotations);
 
882
  Py_DECREF(__pyx_v_matching_blocks);
 
883
  Py_DECREF(__pyx_v_self);
 
884
  Py_DECREF(__pyx_v_key);
 
885
  Py_DECREF(__pyx_v_annotations);
 
886
  Py_DECREF(__pyx_v_lines);
 
887
  Py_DECREF(__pyx_v_parent_key);
 
888
  return __pyx_r;
 
889
}
 
890
 
 
891
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
892
static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents[] = "Reannotate this text relative to a second (or more) parent.";
 
893
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents = {"_update_from_other_parents", (PyCFunction)__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents};
 
894
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
895
  PyObject *__pyx_v_self = 0;
 
896
  PyObject *__pyx_v_key = 0;
 
897
  PyObject *__pyx_v_annotations = 0;
 
898
  PyObject *__pyx_v_lines = 0;
 
899
  PyObject *__pyx_v_this_annotation = 0;
 
900
  PyObject *__pyx_v_parent_key = 0;
 
901
  PyObject *__pyx_v_parent_annotations;
 
902
  PyObject *__pyx_v_matching_blocks;
 
903
  PyObject *__pyx_r;
 
904
  PyObject *__pyx_1 = 0;
 
905
  PyObject *__pyx_2 = 0;
 
906
  PyObject *__pyx_3 = 0;
 
907
  int __pyx_4;
 
908
  static char *__pyx_argnames[] = {"self","key","annotations","lines","this_annotation","parent_key",0};
 
909
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOOO", __pyx_argnames, &__pyx_v_self, &__pyx_v_key, &__pyx_v_annotations, &__pyx_v_lines, &__pyx_v_this_annotation, &__pyx_v_parent_key)) return 0;
 
910
  Py_INCREF(__pyx_v_self);
 
911
  Py_INCREF(__pyx_v_key);
 
912
  Py_INCREF(__pyx_v_annotations);
 
913
  Py_INCREF(__pyx_v_lines);
 
914
  Py_INCREF(__pyx_v_this_annotation);
 
915
  Py_INCREF(__pyx_v_parent_key);
 
916
  __pyx_v_parent_annotations = Py_None; Py_INCREF(Py_None);
 
917
  __pyx_v_matching_blocks = Py_None; Py_INCREF(Py_None);
 
918
 
 
919
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":260 */
 
920
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_k6p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;}
 
921
  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;}
 
922
  Py_INCREF(__pyx_v_key);
 
923
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_key);
 
924
  Py_INCREF(__pyx_v_lines);
 
925
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_lines);
 
926
  Py_INCREF(__pyx_v_parent_key);
 
927
  PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_parent_key);
 
928
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;}
 
929
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
930
  Py_DECREF(__pyx_2); __pyx_2 = 0;
 
931
  __pyx_1 = PyObject_GetIter(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;}
 
932
  Py_DECREF(__pyx_3); __pyx_3 = 0;
 
933
  __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;}
 
934
  Py_DECREF(__pyx_v_parent_annotations);
 
935
  __pyx_v_parent_annotations = __pyx_2;
 
936
  __pyx_2 = 0;
 
937
  __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;}
 
938
  Py_DECREF(__pyx_v_matching_blocks);
 
939
  __pyx_v_matching_blocks = __pyx_3;
 
940
  __pyx_3 = 0;
 
941
  if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;}
 
942
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
943
 
 
944
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":262 */
 
945
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n__ann_tuple_cache); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;}
 
946
  __pyx_4 = __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(__pyx_v_this_annotation,__pyx_v_annotations,__pyx_v_parent_annotations,__pyx_v_matching_blocks,__pyx_2); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}
 
947
  Py_DECREF(__pyx_2); __pyx_2 = 0;
 
948
 
 
949
  __pyx_r = Py_None; Py_INCREF(Py_None);
 
950
  goto __pyx_L0;
 
951
  __pyx_L1:;
 
952
  Py_XDECREF(__pyx_1);
 
953
  Py_XDECREF(__pyx_2);
 
954
  Py_XDECREF(__pyx_3);
 
955
  __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_other_parents");
 
956
  __pyx_r = 0;
 
957
  __pyx_L0:;
 
958
  Py_DECREF(__pyx_v_parent_annotations);
 
959
  Py_DECREF(__pyx_v_matching_blocks);
 
960
  Py_DECREF(__pyx_v_self);
 
961
  Py_DECREF(__pyx_v_key);
 
962
  Py_DECREF(__pyx_v_annotations);
 
963
  Py_DECREF(__pyx_v_lines);
 
964
  Py_DECREF(__pyx_v_this_annotation);
 
965
  Py_DECREF(__pyx_v_parent_key);
 
966
  return __pyx_r;
 
967
}
 
968
 
 
969
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
970
static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat[] = "Determine the single-best-revision to source for each line.\n\n        This is meant as a compatibility thunk to how annotate() used to work.\n        ";
 
971
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat = {"annotate_flat", (PyCFunction)__pyx_f_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat};
 
972
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
973
  PyObject *__pyx_v_self = 0;
 
974
  PyObject *__pyx_v_key = 0;
 
975
  Py_ssize_t __pyx_v_pos;
 
976
  Py_ssize_t __pyx_v_num_lines;
 
977
  PyObject *__pyx_v_annotate;
 
978
  PyObject *__pyx_v_custom_tiebreaker;
 
979
  PyObject *__pyx_v_annotations;
 
980
  PyObject *__pyx_v_lines;
 
981
  PyObject *__pyx_v_out;
 
982
  PyObject *__pyx_v_heads;
 
983
  PyObject *__pyx_v_annotation;
 
984
  PyObject *__pyx_v_line;
 
985
  PyObject *__pyx_v_head;
 
986
  PyObject *__pyx_v_the_heads;
 
987
  PyObject *__pyx_r;
 
988
  PyObject *__pyx_1 = 0;
 
989
  PyObject *__pyx_2 = 0;
 
990
  PyObject *__pyx_3 = 0;
 
991
  Py_ssize_t __pyx_4;
 
992
  int __pyx_5;
 
993
  static char *__pyx_argnames[] = {"self","key",0};
 
994
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_self, &__pyx_v_key)) return 0;
 
995
  Py_INCREF(__pyx_v_self);
 
996
  Py_INCREF(__pyx_v_key);
 
997
  __pyx_v_annotate = Py_None; Py_INCREF(Py_None);
 
998
  __pyx_v_custom_tiebreaker = Py_None; Py_INCREF(Py_None);
 
999
  __pyx_v_annotations = Py_None; Py_INCREF(Py_None);
 
1000
  __pyx_v_lines = Py_None; Py_INCREF(Py_None);
 
1001
  __pyx_v_out = Py_None; Py_INCREF(Py_None);
 
1002
  __pyx_v_heads = Py_None; Py_INCREF(Py_None);
 
1003
  __pyx_v_annotation = Py_None; Py_INCREF(Py_None);
 
1004
  __pyx_v_line = Py_None; Py_INCREF(Py_None);
 
1005
  __pyx_v_head = Py_None; Py_INCREF(Py_None);
 
1006
  __pyx_v_the_heads = Py_None; Py_INCREF(Py_None);
 
1007
 
 
1008
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":272 */
 
1009
  __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;}
 
1010
  Py_INCREF(__pyx_n_annotate);
 
1011
  PyList_SET_ITEM(__pyx_1, 0, __pyx_n_annotate);
 
1012
  __pyx_2 = __Pyx_Import(__pyx_n_bzrlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;}
 
1013
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1014
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_annotate); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;}
 
1015
  Py_DECREF(__pyx_v_annotate);
 
1016
  __pyx_v_annotate = __pyx_1;
 
1017
  __pyx_1 = 0;
 
1018
  Py_DECREF(__pyx_2); __pyx_2 = 0;
 
1019
 
 
1020
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":274 */
 
1021
  __pyx_2 = PyObject_GetAttr(__pyx_v_annotate, __pyx_n__break_annotation_tie); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; goto __pyx_L1;}
 
1022
  Py_DECREF(__pyx_v_custom_tiebreaker);
 
1023
  __pyx_v_custom_tiebreaker = __pyx_2;
 
1024
  __pyx_2 = 0;
 
1025
 
 
1026
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":275 */
 
1027
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_annotate); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
 
1028
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
 
1029
  Py_INCREF(__pyx_v_key);
 
1030
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_key);
 
1031
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
 
1032
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1033
  Py_DECREF(__pyx_2); __pyx_2 = 0;
 
1034
  __pyx_1 = PyObject_GetIter(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
 
1035
  Py_DECREF(__pyx_3); __pyx_3 = 0;
 
1036
  __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
 
1037
  Py_DECREF(__pyx_v_annotations);
 
1038
  __pyx_v_annotations = __pyx_2;
 
1039
  __pyx_2 = 0;
 
1040
  __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
 
1041
  Py_DECREF(__pyx_v_lines);
 
1042
  __pyx_v_lines = __pyx_3;
 
1043
  __pyx_3 = 0;
 
1044
  if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
 
1045
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1046
 
 
1047
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":276 */
 
1048
  __pyx_4 = PyObject_Length(__pyx_v_lines); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;}
 
1049
  __pyx_v_num_lines = __pyx_4;
 
1050
 
 
1051
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":277 */
 
1052
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; goto __pyx_L1;}
 
1053
  Py_DECREF(__pyx_v_out);
 
1054
  __pyx_v_out = __pyx_2;
 
1055
  __pyx_2 = 0;
 
1056
 
 
1057
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":278 */
 
1058
  __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n__get_heads_provider); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
 
1059
  __pyx_1 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
 
1060
  Py_DECREF(__pyx_3); __pyx_3 = 0;
 
1061
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_heads); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
 
1062
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1063
  Py_DECREF(__pyx_v_heads);
 
1064
  __pyx_v_heads = __pyx_2;
 
1065
  __pyx_2 = 0;
 
1066
 
 
1067
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":279 */
 
1068
  for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_v_num_lines; ++__pyx_v_pos) {
 
1069
 
 
1070
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":280 */
 
1071
    __pyx_3 = __Pyx_GetItemInt(__pyx_v_annotations, __pyx_v_pos); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
 
1072
    Py_DECREF(__pyx_v_annotation);
 
1073
    __pyx_v_annotation = __pyx_3;
 
1074
    __pyx_3 = 0;
 
1075
 
 
1076
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":281 */
 
1077
    __pyx_1 = __Pyx_GetItemInt(__pyx_v_lines, __pyx_v_pos); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
 
1078
    Py_DECREF(__pyx_v_line);
 
1079
    __pyx_v_line = __pyx_1;
 
1080
    __pyx_1 = 0;
 
1081
 
 
1082
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":282 */
 
1083
    __pyx_4 = PyObject_Length(__pyx_v_annotation); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;}
 
1084
    __pyx_5 = (__pyx_4 == 1);
 
1085
    if (__pyx_5) {
 
1086
      __pyx_2 = __Pyx_GetItemInt(__pyx_v_annotation, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;}
 
1087
      Py_DECREF(__pyx_v_head);
 
1088
      __pyx_v_head = __pyx_2;
 
1089
      __pyx_2 = 0;
 
1090
      goto __pyx_L4;
 
1091
    }
 
1092
    /*else*/ {
 
1093
 
 
1094
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":285 */
 
1095
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}
 
1096
      Py_INCREF(__pyx_v_annotation);
 
1097
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_annotation);
 
1098
      __pyx_1 = PyObject_CallObject(__pyx_v_heads, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}
 
1099
      Py_DECREF(__pyx_3); __pyx_3 = 0;
 
1100
      Py_DECREF(__pyx_v_the_heads);
 
1101
      __pyx_v_the_heads = __pyx_1;
 
1102
      __pyx_1 = 0;
 
1103
 
 
1104
      /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":286 */
 
1105
      __pyx_4 = PyObject_Length(__pyx_v_the_heads); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; goto __pyx_L1;}
 
1106
      __pyx_5 = (__pyx_4 == 1);
 
1107
      if (__pyx_5) {
 
1108
        __pyx_2 = PyObject_GetIter(__pyx_v_the_heads); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
 
1109
        for (;;) {
 
1110
          __pyx_3 = PyIter_Next(__pyx_2);
 
1111
          if (!__pyx_3) {
 
1112
            if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
 
1113
            break;
 
1114
          }
 
1115
          Py_DECREF(__pyx_v_head);
 
1116
          __pyx_v_head = __pyx_3;
 
1117
          __pyx_3 = 0;
 
1118
          goto __pyx_L7;
 
1119
        }
 
1120
        __pyx_L7:;
 
1121
        Py_DECREF(__pyx_2); __pyx_2 = 0;
 
1122
        goto __pyx_L5;
 
1123
      }
 
1124
      /*else*/ {
 
1125
        __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n__resolve_annotation_tie); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;}
 
1126
        __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;}
 
1127
        Py_INCREF(__pyx_v_the_heads);
 
1128
        PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_the_heads);
 
1129
        Py_INCREF(__pyx_v_line);
 
1130
        PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_line);
 
1131
        Py_INCREF(__pyx_v_custom_tiebreaker);
 
1132
        PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_custom_tiebreaker);
 
1133
        __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;}
 
1134
        Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1135
        Py_DECREF(__pyx_3); __pyx_3 = 0;
 
1136
        Py_DECREF(__pyx_v_head);
 
1137
        __pyx_v_head = __pyx_2;
 
1138
        __pyx_2 = 0;
 
1139
      }
 
1140
      __pyx_L5:;
 
1141
    }
 
1142
    __pyx_L4:;
 
1143
 
 
1144
    /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":293 */
 
1145
    __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; goto __pyx_L1;}
 
1146
    Py_INCREF(__pyx_v_head);
 
1147
    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_head);
 
1148
    Py_INCREF(__pyx_v_line);
 
1149
    PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_line);
 
1150
    __pyx_5 = PyList_Append(__pyx_v_out,__pyx_1); if (__pyx_5 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; goto __pyx_L1;}
 
1151
    Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1152
  }
 
1153
 
 
1154
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":294 */
 
1155
  Py_INCREF(__pyx_v_out);
 
1156
  __pyx_r = __pyx_v_out;
 
1157
  goto __pyx_L0;
 
1158
 
 
1159
  __pyx_r = Py_None; Py_INCREF(Py_None);
 
1160
  goto __pyx_L0;
 
1161
  __pyx_L1:;
 
1162
  Py_XDECREF(__pyx_1);
 
1163
  Py_XDECREF(__pyx_2);
 
1164
  Py_XDECREF(__pyx_3);
 
1165
  __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator.annotate_flat");
 
1166
  __pyx_r = 0;
 
1167
  __pyx_L0:;
 
1168
  Py_DECREF(__pyx_v_annotate);
 
1169
  Py_DECREF(__pyx_v_custom_tiebreaker);
 
1170
  Py_DECREF(__pyx_v_annotations);
 
1171
  Py_DECREF(__pyx_v_lines);
 
1172
  Py_DECREF(__pyx_v_out);
 
1173
  Py_DECREF(__pyx_v_heads);
 
1174
  Py_DECREF(__pyx_v_annotation);
 
1175
  Py_DECREF(__pyx_v_line);
 
1176
  Py_DECREF(__pyx_v_head);
 
1177
  Py_DECREF(__pyx_v_the_heads);
 
1178
  Py_DECREF(__pyx_v_self);
 
1179
  Py_DECREF(__pyx_v_key);
 
1180
  return __pyx_r;
 
1181
}
 
1182
 
 
1183
static struct PyMethodDef __pyx_methods[] = {
 
1184
  {0, 0, 0, 0}
 
1185
};
 
1186
 
 
1187
static void __pyx_init_filenames(void); /*proto*/
 
1188
 
 
1189
PyMODINIT_FUNC init_annotator_pyx(void); /*proto*/
 
1190
PyMODINIT_FUNC init_annotator_pyx(void) {
 
1191
  PyObject *__pyx_1 = 0;
 
1192
  PyObject *__pyx_2 = 0;
 
1193
  PyObject *__pyx_3 = 0;
 
1194
  PyObject *__pyx_4 = 0;
 
1195
  __pyx_init_filenames();
 
1196
  __pyx_m = Py_InitModule4("_annotator_pyx", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
 
1197
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
 
1198
  Py_INCREF(__pyx_m);
 
1199
  __pyx_b = PyImport_AddModule("__builtin__");
 
1200
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
 
1201
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
 
1202
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
 
1203
 
 
1204
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":58 */
 
1205
  __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
 
1206
  Py_INCREF(__pyx_n__annotator_py);
 
1207
  PyList_SET_ITEM(__pyx_1, 0, __pyx_n__annotator_py);
 
1208
  __pyx_2 = __Pyx_Import(__pyx_n_bzrlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
 
1209
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1210
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n__annotator_py); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
 
1211
  if (PyObject_SetAttr(__pyx_m, __pyx_n__annotator_py, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
 
1212
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1213
  Py_DECREF(__pyx_2); __pyx_2 = 0;
 
1214
 
 
1215
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":244 */
 
1216
  __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
 
1217
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__annotator_py); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
 
1218
  __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_Annotator); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
 
1219
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1220
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
 
1221
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
 
1222
  __pyx_3 = 0;
 
1223
  if (PyDict_SetItemString(__pyx_2, "__doc__", __pyx_k16p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
 
1224
  __pyx_3 = __Pyx_CreateClass(__pyx_1, __pyx_2, __pyx_n_Annotator, "bzrlib._annotator_pyx"); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
 
1225
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1226
 
 
1227
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":247 */
 
1228
  __pyx_1 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
 
1229
  __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
 
1230
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1231
  if (PyObject_SetAttr(__pyx_3, __pyx_n__update_from_first_parent, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
 
1232
  Py_DECREF(__pyx_4); __pyx_4 = 0;
 
1233
 
 
1234
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":256 */
 
1235
  __pyx_1 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;}
 
1236
  __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;}
 
1237
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1238
  if (PyObject_SetAttr(__pyx_3, __pyx_n__update_from_other_parents, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;}
 
1239
  Py_DECREF(__pyx_4); __pyx_4 = 0;
 
1240
 
 
1241
  /* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":265 */
 
1242
  __pyx_1 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;}
 
1243
  __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;}
 
1244
  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
1245
  if (PyObject_SetAttr(__pyx_3, __pyx_n_annotate_flat, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;}
 
1246
  Py_DECREF(__pyx_4); __pyx_4 = 0;
 
1247
  if (PyObject_SetAttr(__pyx_m, __pyx_n_Annotator, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
 
1248
  Py_DECREF(__pyx_3); __pyx_3 = 0;
 
1249
  Py_DECREF(__pyx_2); __pyx_2 = 0;
 
1250
  return;
 
1251
  __pyx_L1:;
 
1252
  Py_XDECREF(__pyx_1);
 
1253
  Py_XDECREF(__pyx_2);
 
1254
  Py_XDECREF(__pyx_3);
 
1255
  Py_XDECREF(__pyx_4);
 
1256
  __Pyx_AddTraceback("bzrlib._annotator_pyx");
 
1257
}
 
1258
 
 
1259
static char *__pyx_filenames[] = {
 
1260
  "_annotator_pyx.pyx",
 
1261
};
 
1262
 
 
1263
/* Runtime support code */
 
1264
 
 
1265
static void __pyx_init_filenames(void) {
 
1266
  __pyx_f = __pyx_filenames;
 
1267
}
 
1268
 
 
1269
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
 
1270
    Py_XINCREF(type);
 
1271
    Py_XINCREF(value);
 
1272
    Py_XINCREF(tb);
 
1273
    /* First, check the traceback argument, replacing None with NULL. */
 
1274
    if (tb == Py_None) {
 
1275
        Py_DECREF(tb);
 
1276
        tb = 0;
 
1277
    }
 
1278
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
 
1279
        PyErr_SetString(PyExc_TypeError,
 
1280
            "raise: arg 3 must be a traceback or None");
 
1281
        goto raise_error;
 
1282
    }
 
1283
    /* Next, replace a missing value with None */
 
1284
    if (value == NULL) {
 
1285
        value = Py_None;
 
1286
        Py_INCREF(value);
 
1287
    }
 
1288
    #if PY_VERSION_HEX < 0x02050000
 
1289
    if (!PyClass_Check(type))
 
1290
    #else
 
1291
    if (!PyType_Check(type))
 
1292
    #endif
 
1293
    {
 
1294
        /* Raising an instance.  The value should be a dummy. */
 
1295
        if (value != Py_None) {
 
1296
            PyErr_SetString(PyExc_TypeError,
 
1297
                "instance exception may not have a separate value");
 
1298
            goto raise_error;
 
1299
        }
 
1300
        /* Normalize to raise <class>, <instance> */
 
1301
        Py_DECREF(value);
 
1302
        value = type;
 
1303
        #if PY_VERSION_HEX < 0x02050000
 
1304
            if (PyInstance_Check(type)) {
 
1305
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
 
1306
                Py_INCREF(type);
 
1307
            }
 
1308
            else {
 
1309
                PyErr_SetString(PyExc_TypeError,
 
1310
                    "raise: exception must be an old-style class or instance");
 
1311
                goto raise_error;
 
1312
            }
 
1313
        #else
 
1314
            type = (PyObject*) type->ob_type;
 
1315
            Py_INCREF(type);
 
1316
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
 
1317
                PyErr_SetString(PyExc_TypeError,
 
1318
                    "raise: exception class must be a subclass of BaseException");
 
1319
                goto raise_error;
 
1320
            }
 
1321
        #endif
 
1322
    }
 
1323
    PyErr_Restore(type, value, tb);
 
1324
    return;
 
1325
raise_error:
 
1326
    Py_XDECREF(value);
 
1327
    Py_XDECREF(type);
 
1328
    Py_XDECREF(tb);
 
1329
    return;
 
1330
}
 
1331
 
 
1332
static void __Pyx_UnpackError(void) {
 
1333
    PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size");
 
1334
}
 
1335
 
 
1336
static PyObject *__Pyx_UnpackItem(PyObject *iter) {
 
1337
    PyObject *item;
 
1338
    if (!(item = PyIter_Next(iter))) {
 
1339
        if (!PyErr_Occurred())
 
1340
            __Pyx_UnpackError();
 
1341
    }
 
1342
    return item;
 
1343
}
 
1344
 
 
1345
static int __Pyx_EndUnpack(PyObject *iter) {
 
1346
    PyObject *item;
 
1347
    if ((item = PyIter_Next(iter))) {
 
1348
        Py_DECREF(item);
 
1349
        __Pyx_UnpackError();
 
1350
        return -1;
 
1351
    }
 
1352
    else if (!PyErr_Occurred())
 
1353
        return 0;
 
1354
    else
 
1355
        return -1;
 
1356
}
 
1357
 
 
1358
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
 
1359
    PyObject *__import__ = 0;
 
1360
    PyObject *empty_list = 0;
 
1361
    PyObject *module = 0;
 
1362
    PyObject *global_dict = 0;
 
1363
    PyObject *empty_dict = 0;
 
1364
    PyObject *list;
 
1365
    __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
 
1366
    if (!__import__)
 
1367
        goto bad;
 
1368
    if (from_list)
 
1369
        list = from_list;
 
1370
    else {
 
1371
        empty_list = PyList_New(0);
 
1372
        if (!empty_list)
 
1373
            goto bad;
 
1374
        list = empty_list;
 
1375
    }
 
1376
    global_dict = PyModule_GetDict(__pyx_m);
 
1377
    if (!global_dict)
 
1378
        goto bad;
 
1379
    empty_dict = PyDict_New();
 
1380
    if (!empty_dict)
 
1381
        goto bad;
 
1382
    module = PyObject_CallFunction(__import__, "OOOO",
 
1383
        name, global_dict, empty_dict, list);
 
1384
bad:
 
1385
    Py_XDECREF(empty_list);
 
1386
    Py_XDECREF(__import__);
 
1387
    Py_XDECREF(empty_dict);
 
1388
    return module;
 
1389
}
 
1390
 
 
1391
static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i) {
 
1392
    PyTypeObject *t = o->ob_type;
 
1393
    PyObject *r;
 
1394
    if (t->tp_as_sequence && t->tp_as_sequence->sq_item)
 
1395
        r = PySequence_GetItem(o, i);
 
1396
    else {
 
1397
        PyObject *j = PyInt_FromLong(i);
 
1398
        if (!j)
 
1399
            return 0;
 
1400
        r = PyObject_GetItem(o, j);
 
1401
        Py_DECREF(j);
 
1402
    }
 
1403
    return r;
 
1404
}
 
1405
 
 
1406
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
 
1407
    while (t->p) {
 
1408
        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
 
1409
        if (!*t->p)
 
1410
            return -1;
 
1411
        if (t->i)
 
1412
            PyString_InternInPlace(t->p);
 
1413
        ++t;
 
1414
    }
 
1415
    return 0;
 
1416
}
 
1417
 
 
1418
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
 
1419
    PyObject *result;
 
1420
    result = PyObject_GetAttr(dict, name);
 
1421
    if (!result)
 
1422
        PyErr_SetObject(PyExc_NameError, name);
 
1423
    return result;
 
1424
}
 
1425
 
 
1426
static PyObject *__Pyx_CreateClass(
 
1427
    PyObject *bases, PyObject *dict, PyObject *name, char *modname)
 
1428
{
 
1429
    PyObject *py_modname;
 
1430
    PyObject *result = 0;
 
1431
    
 
1432
    py_modname = PyString_FromString(modname);
 
1433
    if (!py_modname)
 
1434
        goto bad;
 
1435
    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
 
1436
        goto bad;
 
1437
    result = PyClass_New(bases, dict, name);
 
1438
bad:
 
1439
    Py_XDECREF(py_modname);
 
1440
    return result;
 
1441
}
 
1442
 
 
1443
#include "compile.h"
 
1444
#include "frameobject.h"
 
1445
#include "traceback.h"
 
1446
 
 
1447
static void __Pyx_AddTraceback(char *funcname) {
 
1448
    PyObject *py_srcfile = 0;
 
1449
    PyObject *py_funcname = 0;
 
1450
    PyObject *py_globals = 0;
 
1451
    PyObject *empty_tuple = 0;
 
1452
    PyObject *empty_string = 0;
 
1453
    PyCodeObject *py_code = 0;
 
1454
    PyFrameObject *py_frame = 0;
 
1455
    
 
1456
    py_srcfile = PyString_FromString(__pyx_filename);
 
1457
    if (!py_srcfile) goto bad;
 
1458
    py_funcname = PyString_FromString(funcname);
 
1459
    if (!py_funcname) goto bad;
 
1460
    py_globals = PyModule_GetDict(__pyx_m);
 
1461
    if (!py_globals) goto bad;
 
1462
    empty_tuple = PyTuple_New(0);
 
1463
    if (!empty_tuple) goto bad;
 
1464
    empty_string = PyString_FromString("");
 
1465
    if (!empty_string) goto bad;
 
1466
    py_code = PyCode_New(
 
1467
        0,            /*int argcount,*/
 
1468
        0,            /*int nlocals,*/
 
1469
        0,            /*int stacksize,*/
 
1470
        0,            /*int flags,*/
 
1471
        empty_string, /*PyObject *code,*/
 
1472
        empty_tuple,  /*PyObject *consts,*/
 
1473
        empty_tuple,  /*PyObject *names,*/
 
1474
        empty_tuple,  /*PyObject *varnames,*/
 
1475
        empty_tuple,  /*PyObject *freevars,*/
 
1476
        empty_tuple,  /*PyObject *cellvars,*/
 
1477
        py_srcfile,   /*PyObject *filename,*/
 
1478
        py_funcname,  /*PyObject *name,*/
 
1479
        __pyx_lineno,   /*int firstlineno,*/
 
1480
        empty_string  /*PyObject *lnotab*/
 
1481
    );
 
1482
    if (!py_code) goto bad;
 
1483
    py_frame = PyFrame_New(
 
1484
        PyThreadState_Get(), /*PyThreadState *tstate,*/
 
1485
        py_code,             /*PyCodeObject *code,*/
 
1486
        py_globals,          /*PyObject *globals,*/
 
1487
        0                    /*PyObject *locals*/
 
1488
    );
 
1489
    if (!py_frame) goto bad;
 
1490
    py_frame->f_lineno = __pyx_lineno;
 
1491
    PyTraceBack_Here(py_frame);
 
1492
bad:
 
1493
    Py_XDECREF(py_srcfile);
 
1494
    Py_XDECREF(py_funcname);
 
1495
    Py_XDECREF(empty_tuple);
 
1496
    Py_XDECREF(empty_string);
 
1497
    Py_XDECREF(py_code);
 
1498
    Py_XDECREF(py_frame);
 
1499
}