1
/* Generated by Pyrex 0.9.8.5 on Fri May 28 05:01:38 2010 */
3
#define PY_SSIZE_T_CLEAN
5
#include "structmember.h"
7
#define PY_LONG_LONG LONG_LONG
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)
16
#if !defined(WIN32) && !defined(MS_WINDOWS)
25
#define __PYX_EXTERN_C extern "C"
27
#define __PYX_EXTERN_C extern
30
#include "python-compat.h"
33
typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
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;
41
static char __pyx_mdoc[] = "Functionality for doing annotations in the \'optimal\' way";
43
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
45
static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/
46
static int __Pyx_EndUnpack(PyObject *); /*proto*/
48
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
50
static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i); /*proto*/
52
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
54
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
56
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
58
static void __Pyx_AddTraceback(char *funcname); /*proto*/
60
/* Declarations from bzrlib._annotator_pyx */
63
/* Declarations from implementation of bzrlib._annotator_pyx */
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*/
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";
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;
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;
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)},
138
/* Implementation of bzrlib._annotator_pyx */
140
static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *__pyx_v_annotations,PyObject *__pyx_v_parent_annotations) {
143
PyObject *__pyx_2 = 0;
144
PyObject *__pyx_3 = 0;
145
Py_INCREF(__pyx_v_annotations);
146
Py_INCREF(__pyx_v_parent_annotations);
148
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":63 */
149
__pyx_1 = (!PyList_CheckExact(__pyx_v_annotations));
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;}
163
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":65 */
164
__pyx_1 = (!PyList_CheckExact(__pyx_v_parent_annotations));
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;}
178
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":67 */
187
__Pyx_AddTraceback("bzrlib._annotator_pyx._check_annotations_are_lists");
190
Py_DECREF(__pyx_v_annotations);
191
Py_DECREF(__pyx_v_parent_annotations);
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) {
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);
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));
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);
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);
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;}
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));
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);
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);
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;}
252
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":83 */
262
__Pyx_AddTraceback("bzrlib._annotator_pyx._check_match_ranges");
265
Py_DECREF(__pyx_v_parent_annotations);
266
Py_DECREF(__pyx_v_annotations);
270
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *__pyx_v_tpl,Py_ssize_t *__pyx_v_pos) {
273
Py_INCREF(__pyx_v_tpl);
275
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":94 */
276
(__pyx_v_pos[0]) = ((__pyx_v_pos[0]) + 1);
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));
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]));
293
Py_DECREF(__pyx_v_tpl);
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;
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);
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;}
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;
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;
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);
344
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":111 */
345
__pyx_1 = (__pyx_v_temp != NULL);
347
Py_INCREF(((PyObject *)__pyx_v_temp));
348
__pyx_r = ((PyObject *)__pyx_v_temp);
354
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":114 */
355
__pyx_1 = (!PyTuple_CheckExact(__pyx_v_ann_one));
357
__pyx_1 = (!PyTuple_CheckExact(__pyx_v_ann_two));
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;}
372
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":118 */
373
__pyx_v_pos_one = (-1);
375
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":119 */
376
__pyx_v_pos_two = (-1);
378
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":120 */
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));
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));
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;
393
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":125 */
395
__pyx_1 = (__pyx_v_left != NULL);
397
__pyx_1 = (__pyx_v_right != NULL);
401
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":129 */
402
__pyx_1 = (__pyx_v_left == __pyx_v_right);
404
__pyx_1 = PyObject_RichCompareBool(__pyx_v_left,__pyx_v_right,Py_EQ);
408
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":132 */
409
Py_INCREF(__pyx_v_left);
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);
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));
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));
421
__pyx_1 = PyObject_RichCompareBool(__pyx_v_left,__pyx_v_right,Py_LT);
424
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":138 */
425
Py_INCREF(__pyx_v_left);
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);
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));
436
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":142 */
437
Py_INCREF(__pyx_v_right);
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);
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));
447
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":145 */
448
__pyx_v_out_pos = (__pyx_v_out_pos + 1);
451
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":146 */
453
__pyx_1 = (__pyx_v_left != NULL);
456
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":147 */
457
Py_INCREF(__pyx_v_left);
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);
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));
465
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":150 */
466
__pyx_v_out_pos = (__pyx_v_out_pos + 1);
469
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":151 */
471
__pyx_1 = (__pyx_v_right != NULL);
474
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":152 */
475
Py_INCREF(__pyx_v_right);
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);
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));
483
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":155 */
484
__pyx_v_out_pos = (__pyx_v_out_pos + 1);
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));
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;
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;}
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;
506
__pyx_r = Py_None; Py_INCREF(Py_None);
511
__Pyx_AddTraceback("bzrlib._annotator_pyx._combine_annotations");
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);
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;
533
PyObject *__pyx_2 = 0;
534
PyObject *__pyx_3 = 0;
535
PyObject *__pyx_4 = 0;
537
Py_INCREF(__pyx_v_annotations);
538
Py_INCREF(__pyx_v_parent_annotations);
539
Py_INCREF(__pyx_v_matching_blocks);
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;}
544
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":175 */
545
__pyx_v_par_list = ((PyListObject *)__pyx_v_parent_annotations);
547
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":176 */
548
__pyx_v_ann_list = ((PyListObject *)__pyx_v_annotations);
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;}
553
__pyx_3 = PyIter_Next(__pyx_2);
555
if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
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;
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;}
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);
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);
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) {
587
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":187 */
588
Py_INCREF((__pyx_v_par_temp[__pyx_v_idx]));
590
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":188 */
591
Py_DECREF((__pyx_v_ann_temp[__pyx_v_idx]));
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]);
597
Py_DECREF(__pyx_2); __pyx_2 = 0;
599
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":190 */
609
__Pyx_AddTraceback("bzrlib._annotator_pyx._apply_parent_annotations");
612
Py_DECREF(__pyx_v_annotations);
613
Py_DECREF(__pyx_v_parent_annotations);
614
Py_DECREF(__pyx_v_matching_blocks);
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;
634
PyObject *__pyx_2 = 0;
635
PyObject *__pyx_3 = 0;
636
PyObject *__pyx_4 = 0;
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);
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;}
653
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":200 */
655
Py_DECREF(__pyx_v_last_ann);
656
__pyx_v_last_ann = Py_None;
658
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":201 */
660
Py_DECREF(__pyx_v_last_parent);
661
__pyx_v_last_parent = Py_None;
663
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":202 */
665
Py_DECREF(__pyx_v_last_res);
666
__pyx_v_last_res = Py_None;
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;}
671
__pyx_3 = PyIter_Next(__pyx_2);
673
if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
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;
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;}
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) {
699
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":209 */
700
__pyx_v_ann_idx = (__pyx_v_lines_idx + __pyx_v_idx);
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);
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));
708
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":212 */
709
__pyx_1 = (__pyx_v_ann_temp == __pyx_v_par_temp);
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);
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);
726
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":223 */
727
__pyx_1 = __pyx_v_ann == __pyx_v_this_annotation;
730
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":226 */
731
Py_INCREF(__pyx_v_par_ann);
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;}
736
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":228 */
742
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":231 */
743
__pyx_1 = __pyx_v_ann == __pyx_v_last_ann;
745
__pyx_1 = __pyx_v_par_ann == __pyx_v_last_parent;
749
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":232 */
750
Py_INCREF(__pyx_v_last_res);
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;}
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;
764
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":236 */
765
Py_INCREF(__pyx_v_new_ann);
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;}
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;
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;
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;
789
Py_DECREF(__pyx_2); __pyx_2 = 0;
791
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":241 */
801
__Pyx_AddTraceback("bzrlib._annotator_pyx._merge_annotations");
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);
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;
830
PyObject *__pyx_1 = 0;
831
PyObject *__pyx_2 = 0;
832
PyObject *__pyx_3 = 0;
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);
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;
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;
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;
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;}
872
__pyx_r = Py_None; Py_INCREF(Py_None);
878
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_first_parent");
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);
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;
904
PyObject *__pyx_1 = 0;
905
PyObject *__pyx_2 = 0;
906
PyObject *__pyx_3 = 0;
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);
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;
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;
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;
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;
949
__pyx_r = Py_None; Py_INCREF(Py_None);
955
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_other_parents");
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);
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;
988
PyObject *__pyx_1 = 0;
989
PyObject *__pyx_2 = 0;
990
PyObject *__pyx_3 = 0;
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);
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;
1018
Py_DECREF(__pyx_2); __pyx_2 = 0;
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;
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;
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;
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;
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;
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;
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;
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) {
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;
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;
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);
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;
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;
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);
1108
__pyx_2 = PyObject_GetIter(__pyx_v_the_heads); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
1110
__pyx_3 = PyIter_Next(__pyx_2);
1112
if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
1115
Py_DECREF(__pyx_v_head);
1116
__pyx_v_head = __pyx_3;
1121
Py_DECREF(__pyx_2); __pyx_2 = 0;
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;
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;
1154
/* "/home/robertc/source/baz/pending/working/bzrlib/_annotator_pyx.pyx":294 */
1155
Py_INCREF(__pyx_v_out);
1156
__pyx_r = __pyx_v_out;
1159
__pyx_r = Py_None; Py_INCREF(Py_None);
1162
Py_XDECREF(__pyx_1);
1163
Py_XDECREF(__pyx_2);
1164
Py_XDECREF(__pyx_3);
1165
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator.annotate_flat");
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);
1183
static struct PyMethodDef __pyx_methods[] = {
1187
static void __pyx_init_filenames(void); /*proto*/
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;};
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;};
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;
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);
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;
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;
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;
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;
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");
1259
static char *__pyx_filenames[] = {
1260
"_annotator_pyx.pyx",
1263
/* Runtime support code */
1265
static void __pyx_init_filenames(void) {
1266
__pyx_f = __pyx_filenames;
1269
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
1273
/* First, check the traceback argument, replacing None with NULL. */
1274
if (tb == Py_None) {
1278
else if (tb != NULL && !PyTraceBack_Check(tb)) {
1279
PyErr_SetString(PyExc_TypeError,
1280
"raise: arg 3 must be a traceback or None");
1283
/* Next, replace a missing value with None */
1284
if (value == NULL) {
1288
#if PY_VERSION_HEX < 0x02050000
1289
if (!PyClass_Check(type))
1291
if (!PyType_Check(type))
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");
1300
/* Normalize to raise <class>, <instance> */
1303
#if PY_VERSION_HEX < 0x02050000
1304
if (PyInstance_Check(type)) {
1305
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
1309
PyErr_SetString(PyExc_TypeError,
1310
"raise: exception must be an old-style class or instance");
1314
type = (PyObject*) type->ob_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");
1323
PyErr_Restore(type, value, tb);
1332
static void __Pyx_UnpackError(void) {
1333
PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size");
1336
static PyObject *__Pyx_UnpackItem(PyObject *iter) {
1338
if (!(item = PyIter_Next(iter))) {
1339
if (!PyErr_Occurred())
1340
__Pyx_UnpackError();
1345
static int __Pyx_EndUnpack(PyObject *iter) {
1347
if ((item = PyIter_Next(iter))) {
1349
__Pyx_UnpackError();
1352
else if (!PyErr_Occurred())
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;
1365
__import__ = PyObject_GetAttrString(__pyx_b, "__import__");
1371
empty_list = PyList_New(0);
1376
global_dict = PyModule_GetDict(__pyx_m);
1379
empty_dict = PyDict_New();
1382
module = PyObject_CallFunction(__import__, "OOOO",
1383
name, global_dict, empty_dict, list);
1385
Py_XDECREF(empty_list);
1386
Py_XDECREF(__import__);
1387
Py_XDECREF(empty_dict);
1391
static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i) {
1392
PyTypeObject *t = o->ob_type;
1394
if (t->tp_as_sequence && t->tp_as_sequence->sq_item)
1395
r = PySequence_GetItem(o, i);
1397
PyObject *j = PyInt_FromLong(i);
1400
r = PyObject_GetItem(o, j);
1406
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1408
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
1412
PyString_InternInPlace(t->p);
1418
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
1420
result = PyObject_GetAttr(dict, name);
1422
PyErr_SetObject(PyExc_NameError, name);
1426
static PyObject *__Pyx_CreateClass(
1427
PyObject *bases, PyObject *dict, PyObject *name, char *modname)
1429
PyObject *py_modname;
1430
PyObject *result = 0;
1432
py_modname = PyString_FromString(modname);
1435
if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
1437
result = PyClass_New(bases, dict, name);
1439
Py_XDECREF(py_modname);
1443
#include "compile.h"
1444
#include "frameobject.h"
1445
#include "traceback.h"
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;
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,*/
1469
0, /*int stacksize,*/
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*/
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*/
1489
if (!py_frame) goto bad;
1490
py_frame->f_lineno = __pyx_lineno;
1491
PyTraceBack_Here(py_frame);
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);