1
/* Generated by Pyrex 0.9.8.5 on Fri Oct 8 14:00:55 2010 */
1
/* Generated by Cython 0.13 on Thu Aug 11 09:45:13 2011 */
3
3
#define PY_SSIZE_T_CLEAN
5
#include "structmember.h"
6
#error Python headers needed to compile C extensions, please install development version of Python.
9
#include <stddef.h> /* For offsetof */
11
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
14
#if !defined(WIN32) && !defined(MS_WINDOWS)
27
#define DL_IMPORT(t) t
30
#define DL_EXPORT(t) t
6
33
#ifndef PY_LONG_LONG
7
34
#define PY_LONG_LONG LONG_LONG
37
#if PY_VERSION_HEX < 0x02040000
38
#define METH_COEXIST 0
39
#define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
40
#define PyDict_Contains(d,o) PySequence_Contains(d,o)
9
43
#if PY_VERSION_HEX < 0x02050000
10
44
typedef int Py_ssize_t;
11
45
#define PY_SSIZE_T_MAX INT_MAX
12
46
#define PY_SSIZE_T_MIN INT_MIN
47
#define PY_FORMAT_SIZE_T ""
13
48
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
14
#define PyInt_AsSsize_t(o) PyInt_AsLong(o)
16
#if !defined(WIN32) && !defined(MS_WINDOWS)
49
#define PyInt_AsSsize_t(o) PyInt_AsLong(o)
50
#define PyNumber_Index(o) PyNumber_Int(o)
51
#define PyIndex_Check(o) PyNumber_Check(o)
52
#define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
55
#if PY_VERSION_HEX < 0x02060000
56
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
57
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
58
#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
59
#define PyVarObject_HEAD_INIT(type, size) \
60
PyObject_HEAD_INIT(type) size,
61
#define PyType_Modified(t)
73
Py_ssize_t *suboffsets;
77
#define PyBUF_SIMPLE 0
78
#define PyBUF_WRITABLE 0x0001
79
#define PyBUF_FORMAT 0x0004
80
#define PyBUF_ND 0x0008
81
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
82
#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
83
#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
84
#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
85
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
89
#if PY_MAJOR_VERSION < 3
90
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
92
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
95
#if PY_MAJOR_VERSION >= 3
96
#define Py_TPFLAGS_CHECKTYPES 0
97
#define Py_TPFLAGS_HAVE_INDEX 0
100
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
101
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
104
#if PY_MAJOR_VERSION >= 3
105
#define PyBaseString_Type PyUnicode_Type
106
#define PyStringObject PyUnicodeObject
107
#define PyString_Type PyUnicode_Type
108
#define PyString_Check PyUnicode_Check
109
#define PyString_CheckExact PyUnicode_CheckExact
112
#if PY_VERSION_HEX < 0x02060000
113
#define PyBytesObject PyStringObject
114
#define PyBytes_Type PyString_Type
115
#define PyBytes_Check PyString_Check
116
#define PyBytes_CheckExact PyString_CheckExact
117
#define PyBytes_FromString PyString_FromString
118
#define PyBytes_FromStringAndSize PyString_FromStringAndSize
119
#define PyBytes_FromFormat PyString_FromFormat
120
#define PyBytes_DecodeEscape PyString_DecodeEscape
121
#define PyBytes_AsString PyString_AsString
122
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
123
#define PyBytes_Size PyString_Size
124
#define PyBytes_AS_STRING PyString_AS_STRING
125
#define PyBytes_GET_SIZE PyString_GET_SIZE
126
#define PyBytes_Repr PyString_Repr
127
#define PyBytes_Concat PyString_Concat
128
#define PyBytes_ConcatAndDel PyString_ConcatAndDel
129
#define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
130
#define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
133
#ifndef PySet_CheckExact
134
# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
137
#if PY_MAJOR_VERSION >= 3
138
#define PyInt_Type PyLong_Type
139
#define PyInt_Check(op) PyLong_Check(op)
140
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
141
#define PyInt_FromString PyLong_FromString
142
#define PyInt_FromUnicode PyLong_FromUnicode
143
#define PyInt_FromLong PyLong_FromLong
144
#define PyInt_FromSize_t PyLong_FromSize_t
145
#define PyInt_FromSsize_t PyLong_FromSsize_t
146
#define PyInt_AsLong PyLong_AsLong
147
#define PyInt_AS_LONG PyLong_AS_LONG
148
#define PyInt_AsSsize_t PyLong_AsSsize_t
149
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
150
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
153
#if PY_MAJOR_VERSION >= 3
154
#define PyBoolObject PyLongObject
158
#if PY_MAJOR_VERSION >= 3
159
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
160
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
162
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
163
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
166
#if PY_MAJOR_VERSION >= 3
167
#define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
170
#if PY_VERSION_HEX < 0x02050000
171
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
172
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
173
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
175
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
176
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
177
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
180
#if PY_VERSION_HEX < 0x02050000
181
#define __Pyx_NAMESTR(n) ((char *)(n))
182
#define __Pyx_DOCSTR(n) ((char *)(n))
184
#define __Pyx_NAMESTR(n) (n)
185
#define __Pyx_DOCSTR(n) (n)
24
188
#ifdef __cplusplus
25
189
#define __PYX_EXTERN_C extern "C"
27
191
#define __PYX_EXTERN_C extern
194
#if defined(WIN32) || defined(MS_WINDOWS)
195
#define _USE_MATH_DEFINES
198
#define __PYX_HAVE_API__bzrlib___annotator_pyx
30
199
#include "python-compat.h"
33
typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
201
/* inline attribute */
202
#ifndef CYTHON_INLINE
203
#if defined(__GNUC__)
204
#define CYTHON_INLINE __inline__
205
#elif defined(_MSC_VER)
206
#define CYTHON_INLINE __inline
207
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
208
#define CYTHON_INLINE inline
210
#define CYTHON_INLINE
214
/* unused attribute */
215
#ifndef CYTHON_UNUSED
216
# if defined(__GNUC__)
217
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
218
# define CYTHON_UNUSED __attribute__ ((__unused__))
220
# define CYTHON_UNUSED
222
# elif defined(__ICC) || defined(__INTEL_COMPILER)
223
# define CYTHON_UNUSED __attribute__ ((__unused__))
225
# define CYTHON_UNUSED
229
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
232
/* Type Conversion Predeclarations */
234
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
235
#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
237
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
238
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
239
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
241
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
242
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
243
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
245
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
249
/* Test for GCC > 2.95 */
250
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
251
#define likely(x) __builtin_expect(!!(x), 1)
252
#define unlikely(x) __builtin_expect(!!(x), 0)
253
#else /* __GNUC__ > 2 ... */
254
#define likely(x) (x)
255
#define unlikely(x) (x)
256
#endif /* __GNUC__ > 2 ... */
258
#define likely(x) (x)
259
#define unlikely(x) (x)
260
#endif /* __GNUC__ */
35
262
static PyObject *__pyx_m;
36
263
static PyObject *__pyx_b;
264
static PyObject *__pyx_empty_tuple;
265
static PyObject *__pyx_empty_bytes;
37
266
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";
267
static int __pyx_clineno = 0;
268
static const char * __pyx_cfilenm= __FILE__;
269
static const char *__pyx_filename;
272
static const char *__pyx_f[] = {
273
"_annotator_pyx.pyx",
276
/* Type declarations */
278
#ifndef CYTHON_REFNANNY
279
#define CYTHON_REFNANNY 0
284
void (*INCREF)(void*, PyObject*, int);
285
void (*DECREF)(void*, PyObject*, int);
286
void (*GOTREF)(void*, PyObject*, int);
287
void (*GIVEREF)(void*, PyObject*, int);
288
void* (*SetupContext)(const char*, int, const char*);
289
void (*FinishContext)(void**);
290
} __Pyx_RefNannyAPIStruct;
291
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
292
static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
293
PyObject *m = NULL, *p = NULL;
295
m = PyImport_ImportModule((char *)modname);
297
p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
299
r = PyLong_AsVoidPtr(p);
303
return (__Pyx_RefNannyAPIStruct *)r;
305
#define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
306
#define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
307
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
308
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
309
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
310
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
311
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
313
#define __Pyx_RefNannySetupContext(name)
314
#define __Pyx_RefNannyFinishContext()
315
#define __Pyx_INCREF(r) Py_INCREF(r)
316
#define __Pyx_DECREF(r) Py_DECREF(r)
317
#define __Pyx_GOTREF(r)
318
#define __Pyx_GIVEREF(r)
319
#define __Pyx_XDECREF(r) Py_XDECREF(r)
320
#endif /* CYTHON_REFNANNY */
321
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
322
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
324
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
326
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
328
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
330
static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
331
static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/
333
static void __Pyx_RaiseDoubleKeywordsError(
334
const char* func_name, PyObject* kw_name); /*proto*/
336
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
337
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
339
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
342
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
345
r = PyObject_GetItem(o, j);
351
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
352
__Pyx_GetItemInt_List_Fast(o, i) : \
353
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
355
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
356
if (likely(o != Py_None)) {
357
if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
358
PyObject *r = PyList_GET_ITEM(o, i);
362
else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
363
PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
368
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
371
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
372
__Pyx_GetItemInt_Tuple_Fast(o, i) : \
373
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
375
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
376
if (likely(o != Py_None)) {
377
if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
378
PyObject *r = PyTuple_GET_ITEM(o, i);
382
else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
383
PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
388
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
392
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
393
__Pyx_GetItemInt_Fast(o, i) : \
394
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
396
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
398
if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
399
r = PyList_GET_ITEM(o, i);
402
else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
403
r = PyTuple_GET_ITEM(o, i);
406
else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
407
r = PySequence_GetItem(o, i);
410
r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
415
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
417
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/
419
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
420
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
43
422
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*/
424
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
426
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
428
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
430
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
432
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
434
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
436
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
438
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
440
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
442
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
444
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
446
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
448
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
450
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
452
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
454
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
456
static void __Pyx_AddTraceback(const char *funcname); /*proto*/
52
458
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)},
459
/* Module declarations from bzrlib._annotator_pyx */
461
static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *, PyObject *); /*proto*/
462
static int __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(PyObject *, PyObject *, Py_ssize_t, Py_ssize_t, Py_ssize_t); /*proto*/
463
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *, Py_ssize_t *); /*proto*/
464
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *, PyObject *, PyObject *); /*proto*/
465
static int __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(PyObject *, PyObject *, PyObject *); /*proto*/
466
static int __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
467
#define __Pyx_MODULE_NAME "bzrlib._annotator_pyx"
468
int __pyx_module_is_main_bzrlib___annotator_pyx = 0;
138
470
/* 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) {
471
static PyObject *__pyx_builtin_TypeError;
472
static PyObject *__pyx_builtin_ValueError;
473
static char __pyx_k_1[] = "annotations must be a list";
474
static char __pyx_k_2[] = "parent_annotations must be a list";
475
static char __pyx_k_3[] = "Match length exceeds len of parent_annotations %s > %s";
476
static char __pyx_k_4[] = "Match length exceeds len of annotations %s > %s";
477
static char __pyx_k_5[] = "annotations must be tuples";
478
static char __pyx_k_6[] = "_get_parent_annotations_and_matches";
479
static char __pyx_k_7[] = "_break_annotation_tie";
480
static char __pyx_k_8[] = "_resolve_annotation_tie";
481
static char __pyx_k_9[] = "Functionality for doing annotations in the 'optimal' way";
482
static char __pyx_k_10[] = "Class that drives performing annotations.";
483
static char __pyx_k_11[] = "_update_from_first_parent";
484
static char __pyx_k_12[] = "_update_from_other_parents";
485
static char __pyx_k_13[] = "Annotator._update_from_first_parent (line 247)";
486
static char __pyx_k_14[] = "Annotator._update_from_other_parents (line 256)";
487
static char __pyx_k_15[] = "Annotator.annotate_flat (line 265)";
488
static char __pyx_k__key[] = "key";
489
static char __pyx_k__self[] = "self";
490
static char __pyx_k__heads[] = "heads";
491
static char __pyx_k__lines[] = "lines";
492
static char __pyx_k__bzrlib[] = "bzrlib";
493
static char __pyx_k__ob_item[] = "ob_item";
494
static char __pyx_k____main__[] = "__main__";
495
static char __pyx_k____test__[] = "__test__";
496
static char __pyx_k__annotate[] = "annotate";
497
static char __pyx_k__Annotator[] = "Annotator";
498
static char __pyx_k__TypeError[] = "TypeError";
499
static char __pyx_k__ValueError[] = "ValueError";
500
static char __pyx_k__parent_key[] = "parent_key";
501
static char __pyx_k__annotations[] = "annotations";
502
static char __pyx_k___annotator_py[] = "_annotator_py";
503
static char __pyx_k__annotate_flat[] = "annotate_flat";
504
static char __pyx_k__this_annotation[] = "this_annotation";
505
static char __pyx_k___ann_tuple_cache[] = "_ann_tuple_cache";
506
static char __pyx_k___get_heads_provider[] = "_get_heads_provider";
507
static PyObject *__pyx_kp_s_1;
508
static PyObject *__pyx_kp_s_10;
509
static PyObject *__pyx_n_s_11;
510
static PyObject *__pyx_n_s_12;
511
static PyObject *__pyx_kp_u_13;
512
static PyObject *__pyx_kp_u_14;
513
static PyObject *__pyx_kp_u_15;
514
static PyObject *__pyx_kp_s_2;
515
static PyObject *__pyx_kp_s_3;
516
static PyObject *__pyx_kp_s_4;
517
static PyObject *__pyx_kp_s_5;
518
static PyObject *__pyx_n_s_6;
519
static PyObject *__pyx_n_s_7;
520
static PyObject *__pyx_n_s_8;
521
static PyObject *__pyx_n_s__Annotator;
522
static PyObject *__pyx_n_s__TypeError;
523
static PyObject *__pyx_n_s__ValueError;
524
static PyObject *__pyx_n_s____main__;
525
static PyObject *__pyx_n_s____test__;
526
static PyObject *__pyx_n_s___ann_tuple_cache;
527
static PyObject *__pyx_n_s___annotator_py;
528
static PyObject *__pyx_n_s___get_heads_provider;
529
static PyObject *__pyx_n_s__annotate;
530
static PyObject *__pyx_n_s__annotate_flat;
531
static PyObject *__pyx_n_s__annotations;
532
static PyObject *__pyx_n_s__bzrlib;
533
static PyObject *__pyx_n_s__heads;
534
static PyObject *__pyx_n_s__key;
535
static PyObject *__pyx_n_s__lines;
536
static PyObject *__pyx_n_s__ob_item;
537
static PyObject *__pyx_n_s__parent_key;
538
static PyObject *__pyx_n_s__self;
539
static PyObject *__pyx_n_s__this_annotation;
541
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":61
544
* cdef int _check_annotations_are_lists(annotations, # <<<<<<<<<<<<<<
545
* parent_annotations) except -1:
546
* if not PyList_CheckExact(annotations):
549
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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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;}
552
PyObject *__pyx_t_2 = NULL;
553
PyObject *__pyx_t_3 = NULL;
554
__Pyx_RefNannySetupContext("_check_annotations_are_lists");
556
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":63
557
* cdef int _check_annotations_are_lists(annotations,
558
* parent_annotations) except -1:
559
* if not PyList_CheckExact(annotations): # <<<<<<<<<<<<<<
560
* raise TypeError('annotations must be a list')
561
* if not PyList_CheckExact(parent_annotations):
563
__pyx_t_1 = (!PyList_CheckExact(__pyx_v_annotations));
566
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":64
567
* parent_annotations) except -1:
568
* if not PyList_CheckExact(annotations):
569
* raise TypeError('annotations must be a list') # <<<<<<<<<<<<<<
570
* if not PyList_CheckExact(parent_annotations):
571
* raise TypeError('parent_annotations must be a list')
573
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
574
__Pyx_GOTREF(__pyx_t_2);
575
__Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
576
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_1));
577
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
578
__pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
579
__Pyx_GOTREF(__pyx_t_3);
580
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
581
__Pyx_Raise(__pyx_t_3, 0, 0);
582
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
583
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
178
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":67 */
588
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":65
589
* if not PyList_CheckExact(annotations):
590
* raise TypeError('annotations must be a list')
591
* if not PyList_CheckExact(parent_annotations): # <<<<<<<<<<<<<<
592
* raise TypeError('parent_annotations must be a list')
595
__pyx_t_1 = (!PyList_CheckExact(__pyx_v_parent_annotations));
598
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":66
599
* raise TypeError('annotations must be a list')
600
* if not PyList_CheckExact(parent_annotations):
601
* raise TypeError('parent_annotations must be a list') # <<<<<<<<<<<<<<
605
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
606
__Pyx_GOTREF(__pyx_t_3);
607
__Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
608
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2));
609
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
610
__pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
611
__Pyx_GOTREF(__pyx_t_2);
612
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
613
__Pyx_Raise(__pyx_t_2, 0, 0);
614
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
615
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
620
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":67
621
* if not PyList_CheckExact(parent_annotations):
622
* raise TypeError('parent_annotations must be a list')
623
* return 0 # <<<<<<<<<<<<<<
633
__Pyx_XDECREF(__pyx_t_2);
634
__Pyx_XDECREF(__pyx_t_3);
187
635
__Pyx_AddTraceback("bzrlib._annotator_pyx._check_annotations_are_lists");
190
Py_DECREF(__pyx_v_annotations);
191
Py_DECREF(__pyx_v_parent_annotations);
638
__Pyx_RefNannyFinishContext();
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) {
642
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":70
645
* cdef int _check_match_ranges(parent_annotations, annotations, # <<<<<<<<<<<<<<
646
* Py_ssize_t parent_idx, Py_ssize_t lines_idx,
647
* Py_ssize_t match_len) except -1:
650
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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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;}
653
PyObject *__pyx_t_2 = NULL;
654
PyObject *__pyx_t_3 = NULL;
655
PyObject *__pyx_t_4 = NULL;
656
__Pyx_RefNannySetupContext("_check_match_ranges");
658
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":73
659
* Py_ssize_t parent_idx, Py_ssize_t lines_idx,
660
* Py_ssize_t match_len) except -1:
661
* if parent_idx + match_len > PyList_GET_SIZE(parent_annotations): # <<<<<<<<<<<<<<
662
* raise ValueError('Match length exceeds len of'
663
* ' parent_annotations %s > %s'
665
__pyx_t_1 = ((__pyx_v_parent_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_parent_annotations));
668
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":76
669
* raise ValueError('Match length exceeds len of'
670
* ' parent_annotations %s > %s'
671
* % (parent_idx + match_len, # <<<<<<<<<<<<<<
672
* PyList_GET_SIZE(parent_annotations)))
673
* if lines_idx + match_len > PyList_GET_SIZE(annotations):
675
__pyx_t_2 = PyInt_FromSsize_t((__pyx_v_parent_idx + __pyx_v_match_len)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
676
__Pyx_GOTREF(__pyx_t_2);
678
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":77
679
* ' parent_annotations %s > %s'
680
* % (parent_idx + match_len,
681
* PyList_GET_SIZE(parent_annotations))) # <<<<<<<<<<<<<<
682
* if lines_idx + match_len > PyList_GET_SIZE(annotations):
683
* raise ValueError('Match length exceeds len of'
685
__pyx_t_3 = PyInt_FromSsize_t(PyList_GET_SIZE(__pyx_v_parent_annotations)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
686
__Pyx_GOTREF(__pyx_t_3);
687
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
688
__Pyx_GOTREF(__pyx_t_4);
689
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
690
__Pyx_GIVEREF(__pyx_t_2);
691
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
692
__Pyx_GIVEREF(__pyx_t_3);
695
__pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
696
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
697
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
698
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
699
__Pyx_GOTREF(__pyx_t_4);
700
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
701
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
703
__pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
704
__Pyx_GOTREF(__pyx_t_3);
705
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
706
__Pyx_Raise(__pyx_t_3, 0, 0);
707
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
708
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
252
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":83 */
713
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":78
714
* % (parent_idx + match_len,
715
* PyList_GET_SIZE(parent_annotations)))
716
* if lines_idx + match_len > PyList_GET_SIZE(annotations): # <<<<<<<<<<<<<<
717
* raise ValueError('Match length exceeds len of'
718
* ' annotations %s > %s'
720
__pyx_t_1 = ((__pyx_v_lines_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_annotations));
723
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":81
724
* raise ValueError('Match length exceeds len of'
725
* ' annotations %s > %s'
726
* % (lines_idx + match_len, # <<<<<<<<<<<<<<
727
* PyList_GET_SIZE(annotations)))
730
__pyx_t_3 = PyInt_FromSsize_t((__pyx_v_lines_idx + __pyx_v_match_len)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
731
__Pyx_GOTREF(__pyx_t_3);
733
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":82
734
* ' annotations %s > %s'
735
* % (lines_idx + match_len,
736
* PyList_GET_SIZE(annotations))) # <<<<<<<<<<<<<<
740
__pyx_t_4 = PyInt_FromSsize_t(PyList_GET_SIZE(__pyx_v_annotations)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
741
__Pyx_GOTREF(__pyx_t_4);
742
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
743
__Pyx_GOTREF(__pyx_t_2);
744
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
745
__Pyx_GIVEREF(__pyx_t_3);
746
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
747
__Pyx_GIVEREF(__pyx_t_4);
750
__pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
751
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
752
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
753
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
754
__Pyx_GOTREF(__pyx_t_2);
755
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
756
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
758
__pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
759
__Pyx_GOTREF(__pyx_t_4);
760
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
761
__Pyx_Raise(__pyx_t_4, 0, 0);
762
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
763
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
768
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":83
769
* % (lines_idx + match_len,
770
* PyList_GET_SIZE(annotations)))
771
* return 0 # <<<<<<<<<<<<<<
781
__Pyx_XDECREF(__pyx_t_2);
782
__Pyx_XDECREF(__pyx_t_3);
783
__Pyx_XDECREF(__pyx_t_4);
262
784
__Pyx_AddTraceback("bzrlib._annotator_pyx._check_match_ranges");
265
Py_DECREF(__pyx_v_parent_annotations);
266
Py_DECREF(__pyx_v_annotations);
787
__Pyx_RefNannyFinishContext();
270
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *__pyx_v_tpl,Py_ssize_t *__pyx_v_pos) {
791
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":86
794
* cdef PyObject *_next_tuple_entry(object tpl, Py_ssize_t *pos): # cannot_raise # <<<<<<<<<<<<<<
795
* """Return the next entry from this tuple.
799
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *__pyx_v_tpl, Py_ssize_t *__pyx_v_pos) {
271
800
PyObject *__pyx_r;
273
Py_INCREF(__pyx_v_tpl);
802
__Pyx_RefNannySetupContext("_next_tuple_entry");
275
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":94 */
804
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":94
805
* This cannot raise an exception, as it does no error checking.
807
* pos[0] = pos[0] + 1 # <<<<<<<<<<<<<<
808
* if pos[0] >= PyTuple_GET_SIZE(tpl):
276
811
(__pyx_v_pos[0]) = ((__pyx_v_pos[0]) + 1);
278
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":95 */
279
__pyx_1 = ((__pyx_v_pos[0]) >= PyTuple_GET_SIZE(__pyx_v_tpl));
813
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":95
815
* pos[0] = pos[0] + 1
816
* if pos[0] >= PyTuple_GET_SIZE(tpl): # <<<<<<<<<<<<<<
818
* return PyTuple_GET_ITEM(tpl, pos[0])
820
__pyx_t_1 = ((__pyx_v_pos[0]) >= PyTuple_GET_SIZE(__pyx_v_tpl));
823
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":96
824
* pos[0] = pos[0] + 1
825
* if pos[0] >= PyTuple_GET_SIZE(tpl):
826
* return NULL # <<<<<<<<<<<<<<
827
* return PyTuple_GET_ITEM(tpl, pos[0])
287
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":97 */
288
__pyx_r = PyTuple_GET_ITEM(__pyx_v_tpl,(__pyx_v_pos[0]));
836
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":97
837
* if pos[0] >= PyTuple_GET_SIZE(tpl):
839
* return PyTuple_GET_ITEM(tpl, pos[0]) # <<<<<<<<<<<<<<
843
__pyx_r = PyTuple_GET_ITEM(__pyx_v_tpl, (__pyx_v_pos[0]));
293
Py_DECREF(__pyx_v_tpl);
848
__Pyx_RefNannyFinishContext();
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) {
852
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":100
855
* cdef object _combine_annotations(ann_one, ann_two, cache): # <<<<<<<<<<<<<<
856
* """Combine the annotations from both sides."""
857
* cdef Py_ssize_t pos_one, pos_two, len_one, len_two
860
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
861
Py_ssize_t __pyx_v_pos_one;
299
862
Py_ssize_t __pyx_v_pos_two;
300
863
Py_ssize_t __pyx_v_out_pos;
303
866
PyObject *__pyx_v_right;
304
867
PyObject *__pyx_v_cache_key;
305
868
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/vila/src/bzr/integration/trunk/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;
869
PyObject *__pyx_r = NULL;
871
PyObject *__pyx_t_2 = NULL;
875
PyObject *__pyx_t_6 = NULL;
876
__Pyx_RefNannySetupContext("_combine_annotations");
877
__pyx_v_cache_key = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
878
__pyx_v_new_ann = Py_None; __Pyx_INCREF(Py_None);
880
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":106
881
* cdef PyObject *temp, *left, *right
883
* if (PyObject_RichCompareBool(ann_one, ann_two, Py_LT)): # <<<<<<<<<<<<<<
884
* cache_key = (ann_one, ann_two)
887
__pyx_t_1 = PyObject_RichCompareBool(__pyx_v_ann_one, __pyx_v_ann_two, Py_LT); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
890
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":107
892
* if (PyObject_RichCompareBool(ann_one, ann_two, Py_LT)):
893
* cache_key = (ann_one, ann_two) # <<<<<<<<<<<<<<
895
* cache_key = (ann_two, ann_one)
897
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
898
__Pyx_GOTREF(__pyx_t_2);
899
__Pyx_INCREF(__pyx_v_ann_one);
900
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ann_one);
901
__Pyx_GIVEREF(__pyx_v_ann_one);
902
__Pyx_INCREF(__pyx_v_ann_two);
903
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ann_two);
904
__Pyx_GIVEREF(__pyx_v_ann_two);
905
if (!(likely(PyTuple_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
906
__Pyx_DECREF(((PyObject *)__pyx_v_cache_key));
907
__pyx_v_cache_key = ((PyObject *)__pyx_t_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;
913
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":109
914
* cache_key = (ann_one, ann_two)
916
* cache_key = (ann_two, ann_one) # <<<<<<<<<<<<<<
917
* temp = PyDict_GetItem(cache, cache_key)
920
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
921
__Pyx_GOTREF(__pyx_t_2);
922
__Pyx_INCREF(__pyx_v_ann_two);
923
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ann_two);
924
__Pyx_GIVEREF(__pyx_v_ann_two);
925
__Pyx_INCREF(__pyx_v_ann_one);
926
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ann_one);
927
__Pyx_GIVEREF(__pyx_v_ann_one);
928
if (!(likely(PyTuple_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
929
__Pyx_DECREF(((PyObject *)__pyx_v_cache_key));
930
__pyx_v_cache_key = ((PyObject *)__pyx_t_2);
341
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":110 */
342
__pyx_v_temp = PyDict_GetItem(__pyx_v_cache,__pyx_v_cache_key);
344
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":111 */
345
__pyx_1 = (__pyx_v_temp != NULL);
347
Py_INCREF(((PyObject *)__pyx_v_temp));
935
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":110
937
* cache_key = (ann_two, ann_one)
938
* temp = PyDict_GetItem(cache, cache_key) # <<<<<<<<<<<<<<
940
* return <object>temp
942
__pyx_v_temp = PyDict_GetItem(__pyx_v_cache, ((PyObject *)__pyx_v_cache_key));
944
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":111
945
* cache_key = (ann_two, ann_one)
946
* temp = PyDict_GetItem(cache, cache_key)
947
* if temp != NULL: # <<<<<<<<<<<<<<
948
* return <object>temp
951
__pyx_t_3 = (__pyx_v_temp != NULL);
954
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":112
955
* temp = PyDict_GetItem(cache, cache_key)
957
* return <object>temp # <<<<<<<<<<<<<<
959
* if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two):
961
__Pyx_XDECREF(__pyx_r);
962
__Pyx_INCREF(((PyObject *)__pyx_v_temp));
348
963
__pyx_r = ((PyObject *)__pyx_v_temp);
354
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":118 */
373
__pyx_v_pos_one = (-1);
375
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":119 */
376
__pyx_v_pos_two = (-1);
378
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":120 */
969
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":114
970
* return <object>temp
972
* if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two): # <<<<<<<<<<<<<<
973
* raise TypeError('annotations must be tuples')
974
* # We know that annotations are tuples, and that both sides are already
976
__pyx_t_3 = (!PyTuple_CheckExact(__pyx_v_ann_one));
978
__pyx_t_4 = (!PyTuple_CheckExact(__pyx_v_ann_two));
979
__pyx_t_5 = __pyx_t_4;
981
__pyx_t_5 = __pyx_t_3;
985
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":115
987
* if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two):
988
* raise TypeError('annotations must be tuples') # <<<<<<<<<<<<<<
989
* # We know that annotations are tuples, and that both sides are already
990
* # sorted, so we can just walk and update a new list.
992
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
993
__Pyx_GOTREF(__pyx_t_2);
994
__Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
995
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
996
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
997
__pyx_t_6 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
998
__Pyx_GOTREF(__pyx_t_6);
999
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1000
__Pyx_Raise(__pyx_t_6, 0, 0);
1001
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1002
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1007
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":118
1008
* # We know that annotations are tuples, and that both sides are already
1009
* # sorted, so we can just walk and update a new list.
1010
* pos_one = -1 # <<<<<<<<<<<<<<
1014
__pyx_v_pos_one = -1;
1016
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":119
1017
* # sorted, so we can just walk and update a new list.
1019
* pos_two = -1 # <<<<<<<<<<<<<<
1021
* left = _next_tuple_entry(ann_one, &pos_one)
1023
__pyx_v_pos_two = -1;
1025
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":120
1028
* out_pos = 0 # <<<<<<<<<<<<<<
1029
* left = _next_tuple_entry(ann_one, &pos_one)
1030
* right = _next_tuple_entry(ann_two, &pos_two)
379
1032
__pyx_v_out_pos = 0;
381
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":125 */
1034
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":121
1037
* left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<<
1038
* right = _next_tuple_entry(ann_two, &pos_two)
1039
* new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
1041
__pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
1043
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":122
1045
* left = _next_tuple_entry(ann_one, &pos_one)
1046
* right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<<
1047
* new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
1048
* + PyTuple_GET_SIZE(ann_two))
1050
__pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
1052
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":124
1053
* right = _next_tuple_entry(ann_two, &pos_two)
1054
* new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
1055
* + PyTuple_GET_SIZE(ann_two)) # <<<<<<<<<<<<<<
1056
* while left != NULL and right != NULL:
1057
* # left == right is done by PyObject_RichCompareBool_ptr, however it
1059
__pyx_t_6 = PyTuple_New((PyTuple_GET_SIZE(__pyx_v_ann_one) + PyTuple_GET_SIZE(__pyx_v_ann_two))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1060
__Pyx_GOTREF(__pyx_t_6);
1061
__Pyx_DECREF(__pyx_v_new_ann);
1062
__pyx_v_new_ann = __pyx_t_6;
1065
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":125
1066
* new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
1067
* + PyTuple_GET_SIZE(ann_two))
1068
* while left != NULL and right != NULL: # <<<<<<<<<<<<<<
1069
* # left == right is done by PyObject_RichCompareBool_ptr, however it
1070
* # avoids a function call for a very common case. Drops 'time bzr
395
__pyx_1 = (__pyx_v_left != NULL);
397
__pyx_1 = (__pyx_v_right != NULL);
401
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":132 */
409
Py_INCREF(__pyx_v_left);
411
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":133 */
412
PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left);
414
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":138 */
425
Py_INCREF(__pyx_v_left);
427
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":139 */
428
PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left);
430
/* "/home/vila/src/bzr/integration/trunk/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));
1073
__pyx_t_5 = (__pyx_v_left != NULL);
1075
__pyx_t_3 = (__pyx_v_right != NULL);
1076
__pyx_t_4 = __pyx_t_3;
1078
__pyx_t_4 = __pyx_t_5;
1080
if (!__pyx_t_4) break;
1082
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":130
1083
* # annotate NEWS' from 7.25s to 7.16s, so it *is* a visible impact.
1085
* or PyObject_RichCompareBool_ptr(left, right, Py_EQ)): # <<<<<<<<<<<<<<
1086
* # Identical values, step both
1087
* Py_INCREF_ptr(left)
1089
__pyx_t_4 = (__pyx_v_left == __pyx_v_right);
1091
__pyx_t_5 = PyObject_RichCompareBool(__pyx_v_left, __pyx_v_right, Py_EQ);
1093
__pyx_t_5 = __pyx_t_4;
1097
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":132
1098
* or PyObject_RichCompareBool_ptr(left, right, Py_EQ)):
1099
* # Identical values, step both
1100
* Py_INCREF_ptr(left) # <<<<<<<<<<<<<<
1101
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1102
* left = _next_tuple_entry(ann_one, &pos_one)
1104
Py_INCREF(__pyx_v_left);
1106
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":133
1107
* # Identical values, step both
1108
* Py_INCREF_ptr(left)
1109
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) # <<<<<<<<<<<<<<
1110
* left = _next_tuple_entry(ann_one, &pos_one)
1111
* right = _next_tuple_entry(ann_two, &pos_two)
1113
PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left);
1115
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":134
1116
* Py_INCREF_ptr(left)
1117
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1118
* left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<<
1119
* right = _next_tuple_entry(ann_two, &pos_two)
1120
* elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)):
1122
__pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
1124
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":135
1125
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1126
* left = _next_tuple_entry(ann_one, &pos_one)
1127
* right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<<
1128
* elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)):
1129
* # left < right or right == NULL
1131
__pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
1135
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":136
1136
* left = _next_tuple_entry(ann_one, &pos_one)
1137
* right = _next_tuple_entry(ann_two, &pos_two)
1138
* elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)): # <<<<<<<<<<<<<<
1139
* # left < right or right == NULL
1140
* Py_INCREF_ptr(left)
1142
__pyx_t_1 = PyObject_RichCompareBool(__pyx_v_left, __pyx_v_right, Py_LT);
1145
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":138
1146
* elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)):
1147
* # left < right or right == NULL
1148
* Py_INCREF_ptr(left) # <<<<<<<<<<<<<<
1149
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1150
* left = _next_tuple_entry(ann_one, &pos_one)
1152
Py_INCREF(__pyx_v_left);
1154
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":139
1155
* # left < right or right == NULL
1156
* Py_INCREF_ptr(left)
1157
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) # <<<<<<<<<<<<<<
1158
* left = _next_tuple_entry(ann_one, &pos_one)
1159
* else: # right < left or left == NULL
1161
PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left);
1163
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":140
1164
* Py_INCREF_ptr(left)
1165
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1166
* left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<<
1167
* else: # right < left or left == NULL
1168
* Py_INCREF_ptr(right)
1170
__pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
436
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":142 */
1175
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":142
1176
* left = _next_tuple_entry(ann_one, &pos_one)
1177
* else: # right < left or left == NULL
1178
* Py_INCREF_ptr(right) # <<<<<<<<<<<<<<
1179
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1180
* right = _next_tuple_entry(ann_two, &pos_two)
437
1182
Py_INCREF(__pyx_v_right);
439
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":143 */
440
PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_right);
1184
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":143
1185
* else: # right < left or left == NULL
1186
* Py_INCREF_ptr(right)
1187
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) # <<<<<<<<<<<<<<
1188
* right = _next_tuple_entry(ann_two, &pos_two)
1189
* out_pos = out_pos + 1
1191
PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_right);
442
/* "/home/vila/src/bzr/integration/trunk/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));
1193
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":144
1194
* Py_INCREF_ptr(right)
1195
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1196
* right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<<
1197
* out_pos = out_pos + 1
1198
* while left != NULL:
1200
__pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
447
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":145 */
1204
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":145
1205
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1206
* right = _next_tuple_entry(ann_two, &pos_two)
1207
* out_pos = out_pos + 1 # <<<<<<<<<<<<<<
1208
* while left != NULL:
1209
* Py_INCREF_ptr(left)
448
1211
__pyx_v_out_pos = (__pyx_v_out_pos + 1);
451
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":146 */
1214
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":146
1215
* right = _next_tuple_entry(ann_two, &pos_two)
1216
* out_pos = out_pos + 1
1217
* while left != NULL: # <<<<<<<<<<<<<<
1218
* Py_INCREF_ptr(left)
1219
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
453
__pyx_1 = (__pyx_v_left != NULL);
1222
__pyx_t_5 = (__pyx_v_left != NULL);
1223
if (!__pyx_t_5) break;
456
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":147 */
1225
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":147
1226
* out_pos = out_pos + 1
1227
* while left != NULL:
1228
* Py_INCREF_ptr(left) # <<<<<<<<<<<<<<
1229
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1230
* left = _next_tuple_entry(ann_one, &pos_one)
457
1232
Py_INCREF(__pyx_v_left);
459
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":148 */
460
PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left);
462
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":150 */
1234
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":148
1235
* while left != NULL:
1236
* Py_INCREF_ptr(left)
1237
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) # <<<<<<<<<<<<<<
1238
* left = _next_tuple_entry(ann_one, &pos_one)
1239
* out_pos = out_pos + 1
1241
PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left);
1243
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":149
1244
* Py_INCREF_ptr(left)
1245
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1246
* left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<<
1247
* out_pos = out_pos + 1
1248
* while right != NULL:
1250
__pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
1252
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":150
1253
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1254
* left = _next_tuple_entry(ann_one, &pos_one)
1255
* out_pos = out_pos + 1 # <<<<<<<<<<<<<<
1256
* while right != NULL:
1257
* Py_INCREF_ptr(right)
466
1259
__pyx_v_out_pos = (__pyx_v_out_pos + 1);
469
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":151 */
1262
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":151
1263
* left = _next_tuple_entry(ann_one, &pos_one)
1264
* out_pos = out_pos + 1
1265
* while right != NULL: # <<<<<<<<<<<<<<
1266
* Py_INCREF_ptr(right)
1267
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
471
__pyx_1 = (__pyx_v_right != NULL);
1270
__pyx_t_5 = (__pyx_v_right != NULL);
1271
if (!__pyx_t_5) break;
474
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":152 */
1273
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":152
1274
* out_pos = out_pos + 1
1275
* while right != NULL:
1276
* Py_INCREF_ptr(right) # <<<<<<<<<<<<<<
1277
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1278
* right = _next_tuple_entry(ann_two, &pos_two)
475
1280
Py_INCREF(__pyx_v_right);
477
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":153 */
478
PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_right);
480
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":155 */
1282
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":153
1283
* while right != NULL:
1284
* Py_INCREF_ptr(right)
1285
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) # <<<<<<<<<<<<<<
1286
* right = _next_tuple_entry(ann_two, &pos_two)
1287
* out_pos = out_pos + 1
1289
PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_right);
1291
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":154
1292
* Py_INCREF_ptr(right)
1293
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1294
* right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<<
1295
* out_pos = out_pos + 1
1296
* if out_pos != PyTuple_GET_SIZE(new_ann):
1298
__pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
1300
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":155
1301
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1302
* right = _next_tuple_entry(ann_two, &pos_two)
1303
* out_pos = out_pos + 1 # <<<<<<<<<<<<<<
1304
* if out_pos != PyTuple_GET_SIZE(new_ann):
1305
* # Timing _PyTuple_Resize was not significantly faster that slicing
484
1307
__pyx_v_out_pos = (__pyx_v_out_pos + 1);
487
/* "/home/vila/src/bzr/integration/trunk/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;
1310
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":156
1311
* right = _next_tuple_entry(ann_two, &pos_two)
1312
* out_pos = out_pos + 1
1313
* if out_pos != PyTuple_GET_SIZE(new_ann): # <<<<<<<<<<<<<<
1314
* # Timing _PyTuple_Resize was not significantly faster that slicing
1315
* # PyTuple_Resize((<PyObject **>new_ann), out_pos)
1317
__pyx_t_5 = (__pyx_v_out_pos != PyTuple_GET_SIZE(__pyx_v_new_ann));
1320
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":159
1321
* # Timing _PyTuple_Resize was not significantly faster that slicing
1322
* # PyTuple_Resize((<PyObject **>new_ann), out_pos)
1323
* new_ann = new_ann[0:out_pos] # <<<<<<<<<<<<<<
1324
* PyDict_SetItem(cache, cache_key, new_ann)
1327
__pyx_t_6 = PySequence_GetSlice(__pyx_v_new_ann, 0, __pyx_v_out_pos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1328
__Pyx_GOTREF(__pyx_t_6);
1329
__Pyx_DECREF(__pyx_v_new_ann);
1330
__pyx_v_new_ann = __pyx_t_6;
498
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":161 */
502
Py_INCREF(__pyx_v_new_ann);
1336
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":160
1337
* # PyTuple_Resize((<PyObject **>new_ann), out_pos)
1338
* new_ann = new_ann[0:out_pos]
1339
* PyDict_SetItem(cache, cache_key, new_ann) # <<<<<<<<<<<<<<
1343
__pyx_t_1 = PyDict_SetItem(__pyx_v_cache, ((PyObject *)__pyx_v_cache_key), __pyx_v_new_ann); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1345
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":161
1346
* new_ann = new_ann[0:out_pos]
1347
* PyDict_SetItem(cache, cache_key, new_ann)
1348
* return new_ann # <<<<<<<<<<<<<<
1352
__Pyx_XDECREF(__pyx_r);
1353
__Pyx_INCREF(__pyx_v_new_ann);
503
1354
__pyx_r = __pyx_v_new_ann;
506
__pyx_r = Py_None; Py_INCREF(Py_None);
1357
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
1360
__Pyx_XDECREF(__pyx_t_2);
1361
__Pyx_XDECREF(__pyx_t_6);
511
1362
__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);
1365
__Pyx_DECREF(__pyx_v_cache_key);
1366
__Pyx_DECREF(__pyx_v_new_ann);
1367
__Pyx_XGIVEREF(__pyx_r);
1368
__Pyx_RefNannyFinishContext();
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) {
1372
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":164
1375
* cdef int _apply_parent_annotations(annotations, parent_annotations, # <<<<<<<<<<<<<<
1376
* matching_blocks) except -1:
1377
* """Apply the annotations from parent_annotations into annotations.
1380
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
1381
Py_ssize_t __pyx_v_parent_idx;
524
1382
Py_ssize_t __pyx_v_lines_idx;
525
1383
Py_ssize_t __pyx_v_match_len;
529
1387
PyObject **__pyx_v_par_temp;
530
1388
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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":175 */
1391
Py_ssize_t __pyx_t_2;
1392
PyObject *__pyx_t_3 = NULL;
1393
PyObject *__pyx_t_4 = NULL;
1394
PyObject *__pyx_t_5 = NULL;
1395
PyObject *__pyx_t_6 = NULL;
1396
PyObject *__pyx_t_7 = NULL;
1397
Py_ssize_t __pyx_t_8;
1398
Py_ssize_t __pyx_t_9;
1399
Py_ssize_t __pyx_t_10;
1400
PyObject *__pyx_t_11 = NULL;
1401
__Pyx_RefNannySetupContext("_apply_parent_annotations");
1403
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":174
1404
* cdef PyObject **par_temp, **ann_temp
1406
* _check_annotations_are_lists(annotations, parent_annotations) # <<<<<<<<<<<<<<
1407
* par_list = <PyListObject *>parent_annotations
1408
* ann_list = <PyListObject *>annotations
1410
__pyx_t_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(__pyx_v_annotations, __pyx_v_parent_annotations); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1412
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":175
1414
* _check_annotations_are_lists(annotations, parent_annotations)
1415
* par_list = <PyListObject *>parent_annotations # <<<<<<<<<<<<<<
1416
* ann_list = <PyListObject *>annotations
1417
* # For NEWS and bzrlib/builtins.py, over 99% of the lines are simply copied
545
1419
__pyx_v_par_list = ((PyListObject *)__pyx_v_parent_annotations);
547
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":176 */
1421
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":176
1422
* _check_annotations_are_lists(annotations, parent_annotations)
1423
* par_list = <PyListObject *>parent_annotations
1424
* ann_list = <PyListObject *>annotations # <<<<<<<<<<<<<<
1425
* # For NEWS and bzrlib/builtins.py, over 99% of the lines are simply copied
1426
* # across from the parent entry. So this routine is heavily optimized for
548
1428
__pyx_v_ann_list = ((PyListObject *)__pyx_v_annotations);
550
/* "/home/vila/src/bzr/integration/trunk/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;}
1430
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":181
1431
* # that. Would be interesting if we could use memcpy() but we have to incref
1433
* for parent_idx, lines_idx, match_len in matching_blocks: # <<<<<<<<<<<<<<
1434
* _check_match_ranges(parent_annotations, annotations,
1435
* parent_idx, lines_idx, match_len)
1437
if (PyList_CheckExact(__pyx_v_matching_blocks) || PyTuple_CheckExact(__pyx_v_matching_blocks)) {
1438
__pyx_t_2 = 0; __pyx_t_3 = __pyx_v_matching_blocks; __Pyx_INCREF(__pyx_t_3);
1440
__pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_matching_blocks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1441
__Pyx_GOTREF(__pyx_t_3);
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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":184 */
1444
if (likely(PyList_CheckExact(__pyx_t_3))) {
1445
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
1446
__pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
1447
} else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
1448
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
1449
__pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
1451
__pyx_t_4 = PyIter_Next(__pyx_t_3);
1453
if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1456
__Pyx_GOTREF(__pyx_t_4);
1458
if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 3)) {
1459
PyObject* tuple = __pyx_t_4;
1460
__pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5);
1461
__pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1462
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1463
__pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
1464
__pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1465
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1466
__pyx_t_7 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_7);
1467
__pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1468
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1469
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1470
__pyx_v_parent_idx = __pyx_t_8;
1471
__pyx_v_lines_idx = __pyx_t_9;
1472
__pyx_v_match_len = __pyx_t_10;
1474
__pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1475
__Pyx_GOTREF(__pyx_t_11);
1476
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1477
__pyx_t_5 = __Pyx_UnpackItem(__pyx_t_11, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1478
__Pyx_GOTREF(__pyx_t_5);
1479
__pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1480
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1481
__pyx_t_6 = __Pyx_UnpackItem(__pyx_t_11, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1482
__Pyx_GOTREF(__pyx_t_6);
1483
__pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1484
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1485
__pyx_t_7 = __Pyx_UnpackItem(__pyx_t_11, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1486
__Pyx_GOTREF(__pyx_t_7);
1487
__pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1488
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1489
if (__Pyx_EndUnpack(__pyx_t_11, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1490
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
1491
__pyx_v_parent_idx = __pyx_t_10;
1492
__pyx_v_lines_idx = __pyx_t_9;
1493
__pyx_v_match_len = __pyx_t_8;
1496
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":183
1497
* for parent_idx, lines_idx, match_len in matching_blocks:
1498
* _check_match_ranges(parent_annotations, annotations,
1499
* parent_idx, lines_idx, match_len) # <<<<<<<<<<<<<<
1500
* par_temp = par_list.ob_item + parent_idx
1501
* ann_temp = ann_list.ob_item + lines_idx
1503
__pyx_t_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 (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1505
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":184
1506
* _check_match_ranges(parent_annotations, annotations,
1507
* parent_idx, lines_idx, match_len)
1508
* par_temp = par_list.ob_item + parent_idx # <<<<<<<<<<<<<<
1509
* ann_temp = ann_list.ob_item + lines_idx
1510
* for idx from 0 <= idx < match_len:
579
1512
__pyx_v_par_temp = (__pyx_v_par_list->ob_item + __pyx_v_parent_idx);
581
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":185 */
1514
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":185
1515
* parent_idx, lines_idx, match_len)
1516
* par_temp = par_list.ob_item + parent_idx
1517
* ann_temp = ann_list.ob_item + lines_idx # <<<<<<<<<<<<<<
1518
* for idx from 0 <= idx < match_len:
1519
* Py_INCREF_ptr(par_temp[idx])
582
1521
__pyx_v_ann_temp = (__pyx_v_ann_list->ob_item + __pyx_v_lines_idx);
584
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":186 */
585
for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_v_match_len; ++__pyx_v_idx) {
1523
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":186
1524
* par_temp = par_list.ob_item + parent_idx
1525
* ann_temp = ann_list.ob_item + lines_idx
1526
* for idx from 0 <= idx < match_len: # <<<<<<<<<<<<<<
1527
* Py_INCREF_ptr(par_temp[idx])
1528
* Py_DECREF_ptr(ann_temp[idx])
1530
__pyx_t_8 = __pyx_v_match_len;
1531
for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_8; __pyx_v_idx++) {
587
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":187 */
1533
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":187
1534
* ann_temp = ann_list.ob_item + lines_idx
1535
* for idx from 0 <= idx < match_len:
1536
* Py_INCREF_ptr(par_temp[idx]) # <<<<<<<<<<<<<<
1537
* Py_DECREF_ptr(ann_temp[idx])
1538
* ann_temp[idx] = par_temp[idx]
588
1540
Py_INCREF((__pyx_v_par_temp[__pyx_v_idx]));
590
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":188 */
1542
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":188
1543
* for idx from 0 <= idx < match_len:
1544
* Py_INCREF_ptr(par_temp[idx])
1545
* Py_DECREF_ptr(ann_temp[idx]) # <<<<<<<<<<<<<<
1546
* ann_temp[idx] = par_temp[idx]
591
1549
Py_DECREF((__pyx_v_ann_temp[__pyx_v_idx]));
593
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":189 */
1551
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":189
1552
* Py_INCREF_ptr(par_temp[idx])
1553
* Py_DECREF_ptr(ann_temp[idx])
1554
* ann_temp[idx] = par_temp[idx] # <<<<<<<<<<<<<<
594
1558
(__pyx_v_ann_temp[__pyx_v_idx]) = (__pyx_v_par_temp[__pyx_v_idx]);
597
Py_DECREF(__pyx_2); __pyx_2 = 0;
599
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":190 */
1561
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1563
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":190
1564
* Py_DECREF_ptr(ann_temp[idx])
1565
* ann_temp[idx] = par_temp[idx]
1566
* return 0 # <<<<<<<<<<<<<<
1576
__Pyx_XDECREF(__pyx_t_3);
1577
__Pyx_XDECREF(__pyx_t_4);
1578
__Pyx_XDECREF(__pyx_t_5);
1579
__Pyx_XDECREF(__pyx_t_6);
1580
__Pyx_XDECREF(__pyx_t_7);
1581
__Pyx_XDECREF(__pyx_t_11);
609
1582
__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);
1585
__Pyx_RefNannyFinishContext();
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) {
1589
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":193
1592
* cdef int _merge_annotations(this_annotation, annotations, parent_annotations, # <<<<<<<<<<<<<<
1593
* matching_blocks, ann_cache) except -1:
1594
* cdef Py_ssize_t parent_idx, ann_idx, lines_idx, match_len, idx
1597
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
1598
Py_ssize_t __pyx_v_parent_idx;
620
1599
Py_ssize_t __pyx_v_ann_idx;
621
1600
Py_ssize_t __pyx_v_lines_idx;
630
1609
PyObject *__pyx_v_ann;
631
1610
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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":200 */
655
Py_DECREF(__pyx_v_last_ann);
1613
Py_ssize_t __pyx_t_2;
1614
PyObject *__pyx_t_3 = NULL;
1615
PyObject *__pyx_t_4 = NULL;
1616
PyObject *__pyx_t_5 = NULL;
1617
PyObject *__pyx_t_6 = NULL;
1618
PyObject *__pyx_t_7 = NULL;
1619
Py_ssize_t __pyx_t_8;
1620
Py_ssize_t __pyx_t_9;
1621
Py_ssize_t __pyx_t_10;
1622
PyObject *__pyx_t_11 = NULL;
1626
__Pyx_RefNannySetupContext("_merge_annotations");
1627
__pyx_v_last_ann = Py_None; __Pyx_INCREF(Py_None);
1628
__pyx_v_last_parent = Py_None; __Pyx_INCREF(Py_None);
1629
__pyx_v_last_res = Py_None; __Pyx_INCREF(Py_None);
1630
__pyx_v_par_ann = Py_None; __Pyx_INCREF(Py_None);
1631
__pyx_v_ann = Py_None; __Pyx_INCREF(Py_None);
1632
__pyx_v_new_ann = Py_None; __Pyx_INCREF(Py_None);
1634
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":199
1635
* cdef PyObject *ann_temp, *par_temp
1637
* _check_annotations_are_lists(annotations, parent_annotations) # <<<<<<<<<<<<<<
1639
* last_parent = None
1641
__pyx_t_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(__pyx_v_annotations, __pyx_v_parent_annotations); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1643
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":200
1645
* _check_annotations_are_lists(annotations, parent_annotations)
1646
* last_ann = None # <<<<<<<<<<<<<<
1647
* last_parent = None
1650
__Pyx_INCREF(Py_None);
1651
__Pyx_DECREF(__pyx_v_last_ann);
656
1652
__pyx_v_last_ann = Py_None;
658
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":201 */
660
Py_DECREF(__pyx_v_last_parent);
1654
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":201
1655
* _check_annotations_are_lists(annotations, parent_annotations)
1657
* last_parent = None # <<<<<<<<<<<<<<
1659
* for parent_idx, lines_idx, match_len in matching_blocks:
1661
__Pyx_INCREF(Py_None);
1662
__Pyx_DECREF(__pyx_v_last_parent);
661
1663
__pyx_v_last_parent = Py_None;
663
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":202 */
665
Py_DECREF(__pyx_v_last_res);
1665
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":202
1667
* last_parent = None
1668
* last_res = None # <<<<<<<<<<<<<<
1669
* for parent_idx, lines_idx, match_len in matching_blocks:
1670
* _check_match_ranges(parent_annotations, annotations,
1672
__Pyx_INCREF(Py_None);
1673
__Pyx_DECREF(__pyx_v_last_res);
666
1674
__pyx_v_last_res = Py_None;
668
/* "/home/vila/src/bzr/integration/trunk/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;}
1676
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":203
1677
* last_parent = None
1679
* for parent_idx, lines_idx, match_len in matching_blocks: # <<<<<<<<<<<<<<
1680
* _check_match_ranges(parent_annotations, annotations,
1681
* parent_idx, lines_idx, match_len)
1683
if (PyList_CheckExact(__pyx_v_matching_blocks) || PyTuple_CheckExact(__pyx_v_matching_blocks)) {
1684
__pyx_t_2 = 0; __pyx_t_3 = __pyx_v_matching_blocks; __Pyx_INCREF(__pyx_t_3);
1686
__pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_matching_blocks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1687
__Pyx_GOTREF(__pyx_t_3);
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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":208 */
697
for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_v_match_len; ++__pyx_v_idx) {
699
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":209 */
1690
if (likely(PyList_CheckExact(__pyx_t_3))) {
1691
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
1692
__pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
1693
} else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
1694
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
1695
__pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
1697
__pyx_t_4 = PyIter_Next(__pyx_t_3);
1699
if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1702
__Pyx_GOTREF(__pyx_t_4);
1704
if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 3)) {
1705
PyObject* tuple = __pyx_t_4;
1706
__pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5);
1707
__pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1708
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1709
__pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
1710
__pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1711
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1712
__pyx_t_7 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_7);
1713
__pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1714
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1715
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1716
__pyx_v_parent_idx = __pyx_t_8;
1717
__pyx_v_lines_idx = __pyx_t_9;
1718
__pyx_v_match_len = __pyx_t_10;
1720
__pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1721
__Pyx_GOTREF(__pyx_t_11);
1722
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1723
__pyx_t_5 = __Pyx_UnpackItem(__pyx_t_11, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1724
__Pyx_GOTREF(__pyx_t_5);
1725
__pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1726
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1727
__pyx_t_6 = __Pyx_UnpackItem(__pyx_t_11, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1728
__Pyx_GOTREF(__pyx_t_6);
1729
__pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1730
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1731
__pyx_t_7 = __Pyx_UnpackItem(__pyx_t_11, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1732
__Pyx_GOTREF(__pyx_t_7);
1733
__pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1734
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1735
if (__Pyx_EndUnpack(__pyx_t_11, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1736
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
1737
__pyx_v_parent_idx = __pyx_t_10;
1738
__pyx_v_lines_idx = __pyx_t_9;
1739
__pyx_v_match_len = __pyx_t_8;
1742
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":205
1743
* for parent_idx, lines_idx, match_len in matching_blocks:
1744
* _check_match_ranges(parent_annotations, annotations,
1745
* parent_idx, lines_idx, match_len) # <<<<<<<<<<<<<<
1746
* # For lines which match this parent, we will now resolve whether
1747
* # this parent wins over the current annotation
1749
__pyx_t_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 (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1751
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":208
1752
* # For lines which match this parent, we will now resolve whether
1753
* # this parent wins over the current annotation
1754
* for idx from 0 <= idx < match_len: # <<<<<<<<<<<<<<
1755
* ann_idx = lines_idx + idx
1756
* ann_temp = PyList_GET_ITEM(annotations, ann_idx)
1758
__pyx_t_8 = __pyx_v_match_len;
1759
for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_8; __pyx_v_idx++) {
1761
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":209
1762
* # this parent wins over the current annotation
1763
* for idx from 0 <= idx < match_len:
1764
* ann_idx = lines_idx + idx # <<<<<<<<<<<<<<
1765
* ann_temp = PyList_GET_ITEM(annotations, ann_idx)
1766
* par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx)
700
1768
__pyx_v_ann_idx = (__pyx_v_lines_idx + __pyx_v_idx);
702
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":210 */
703
__pyx_v_ann_temp = PyList_GET_ITEM(__pyx_v_annotations,__pyx_v_ann_idx);
705
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":212 */
709
__pyx_1 = (__pyx_v_ann_temp == __pyx_v_par_temp);
1770
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":210
1771
* for idx from 0 <= idx < match_len:
1772
* ann_idx = lines_idx + idx
1773
* ann_temp = PyList_GET_ITEM(annotations, ann_idx) # <<<<<<<<<<<<<<
1774
* par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx)
1775
* if (ann_temp == par_temp):
1777
__pyx_v_ann_temp = PyList_GET_ITEM(__pyx_v_annotations, __pyx_v_ann_idx);
1779
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":211
1780
* ann_idx = lines_idx + idx
1781
* ann_temp = PyList_GET_ITEM(annotations, ann_idx)
1782
* par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx) # <<<<<<<<<<<<<<
1783
* if (ann_temp == par_temp):
1784
* # This is parent, do nothing
1786
__pyx_v_par_temp = PyList_GET_ITEM(__pyx_v_parent_annotations, (__pyx_v_parent_idx + __pyx_v_idx));
1788
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":212
1789
* ann_temp = PyList_GET_ITEM(annotations, ann_idx)
1790
* par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx)
1791
* if (ann_temp == par_temp): # <<<<<<<<<<<<<<
1792
* # This is parent, do nothing
1793
* # Pointer comparison is fine here. Value comparison would
1795
__pyx_t_12 = (__pyx_v_ann_temp == __pyx_v_par_temp);
1798
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":220
1799
* # PyObject_RichCompareBool using pointer comparison drops
1800
* # timing from 215ms => 125ms
1801
* continue # <<<<<<<<<<<<<<
1802
* par_ann = <object>par_temp
1803
* ann = <object>ann_temp
1805
goto __pyx_L5_continue;
716
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":221 */
717
Py_INCREF(((PyObject *)__pyx_v_par_temp));
718
Py_DECREF(__pyx_v_par_ann);
1810
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":221
1811
* # timing from 215ms => 125ms
1813
* par_ann = <object>par_temp # <<<<<<<<<<<<<<
1814
* ann = <object>ann_temp
1815
* if (ann is this_annotation):
1817
__Pyx_INCREF(((PyObject *)__pyx_v_par_temp));
1818
__Pyx_DECREF(__pyx_v_par_ann);
719
1819
__pyx_v_par_ann = ((PyObject *)__pyx_v_par_temp);
721
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":222 */
722
Py_INCREF(((PyObject *)__pyx_v_ann_temp));
723
Py_DECREF(__pyx_v_ann);
1821
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":222
1823
* par_ann = <object>par_temp
1824
* ann = <object>ann_temp # <<<<<<<<<<<<<<
1825
* if (ann is this_annotation):
1826
* # Originally claimed 'this', but it was really in this
1828
__Pyx_INCREF(((PyObject *)__pyx_v_ann_temp));
1829
__Pyx_DECREF(__pyx_v_ann);
724
1830
__pyx_v_ann = ((PyObject *)__pyx_v_ann_temp);
726
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":223 */
727
__pyx_1 = __pyx_v_ann == __pyx_v_this_annotation;
1832
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":223
1833
* par_ann = <object>par_temp
1834
* ann = <object>ann_temp
1835
* if (ann is this_annotation): # <<<<<<<<<<<<<<
1836
* # Originally claimed 'this', but it was really in this
1839
__pyx_t_12 = (__pyx_v_ann == __pyx_v_this_annotation);
730
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":226 */
1842
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":226
1843
* # Originally claimed 'this', but it was really in this
1845
* Py_INCREF(par_ann) # <<<<<<<<<<<<<<
1846
* PyList_SetItem(annotations, ann_idx, par_ann)
731
1849
Py_INCREF(__pyx_v_par_ann);
733
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":228 */
742
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":232 */
1851
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":227
1853
* Py_INCREF(par_ann)
1854
* PyList_SetItem(annotations, ann_idx, par_ann) # <<<<<<<<<<<<<<
1856
* # Resolve the fact that both sides have a different value for
1858
__pyx_t_1 = PyList_SetItem(__pyx_v_annotations, __pyx_v_ann_idx, __pyx_v_par_ann); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1860
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":228
1861
* Py_INCREF(par_ann)
1862
* PyList_SetItem(annotations, ann_idx, par_ann)
1863
* continue # <<<<<<<<<<<<<<
1864
* # Resolve the fact that both sides have a different value for
1867
goto __pyx_L5_continue;
1872
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":231
1873
* # Resolve the fact that both sides have a different value for
1875
* if (ann is last_ann and par_ann is last_parent): # <<<<<<<<<<<<<<
1876
* Py_INCREF(last_res)
1877
* PyList_SetItem(annotations, ann_idx, last_res)
1879
__pyx_t_12 = (__pyx_v_ann == __pyx_v_last_ann);
1881
__pyx_t_13 = (__pyx_v_par_ann == __pyx_v_last_parent);
1882
__pyx_t_14 = __pyx_t_13;
1884
__pyx_t_14 = __pyx_t_12;
1888
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":232
1890
* if (ann is last_ann and par_ann is last_parent):
1891
* Py_INCREF(last_res) # <<<<<<<<<<<<<<
1892
* PyList_SetItem(annotations, ann_idx, last_res)
750
1895
Py_INCREF(__pyx_v_last_res);
752
/* "/home/vila/src/bzr/integration/trunk/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;}
1897
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":233
1898
* if (ann is last_ann and par_ann is last_parent):
1899
* Py_INCREF(last_res)
1900
* PyList_SetItem(annotations, ann_idx, last_res) # <<<<<<<<<<<<<<
1902
* new_ann = _combine_annotations(ann, par_ann, ann_cache)
1904
__pyx_t_1 = PyList_SetItem(__pyx_v_annotations, __pyx_v_ann_idx, __pyx_v_last_res); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
758
/* "/home/vila/src/bzr/integration/trunk/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;
1909
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":235
1910
* PyList_SetItem(annotations, ann_idx, last_res)
1912
* new_ann = _combine_annotations(ann, par_ann, ann_cache) # <<<<<<<<<<<<<<
1913
* Py_INCREF(new_ann)
1914
* PyList_SetItem(annotations, ann_idx, new_ann)
1916
__pyx_t_4 = __pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(__pyx_v_ann, __pyx_v_par_ann, __pyx_v_ann_cache); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1917
__Pyx_GOTREF(__pyx_t_4);
1918
__Pyx_DECREF(__pyx_v_new_ann);
1919
__pyx_v_new_ann = __pyx_t_4;
764
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":236 */
1922
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":236
1924
* new_ann = _combine_annotations(ann, par_ann, ann_cache)
1925
* Py_INCREF(new_ann) # <<<<<<<<<<<<<<
1926
* PyList_SetItem(annotations, ann_idx, new_ann)
765
1929
Py_INCREF(__pyx_v_new_ann);
767
/* "/home/vila/src/bzr/integration/trunk/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;}
1931
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":237
1932
* new_ann = _combine_annotations(ann, par_ann, ann_cache)
1933
* Py_INCREF(new_ann)
1934
* PyList_SetItem(annotations, ann_idx, new_ann) # <<<<<<<<<<<<<<
1936
* last_parent = par_ann
1938
__pyx_t_1 = PyList_SetItem(__pyx_v_annotations, __pyx_v_ann_idx, __pyx_v_new_ann); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
770
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":238 */
771
Py_INCREF(__pyx_v_ann);
772
Py_DECREF(__pyx_v_last_ann);
1940
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":238
1941
* Py_INCREF(new_ann)
1942
* PyList_SetItem(annotations, ann_idx, new_ann)
1943
* last_ann = ann # <<<<<<<<<<<<<<
1944
* last_parent = par_ann
1945
* last_res = new_ann
1947
__Pyx_INCREF(__pyx_v_ann);
1948
__Pyx_DECREF(__pyx_v_last_ann);
773
1949
__pyx_v_last_ann = __pyx_v_ann;
775
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":239 */
776
Py_INCREF(__pyx_v_par_ann);
777
Py_DECREF(__pyx_v_last_parent);
1951
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":239
1952
* PyList_SetItem(annotations, ann_idx, new_ann)
1954
* last_parent = par_ann # <<<<<<<<<<<<<<
1955
* last_res = new_ann
1958
__Pyx_INCREF(__pyx_v_par_ann);
1959
__Pyx_DECREF(__pyx_v_last_parent);
778
1960
__pyx_v_last_parent = __pyx_v_par_ann;
780
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":240 */
781
Py_INCREF(__pyx_v_new_ann);
782
Py_DECREF(__pyx_v_last_res);
1962
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":240
1964
* last_parent = par_ann
1965
* last_res = new_ann # <<<<<<<<<<<<<<
1969
__Pyx_INCREF(__pyx_v_new_ann);
1970
__Pyx_DECREF(__pyx_v_last_res);
783
1971
__pyx_v_last_res = __pyx_v_new_ann;
789
Py_DECREF(__pyx_2); __pyx_2 = 0;
791
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":241 */
1977
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1979
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":241
1980
* last_parent = par_ann
1981
* last_res = new_ann
1982
* return 0 # <<<<<<<<<<<<<<
1992
__Pyx_XDECREF(__pyx_t_3);
1993
__Pyx_XDECREF(__pyx_t_4);
1994
__Pyx_XDECREF(__pyx_t_5);
1995
__Pyx_XDECREF(__pyx_t_6);
1996
__Pyx_XDECREF(__pyx_t_7);
1997
__Pyx_XDECREF(__pyx_t_11);
801
1998
__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);
2001
__Pyx_DECREF(__pyx_v_last_ann);
2002
__Pyx_DECREF(__pyx_v_last_parent);
2003
__Pyx_DECREF(__pyx_v_last_res);
2004
__Pyx_DECREF(__pyx_v_par_ann);
2005
__Pyx_DECREF(__pyx_v_ann);
2006
__Pyx_DECREF(__pyx_v_new_ann);
2007
__Pyx_RefNannyFinishContext();
818
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2011
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":247
2012
* """Class that drives performing annotations."""
2014
* def _update_from_first_parent(self, key, annotations, lines, parent_key): # <<<<<<<<<<<<<<
2015
* """Reannotate this text relative to its first parent."""
2016
* (parent_annotations,
2019
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
819
2020
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) {
2021
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent = {__Pyx_NAMESTR("_update_from_first_parent"), (PyCFunction)__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent)};
2022
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
822
2023
PyObject *__pyx_v_self = 0;
823
2024
PyObject *__pyx_v_key = 0;
824
2025
PyObject *__pyx_v_annotations = 0;
826
2027
PyObject *__pyx_v_parent_key = 0;
827
2028
PyObject *__pyx_v_parent_annotations;
828
2029
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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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);
2030
PyObject *__pyx_r = NULL;
2031
PyObject *__pyx_t_1 = NULL;
2032
PyObject *__pyx_t_2 = NULL;
2033
PyObject *__pyx_t_3 = NULL;
2034
PyObject *__pyx_t_4 = NULL;
2036
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__key,&__pyx_n_s__annotations,&__pyx_n_s__lines,&__pyx_n_s__parent_key,0};
2037
__Pyx_RefNannySetupContext("_update_from_first_parent");
2038
__pyx_self = __pyx_self;
2039
if (unlikely(__pyx_kwds)) {
2040
Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2041
PyObject* values[5] = {0,0,0,0,0};
2042
switch (PyTuple_GET_SIZE(__pyx_args)) {
2043
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2044
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2045
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2046
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2047
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2049
default: goto __pyx_L5_argtuple_error;
2051
switch (PyTuple_GET_SIZE(__pyx_args)) {
2053
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
2054
if (likely(values[0])) kw_args--;
2055
else goto __pyx_L5_argtuple_error;
2057
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
2058
if (likely(values[1])) kw_args--;
2060
__Pyx_RaiseArgtupleInvalid("_update_from_first_parent", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2063
values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__annotations);
2064
if (likely(values[2])) kw_args--;
2066
__Pyx_RaiseArgtupleInvalid("_update_from_first_parent", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2069
values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lines);
2070
if (likely(values[3])) kw_args--;
2072
__Pyx_RaiseArgtupleInvalid("_update_from_first_parent", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2075
values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parent_key);
2076
if (likely(values[4])) kw_args--;
2078
__Pyx_RaiseArgtupleInvalid("_update_from_first_parent", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2081
if (unlikely(kw_args > 0)) {
2082
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_update_from_first_parent") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2084
__pyx_v_self = values[0];
2085
__pyx_v_key = values[1];
2086
__pyx_v_annotations = values[2];
2087
__pyx_v_lines = values[3];
2088
__pyx_v_parent_key = values[4];
2089
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
2090
goto __pyx_L5_argtuple_error;
2092
__pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
2093
__pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1);
2094
__pyx_v_annotations = PyTuple_GET_ITEM(__pyx_args, 2);
2095
__pyx_v_lines = PyTuple_GET_ITEM(__pyx_args, 3);
2096
__pyx_v_parent_key = PyTuple_GET_ITEM(__pyx_args, 4);
2098
goto __pyx_L4_argument_unpacking_done;
2099
__pyx_L5_argtuple_error:;
2100
__Pyx_RaiseArgtupleInvalid("_update_from_first_parent", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2102
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_first_parent");
2103
__Pyx_RefNannyFinishContext();
2105
__pyx_L4_argument_unpacking_done:;
2106
__pyx_v_parent_annotations = Py_None; __Pyx_INCREF(Py_None);
2107
__pyx_v_matching_blocks = Py_None; __Pyx_INCREF(Py_None);
2109
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":250
2110
* """Reannotate this text relative to its first parent."""
2111
* (parent_annotations,
2112
* matching_blocks) = self._get_parent_annotations_and_matches( # <<<<<<<<<<<<<<
2113
* key, lines, parent_key)
2116
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2117
__Pyx_GOTREF(__pyx_t_1);
2119
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":251
2120
* (parent_annotations,
2121
* matching_blocks) = self._get_parent_annotations_and_matches(
2122
* key, lines, parent_key) # <<<<<<<<<<<<<<
2124
* _apply_parent_annotations(annotations, parent_annotations,
2126
__pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2127
__Pyx_GOTREF(__pyx_t_2);
2128
__Pyx_INCREF(__pyx_v_key);
2129
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
2130
__Pyx_GIVEREF(__pyx_v_key);
2131
__Pyx_INCREF(__pyx_v_lines);
2132
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_lines);
2133
__Pyx_GIVEREF(__pyx_v_lines);
2134
__Pyx_INCREF(__pyx_v_parent_key);
2135
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_parent_key);
2136
__Pyx_GIVEREF(__pyx_v_parent_key);
2137
__pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2138
__Pyx_GOTREF(__pyx_t_3);
2139
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2140
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2141
if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
2142
PyObject* tuple = __pyx_t_3;
2143
__pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
2144
__pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
2146
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":249
2147
* def _update_from_first_parent(self, key, annotations, lines, parent_key):
2148
* """Reannotate this text relative to its first parent."""
2149
* (parent_annotations, # <<<<<<<<<<<<<<
2150
* matching_blocks) = self._get_parent_annotations_and_matches(
2151
* key, lines, parent_key)
2153
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2154
__Pyx_DECREF(__pyx_v_parent_annotations);
2155
__pyx_v_parent_annotations = __pyx_t_2;
2157
__Pyx_DECREF(__pyx_v_matching_blocks);
2158
__pyx_v_matching_blocks = __pyx_t_1;
2161
__pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2162
__Pyx_GOTREF(__pyx_t_4);
2163
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2164
__pyx_t_2 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2165
__Pyx_GOTREF(__pyx_t_2);
2166
__pyx_t_1 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2167
__Pyx_GOTREF(__pyx_t_1);
2168
if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2169
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2170
__Pyx_DECREF(__pyx_v_parent_annotations);
2171
__pyx_v_parent_annotations = __pyx_t_2;
2173
__Pyx_DECREF(__pyx_v_matching_blocks);
2174
__pyx_v_matching_blocks = __pyx_t_1;
2178
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":254
2180
* _apply_parent_annotations(annotations, parent_annotations,
2181
* matching_blocks) # <<<<<<<<<<<<<<
2183
* def _update_from_other_parents(self, key, annotations, lines,
2185
__pyx_t_5 = __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(__pyx_v_annotations, __pyx_v_parent_annotations, __pyx_v_matching_blocks); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2187
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
2190
__Pyx_XDECREF(__pyx_t_1);
2191
__Pyx_XDECREF(__pyx_t_2);
2192
__Pyx_XDECREF(__pyx_t_3);
2193
__Pyx_XDECREF(__pyx_t_4);
878
2194
__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);
2197
__Pyx_DECREF(__pyx_v_parent_annotations);
2198
__Pyx_DECREF(__pyx_v_matching_blocks);
2199
__Pyx_XGIVEREF(__pyx_r);
2200
__Pyx_RefNannyFinishContext();
891
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2204
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":256
2207
* def _update_from_other_parents(self, key, annotations, lines, # <<<<<<<<<<<<<<
2208
* this_annotation, parent_key):
2209
* """Reannotate this text relative to a second (or more) parent."""
2212
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
892
2213
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) {
2214
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents = {__Pyx_NAMESTR("_update_from_other_parents"), (PyCFunction)__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents)};
2215
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
895
2216
PyObject *__pyx_v_self = 0;
896
2217
PyObject *__pyx_v_key = 0;
897
2218
PyObject *__pyx_v_annotations = 0;
900
2221
PyObject *__pyx_v_parent_key = 0;
901
2222
PyObject *__pyx_v_parent_annotations;
902
2223
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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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);
2224
PyObject *__pyx_r = NULL;
2225
PyObject *__pyx_t_1 = NULL;
2226
PyObject *__pyx_t_2 = NULL;
2227
PyObject *__pyx_t_3 = NULL;
2228
PyObject *__pyx_t_4 = NULL;
2230
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__key,&__pyx_n_s__annotations,&__pyx_n_s__lines,&__pyx_n_s__this_annotation,&__pyx_n_s__parent_key,0};
2231
__Pyx_RefNannySetupContext("_update_from_other_parents");
2232
__pyx_self = __pyx_self;
2233
if (unlikely(__pyx_kwds)) {
2234
Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2235
PyObject* values[6] = {0,0,0,0,0,0};
2236
switch (PyTuple_GET_SIZE(__pyx_args)) {
2237
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2238
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2239
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2240
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2241
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2242
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2244
default: goto __pyx_L5_argtuple_error;
2246
switch (PyTuple_GET_SIZE(__pyx_args)) {
2248
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
2249
if (likely(values[0])) kw_args--;
2250
else goto __pyx_L5_argtuple_error;
2252
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
2253
if (likely(values[1])) kw_args--;
2255
__Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2258
values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__annotations);
2259
if (likely(values[2])) kw_args--;
2261
__Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2264
values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lines);
2265
if (likely(values[3])) kw_args--;
2267
__Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2270
values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__this_annotation);
2271
if (likely(values[4])) kw_args--;
2273
__Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2276
values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parent_key);
2277
if (likely(values[5])) kw_args--;
2279
__Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2282
if (unlikely(kw_args > 0)) {
2283
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_update_from_other_parents") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2285
__pyx_v_self = values[0];
2286
__pyx_v_key = values[1];
2287
__pyx_v_annotations = values[2];
2288
__pyx_v_lines = values[3];
2289
__pyx_v_this_annotation = values[4];
2290
__pyx_v_parent_key = values[5];
2291
} else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
2292
goto __pyx_L5_argtuple_error;
2294
__pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
2295
__pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1);
2296
__pyx_v_annotations = PyTuple_GET_ITEM(__pyx_args, 2);
2297
__pyx_v_lines = PyTuple_GET_ITEM(__pyx_args, 3);
2298
__pyx_v_this_annotation = PyTuple_GET_ITEM(__pyx_args, 4);
2299
__pyx_v_parent_key = PyTuple_GET_ITEM(__pyx_args, 5);
2301
goto __pyx_L4_argument_unpacking_done;
2302
__pyx_L5_argtuple_error:;
2303
__Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2305
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_other_parents");
2306
__Pyx_RefNannyFinishContext();
2308
__pyx_L4_argument_unpacking_done:;
2309
__pyx_v_parent_annotations = Py_None; __Pyx_INCREF(Py_None);
2310
__pyx_v_matching_blocks = Py_None; __Pyx_INCREF(Py_None);
2312
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":260
2313
* """Reannotate this text relative to a second (or more) parent."""
2314
* (parent_annotations,
2315
* matching_blocks) = self._get_parent_annotations_and_matches( # <<<<<<<<<<<<<<
2316
* key, lines, parent_key)
2317
* _merge_annotations(this_annotation, annotations, parent_annotations,
2319
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2320
__Pyx_GOTREF(__pyx_t_1);
2322
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":261
2323
* (parent_annotations,
2324
* matching_blocks) = self._get_parent_annotations_and_matches(
2325
* key, lines, parent_key) # <<<<<<<<<<<<<<
2326
* _merge_annotations(this_annotation, annotations, parent_annotations,
2327
* matching_blocks, self._ann_tuple_cache)
2329
__pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2330
__Pyx_GOTREF(__pyx_t_2);
2331
__Pyx_INCREF(__pyx_v_key);
2332
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
2333
__Pyx_GIVEREF(__pyx_v_key);
2334
__Pyx_INCREF(__pyx_v_lines);
2335
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_lines);
2336
__Pyx_GIVEREF(__pyx_v_lines);
2337
__Pyx_INCREF(__pyx_v_parent_key);
2338
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_parent_key);
2339
__Pyx_GIVEREF(__pyx_v_parent_key);
2340
__pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2341
__Pyx_GOTREF(__pyx_t_3);
2342
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2343
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2344
if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
2345
PyObject* tuple = __pyx_t_3;
2346
__pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
2347
__pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
2349
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":259
2350
* this_annotation, parent_key):
2351
* """Reannotate this text relative to a second (or more) parent."""
2352
* (parent_annotations, # <<<<<<<<<<<<<<
2353
* matching_blocks) = self._get_parent_annotations_and_matches(
2354
* key, lines, parent_key)
2356
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2357
__Pyx_DECREF(__pyx_v_parent_annotations);
2358
__pyx_v_parent_annotations = __pyx_t_2;
2360
__Pyx_DECREF(__pyx_v_matching_blocks);
2361
__pyx_v_matching_blocks = __pyx_t_1;
2364
__pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2365
__Pyx_GOTREF(__pyx_t_4);
2366
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2367
__pyx_t_2 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2368
__Pyx_GOTREF(__pyx_t_2);
2369
__pyx_t_1 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2370
__Pyx_GOTREF(__pyx_t_1);
2371
if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2372
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2373
__Pyx_DECREF(__pyx_v_parent_annotations);
2374
__pyx_v_parent_annotations = __pyx_t_2;
2376
__Pyx_DECREF(__pyx_v_matching_blocks);
2377
__pyx_v_matching_blocks = __pyx_t_1;
2381
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":263
2382
* key, lines, parent_key)
2383
* _merge_annotations(this_annotation, annotations, parent_annotations,
2384
* matching_blocks, self._ann_tuple_cache) # <<<<<<<<<<<<<<
2386
* def annotate_flat(self, key):
2388
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___ann_tuple_cache); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2389
__Pyx_GOTREF(__pyx_t_3);
2390
__pyx_t_5 = __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(__pyx_v_this_annotation, __pyx_v_annotations, __pyx_v_parent_annotations, __pyx_v_matching_blocks, __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2391
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2393
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
2396
__Pyx_XDECREF(__pyx_t_1);
2397
__Pyx_XDECREF(__pyx_t_2);
2398
__Pyx_XDECREF(__pyx_t_3);
2399
__Pyx_XDECREF(__pyx_t_4);
955
2400
__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);
2403
__Pyx_DECREF(__pyx_v_parent_annotations);
2404
__Pyx_DECREF(__pyx_v_matching_blocks);
2405
__Pyx_XGIVEREF(__pyx_r);
2406
__Pyx_RefNannyFinishContext();
969
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2410
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":265
2411
* matching_blocks, self._ann_tuple_cache)
2413
* def annotate_flat(self, key): # <<<<<<<<<<<<<<
2414
* """Determine the single-best-revision to source for each line.
2418
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
970
2419
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) {
2420
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat = {__Pyx_NAMESTR("annotate_flat"), (PyCFunction)__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat)};
2421
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
973
2422
PyObject *__pyx_v_self = 0;
974
2423
PyObject *__pyx_v_key = 0;
975
2424
Py_ssize_t __pyx_v_pos;
984
2433
PyObject *__pyx_v_line;
985
2434
PyObject *__pyx_v_head;
986
2435
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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":279 */
1068
for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_v_num_lines; ++__pyx_v_pos) {
1070
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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;
2436
PyObject *__pyx_r = NULL;
2437
PyObject *__pyx_t_1 = NULL;
2438
PyObject *__pyx_t_2 = NULL;
2439
PyObject *__pyx_t_3 = NULL;
2440
PyObject *__pyx_t_4 = NULL;
2441
Py_ssize_t __pyx_t_5;
2442
Py_ssize_t __pyx_t_6;
2445
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__key,0};
2446
__Pyx_RefNannySetupContext("annotate_flat");
2447
__pyx_self = __pyx_self;
2448
if (unlikely(__pyx_kwds)) {
2449
Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2450
PyObject* values[2] = {0,0};
2451
switch (PyTuple_GET_SIZE(__pyx_args)) {
2452
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2453
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2455
default: goto __pyx_L5_argtuple_error;
2457
switch (PyTuple_GET_SIZE(__pyx_args)) {
2459
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
2460
if (likely(values[0])) kw_args--;
2461
else goto __pyx_L5_argtuple_error;
2463
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
2464
if (likely(values[1])) kw_args--;
2466
__Pyx_RaiseArgtupleInvalid("annotate_flat", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2469
if (unlikely(kw_args > 0)) {
2470
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "annotate_flat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2472
__pyx_v_self = values[0];
2473
__pyx_v_key = values[1];
2474
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2475
goto __pyx_L5_argtuple_error;
2477
__pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
2478
__pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1);
2480
goto __pyx_L4_argument_unpacking_done;
2481
__pyx_L5_argtuple_error:;
2482
__Pyx_RaiseArgtupleInvalid("annotate_flat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2484
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator.annotate_flat");
2485
__Pyx_RefNannyFinishContext();
2487
__pyx_L4_argument_unpacking_done:;
2488
__pyx_v_annotate = Py_None; __Pyx_INCREF(Py_None);
2489
__pyx_v_custom_tiebreaker = Py_None; __Pyx_INCREF(Py_None);
2490
__pyx_v_annotations = Py_None; __Pyx_INCREF(Py_None);
2491
__pyx_v_lines = Py_None; __Pyx_INCREF(Py_None);
2492
__pyx_v_out = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
2493
__pyx_v_heads = Py_None; __Pyx_INCREF(Py_None);
2494
__pyx_v_annotation = Py_None; __Pyx_INCREF(Py_None);
2495
__pyx_v_line = Py_None; __Pyx_INCREF(Py_None);
2496
__pyx_v_head = Py_None; __Pyx_INCREF(Py_None);
2497
__pyx_v_the_heads = Py_None; __Pyx_INCREF(Py_None);
2499
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":272
2500
* cdef Py_ssize_t pos, num_lines
2502
* from bzrlib import annotate # <<<<<<<<<<<<<<
2504
* custom_tiebreaker = annotate._break_annotation_tie
2506
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2507
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
2508
__Pyx_INCREF(((PyObject *)__pyx_n_s__annotate));
2509
PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__annotate));
2510
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__annotate));
2511
__pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__bzrlib), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2512
__Pyx_GOTREF(__pyx_t_2);
2513
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2514
__pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__annotate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2515
__Pyx_GOTREF(__pyx_t_1);
2516
__Pyx_INCREF(__pyx_t_1);
2517
__Pyx_DECREF(__pyx_v_annotate);
2518
__pyx_v_annotate = __pyx_t_1;
2519
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2520
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2522
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":274
2523
* from bzrlib import annotate
2525
* custom_tiebreaker = annotate._break_annotation_tie # <<<<<<<<<<<<<<
2526
* annotations, lines = self.annotate(key)
2527
* num_lines = len(lines)
2529
__pyx_t_2 = PyObject_GetAttr(__pyx_v_annotate, __pyx_n_s_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2530
__Pyx_GOTREF(__pyx_t_2);
2531
__Pyx_DECREF(__pyx_v_custom_tiebreaker);
2532
__pyx_v_custom_tiebreaker = __pyx_t_2;
2535
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":275
2537
* custom_tiebreaker = annotate._break_annotation_tie
2538
* annotations, lines = self.annotate(key) # <<<<<<<<<<<<<<
2539
* num_lines = len(lines)
2542
__pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__annotate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2543
__Pyx_GOTREF(__pyx_t_2);
2544
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2545
__Pyx_GOTREF(__pyx_t_1);
2546
__Pyx_INCREF(__pyx_v_key);
2547
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
2548
__Pyx_GIVEREF(__pyx_v_key);
2549
__pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2550
__Pyx_GOTREF(__pyx_t_3);
2551
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2552
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2553
if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
2554
PyObject* tuple = __pyx_t_3;
2555
__pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
2556
__pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2);
2557
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2558
__Pyx_DECREF(__pyx_v_annotations);
2559
__pyx_v_annotations = __pyx_t_1;
2561
__Pyx_DECREF(__pyx_v_lines);
2562
__pyx_v_lines = __pyx_t_2;
2565
__pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2566
__Pyx_GOTREF(__pyx_t_4);
2567
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2568
__pyx_t_1 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2569
__Pyx_GOTREF(__pyx_t_1);
2570
__pyx_t_2 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2571
__Pyx_GOTREF(__pyx_t_2);
2572
if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2573
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2574
__Pyx_DECREF(__pyx_v_annotations);
2575
__pyx_v_annotations = __pyx_t_1;
2577
__Pyx_DECREF(__pyx_v_lines);
2578
__pyx_v_lines = __pyx_t_2;
2582
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":276
2583
* custom_tiebreaker = annotate._break_annotation_tie
2584
* annotations, lines = self.annotate(key)
2585
* num_lines = len(lines) # <<<<<<<<<<<<<<
2587
* heads = self._get_heads_provider().heads
2589
__pyx_t_5 = PyObject_Length(__pyx_v_lines); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2590
__pyx_v_num_lines = __pyx_t_5;
2592
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":277
2593
* annotations, lines = self.annotate(key)
2594
* num_lines = len(lines)
2595
* out = [] # <<<<<<<<<<<<<<
2596
* heads = self._get_heads_provider().heads
2597
* for pos from 0 <= pos < num_lines:
2599
__pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2600
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
2601
__Pyx_DECREF(((PyObject *)__pyx_v_out));
2602
__pyx_v_out = __pyx_t_3;
2605
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":278
2606
* num_lines = len(lines)
2608
* heads = self._get_heads_provider().heads # <<<<<<<<<<<<<<
2609
* for pos from 0 <= pos < num_lines:
2610
* annotation = annotations[pos]
2612
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___get_heads_provider); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2613
__Pyx_GOTREF(__pyx_t_3);
2614
__pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2615
__Pyx_GOTREF(__pyx_t_2);
2616
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2617
__pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__heads); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2618
__Pyx_GOTREF(__pyx_t_3);
2619
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2620
__Pyx_DECREF(__pyx_v_heads);
2621
__pyx_v_heads = __pyx_t_3;
2624
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":279
2626
* heads = self._get_heads_provider().heads
2627
* for pos from 0 <= pos < num_lines: # <<<<<<<<<<<<<<
2628
* annotation = annotations[pos]
2631
__pyx_t_5 = __pyx_v_num_lines;
2632
for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_t_5; __pyx_v_pos++) {
2634
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":280
2635
* heads = self._get_heads_provider().heads
2636
* for pos from 0 <= pos < num_lines:
2637
* annotation = annotations[pos] # <<<<<<<<<<<<<<
2639
* if len(annotation) == 1:
2641
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_annotations, __pyx_v_pos, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2642
__Pyx_GOTREF(__pyx_t_3);
2643
__Pyx_DECREF(__pyx_v_annotation);
2644
__pyx_v_annotation = __pyx_t_3;
2647
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":281
2648
* for pos from 0 <= pos < num_lines:
2649
* annotation = annotations[pos]
2650
* line = lines[pos] # <<<<<<<<<<<<<<
2651
* if len(annotation) == 1:
2652
* head = annotation[0]
2654
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_lines, __pyx_v_pos, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2655
__Pyx_GOTREF(__pyx_t_3);
2656
__Pyx_DECREF(__pyx_v_line);
2657
__pyx_v_line = __pyx_t_3;
2660
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":282
2661
* annotation = annotations[pos]
2663
* if len(annotation) == 1: # <<<<<<<<<<<<<<
2664
* head = annotation[0]
2667
__pyx_t_6 = PyObject_Length(__pyx_v_annotation); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2668
__pyx_t_7 = (__pyx_t_6 == 1);
2671
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":283
2673
* if len(annotation) == 1:
2674
* head = annotation[0] # <<<<<<<<<<<<<<
2676
* the_heads = heads(annotation)
2678
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_annotation, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2679
__Pyx_GOTREF(__pyx_t_3);
2680
__Pyx_DECREF(__pyx_v_head);
2681
__pyx_v_head = __pyx_t_3;
1094
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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;}
2687
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":285
2688
* head = annotation[0]
2690
* the_heads = heads(annotation) # <<<<<<<<<<<<<<
2691
* if len(the_heads) == 1:
2692
* for head in the_heads: break # get the item out of the set
2694
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2695
__Pyx_GOTREF(__pyx_t_3);
2696
__Pyx_INCREF(__pyx_v_annotation);
2697
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_annotation);
2698
__Pyx_GIVEREF(__pyx_v_annotation);
2699
__pyx_t_2 = PyObject_Call(__pyx_v_heads, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2700
__Pyx_GOTREF(__pyx_t_2);
2701
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2702
__Pyx_DECREF(__pyx_v_the_heads);
2703
__pyx_v_the_heads = __pyx_t_2;
2706
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":286
2708
* the_heads = heads(annotation)
2709
* if len(the_heads) == 1: # <<<<<<<<<<<<<<
2710
* for head in the_heads: break # get the item out of the set
2713
__pyx_t_6 = PyObject_Length(__pyx_v_the_heads); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2714
__pyx_t_7 = (__pyx_t_6 == 1);
2717
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":287
2718
* the_heads = heads(annotation)
2719
* if len(the_heads) == 1:
2720
* for head in the_heads: break # get the item out of the set # <<<<<<<<<<<<<<
2722
* # We need to resolve the ambiguity, for now just pick the
2724
if (PyList_CheckExact(__pyx_v_the_heads) || PyTuple_CheckExact(__pyx_v_the_heads)) {
2725
__pyx_t_6 = 0; __pyx_t_2 = __pyx_v_the_heads; __Pyx_INCREF(__pyx_t_2);
2727
__pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_the_heads); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2728
__Pyx_GOTREF(__pyx_t_2);
1110
__pyx_3 = PyIter_Next(__pyx_2);
1112
if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
2731
if (likely(PyList_CheckExact(__pyx_t_2))) {
2732
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
2733
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++;
2734
} else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
2735
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
2736
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++;
2738
__pyx_t_3 = PyIter_Next(__pyx_t_2);
2740
if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2743
__Pyx_GOTREF(__pyx_t_3);
1115
Py_DECREF(__pyx_v_head);
1116
__pyx_v_head = __pyx_3;
2745
__Pyx_DECREF(__pyx_v_head);
2746
__pyx_v_head = __pyx_t_3;
2748
goto __pyx_L11_break;
1121
Py_DECREF(__pyx_2); __pyx_2 = 0;
2751
__Pyx_DECREF(__pyx_t_2); __pyx_t_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;
2756
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":291
2757
* # We need to resolve the ambiguity, for now just pick the
2759
* head = self._resolve_annotation_tie(the_heads, line, # <<<<<<<<<<<<<<
2760
* custom_tiebreaker)
2761
* PyList_Append(out, (head, line))
2763
__pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2764
__Pyx_GOTREF(__pyx_t_2);
2766
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":292
2768
* head = self._resolve_annotation_tie(the_heads, line,
2769
* custom_tiebreaker) # <<<<<<<<<<<<<<
2770
* PyList_Append(out, (head, line))
2773
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2774
__Pyx_GOTREF(__pyx_t_3);
2775
__Pyx_INCREF(__pyx_v_the_heads);
2776
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_the_heads);
2777
__Pyx_GIVEREF(__pyx_v_the_heads);
2778
__Pyx_INCREF(__pyx_v_line);
2779
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_line);
2780
__Pyx_GIVEREF(__pyx_v_line);
2781
__Pyx_INCREF(__pyx_v_custom_tiebreaker);
2782
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_custom_tiebreaker);
2783
__Pyx_GIVEREF(__pyx_v_custom_tiebreaker);
2784
__pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2785
__Pyx_GOTREF(__pyx_t_1);
2786
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2787
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2788
__Pyx_DECREF(__pyx_v_head);
2789
__pyx_v_head = __pyx_t_1;
1144
/* "/home/vila/src/bzr/integration/trunk/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;
2796
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":293
2797
* head = self._resolve_annotation_tie(the_heads, line,
2798
* custom_tiebreaker)
2799
* PyList_Append(out, (head, line)) # <<<<<<<<<<<<<<
2802
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2803
__Pyx_GOTREF(__pyx_t_1);
2804
__Pyx_INCREF(__pyx_v_head);
2805
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_head);
2806
__Pyx_GIVEREF(__pyx_v_head);
2807
__Pyx_INCREF(__pyx_v_line);
2808
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_line);
2809
__Pyx_GIVEREF(__pyx_v_line);
2810
__pyx_t_8 = PyList_Append(((PyObject *)__pyx_v_out), __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2811
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1154
/* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":294 */
1155
Py_INCREF(__pyx_v_out);
1156
__pyx_r = __pyx_v_out;
2814
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":294
2815
* custom_tiebreaker)
2816
* PyList_Append(out, (head, line))
2817
* return out # <<<<<<<<<<<<<<
2819
__Pyx_XDECREF(__pyx_r);
2820
__Pyx_INCREF(((PyObject *)__pyx_v_out));
2821
__pyx_r = ((PyObject *)__pyx_v_out);
1159
__pyx_r = Py_None; Py_INCREF(Py_None);
2824
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
1162
Py_XDECREF(__pyx_1);
1163
Py_XDECREF(__pyx_2);
1164
Py_XDECREF(__pyx_3);
2827
__Pyx_XDECREF(__pyx_t_1);
2828
__Pyx_XDECREF(__pyx_t_2);
2829
__Pyx_XDECREF(__pyx_t_3);
2830
__Pyx_XDECREF(__pyx_t_4);
1165
2831
__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);
2834
__Pyx_DECREF(__pyx_v_annotate);
2835
__Pyx_DECREF(__pyx_v_custom_tiebreaker);
2836
__Pyx_DECREF(__pyx_v_annotations);
2837
__Pyx_DECREF(__pyx_v_lines);
2838
__Pyx_DECREF(__pyx_v_out);
2839
__Pyx_DECREF(__pyx_v_heads);
2840
__Pyx_DECREF(__pyx_v_annotation);
2841
__Pyx_DECREF(__pyx_v_line);
2842
__Pyx_DECREF(__pyx_v_head);
2843
__Pyx_DECREF(__pyx_v_the_heads);
2844
__Pyx_XGIVEREF(__pyx_r);
2845
__Pyx_RefNannyFinishContext();
1180
2846
return __pyx_r;
1183
static struct PyMethodDef __pyx_methods[] = {
2849
static PyMethodDef __pyx_methods[] = {
1187
static void __pyx_init_filenames(void); /*proto*/
2853
#if PY_MAJOR_VERSION >= 3
2854
static struct PyModuleDef __pyx_moduledef = {
2855
PyModuleDef_HEAD_INIT,
2856
__Pyx_NAMESTR("_annotator_pyx"),
2857
__Pyx_DOCSTR(__pyx_k_9), /* m_doc */
2859
__pyx_methods /* m_methods */,
2860
NULL, /* m_reload */
2861
NULL, /* m_traverse */
2867
static __Pyx_StringTabEntry __pyx_string_tab[] = {
2868
{&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
2869
{&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
2870
{&__pyx_n_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 1},
2871
{&__pyx_n_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 1},
2872
{&__pyx_kp_u_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 1, 0, 0},
2873
{&__pyx_kp_u_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 1, 0, 0},
2874
{&__pyx_kp_u_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 1, 0, 0},
2875
{&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
2876
{&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
2877
{&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
2878
{&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
2879
{&__pyx_n_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 1},
2880
{&__pyx_n_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 1},
2881
{&__pyx_n_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 1},
2882
{&__pyx_n_s__Annotator, __pyx_k__Annotator, sizeof(__pyx_k__Annotator), 0, 0, 1, 1},
2883
{&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
2884
{&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
2885
{&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
2886
{&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
2887
{&__pyx_n_s___ann_tuple_cache, __pyx_k___ann_tuple_cache, sizeof(__pyx_k___ann_tuple_cache), 0, 0, 1, 1},
2888
{&__pyx_n_s___annotator_py, __pyx_k___annotator_py, sizeof(__pyx_k___annotator_py), 0, 0, 1, 1},
2889
{&__pyx_n_s___get_heads_provider, __pyx_k___get_heads_provider, sizeof(__pyx_k___get_heads_provider), 0, 0, 1, 1},
2890
{&__pyx_n_s__annotate, __pyx_k__annotate, sizeof(__pyx_k__annotate), 0, 0, 1, 1},
2891
{&__pyx_n_s__annotate_flat, __pyx_k__annotate_flat, sizeof(__pyx_k__annotate_flat), 0, 0, 1, 1},
2892
{&__pyx_n_s__annotations, __pyx_k__annotations, sizeof(__pyx_k__annotations), 0, 0, 1, 1},
2893
{&__pyx_n_s__bzrlib, __pyx_k__bzrlib, sizeof(__pyx_k__bzrlib), 0, 0, 1, 1},
2894
{&__pyx_n_s__heads, __pyx_k__heads, sizeof(__pyx_k__heads), 0, 0, 1, 1},
2895
{&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1},
2896
{&__pyx_n_s__lines, __pyx_k__lines, sizeof(__pyx_k__lines), 0, 0, 1, 1},
2897
{&__pyx_n_s__ob_item, __pyx_k__ob_item, sizeof(__pyx_k__ob_item), 0, 0, 1, 1},
2898
{&__pyx_n_s__parent_key, __pyx_k__parent_key, sizeof(__pyx_k__parent_key), 0, 0, 1, 1},
2899
{&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
2900
{&__pyx_n_s__this_annotation, __pyx_k__this_annotation, sizeof(__pyx_k__this_annotation), 0, 0, 1, 1},
2901
{0, 0, 0, 0, 0, 0, 0}
2903
static int __Pyx_InitCachedBuiltins(void) {
2904
__pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2905
__pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2911
static int __Pyx_InitGlobals(void) {
2912
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
2918
#if PY_MAJOR_VERSION < 3
1189
2919
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;};
2920
PyMODINIT_FUNC init_annotator_pyx(void)
2922
PyMODINIT_FUNC PyInit__annotator_pyx(void); /*proto*/
2923
PyMODINIT_FUNC PyInit__annotator_pyx(void)
2926
PyObject *__pyx_t_1 = NULL;
2927
PyObject *__pyx_t_2 = NULL;
2928
PyObject *__pyx_t_3 = NULL;
2929
PyObject *__pyx_t_4 = NULL;
2931
void* __pyx_refnanny = NULL;
2932
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
2933
if (!__Pyx_RefNanny) {
2935
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
2936
if (!__Pyx_RefNanny)
2937
Py_FatalError("failed to import 'refnanny' module");
2939
__pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__annotator_pyx(void)", __LINE__, __FILE__);
2941
__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2942
__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2943
#ifdef __pyx_binding_PyCFunctionType_USED
2944
if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2946
/*--- Library function declarations ---*/
2947
/*--- Threads initialization code ---*/
2948
#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
2949
#ifdef WITH_THREAD /* Python build with threading support? */
2950
PyEval_InitThreads();
2953
/*--- Module creation code ---*/
2954
#if PY_MAJOR_VERSION < 3
2955
__pyx_m = Py_InitModule4(__Pyx_NAMESTR("_annotator_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_9), 0, PYTHON_API_VERSION);
2957
__pyx_m = PyModule_Create(&__pyx_moduledef);
2959
if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
2960
#if PY_MAJOR_VERSION < 3
1198
2961
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;};
1204
/* "/home/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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/vila/src/bzr/integration/trunk/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;
2963
__pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
2964
if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
2965
if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
2966
/*--- Initialize various global constants etc. ---*/
2967
if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2968
if (__pyx_module_is_main_bzrlib___annotator_pyx) {
2969
if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
2971
/*--- Builtin init code ---*/
2972
if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2973
/*--- Global init code ---*/
2974
/*--- Function export code ---*/
2975
/*--- Type init code ---*/
2976
/*--- Type import code ---*/
2977
/*--- Function import code ---*/
2978
/*--- Execution code ---*/
2980
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":58
2983
* from bzrlib import _annotator_py # <<<<<<<<<<<<<<
2987
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2988
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
2989
__Pyx_INCREF(((PyObject *)__pyx_n_s___annotator_py));
2990
PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s___annotator_py));
2991
__Pyx_GIVEREF(((PyObject *)__pyx_n_s___annotator_py));
2992
__pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__bzrlib), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2993
__Pyx_GOTREF(__pyx_t_2);
2994
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2995
__pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___annotator_py); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2996
__Pyx_GOTREF(__pyx_t_1);
2997
if (PyObject_SetAttr(__pyx_m, __pyx_n_s___annotator_py, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2998
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2999
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3001
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":244
3004
* class Annotator(_annotator_py.Annotator): # <<<<<<<<<<<<<<
3005
* """Class that drives performing annotations."""
3008
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3009
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
3010
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___annotator_py); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3011
__Pyx_GOTREF(__pyx_t_1);
3012
__pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__Annotator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3013
__Pyx_GOTREF(__pyx_t_3);
3014
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3015
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3016
__Pyx_GOTREF(__pyx_t_1);
3017
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
3018
__Pyx_GIVEREF(__pyx_t_3);
3020
if (PyDict_SetItemString(((PyObject *)__pyx_t_2), "__doc__", ((PyObject *)__pyx_kp_s_10)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3021
__pyx_t_3 = __Pyx_CreateClass(__pyx_t_1, ((PyObject *)__pyx_t_2), __pyx_n_s__Annotator, "bzrlib._annotator_pyx"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3022
__Pyx_GOTREF(__pyx_t_3);
3023
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3025
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":247
3026
* """Class that drives performing annotations."""
3028
* def _update_from_first_parent(self, key, annotations, lines, parent_key): # <<<<<<<<<<<<<<
3029
* """Reannotate this text relative to its first parent."""
3030
* (parent_annotations,
3032
__pyx_t_1 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3033
__Pyx_GOTREF(__pyx_t_1);
3034
__pyx_t_4 = PyMethod_New(__pyx_t_1, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3035
__Pyx_GOTREF(__pyx_t_4);
3036
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3037
if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s_11, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3038
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3040
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":256
3043
* def _update_from_other_parents(self, key, annotations, lines, # <<<<<<<<<<<<<<
3044
* this_annotation, parent_key):
3045
* """Reannotate this text relative to a second (or more) parent."""
3047
__pyx_t_4 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3048
__Pyx_GOTREF(__pyx_t_4);
3049
__pyx_t_1 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3050
__Pyx_GOTREF(__pyx_t_1);
3051
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3052
if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s_12, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3053
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3055
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":265
3056
* matching_blocks, self._ann_tuple_cache)
3058
* def annotate_flat(self, key): # <<<<<<<<<<<<<<
3059
* """Determine the single-best-revision to source for each line.
3062
__pyx_t_1 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3063
__Pyx_GOTREF(__pyx_t_1);
3064
__pyx_t_4 = PyMethod_New(__pyx_t_1, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3065
__Pyx_GOTREF(__pyx_t_4);
3066
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3067
if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__annotate_flat, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3068
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3069
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Annotator, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3070
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3071
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3073
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":1
3074
* # Copyright (C) 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<<
3076
* # This program is free software; you can redistribute it and/or modify
3078
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3079
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
3080
__pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Annotator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3081
__Pyx_GOTREF(__pyx_t_3);
3082
__pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3083
__Pyx_GOTREF(__pyx_t_4);
3084
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3085
__pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3086
__Pyx_GOTREF(__pyx_t_3);
3087
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3088
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_13), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3089
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3090
__pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Annotator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3091
__Pyx_GOTREF(__pyx_t_3);
3092
__pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s_12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3093
__Pyx_GOTREF(__pyx_t_4);
3094
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3095
__pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3096
__Pyx_GOTREF(__pyx_t_3);
3097
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3098
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_14), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3099
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3100
__pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Annotator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3101
__Pyx_GOTREF(__pyx_t_3);
3102
__pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__annotate_flat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3103
__Pyx_GOTREF(__pyx_t_4);
3104
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3105
__pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3106
__Pyx_GOTREF(__pyx_t_3);
3107
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3108
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_15), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3109
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3110
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3111
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3114
__Pyx_XDECREF(__pyx_t_1);
3115
__Pyx_XDECREF(__pyx_t_2);
3116
__Pyx_XDECREF(__pyx_t_3);
3117
__Pyx_XDECREF(__pyx_t_4);
3119
__Pyx_AddTraceback("init bzrlib._annotator_pyx");
3120
Py_DECREF(__pyx_m); __pyx_m = 0;
3121
} else if (!PyErr_Occurred()) {
3122
PyErr_SetString(PyExc_ImportError, "init bzrlib._annotator_pyx");
3125
__Pyx_RefNannyFinishContext();
3126
#if PY_MAJOR_VERSION < 3
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
3133
/* 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) {
3135
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
3137
result = PyObject_GetAttr(dict, name);
3139
PyErr_SetObject(PyExc_NameError, name);
3143
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
3144
PyErr_Format(PyExc_ValueError,
3145
#if PY_VERSION_HEX < 0x02050000
3146
"need more than %d value%s to unpack", (int)index,
3148
"need more than %zd value%s to unpack", index,
3150
(index == 1) ? "" : "s");
3153
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
3154
PyErr_Format(PyExc_ValueError,
3155
#if PY_VERSION_HEX < 0x02050000
3156
"too many values to unpack (expected %d)", (int)expected);
3158
"too many values to unpack (expected %zd)", expected);
3162
static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
1337
3163
PyObject *item;
1338
3164
if (!(item = PyIter_Next(iter))) {
1339
if (!PyErr_Occurred())
1340
__Pyx_UnpackError();
3165
if (!PyErr_Occurred()) {
3166
__Pyx_RaiseNeedMoreValuesError(index);
1345
static int __Pyx_EndUnpack(PyObject *iter) {
3172
static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) {
1346
3173
PyObject *item;
1347
3174
if ((item = PyIter_Next(iter))) {
1348
3175
Py_DECREF(item);
1349
__Pyx_UnpackError();
3176
__Pyx_RaiseTooManyValuesError(expected);
1352
3179
else if (!PyErr_Occurred())
1379
3329
empty_dict = PyDict_New();
1380
3330
if (!empty_dict)
1382
module = PyObject_CallFunction(__import__, "OOOO",
1383
name, global_dict, empty_dict, list);
3332
module = PyObject_CallFunctionObjArgs(py_import,
3333
name, global_dict, empty_dict, list, NULL);
1385
3335
Py_XDECREF(empty_list);
1386
Py_XDECREF(__import__);
3336
Py_XDECREF(py_import);
1387
3337
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
3341
static PyObject *__Pyx_CreateClass(
1427
PyObject *bases, PyObject *dict, PyObject *name, char *modname)
3342
PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
1429
3344
PyObject *py_modname;
1430
3345
PyObject *result = 0;
3347
#if PY_MAJOR_VERSION < 3
1432
3348
py_modname = PyString_FromString(modname);
3350
py_modname = PyUnicode_FromString(modname);
1433
3352
if (!py_modname)
1435
3354
if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
3356
#if PY_MAJOR_VERSION < 3
1437
3357
result = PyClass_New(bases, dict, name);
3359
result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL);
1439
3362
Py_XDECREF(py_modname);
3366
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
3367
PyObject *tmp_type, *tmp_value, *tmp_tb;
3368
PyThreadState *tstate = PyThreadState_GET();
3370
tmp_type = tstate->curexc_type;
3371
tmp_value = tstate->curexc_value;
3372
tmp_tb = tstate->curexc_traceback;
3373
tstate->curexc_type = type;
3374
tstate->curexc_value = value;
3375
tstate->curexc_traceback = tb;
3376
Py_XDECREF(tmp_type);
3377
Py_XDECREF(tmp_value);
3381
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
3382
PyThreadState *tstate = PyThreadState_GET();
3383
*type = tstate->curexc_type;
3384
*value = tstate->curexc_value;
3385
*tb = tstate->curexc_traceback;
3387
tstate->curexc_type = 0;
3388
tstate->curexc_value = 0;
3389
tstate->curexc_traceback = 0;
3393
#if PY_MAJOR_VERSION < 3
3394
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
3398
/* First, check the traceback argument, replacing None with NULL. */
3399
if (tb == Py_None) {
3403
else if (tb != NULL && !PyTraceBack_Check(tb)) {
3404
PyErr_SetString(PyExc_TypeError,
3405
"raise: arg 3 must be a traceback or None");
3408
/* Next, replace a missing value with None */
3409
if (value == NULL) {
3413
#if PY_VERSION_HEX < 0x02050000
3414
if (!PyClass_Check(type))
3416
if (!PyType_Check(type))
3419
/* Raising an instance. The value should be a dummy. */
3420
if (value != Py_None) {
3421
PyErr_SetString(PyExc_TypeError,
3422
"instance exception may not have a separate value");
3425
/* Normalize to raise <class>, <instance> */
3428
#if PY_VERSION_HEX < 0x02050000
3429
if (PyInstance_Check(type)) {
3430
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
3435
PyErr_SetString(PyExc_TypeError,
3436
"raise: exception must be an old-style class or instance");
3440
type = (PyObject*) Py_TYPE(type);
3442
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
3443
PyErr_SetString(PyExc_TypeError,
3444
"raise: exception class must be a subclass of BaseException");
3450
__Pyx_ErrRestore(type, value, tb);
3459
#else /* Python 3+ */
3461
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
3462
if (tb == Py_None) {
3464
} else if (tb && !PyTraceBack_Check(tb)) {
3465
PyErr_SetString(PyExc_TypeError,
3466
"raise: arg 3 must be a traceback or None");
3469
if (value == Py_None)
3472
if (PyExceptionInstance_Check(type)) {
3474
PyErr_SetString(PyExc_TypeError,
3475
"instance exception may not have a separate value");
3479
type = (PyObject*) Py_TYPE(value);
3480
} else if (!PyExceptionClass_Check(type)) {
3481
PyErr_SetString(PyExc_TypeError,
3482
"raise: exception class must be a subclass of BaseException");
3486
PyErr_SetObject(type, value);
3489
PyThreadState *tstate = PyThreadState_GET();
3490
PyObject* tmp_tb = tstate->curexc_traceback;
3493
tstate->curexc_traceback = tb;
3503
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
3504
const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
3505
const int is_unsigned = neg_one > const_zero;
3506
if (sizeof(unsigned char) < sizeof(long)) {
3507
long val = __Pyx_PyInt_AsLong(x);
3508
if (unlikely(val != (long)(unsigned char)val)) {
3509
if (!unlikely(val == -1 && PyErr_Occurred())) {
3510
PyErr_SetString(PyExc_OverflowError,
3511
(is_unsigned && unlikely(val < 0)) ?
3512
"can't convert negative value to unsigned char" :
3513
"value too large to convert to unsigned char");
3515
return (unsigned char)-1;
3517
return (unsigned char)val;
3519
return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
3522
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
3523
const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
3524
const int is_unsigned = neg_one > const_zero;
3525
if (sizeof(unsigned short) < sizeof(long)) {
3526
long val = __Pyx_PyInt_AsLong(x);
3527
if (unlikely(val != (long)(unsigned short)val)) {
3528
if (!unlikely(val == -1 && PyErr_Occurred())) {
3529
PyErr_SetString(PyExc_OverflowError,
3530
(is_unsigned && unlikely(val < 0)) ?
3531
"can't convert negative value to unsigned short" :
3532
"value too large to convert to unsigned short");
3534
return (unsigned short)-1;
3536
return (unsigned short)val;
3538
return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
3541
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
3542
const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
3543
const int is_unsigned = neg_one > const_zero;
3544
if (sizeof(unsigned int) < sizeof(long)) {
3545
long val = __Pyx_PyInt_AsLong(x);
3546
if (unlikely(val != (long)(unsigned int)val)) {
3547
if (!unlikely(val == -1 && PyErr_Occurred())) {
3548
PyErr_SetString(PyExc_OverflowError,
3549
(is_unsigned && unlikely(val < 0)) ?
3550
"can't convert negative value to unsigned int" :
3551
"value too large to convert to unsigned int");
3553
return (unsigned int)-1;
3555
return (unsigned int)val;
3557
return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
3560
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
3561
const char neg_one = (char)-1, const_zero = 0;
3562
const int is_unsigned = neg_one > const_zero;
3563
if (sizeof(char) < sizeof(long)) {
3564
long val = __Pyx_PyInt_AsLong(x);
3565
if (unlikely(val != (long)(char)val)) {
3566
if (!unlikely(val == -1 && PyErr_Occurred())) {
3567
PyErr_SetString(PyExc_OverflowError,
3568
(is_unsigned && unlikely(val < 0)) ?
3569
"can't convert negative value to char" :
3570
"value too large to convert to char");
3576
return (char)__Pyx_PyInt_AsLong(x);
3579
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
3580
const short neg_one = (short)-1, const_zero = 0;
3581
const int is_unsigned = neg_one > const_zero;
3582
if (sizeof(short) < sizeof(long)) {
3583
long val = __Pyx_PyInt_AsLong(x);
3584
if (unlikely(val != (long)(short)val)) {
3585
if (!unlikely(val == -1 && PyErr_Occurred())) {
3586
PyErr_SetString(PyExc_OverflowError,
3587
(is_unsigned && unlikely(val < 0)) ?
3588
"can't convert negative value to short" :
3589
"value too large to convert to short");
3595
return (short)__Pyx_PyInt_AsLong(x);
3598
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
3599
const int neg_one = (int)-1, const_zero = 0;
3600
const int is_unsigned = neg_one > const_zero;
3601
if (sizeof(int) < sizeof(long)) {
3602
long val = __Pyx_PyInt_AsLong(x);
3603
if (unlikely(val != (long)(int)val)) {
3604
if (!unlikely(val == -1 && PyErr_Occurred())) {
3605
PyErr_SetString(PyExc_OverflowError,
3606
(is_unsigned && unlikely(val < 0)) ?
3607
"can't convert negative value to int" :
3608
"value too large to convert to int");
3614
return (int)__Pyx_PyInt_AsLong(x);
3617
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
3618
const signed char neg_one = (signed char)-1, const_zero = 0;
3619
const int is_unsigned = neg_one > const_zero;
3620
if (sizeof(signed char) < sizeof(long)) {
3621
long val = __Pyx_PyInt_AsLong(x);
3622
if (unlikely(val != (long)(signed char)val)) {
3623
if (!unlikely(val == -1 && PyErr_Occurred())) {
3624
PyErr_SetString(PyExc_OverflowError,
3625
(is_unsigned && unlikely(val < 0)) ?
3626
"can't convert negative value to signed char" :
3627
"value too large to convert to signed char");
3629
return (signed char)-1;
3631
return (signed char)val;
3633
return (signed char)__Pyx_PyInt_AsSignedLong(x);
3636
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
3637
const signed short neg_one = (signed short)-1, const_zero = 0;
3638
const int is_unsigned = neg_one > const_zero;
3639
if (sizeof(signed short) < sizeof(long)) {
3640
long val = __Pyx_PyInt_AsLong(x);
3641
if (unlikely(val != (long)(signed short)val)) {
3642
if (!unlikely(val == -1 && PyErr_Occurred())) {
3643
PyErr_SetString(PyExc_OverflowError,
3644
(is_unsigned && unlikely(val < 0)) ?
3645
"can't convert negative value to signed short" :
3646
"value too large to convert to signed short");
3648
return (signed short)-1;
3650
return (signed short)val;
3652
return (signed short)__Pyx_PyInt_AsSignedLong(x);
3655
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
3656
const signed int neg_one = (signed int)-1, const_zero = 0;
3657
const int is_unsigned = neg_one > const_zero;
3658
if (sizeof(signed int) < sizeof(long)) {
3659
long val = __Pyx_PyInt_AsLong(x);
3660
if (unlikely(val != (long)(signed int)val)) {
3661
if (!unlikely(val == -1 && PyErr_Occurred())) {
3662
PyErr_SetString(PyExc_OverflowError,
3663
(is_unsigned && unlikely(val < 0)) ?
3664
"can't convert negative value to signed int" :
3665
"value too large to convert to signed int");
3667
return (signed int)-1;
3669
return (signed int)val;
3671
return (signed int)__Pyx_PyInt_AsSignedLong(x);
3674
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
3675
const int neg_one = (int)-1, const_zero = 0;
3676
const int is_unsigned = neg_one > const_zero;
3677
if (sizeof(int) < sizeof(long)) {
3678
long val = __Pyx_PyInt_AsLong(x);
3679
if (unlikely(val != (long)(int)val)) {
3680
if (!unlikely(val == -1 && PyErr_Occurred())) {
3681
PyErr_SetString(PyExc_OverflowError,
3682
(is_unsigned && unlikely(val < 0)) ?
3683
"can't convert negative value to int" :
3684
"value too large to convert to int");
3690
return (int)__Pyx_PyInt_AsLong(x);
3693
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
3694
const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
3695
const int is_unsigned = neg_one > const_zero;
3696
#if PY_VERSION_HEX < 0x03000000
3697
if (likely(PyInt_Check(x))) {
3698
long val = PyInt_AS_LONG(x);
3699
if (is_unsigned && unlikely(val < 0)) {
3700
PyErr_SetString(PyExc_OverflowError,
3701
"can't convert negative value to unsigned long");
3702
return (unsigned long)-1;
3704
return (unsigned long)val;
3707
if (likely(PyLong_Check(x))) {
3709
if (unlikely(Py_SIZE(x) < 0)) {
3710
PyErr_SetString(PyExc_OverflowError,
3711
"can't convert negative value to unsigned long");
3712
return (unsigned long)-1;
3714
return PyLong_AsUnsignedLong(x);
3716
return PyLong_AsLong(x);
3720
PyObject *tmp = __Pyx_PyNumber_Int(x);
3721
if (!tmp) return (unsigned long)-1;
3722
val = __Pyx_PyInt_AsUnsignedLong(tmp);
3728
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
3729
const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
3730
const int is_unsigned = neg_one > const_zero;
3731
#if PY_VERSION_HEX < 0x03000000
3732
if (likely(PyInt_Check(x))) {
3733
long val = PyInt_AS_LONG(x);
3734
if (is_unsigned && unlikely(val < 0)) {
3735
PyErr_SetString(PyExc_OverflowError,
3736
"can't convert negative value to unsigned PY_LONG_LONG");
3737
return (unsigned PY_LONG_LONG)-1;
3739
return (unsigned PY_LONG_LONG)val;
3742
if (likely(PyLong_Check(x))) {
3744
if (unlikely(Py_SIZE(x) < 0)) {
3745
PyErr_SetString(PyExc_OverflowError,
3746
"can't convert negative value to unsigned PY_LONG_LONG");
3747
return (unsigned PY_LONG_LONG)-1;
3749
return PyLong_AsUnsignedLongLong(x);
3751
return PyLong_AsLongLong(x);
3754
unsigned PY_LONG_LONG val;
3755
PyObject *tmp = __Pyx_PyNumber_Int(x);
3756
if (!tmp) return (unsigned PY_LONG_LONG)-1;
3757
val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
3763
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
3764
const long neg_one = (long)-1, const_zero = 0;
3765
const int is_unsigned = neg_one > const_zero;
3766
#if PY_VERSION_HEX < 0x03000000
3767
if (likely(PyInt_Check(x))) {
3768
long val = PyInt_AS_LONG(x);
3769
if (is_unsigned && unlikely(val < 0)) {
3770
PyErr_SetString(PyExc_OverflowError,
3771
"can't convert negative value to long");
3777
if (likely(PyLong_Check(x))) {
3779
if (unlikely(Py_SIZE(x) < 0)) {
3780
PyErr_SetString(PyExc_OverflowError,
3781
"can't convert negative value to long");
3784
return PyLong_AsUnsignedLong(x);
3786
return PyLong_AsLong(x);
3790
PyObject *tmp = __Pyx_PyNumber_Int(x);
3791
if (!tmp) return (long)-1;
3792
val = __Pyx_PyInt_AsLong(tmp);
3798
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
3799
const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
3800
const int is_unsigned = neg_one > const_zero;
3801
#if PY_VERSION_HEX < 0x03000000
3802
if (likely(PyInt_Check(x))) {
3803
long val = PyInt_AS_LONG(x);
3804
if (is_unsigned && unlikely(val < 0)) {
3805
PyErr_SetString(PyExc_OverflowError,
3806
"can't convert negative value to PY_LONG_LONG");
3807
return (PY_LONG_LONG)-1;
3809
return (PY_LONG_LONG)val;
3812
if (likely(PyLong_Check(x))) {
3814
if (unlikely(Py_SIZE(x) < 0)) {
3815
PyErr_SetString(PyExc_OverflowError,
3816
"can't convert negative value to PY_LONG_LONG");
3817
return (PY_LONG_LONG)-1;
3819
return PyLong_AsUnsignedLongLong(x);
3821
return PyLong_AsLongLong(x);
3825
PyObject *tmp = __Pyx_PyNumber_Int(x);
3826
if (!tmp) return (PY_LONG_LONG)-1;
3827
val = __Pyx_PyInt_AsLongLong(tmp);
3833
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
3834
const signed long neg_one = (signed long)-1, const_zero = 0;
3835
const int is_unsigned = neg_one > const_zero;
3836
#if PY_VERSION_HEX < 0x03000000
3837
if (likely(PyInt_Check(x))) {
3838
long val = PyInt_AS_LONG(x);
3839
if (is_unsigned && unlikely(val < 0)) {
3840
PyErr_SetString(PyExc_OverflowError,
3841
"can't convert negative value to signed long");
3842
return (signed long)-1;
3844
return (signed long)val;
3847
if (likely(PyLong_Check(x))) {
3849
if (unlikely(Py_SIZE(x) < 0)) {
3850
PyErr_SetString(PyExc_OverflowError,
3851
"can't convert negative value to signed long");
3852
return (signed long)-1;
3854
return PyLong_AsUnsignedLong(x);
3856
return PyLong_AsLong(x);
3860
PyObject *tmp = __Pyx_PyNumber_Int(x);
3861
if (!tmp) return (signed long)-1;
3862
val = __Pyx_PyInt_AsSignedLong(tmp);
3868
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
3869
const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
3870
const int is_unsigned = neg_one > const_zero;
3871
#if PY_VERSION_HEX < 0x03000000
3872
if (likely(PyInt_Check(x))) {
3873
long val = PyInt_AS_LONG(x);
3874
if (is_unsigned && unlikely(val < 0)) {
3875
PyErr_SetString(PyExc_OverflowError,
3876
"can't convert negative value to signed PY_LONG_LONG");
3877
return (signed PY_LONG_LONG)-1;
3879
return (signed PY_LONG_LONG)val;
3882
if (likely(PyLong_Check(x))) {
3884
if (unlikely(Py_SIZE(x) < 0)) {
3885
PyErr_SetString(PyExc_OverflowError,
3886
"can't convert negative value to signed PY_LONG_LONG");
3887
return (signed PY_LONG_LONG)-1;
3889
return PyLong_AsUnsignedLongLong(x);
3891
return PyLong_AsLongLong(x);
3894
signed PY_LONG_LONG val;
3895
PyObject *tmp = __Pyx_PyNumber_Int(x);
3896
if (!tmp) return (signed PY_LONG_LONG)-1;
3897
val = __Pyx_PyInt_AsSignedLongLong(tmp);
1443
3903
#include "compile.h"
1444
3904
#include "frameobject.h"
1445
3905
#include "traceback.h"
1447
static void __Pyx_AddTraceback(char *funcname) {
3907
static void __Pyx_AddTraceback(const char *funcname) {
1448
3908
PyObject *py_srcfile = 0;
1449
3909
PyObject *py_funcname = 0;
1450
3910
PyObject *py_globals = 0;
1451
PyObject *empty_tuple = 0;
1452
PyObject *empty_string = 0;
1453
3911
PyCodeObject *py_code = 0;
1454
3912
PyFrameObject *py_frame = 0;
3914
#if PY_MAJOR_VERSION < 3
1456
3915
py_srcfile = PyString_FromString(__pyx_filename);
3917
py_srcfile = PyUnicode_FromString(__pyx_filename);
1457
3919
if (!py_srcfile) goto bad;
1458
py_funcname = PyString_FromString(funcname);
3920
if (__pyx_clineno) {
3921
#if PY_MAJOR_VERSION < 3
3922
py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
3924
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
3928
#if PY_MAJOR_VERSION < 3
3929
py_funcname = PyString_FromString(funcname);
3931
py_funcname = PyUnicode_FromString(funcname);
1459
3934
if (!py_funcname) goto bad;
1460
3935
py_globals = PyModule_GetDict(__pyx_m);
1461
3936
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
3937
py_code = PyCode_New(
1467
3938
0, /*int argcount,*/
3939
#if PY_MAJOR_VERSION >= 3
3940
0, /*int kwonlyargcount,*/
1468
3942
0, /*int nlocals,*/
1469
3943
0, /*int stacksize,*/
1470
3944
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,*/
3945
__pyx_empty_bytes, /*PyObject *code,*/
3946
__pyx_empty_tuple, /*PyObject *consts,*/
3947
__pyx_empty_tuple, /*PyObject *names,*/
3948
__pyx_empty_tuple, /*PyObject *varnames,*/
3949
__pyx_empty_tuple, /*PyObject *freevars,*/
3950
__pyx_empty_tuple, /*PyObject *cellvars,*/
1477
3951
py_srcfile, /*PyObject *filename,*/
1478
3952
py_funcname, /*PyObject *name,*/
1479
3953
__pyx_lineno, /*int firstlineno,*/
1480
empty_string /*PyObject *lnotab*/
3954
__pyx_empty_bytes /*PyObject *lnotab*/
1482
3956
if (!py_code) goto bad;
1483
3957
py_frame = PyFrame_New(
1484
PyThreadState_Get(), /*PyThreadState *tstate,*/
3958
PyThreadState_GET(), /*PyThreadState *tstate,*/
1485
3959
py_code, /*PyCodeObject *code,*/
1486
3960
py_globals, /*PyObject *globals,*/
1487
3961
0 /*PyObject *locals*/