1
/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:23 2012 */
3
#define PY_SSIZE_T_CLEAN
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
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)
43
#if PY_VERSION_HEX < 0x02050000
44
typedef int Py_ssize_t;
45
#define PY_SSIZE_T_MAX INT_MAX
46
#define PY_SSIZE_T_MIN INT_MIN
47
#define PY_FORMAT_SIZE_T ""
48
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
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
131
#if PY_VERSION_HEX < 0x02060000
132
#define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
133
#define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
135
#ifndef PySet_CheckExact
136
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
139
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
141
#if PY_MAJOR_VERSION >= 3
142
#define PyIntObject PyLongObject
143
#define PyInt_Type PyLong_Type
144
#define PyInt_Check(op) PyLong_Check(op)
145
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
146
#define PyInt_FromString PyLong_FromString
147
#define PyInt_FromUnicode PyLong_FromUnicode
148
#define PyInt_FromLong PyLong_FromLong
149
#define PyInt_FromSize_t PyLong_FromSize_t
150
#define PyInt_FromSsize_t PyLong_FromSsize_t
151
#define PyInt_AsLong PyLong_AsLong
152
#define PyInt_AS_LONG PyLong_AS_LONG
153
#define PyInt_AsSsize_t PyLong_AsSsize_t
154
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
155
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
158
#if PY_MAJOR_VERSION >= 3
159
#define PyBoolObject PyLongObject
163
#if PY_MAJOR_VERSION >= 3
164
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
165
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
167
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
168
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
171
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
172
#define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
173
#define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
174
#define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
176
#define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
177
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
178
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
179
(PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
180
#define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
181
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
182
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
183
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
184
#define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
185
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
186
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
187
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
190
#if PY_MAJOR_VERSION >= 3
191
#define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
194
#if PY_VERSION_HEX < 0x02050000
195
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
196
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
197
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
199
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
200
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
201
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
204
#if PY_VERSION_HEX < 0x02050000
205
#define __Pyx_NAMESTR(n) ((char *)(n))
206
#define __Pyx_DOCSTR(n) ((char *)(n))
208
#define __Pyx_NAMESTR(n) (n)
209
#define __Pyx_DOCSTR(n) (n)
213
#define __PYX_EXTERN_C extern "C"
215
#define __PYX_EXTERN_C extern
218
#if defined(WIN32) || defined(MS_WINDOWS)
219
#define _USE_MATH_DEFINES
222
#define __PYX_HAVE_API__bzrlib___annotator_pyx
223
#include "python-compat.h"
225
#ifdef PYREX_WITHOUT_ASSERTIONS
226
#define CYTHON_WITHOUT_ASSERTIONS
230
/* inline attribute */
231
#ifndef CYTHON_INLINE
232
#if defined(__GNUC__)
233
#define CYTHON_INLINE __inline__
234
#elif defined(_MSC_VER)
235
#define CYTHON_INLINE __inline
236
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
237
#define CYTHON_INLINE inline
239
#define CYTHON_INLINE
243
/* unused attribute */
244
#ifndef CYTHON_UNUSED
245
# if defined(__GNUC__)
246
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
247
# define CYTHON_UNUSED __attribute__ ((__unused__))
249
# define CYTHON_UNUSED
251
# elif defined(__ICC) || defined(__INTEL_COMPILER)
252
# define CYTHON_UNUSED __attribute__ ((__unused__))
254
# define CYTHON_UNUSED
258
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*/
261
/* Type Conversion Predeclarations */
263
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
264
#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
266
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
267
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
268
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
270
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
271
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
272
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
274
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
278
/* Test for GCC > 2.95 */
279
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
280
#define likely(x) __builtin_expect(!!(x), 1)
281
#define unlikely(x) __builtin_expect(!!(x), 0)
282
#else /* __GNUC__ > 2 ... */
283
#define likely(x) (x)
284
#define unlikely(x) (x)
285
#endif /* __GNUC__ > 2 ... */
287
#define likely(x) (x)
288
#define unlikely(x) (x)
289
#endif /* __GNUC__ */
291
static PyObject *__pyx_m;
292
static PyObject *__pyx_b;
293
static PyObject *__pyx_empty_tuple;
294
static PyObject *__pyx_empty_bytes;
295
static int __pyx_lineno;
296
static int __pyx_clineno = 0;
297
static const char * __pyx_cfilenm= __FILE__;
298
static const char *__pyx_filename;
301
static const char *__pyx_f[] = {
302
"_annotator_pyx.pyx",
305
/* Type declarations */
307
#ifndef CYTHON_REFNANNY
308
#define CYTHON_REFNANNY 0
313
void (*INCREF)(void*, PyObject*, int);
314
void (*DECREF)(void*, PyObject*, int);
315
void (*GOTREF)(void*, PyObject*, int);
316
void (*GIVEREF)(void*, PyObject*, int);
317
void* (*SetupContext)(const char*, int, const char*);
318
void (*FinishContext)(void**);
319
} __Pyx_RefNannyAPIStruct;
320
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
321
static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
322
PyObject *m = NULL, *p = NULL;
324
m = PyImport_ImportModule((char *)modname);
326
p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
328
r = PyLong_AsVoidPtr(p);
332
return (__Pyx_RefNannyAPIStruct *)r;
334
#define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
335
#define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
336
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
337
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
338
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
339
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
340
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
342
#define __Pyx_RefNannySetupContext(name)
343
#define __Pyx_RefNannyFinishContext()
344
#define __Pyx_INCREF(r) Py_INCREF(r)
345
#define __Pyx_DECREF(r) Py_DECREF(r)
346
#define __Pyx_GOTREF(r)
347
#define __Pyx_GIVEREF(r)
348
#define __Pyx_XDECREF(r) Py_XDECREF(r)
349
#endif /* CYTHON_REFNANNY */
350
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
351
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
353
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
355
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
356
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
358
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
360
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
362
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
364
static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
365
static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/
367
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
368
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
370
static void __Pyx_RaiseDoubleKeywordsError(
371
const char* func_name, PyObject* kw_name); /*proto*/
373
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
376
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
379
r = PyObject_GetItem(o, j);
385
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
386
__Pyx_GetItemInt_List_Fast(o, i) : \
387
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
389
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
390
if (likely(o != Py_None)) {
391
if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
392
PyObject *r = PyList_GET_ITEM(o, i);
396
else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
397
PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
402
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
405
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
406
__Pyx_GetItemInt_Tuple_Fast(o, i) : \
407
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
409
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
410
if (likely(o != Py_None)) {
411
if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
412
PyObject *r = PyTuple_GET_ITEM(o, i);
416
else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
417
PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
422
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
426
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
427
__Pyx_GetItemInt_Fast(o, i) : \
428
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
430
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
432
if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
433
r = PyList_GET_ITEM(o, i);
436
else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
437
r = PyTuple_GET_ITEM(o, i);
440
else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
441
r = PySequence_GetItem(o, i);
444
r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
449
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
451
static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/
453
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
454
PyObject *modname); /*proto*/
456
#define __pyx_binding_PyCFunctionType_USED 1
459
PyCFunctionObject func;
460
} __pyx_binding_PyCFunctionType_object;
462
static PyTypeObject __pyx_binding_PyCFunctionType_type;
463
static PyTypeObject *__pyx_binding_PyCFunctionType = NULL;
465
static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module); /* proto */
466
#define __pyx_binding_PyCFunctionType_New(ml, self) __pyx_binding_PyCFunctionType_NewEx(ml, self, NULL)
468
static int __pyx_binding_PyCFunctionType_init(void); /* proto */
470
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
472
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
474
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
476
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
478
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
480
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
482
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
484
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
486
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
488
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
490
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
492
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
494
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
496
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
498
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
500
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
502
static void __Pyx_AddTraceback(const char *funcname); /*proto*/
504
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
505
/* Module declarations from bzrlib._annotator_pyx */
507
static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *, PyObject *); /*proto*/
508
static int __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(PyObject *, PyObject *, Py_ssize_t, Py_ssize_t, Py_ssize_t); /*proto*/
509
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *, Py_ssize_t *); /*proto*/
510
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *, PyObject *, PyObject *); /*proto*/
511
static int __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(PyObject *, PyObject *, PyObject *); /*proto*/
512
static int __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
513
#define __Pyx_MODULE_NAME "bzrlib._annotator_pyx"
514
static int __pyx_module_is_main_bzrlib___annotator_pyx = 0;
516
/* Implementation of bzrlib._annotator_pyx */
517
static PyObject *__pyx_builtin_TypeError;
518
static PyObject *__pyx_builtin_ValueError;
519
static char __pyx_k_1[] = "annotations must be a list";
520
static char __pyx_k_3[] = "parent_annotations must be a list";
521
static char __pyx_k_5[] = "Match length exceeds len of parent_annotations %s > %s";
522
static char __pyx_k_6[] = "Match length exceeds len of annotations %s > %s";
523
static char __pyx_k_7[] = "annotations must be tuples";
524
static char __pyx_k_9[] = "_get_parent_annotations_and_matches";
525
static char __pyx_k_10[] = "_break_annotation_tie";
526
static char __pyx_k_11[] = "_resolve_annotation_tie";
527
static char __pyx_k_12[] = "Functionality for doing annotations in the 'optimal' way";
528
static char __pyx_k_13[] = "bzrlib._annotator_pyx";
529
static char __pyx_k_14[] = "_update_from_first_parent";
530
static char __pyx_k_15[] = "_update_from_other_parents";
531
static char __pyx_k_16[] = "Class that drives performing annotations.";
532
static char __pyx_k__key[] = "key";
533
static char __pyx_k__self[] = "self";
534
static char __pyx_k__heads[] = "heads";
535
static char __pyx_k__lines[] = "lines";
536
static char __pyx_k__bzrlib[] = "bzrlib";
537
static char __pyx_k__ob_item[] = "ob_item";
538
static char __pyx_k____main__[] = "__main__";
539
static char __pyx_k____test__[] = "__test__";
540
static char __pyx_k__annotate[] = "annotate";
541
static char __pyx_k__Annotator[] = "Annotator";
542
static char __pyx_k__TypeError[] = "TypeError";
543
static char __pyx_k__ValueError[] = "ValueError";
544
static char __pyx_k__parent_key[] = "parent_key";
545
static char __pyx_k__annotations[] = "annotations";
546
static char __pyx_k___annotator_py[] = "_annotator_py";
547
static char __pyx_k__annotate_flat[] = "annotate_flat";
548
static char __pyx_k__this_annotation[] = "this_annotation";
549
static char __pyx_k___ann_tuple_cache[] = "_ann_tuple_cache";
550
static char __pyx_k___get_heads_provider[] = "_get_heads_provider";
551
static PyObject *__pyx_kp_s_1;
552
static PyObject *__pyx_n_s_10;
553
static PyObject *__pyx_n_s_11;
554
static PyObject *__pyx_n_s_13;
555
static PyObject *__pyx_n_s_14;
556
static PyObject *__pyx_n_s_15;
557
static PyObject *__pyx_kp_s_16;
558
static PyObject *__pyx_kp_s_3;
559
static PyObject *__pyx_kp_s_5;
560
static PyObject *__pyx_kp_s_6;
561
static PyObject *__pyx_kp_s_7;
562
static PyObject *__pyx_n_s_9;
563
static PyObject *__pyx_n_s__Annotator;
564
static PyObject *__pyx_n_s__TypeError;
565
static PyObject *__pyx_n_s__ValueError;
566
static PyObject *__pyx_n_s____main__;
567
static PyObject *__pyx_n_s____test__;
568
static PyObject *__pyx_n_s___ann_tuple_cache;
569
static PyObject *__pyx_n_s___annotator_py;
570
static PyObject *__pyx_n_s___get_heads_provider;
571
static PyObject *__pyx_n_s__annotate;
572
static PyObject *__pyx_n_s__annotate_flat;
573
static PyObject *__pyx_n_s__annotations;
574
static PyObject *__pyx_n_s__bzrlib;
575
static PyObject *__pyx_n_s__heads;
576
static PyObject *__pyx_n_s__key;
577
static PyObject *__pyx_n_s__lines;
578
static PyObject *__pyx_n_s__ob_item;
579
static PyObject *__pyx_n_s__parent_key;
580
static PyObject *__pyx_n_s__self;
581
static PyObject *__pyx_n_s__this_annotation;
582
static PyObject *__pyx_k_tuple_2;
583
static PyObject *__pyx_k_tuple_4;
584
static PyObject *__pyx_k_tuple_8;
586
/* "bzrlib/_annotator_pyx.pyx":61
589
* cdef int _check_annotations_are_lists(annotations, # <<<<<<<<<<<<<<
590
* parent_annotations) except -1:
591
* if not PyList_CheckExact(annotations):
594
static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *__pyx_v_annotations, PyObject *__pyx_v_parent_annotations) {
597
PyObject *__pyx_t_2 = NULL;
598
__Pyx_RefNannySetupContext("_check_annotations_are_lists");
600
/* "bzrlib/_annotator_pyx.pyx":63
601
* cdef int _check_annotations_are_lists(annotations,
602
* parent_annotations) except -1:
603
* if not PyList_CheckExact(annotations): # <<<<<<<<<<<<<<
604
* raise TypeError('annotations must be a list')
605
* if not PyList_CheckExact(parent_annotations):
607
__pyx_t_1 = (!PyList_CheckExact(__pyx_v_annotations));
610
/* "bzrlib/_annotator_pyx.pyx":64
611
* parent_annotations) except -1:
612
* if not PyList_CheckExact(annotations):
613
* raise TypeError('annotations must be a list') # <<<<<<<<<<<<<<
614
* if not PyList_CheckExact(parent_annotations):
615
* raise TypeError('parent_annotations must be a list')
617
__pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
618
__Pyx_GOTREF(__pyx_t_2);
619
__Pyx_Raise(__pyx_t_2, 0, 0);
620
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
621
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
626
/* "bzrlib/_annotator_pyx.pyx":65
627
* if not PyList_CheckExact(annotations):
628
* raise TypeError('annotations must be a list')
629
* if not PyList_CheckExact(parent_annotations): # <<<<<<<<<<<<<<
630
* raise TypeError('parent_annotations must be a list')
633
__pyx_t_1 = (!PyList_CheckExact(__pyx_v_parent_annotations));
636
/* "bzrlib/_annotator_pyx.pyx":66
637
* raise TypeError('annotations must be a list')
638
* if not PyList_CheckExact(parent_annotations):
639
* raise TypeError('parent_annotations must be a list') # <<<<<<<<<<<<<<
643
__pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
644
__Pyx_GOTREF(__pyx_t_2);
645
__Pyx_Raise(__pyx_t_2, 0, 0);
646
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
647
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
652
/* "bzrlib/_annotator_pyx.pyx":67
653
* if not PyList_CheckExact(parent_annotations):
654
* raise TypeError('parent_annotations must be a list')
655
* return 0 # <<<<<<<<<<<<<<
665
__Pyx_XDECREF(__pyx_t_2);
666
__Pyx_AddTraceback("bzrlib._annotator_pyx._check_annotations_are_lists");
669
__Pyx_RefNannyFinishContext();
673
/* "bzrlib/_annotator_pyx.pyx":70
676
* cdef int _check_match_ranges(parent_annotations, annotations, # <<<<<<<<<<<<<<
677
* Py_ssize_t parent_idx, Py_ssize_t lines_idx,
678
* Py_ssize_t match_len) except -1:
681
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) {
684
PyObject *__pyx_t_2 = NULL;
685
PyObject *__pyx_t_3 = NULL;
686
PyObject *__pyx_t_4 = NULL;
687
__Pyx_RefNannySetupContext("_check_match_ranges");
689
/* "bzrlib/_annotator_pyx.pyx":73
690
* Py_ssize_t parent_idx, Py_ssize_t lines_idx,
691
* Py_ssize_t match_len) except -1:
692
* if parent_idx + match_len > PyList_GET_SIZE(parent_annotations): # <<<<<<<<<<<<<<
693
* raise ValueError('Match length exceeds len of'
694
* ' parent_annotations %s > %s'
696
__pyx_t_1 = ((__pyx_v_parent_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_parent_annotations));
699
/* "bzrlib/_annotator_pyx.pyx":76
700
* raise ValueError('Match length exceeds len of'
701
* ' parent_annotations %s > %s'
702
* % (parent_idx + match_len, # <<<<<<<<<<<<<<
703
* PyList_GET_SIZE(parent_annotations)))
704
* if lines_idx + match_len > PyList_GET_SIZE(annotations):
706
__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;}
707
__Pyx_GOTREF(__pyx_t_2);
709
/* "bzrlib/_annotator_pyx.pyx":77
710
* ' parent_annotations %s > %s'
711
* % (parent_idx + match_len,
712
* PyList_GET_SIZE(parent_annotations))) # <<<<<<<<<<<<<<
713
* if lines_idx + match_len > PyList_GET_SIZE(annotations):
714
* raise ValueError('Match length exceeds len of'
716
__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;}
717
__Pyx_GOTREF(__pyx_t_3);
718
__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;}
719
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
720
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
721
__Pyx_GIVEREF(__pyx_t_2);
722
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
723
__Pyx_GIVEREF(__pyx_t_3);
726
__pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
727
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
728
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
729
__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;}
730
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
731
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
732
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
734
__pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
735
__Pyx_GOTREF(__pyx_t_3);
736
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
737
__Pyx_Raise(__pyx_t_3, 0, 0);
738
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
739
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
744
/* "bzrlib/_annotator_pyx.pyx":78
745
* % (parent_idx + match_len,
746
* PyList_GET_SIZE(parent_annotations)))
747
* if lines_idx + match_len > PyList_GET_SIZE(annotations): # <<<<<<<<<<<<<<
748
* raise ValueError('Match length exceeds len of'
749
* ' annotations %s > %s'
751
__pyx_t_1 = ((__pyx_v_lines_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_annotations));
754
/* "bzrlib/_annotator_pyx.pyx":81
755
* raise ValueError('Match length exceeds len of'
756
* ' annotations %s > %s'
757
* % (lines_idx + match_len, # <<<<<<<<<<<<<<
758
* PyList_GET_SIZE(annotations)))
761
__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;}
762
__Pyx_GOTREF(__pyx_t_3);
764
/* "bzrlib/_annotator_pyx.pyx":82
765
* ' annotations %s > %s'
766
* % (lines_idx + match_len,
767
* PyList_GET_SIZE(annotations))) # <<<<<<<<<<<<<<
771
__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;}
772
__Pyx_GOTREF(__pyx_t_4);
773
__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;}
774
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
775
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
776
__Pyx_GIVEREF(__pyx_t_3);
777
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
778
__Pyx_GIVEREF(__pyx_t_4);
781
__pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
782
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
783
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
784
__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;}
785
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
786
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
787
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
789
__pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
790
__Pyx_GOTREF(__pyx_t_4);
791
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
792
__Pyx_Raise(__pyx_t_4, 0, 0);
793
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
794
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
799
/* "bzrlib/_annotator_pyx.pyx":83
800
* % (lines_idx + match_len,
801
* PyList_GET_SIZE(annotations)))
802
* return 0 # <<<<<<<<<<<<<<
812
__Pyx_XDECREF(__pyx_t_2);
813
__Pyx_XDECREF(__pyx_t_3);
814
__Pyx_XDECREF(__pyx_t_4);
815
__Pyx_AddTraceback("bzrlib._annotator_pyx._check_match_ranges");
818
__Pyx_RefNannyFinishContext();
822
/* "bzrlib/_annotator_pyx.pyx":86
825
* cdef PyObject *_next_tuple_entry(object tpl, Py_ssize_t *pos): # cannot_raise # <<<<<<<<<<<<<<
826
* """Return the next entry from this tuple.
830
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *__pyx_v_tpl, Py_ssize_t *__pyx_v_pos) {
833
__Pyx_RefNannySetupContext("_next_tuple_entry");
835
/* "bzrlib/_annotator_pyx.pyx":94
836
* This cannot raise an exception, as it does no error checking.
838
* pos[0] = pos[0] + 1 # <<<<<<<<<<<<<<
839
* if pos[0] >= PyTuple_GET_SIZE(tpl):
842
(__pyx_v_pos[0]) = ((__pyx_v_pos[0]) + 1);
844
/* "bzrlib/_annotator_pyx.pyx":95
846
* pos[0] = pos[0] + 1
847
* if pos[0] >= PyTuple_GET_SIZE(tpl): # <<<<<<<<<<<<<<
849
* return PyTuple_GET_ITEM(tpl, pos[0])
851
__pyx_t_1 = ((__pyx_v_pos[0]) >= PyTuple_GET_SIZE(__pyx_v_tpl));
854
/* "bzrlib/_annotator_pyx.pyx":96
855
* pos[0] = pos[0] + 1
856
* if pos[0] >= PyTuple_GET_SIZE(tpl):
857
* return NULL # <<<<<<<<<<<<<<
858
* return PyTuple_GET_ITEM(tpl, pos[0])
867
/* "bzrlib/_annotator_pyx.pyx":97
868
* if pos[0] >= PyTuple_GET_SIZE(tpl):
870
* return PyTuple_GET_ITEM(tpl, pos[0]) # <<<<<<<<<<<<<<
874
__pyx_r = PyTuple_GET_ITEM(__pyx_v_tpl, (__pyx_v_pos[0]));
879
__Pyx_RefNannyFinishContext();
883
/* "bzrlib/_annotator_pyx.pyx":100
886
* cdef object _combine_annotations(ann_one, ann_two, cache): # <<<<<<<<<<<<<<
887
* """Combine the annotations from both sides."""
888
* cdef Py_ssize_t pos_one, pos_two, len_one, len_two
891
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *__pyx_v_ann_one, PyObject *__pyx_v_ann_two, PyObject *__pyx_v_cache) {
892
Py_ssize_t __pyx_v_pos_one;
893
Py_ssize_t __pyx_v_pos_two;
894
Py_ssize_t __pyx_v_out_pos;
895
PyObject *__pyx_v_temp;
896
PyObject *__pyx_v_left;
897
PyObject *__pyx_v_right;
898
PyObject *__pyx_v_cache_key;
899
PyObject *__pyx_v_new_ann;
900
PyObject *__pyx_r = NULL;
902
PyObject *__pyx_t_2 = NULL;
906
__Pyx_RefNannySetupContext("_combine_annotations");
907
__pyx_v_cache_key = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
908
__pyx_v_new_ann = Py_None; __Pyx_INCREF(Py_None);
910
/* "bzrlib/_annotator_pyx.pyx":106
911
* cdef PyObject *temp, *left, *right
913
* if (PyObject_RichCompareBool(ann_one, ann_two, Py_LT)): # <<<<<<<<<<<<<<
914
* cache_key = (ann_one, ann_two)
917
__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;}
920
/* "bzrlib/_annotator_pyx.pyx":107
922
* if (PyObject_RichCompareBool(ann_one, ann_two, Py_LT)):
923
* cache_key = (ann_one, ann_two) # <<<<<<<<<<<<<<
925
* cache_key = (ann_two, ann_one)
927
__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;}
928
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
929
__Pyx_INCREF(__pyx_v_ann_one);
930
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ann_one);
931
__Pyx_GIVEREF(__pyx_v_ann_one);
932
__Pyx_INCREF(__pyx_v_ann_two);
933
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ann_two);
934
__Pyx_GIVEREF(__pyx_v_ann_two);
935
__Pyx_DECREF(((PyObject *)__pyx_v_cache_key));
936
__pyx_v_cache_key = __pyx_t_2;
942
/* "bzrlib/_annotator_pyx.pyx":109
943
* cache_key = (ann_one, ann_two)
945
* cache_key = (ann_two, ann_one) # <<<<<<<<<<<<<<
946
* temp = PyDict_GetItem(cache, cache_key)
949
__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;}
950
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
951
__Pyx_INCREF(__pyx_v_ann_two);
952
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ann_two);
953
__Pyx_GIVEREF(__pyx_v_ann_two);
954
__Pyx_INCREF(__pyx_v_ann_one);
955
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ann_one);
956
__Pyx_GIVEREF(__pyx_v_ann_one);
957
__Pyx_DECREF(((PyObject *)__pyx_v_cache_key));
958
__pyx_v_cache_key = __pyx_t_2;
963
/* "bzrlib/_annotator_pyx.pyx":110
965
* cache_key = (ann_two, ann_one)
966
* temp = PyDict_GetItem(cache, cache_key) # <<<<<<<<<<<<<<
968
* return <object>temp
970
__pyx_v_temp = PyDict_GetItem(__pyx_v_cache, ((PyObject *)__pyx_v_cache_key));
972
/* "bzrlib/_annotator_pyx.pyx":111
973
* cache_key = (ann_two, ann_one)
974
* temp = PyDict_GetItem(cache, cache_key)
975
* if temp != NULL: # <<<<<<<<<<<<<<
976
* return <object>temp
979
__pyx_t_3 = (__pyx_v_temp != NULL);
982
/* "bzrlib/_annotator_pyx.pyx":112
983
* temp = PyDict_GetItem(cache, cache_key)
985
* return <object>temp # <<<<<<<<<<<<<<
987
* if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two):
989
__Pyx_XDECREF(__pyx_r);
990
__Pyx_INCREF(((PyObject *)__pyx_v_temp));
991
__pyx_r = ((PyObject *)__pyx_v_temp);
997
/* "bzrlib/_annotator_pyx.pyx":114
998
* return <object>temp
1000
* if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two): # <<<<<<<<<<<<<<
1001
* raise TypeError('annotations must be tuples')
1002
* # We know that annotations are tuples, and that both sides are already
1004
__pyx_t_3 = (!PyTuple_CheckExact(__pyx_v_ann_one));
1006
__pyx_t_4 = (!PyTuple_CheckExact(__pyx_v_ann_two));
1007
__pyx_t_5 = __pyx_t_4;
1009
__pyx_t_5 = __pyx_t_3;
1013
/* "bzrlib/_annotator_pyx.pyx":115
1015
* if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two):
1016
* raise TypeError('annotations must be tuples') # <<<<<<<<<<<<<<
1017
* # We know that annotations are tuples, and that both sides are already
1018
* # sorted, so we can just walk and update a new list.
1020
__pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1021
__Pyx_GOTREF(__pyx_t_2);
1022
__Pyx_Raise(__pyx_t_2, 0, 0);
1023
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1024
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1029
/* "bzrlib/_annotator_pyx.pyx":118
1030
* # We know that annotations are tuples, and that both sides are already
1031
* # sorted, so we can just walk and update a new list.
1032
* pos_one = -1 # <<<<<<<<<<<<<<
1036
__pyx_v_pos_one = -1;
1038
/* "bzrlib/_annotator_pyx.pyx":119
1039
* # sorted, so we can just walk and update a new list.
1041
* pos_two = -1 # <<<<<<<<<<<<<<
1043
* left = _next_tuple_entry(ann_one, &pos_one)
1045
__pyx_v_pos_two = -1;
1047
/* "bzrlib/_annotator_pyx.pyx":120
1050
* out_pos = 0 # <<<<<<<<<<<<<<
1051
* left = _next_tuple_entry(ann_one, &pos_one)
1052
* right = _next_tuple_entry(ann_two, &pos_two)
1054
__pyx_v_out_pos = 0;
1056
/* "bzrlib/_annotator_pyx.pyx":121
1059
* left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<<
1060
* right = _next_tuple_entry(ann_two, &pos_two)
1061
* new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
1063
__pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
1065
/* "bzrlib/_annotator_pyx.pyx":122
1067
* left = _next_tuple_entry(ann_one, &pos_one)
1068
* right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<<
1069
* new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
1070
* + PyTuple_GET_SIZE(ann_two))
1072
__pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
1074
/* "bzrlib/_annotator_pyx.pyx":124
1075
* right = _next_tuple_entry(ann_two, &pos_two)
1076
* new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
1077
* + PyTuple_GET_SIZE(ann_two)) # <<<<<<<<<<<<<<
1078
* while left != NULL and right != NULL:
1079
* # left == right is done by PyObject_RichCompareBool_ptr, however it
1081
__pyx_t_2 = PyTuple_New((PyTuple_GET_SIZE(__pyx_v_ann_one) + PyTuple_GET_SIZE(__pyx_v_ann_two))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1082
__Pyx_GOTREF(__pyx_t_2);
1083
__Pyx_DECREF(__pyx_v_new_ann);
1084
__pyx_v_new_ann = __pyx_t_2;
1087
/* "bzrlib/_annotator_pyx.pyx":125
1088
* new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
1089
* + PyTuple_GET_SIZE(ann_two))
1090
* while left != NULL and right != NULL: # <<<<<<<<<<<<<<
1091
* # left == right is done by PyObject_RichCompareBool_ptr, however it
1092
* # avoids a function call for a very common case. Drops 'time bzr
1095
__pyx_t_5 = (__pyx_v_left != NULL);
1097
__pyx_t_3 = (__pyx_v_right != NULL);
1098
__pyx_t_4 = __pyx_t_3;
1100
__pyx_t_4 = __pyx_t_5;
1102
if (!__pyx_t_4) break;
1104
/* "bzrlib/_annotator_pyx.pyx":130
1105
* # annotate NEWS' from 7.25s to 7.16s, so it *is* a visible impact.
1107
* or PyObject_RichCompareBool_ptr(left, right, Py_EQ)): # <<<<<<<<<<<<<<
1108
* # Identical values, step both
1109
* Py_INCREF_ptr(left)
1111
__pyx_t_4 = (__pyx_v_left == __pyx_v_right);
1113
__pyx_t_5 = PyObject_RichCompareBool(__pyx_v_left, __pyx_v_right, Py_EQ);
1115
__pyx_t_5 = __pyx_t_4;
1119
/* "bzrlib/_annotator_pyx.pyx":132
1120
* or PyObject_RichCompareBool_ptr(left, right, Py_EQ)):
1121
* # Identical values, step both
1122
* Py_INCREF_ptr(left) # <<<<<<<<<<<<<<
1123
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1124
* left = _next_tuple_entry(ann_one, &pos_one)
1126
Py_INCREF(__pyx_v_left);
1128
/* "bzrlib/_annotator_pyx.pyx":133
1129
* # Identical values, step both
1130
* Py_INCREF_ptr(left)
1131
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) # <<<<<<<<<<<<<<
1132
* left = _next_tuple_entry(ann_one, &pos_one)
1133
* right = _next_tuple_entry(ann_two, &pos_two)
1135
PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left);
1137
/* "bzrlib/_annotator_pyx.pyx":134
1138
* Py_INCREF_ptr(left)
1139
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1140
* left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<<
1141
* right = _next_tuple_entry(ann_two, &pos_two)
1142
* elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)):
1144
__pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
1146
/* "bzrlib/_annotator_pyx.pyx":135
1147
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1148
* left = _next_tuple_entry(ann_one, &pos_one)
1149
* right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<<
1150
* elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)):
1151
* # left < right or right == NULL
1153
__pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
1157
/* "bzrlib/_annotator_pyx.pyx":136
1158
* left = _next_tuple_entry(ann_one, &pos_one)
1159
* right = _next_tuple_entry(ann_two, &pos_two)
1160
* elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)): # <<<<<<<<<<<<<<
1161
* # left < right or right == NULL
1162
* Py_INCREF_ptr(left)
1164
__pyx_t_1 = PyObject_RichCompareBool(__pyx_v_left, __pyx_v_right, Py_LT);
1167
/* "bzrlib/_annotator_pyx.pyx":138
1168
* elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)):
1169
* # left < right or right == NULL
1170
* Py_INCREF_ptr(left) # <<<<<<<<<<<<<<
1171
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1172
* left = _next_tuple_entry(ann_one, &pos_one)
1174
Py_INCREF(__pyx_v_left);
1176
/* "bzrlib/_annotator_pyx.pyx":139
1177
* # left < right or right == NULL
1178
* Py_INCREF_ptr(left)
1179
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) # <<<<<<<<<<<<<<
1180
* left = _next_tuple_entry(ann_one, &pos_one)
1181
* else: # right < left or left == NULL
1183
PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left);
1185
/* "bzrlib/_annotator_pyx.pyx":140
1186
* Py_INCREF_ptr(left)
1187
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1188
* left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<<
1189
* else: # right < left or left == NULL
1190
* Py_INCREF_ptr(right)
1192
__pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
1197
/* "bzrlib/_annotator_pyx.pyx":142
1198
* left = _next_tuple_entry(ann_one, &pos_one)
1199
* else: # right < left or left == NULL
1200
* Py_INCREF_ptr(right) # <<<<<<<<<<<<<<
1201
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1202
* right = _next_tuple_entry(ann_two, &pos_two)
1204
Py_INCREF(__pyx_v_right);
1206
/* "bzrlib/_annotator_pyx.pyx":143
1207
* else: # right < left or left == NULL
1208
* Py_INCREF_ptr(right)
1209
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) # <<<<<<<<<<<<<<
1210
* right = _next_tuple_entry(ann_two, &pos_two)
1211
* out_pos = out_pos + 1
1213
PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_right);
1215
/* "bzrlib/_annotator_pyx.pyx":144
1216
* Py_INCREF_ptr(right)
1217
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1218
* right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<<
1219
* out_pos = out_pos + 1
1220
* while left != NULL:
1222
__pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
1226
/* "bzrlib/_annotator_pyx.pyx":145
1227
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1228
* right = _next_tuple_entry(ann_two, &pos_two)
1229
* out_pos = out_pos + 1 # <<<<<<<<<<<<<<
1230
* while left != NULL:
1231
* Py_INCREF_ptr(left)
1233
__pyx_v_out_pos = (__pyx_v_out_pos + 1);
1236
/* "bzrlib/_annotator_pyx.pyx":146
1237
* right = _next_tuple_entry(ann_two, &pos_two)
1238
* out_pos = out_pos + 1
1239
* while left != NULL: # <<<<<<<<<<<<<<
1240
* Py_INCREF_ptr(left)
1241
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1244
__pyx_t_5 = (__pyx_v_left != NULL);
1245
if (!__pyx_t_5) break;
1247
/* "bzrlib/_annotator_pyx.pyx":147
1248
* out_pos = out_pos + 1
1249
* while left != NULL:
1250
* Py_INCREF_ptr(left) # <<<<<<<<<<<<<<
1251
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1252
* left = _next_tuple_entry(ann_one, &pos_one)
1254
Py_INCREF(__pyx_v_left);
1256
/* "bzrlib/_annotator_pyx.pyx":148
1257
* while left != NULL:
1258
* Py_INCREF_ptr(left)
1259
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) # <<<<<<<<<<<<<<
1260
* left = _next_tuple_entry(ann_one, &pos_one)
1261
* out_pos = out_pos + 1
1263
PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left);
1265
/* "bzrlib/_annotator_pyx.pyx":149
1266
* Py_INCREF_ptr(left)
1267
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1268
* left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<<
1269
* out_pos = out_pos + 1
1270
* while right != NULL:
1272
__pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
1274
/* "bzrlib/_annotator_pyx.pyx":150
1275
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
1276
* left = _next_tuple_entry(ann_one, &pos_one)
1277
* out_pos = out_pos + 1 # <<<<<<<<<<<<<<
1278
* while right != NULL:
1279
* Py_INCREF_ptr(right)
1281
__pyx_v_out_pos = (__pyx_v_out_pos + 1);
1284
/* "bzrlib/_annotator_pyx.pyx":151
1285
* left = _next_tuple_entry(ann_one, &pos_one)
1286
* out_pos = out_pos + 1
1287
* while right != NULL: # <<<<<<<<<<<<<<
1288
* Py_INCREF_ptr(right)
1289
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1292
__pyx_t_5 = (__pyx_v_right != NULL);
1293
if (!__pyx_t_5) break;
1295
/* "bzrlib/_annotator_pyx.pyx":152
1296
* out_pos = out_pos + 1
1297
* while right != NULL:
1298
* Py_INCREF_ptr(right) # <<<<<<<<<<<<<<
1299
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1300
* right = _next_tuple_entry(ann_two, &pos_two)
1302
Py_INCREF(__pyx_v_right);
1304
/* "bzrlib/_annotator_pyx.pyx":153
1305
* while right != NULL:
1306
* Py_INCREF_ptr(right)
1307
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) # <<<<<<<<<<<<<<
1308
* right = _next_tuple_entry(ann_two, &pos_two)
1309
* out_pos = out_pos + 1
1311
PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_right);
1313
/* "bzrlib/_annotator_pyx.pyx":154
1314
* Py_INCREF_ptr(right)
1315
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1316
* right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<<
1317
* out_pos = out_pos + 1
1318
* if out_pos != PyTuple_GET_SIZE(new_ann):
1320
__pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
1322
/* "bzrlib/_annotator_pyx.pyx":155
1323
* PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
1324
* right = _next_tuple_entry(ann_two, &pos_two)
1325
* out_pos = out_pos + 1 # <<<<<<<<<<<<<<
1326
* if out_pos != PyTuple_GET_SIZE(new_ann):
1327
* # Timing _PyTuple_Resize was not significantly faster that slicing
1329
__pyx_v_out_pos = (__pyx_v_out_pos + 1);
1332
/* "bzrlib/_annotator_pyx.pyx":156
1333
* right = _next_tuple_entry(ann_two, &pos_two)
1334
* out_pos = out_pos + 1
1335
* if out_pos != PyTuple_GET_SIZE(new_ann): # <<<<<<<<<<<<<<
1336
* # Timing _PyTuple_Resize was not significantly faster that slicing
1337
* # PyTuple_Resize((<PyObject **>new_ann), out_pos)
1339
__pyx_t_5 = (__pyx_v_out_pos != PyTuple_GET_SIZE(__pyx_v_new_ann));
1342
/* "bzrlib/_annotator_pyx.pyx":159
1343
* # Timing _PyTuple_Resize was not significantly faster that slicing
1344
* # PyTuple_Resize((<PyObject **>new_ann), out_pos)
1345
* new_ann = new_ann[0:out_pos] # <<<<<<<<<<<<<<
1346
* PyDict_SetItem(cache, cache_key, new_ann)
1349
__pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_new_ann, 0, __pyx_v_out_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1350
__Pyx_GOTREF(__pyx_t_2);
1351
__Pyx_DECREF(__pyx_v_new_ann);
1352
__pyx_v_new_ann = __pyx_t_2;
1358
/* "bzrlib/_annotator_pyx.pyx":160
1359
* # PyTuple_Resize((<PyObject **>new_ann), out_pos)
1360
* new_ann = new_ann[0:out_pos]
1361
* PyDict_SetItem(cache, cache_key, new_ann) # <<<<<<<<<<<<<<
1365
__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;}
1367
/* "bzrlib/_annotator_pyx.pyx":161
1368
* new_ann = new_ann[0:out_pos]
1369
* PyDict_SetItem(cache, cache_key, new_ann)
1370
* return new_ann # <<<<<<<<<<<<<<
1374
__Pyx_XDECREF(__pyx_r);
1375
__Pyx_INCREF(__pyx_v_new_ann);
1376
__pyx_r = __pyx_v_new_ann;
1379
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
1382
__Pyx_XDECREF(__pyx_t_2);
1383
__Pyx_AddTraceback("bzrlib._annotator_pyx._combine_annotations");
1386
__Pyx_DECREF(__pyx_v_cache_key);
1387
__Pyx_DECREF(__pyx_v_new_ann);
1388
__Pyx_XGIVEREF(__pyx_r);
1389
__Pyx_RefNannyFinishContext();
1393
/* "bzrlib/_annotator_pyx.pyx":164
1396
* cdef int _apply_parent_annotations(annotations, parent_annotations, # <<<<<<<<<<<<<<
1397
* matching_blocks) except -1:
1398
* """Apply the annotations from parent_annotations into annotations.
1401
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) {
1402
Py_ssize_t __pyx_v_parent_idx;
1403
Py_ssize_t __pyx_v_lines_idx;
1404
Py_ssize_t __pyx_v_match_len;
1405
Py_ssize_t __pyx_v_idx;
1406
PyListObject *__pyx_v_par_list;
1407
PyListObject *__pyx_v_ann_list;
1408
PyObject **__pyx_v_par_temp;
1409
PyObject **__pyx_v_ann_temp;
1412
Py_ssize_t __pyx_t_2;
1413
PyObject *__pyx_t_3 = NULL;
1414
PyObject *__pyx_t_4 = NULL;
1415
PyObject *__pyx_t_5 = NULL;
1416
PyObject *__pyx_t_6 = NULL;
1417
PyObject *__pyx_t_7 = NULL;
1418
Py_ssize_t __pyx_t_8;
1419
Py_ssize_t __pyx_t_9;
1420
Py_ssize_t __pyx_t_10;
1421
PyObject *__pyx_t_11 = NULL;
1422
__Pyx_RefNannySetupContext("_apply_parent_annotations");
1424
/* "bzrlib/_annotator_pyx.pyx":174
1425
* cdef PyObject **par_temp, **ann_temp
1427
* _check_annotations_are_lists(annotations, parent_annotations) # <<<<<<<<<<<<<<
1428
* par_list = <PyListObject *>parent_annotations
1429
* ann_list = <PyListObject *>annotations
1431
__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;}
1433
/* "bzrlib/_annotator_pyx.pyx":175
1435
* _check_annotations_are_lists(annotations, parent_annotations)
1436
* par_list = <PyListObject *>parent_annotations # <<<<<<<<<<<<<<
1437
* ann_list = <PyListObject *>annotations
1438
* # For NEWS and bzrlib/builtins.py, over 99% of the lines are simply copied
1440
__pyx_v_par_list = ((PyListObject *)__pyx_v_parent_annotations);
1442
/* "bzrlib/_annotator_pyx.pyx":176
1443
* _check_annotations_are_lists(annotations, parent_annotations)
1444
* par_list = <PyListObject *>parent_annotations
1445
* ann_list = <PyListObject *>annotations # <<<<<<<<<<<<<<
1446
* # For NEWS and bzrlib/builtins.py, over 99% of the lines are simply copied
1447
* # across from the parent entry. So this routine is heavily optimized for
1449
__pyx_v_ann_list = ((PyListObject *)__pyx_v_annotations);
1451
/* "bzrlib/_annotator_pyx.pyx":181
1452
* # that. Would be interesting if we could use memcpy() but we have to incref
1454
* for parent_idx, lines_idx, match_len in matching_blocks: # <<<<<<<<<<<<<<
1455
* _check_match_ranges(parent_annotations, annotations,
1456
* parent_idx, lines_idx, match_len)
1458
if (PyList_CheckExact(__pyx_v_matching_blocks) || PyTuple_CheckExact(__pyx_v_matching_blocks)) {
1459
__pyx_t_2 = 0; __pyx_t_3 = __pyx_v_matching_blocks; __Pyx_INCREF(__pyx_t_3);
1461
__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;}
1462
__Pyx_GOTREF(__pyx_t_3);
1465
if (likely(PyList_CheckExact(__pyx_t_3))) {
1466
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
1467
__pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
1468
} else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
1469
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
1470
__pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
1472
__pyx_t_4 = PyIter_Next(__pyx_t_3);
1474
if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1477
__Pyx_GOTREF(__pyx_t_4);
1479
if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 3)) {
1480
PyObject* tuple = __pyx_t_4;
1481
__pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5);
1482
__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;}
1483
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1484
__pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
1485
__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;}
1486
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1487
__pyx_t_7 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_7);
1488
__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;}
1489
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1490
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1491
__pyx_v_parent_idx = __pyx_t_8;
1492
__pyx_v_lines_idx = __pyx_t_9;
1493
__pyx_v_match_len = __pyx_t_10;
1495
__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;}
1496
__Pyx_GOTREF(__pyx_t_11);
1497
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1498
__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;}
1499
__Pyx_GOTREF(__pyx_t_5);
1500
__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;}
1501
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1502
__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;}
1503
__Pyx_GOTREF(__pyx_t_6);
1504
__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;}
1505
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1506
__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;}
1507
__Pyx_GOTREF(__pyx_t_7);
1508
__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;}
1509
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1510
if (__Pyx_EndUnpack(__pyx_t_11, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1511
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
1512
__pyx_v_parent_idx = __pyx_t_10;
1513
__pyx_v_lines_idx = __pyx_t_9;
1514
__pyx_v_match_len = __pyx_t_8;
1517
/* "bzrlib/_annotator_pyx.pyx":183
1518
* for parent_idx, lines_idx, match_len in matching_blocks:
1519
* _check_match_ranges(parent_annotations, annotations,
1520
* parent_idx, lines_idx, match_len) # <<<<<<<<<<<<<<
1521
* par_temp = par_list.ob_item + parent_idx
1522
* ann_temp = ann_list.ob_item + lines_idx
1524
__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;}
1526
/* "bzrlib/_annotator_pyx.pyx":184
1527
* _check_match_ranges(parent_annotations, annotations,
1528
* parent_idx, lines_idx, match_len)
1529
* par_temp = par_list.ob_item + parent_idx # <<<<<<<<<<<<<<
1530
* ann_temp = ann_list.ob_item + lines_idx
1531
* for idx from 0 <= idx < match_len:
1533
__pyx_v_par_temp = (__pyx_v_par_list->ob_item + __pyx_v_parent_idx);
1535
/* "bzrlib/_annotator_pyx.pyx":185
1536
* parent_idx, lines_idx, match_len)
1537
* par_temp = par_list.ob_item + parent_idx
1538
* ann_temp = ann_list.ob_item + lines_idx # <<<<<<<<<<<<<<
1539
* for idx from 0 <= idx < match_len:
1540
* Py_INCREF_ptr(par_temp[idx])
1542
__pyx_v_ann_temp = (__pyx_v_ann_list->ob_item + __pyx_v_lines_idx);
1544
/* "bzrlib/_annotator_pyx.pyx":186
1545
* par_temp = par_list.ob_item + parent_idx
1546
* ann_temp = ann_list.ob_item + lines_idx
1547
* for idx from 0 <= idx < match_len: # <<<<<<<<<<<<<<
1548
* Py_INCREF_ptr(par_temp[idx])
1549
* Py_DECREF_ptr(ann_temp[idx])
1551
__pyx_t_8 = __pyx_v_match_len;
1552
for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_8; __pyx_v_idx++) {
1554
/* "bzrlib/_annotator_pyx.pyx":187
1555
* ann_temp = ann_list.ob_item + lines_idx
1556
* for idx from 0 <= idx < match_len:
1557
* Py_INCREF_ptr(par_temp[idx]) # <<<<<<<<<<<<<<
1558
* Py_DECREF_ptr(ann_temp[idx])
1559
* ann_temp[idx] = par_temp[idx]
1561
Py_INCREF((__pyx_v_par_temp[__pyx_v_idx]));
1563
/* "bzrlib/_annotator_pyx.pyx":188
1564
* for idx from 0 <= idx < match_len:
1565
* Py_INCREF_ptr(par_temp[idx])
1566
* Py_DECREF_ptr(ann_temp[idx]) # <<<<<<<<<<<<<<
1567
* ann_temp[idx] = par_temp[idx]
1570
Py_DECREF((__pyx_v_ann_temp[__pyx_v_idx]));
1572
/* "bzrlib/_annotator_pyx.pyx":189
1573
* Py_INCREF_ptr(par_temp[idx])
1574
* Py_DECREF_ptr(ann_temp[idx])
1575
* ann_temp[idx] = par_temp[idx] # <<<<<<<<<<<<<<
1579
(__pyx_v_ann_temp[__pyx_v_idx]) = (__pyx_v_par_temp[__pyx_v_idx]);
1582
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1584
/* "bzrlib/_annotator_pyx.pyx":190
1585
* Py_DECREF_ptr(ann_temp[idx])
1586
* ann_temp[idx] = par_temp[idx]
1587
* return 0 # <<<<<<<<<<<<<<
1597
__Pyx_XDECREF(__pyx_t_3);
1598
__Pyx_XDECREF(__pyx_t_4);
1599
__Pyx_XDECREF(__pyx_t_5);
1600
__Pyx_XDECREF(__pyx_t_6);
1601
__Pyx_XDECREF(__pyx_t_7);
1602
__Pyx_XDECREF(__pyx_t_11);
1603
__Pyx_AddTraceback("bzrlib._annotator_pyx._apply_parent_annotations");
1606
__Pyx_RefNannyFinishContext();
1610
/* "bzrlib/_annotator_pyx.pyx":193
1613
* cdef int _merge_annotations(this_annotation, annotations, parent_annotations, # <<<<<<<<<<<<<<
1614
* matching_blocks, ann_cache) except -1:
1615
* cdef Py_ssize_t parent_idx, ann_idx, lines_idx, match_len, idx
1618
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) {
1619
Py_ssize_t __pyx_v_parent_idx;
1620
Py_ssize_t __pyx_v_ann_idx;
1621
Py_ssize_t __pyx_v_lines_idx;
1622
Py_ssize_t __pyx_v_match_len;
1623
Py_ssize_t __pyx_v_idx;
1624
PyObject *__pyx_v_ann_temp;
1625
PyObject *__pyx_v_par_temp;
1626
PyObject *__pyx_v_last_ann;
1627
PyObject *__pyx_v_last_parent;
1628
PyObject *__pyx_v_last_res;
1629
PyObject *__pyx_v_par_ann;
1630
PyObject *__pyx_v_ann;
1631
PyObject *__pyx_v_new_ann;
1634
Py_ssize_t __pyx_t_2;
1635
PyObject *__pyx_t_3 = NULL;
1636
PyObject *__pyx_t_4 = NULL;
1637
PyObject *__pyx_t_5 = NULL;
1638
PyObject *__pyx_t_6 = NULL;
1639
PyObject *__pyx_t_7 = NULL;
1640
Py_ssize_t __pyx_t_8;
1641
Py_ssize_t __pyx_t_9;
1642
Py_ssize_t __pyx_t_10;
1643
PyObject *__pyx_t_11 = NULL;
1647
__Pyx_RefNannySetupContext("_merge_annotations");
1648
__pyx_v_last_ann = Py_None; __Pyx_INCREF(Py_None);
1649
__pyx_v_last_parent = Py_None; __Pyx_INCREF(Py_None);
1650
__pyx_v_last_res = Py_None; __Pyx_INCREF(Py_None);
1651
__pyx_v_par_ann = Py_None; __Pyx_INCREF(Py_None);
1652
__pyx_v_ann = Py_None; __Pyx_INCREF(Py_None);
1653
__pyx_v_new_ann = Py_None; __Pyx_INCREF(Py_None);
1655
/* "bzrlib/_annotator_pyx.pyx":199
1656
* cdef PyObject *ann_temp, *par_temp
1658
* _check_annotations_are_lists(annotations, parent_annotations) # <<<<<<<<<<<<<<
1660
* last_parent = None
1662
__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;}
1664
/* "bzrlib/_annotator_pyx.pyx":200
1666
* _check_annotations_are_lists(annotations, parent_annotations)
1667
* last_ann = None # <<<<<<<<<<<<<<
1668
* last_parent = None
1671
__Pyx_INCREF(Py_None);
1672
__Pyx_DECREF(__pyx_v_last_ann);
1673
__pyx_v_last_ann = Py_None;
1675
/* "bzrlib/_annotator_pyx.pyx":201
1676
* _check_annotations_are_lists(annotations, parent_annotations)
1678
* last_parent = None # <<<<<<<<<<<<<<
1680
* for parent_idx, lines_idx, match_len in matching_blocks:
1682
__Pyx_INCREF(Py_None);
1683
__Pyx_DECREF(__pyx_v_last_parent);
1684
__pyx_v_last_parent = Py_None;
1686
/* "bzrlib/_annotator_pyx.pyx":202
1688
* last_parent = None
1689
* last_res = None # <<<<<<<<<<<<<<
1690
* for parent_idx, lines_idx, match_len in matching_blocks:
1691
* _check_match_ranges(parent_annotations, annotations,
1693
__Pyx_INCREF(Py_None);
1694
__Pyx_DECREF(__pyx_v_last_res);
1695
__pyx_v_last_res = Py_None;
1697
/* "bzrlib/_annotator_pyx.pyx":203
1698
* last_parent = None
1700
* for parent_idx, lines_idx, match_len in matching_blocks: # <<<<<<<<<<<<<<
1701
* _check_match_ranges(parent_annotations, annotations,
1702
* parent_idx, lines_idx, match_len)
1704
if (PyList_CheckExact(__pyx_v_matching_blocks) || PyTuple_CheckExact(__pyx_v_matching_blocks)) {
1705
__pyx_t_2 = 0; __pyx_t_3 = __pyx_v_matching_blocks; __Pyx_INCREF(__pyx_t_3);
1707
__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;}
1708
__Pyx_GOTREF(__pyx_t_3);
1711
if (likely(PyList_CheckExact(__pyx_t_3))) {
1712
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
1713
__pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
1714
} else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
1715
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
1716
__pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
1718
__pyx_t_4 = PyIter_Next(__pyx_t_3);
1720
if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1723
__Pyx_GOTREF(__pyx_t_4);
1725
if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 3)) {
1726
PyObject* tuple = __pyx_t_4;
1727
__pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5);
1728
__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;}
1729
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1730
__pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
1731
__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;}
1732
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1733
__pyx_t_7 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_7);
1734
__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;}
1735
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1736
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1737
__pyx_v_parent_idx = __pyx_t_8;
1738
__pyx_v_lines_idx = __pyx_t_9;
1739
__pyx_v_match_len = __pyx_t_10;
1741
__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;}
1742
__Pyx_GOTREF(__pyx_t_11);
1743
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1744
__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;}
1745
__Pyx_GOTREF(__pyx_t_5);
1746
__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;}
1747
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1748
__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;}
1749
__Pyx_GOTREF(__pyx_t_6);
1750
__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;}
1751
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1752
__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;}
1753
__Pyx_GOTREF(__pyx_t_7);
1754
__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;}
1755
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1756
if (__Pyx_EndUnpack(__pyx_t_11, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1757
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
1758
__pyx_v_parent_idx = __pyx_t_10;
1759
__pyx_v_lines_idx = __pyx_t_9;
1760
__pyx_v_match_len = __pyx_t_8;
1763
/* "bzrlib/_annotator_pyx.pyx":205
1764
* for parent_idx, lines_idx, match_len in matching_blocks:
1765
* _check_match_ranges(parent_annotations, annotations,
1766
* parent_idx, lines_idx, match_len) # <<<<<<<<<<<<<<
1767
* # For lines which match this parent, we will now resolve whether
1768
* # this parent wins over the current annotation
1770
__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;}
1772
/* "bzrlib/_annotator_pyx.pyx":208
1773
* # For lines which match this parent, we will now resolve whether
1774
* # this parent wins over the current annotation
1775
* for idx from 0 <= idx < match_len: # <<<<<<<<<<<<<<
1776
* ann_idx = lines_idx + idx
1777
* ann_temp = PyList_GET_ITEM(annotations, ann_idx)
1779
__pyx_t_8 = __pyx_v_match_len;
1780
for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_8; __pyx_v_idx++) {
1782
/* "bzrlib/_annotator_pyx.pyx":209
1783
* # this parent wins over the current annotation
1784
* for idx from 0 <= idx < match_len:
1785
* ann_idx = lines_idx + idx # <<<<<<<<<<<<<<
1786
* ann_temp = PyList_GET_ITEM(annotations, ann_idx)
1787
* par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx)
1789
__pyx_v_ann_idx = (__pyx_v_lines_idx + __pyx_v_idx);
1791
/* "bzrlib/_annotator_pyx.pyx":210
1792
* for idx from 0 <= idx < match_len:
1793
* ann_idx = lines_idx + idx
1794
* ann_temp = PyList_GET_ITEM(annotations, ann_idx) # <<<<<<<<<<<<<<
1795
* par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx)
1796
* if (ann_temp == par_temp):
1798
__pyx_v_ann_temp = PyList_GET_ITEM(__pyx_v_annotations, __pyx_v_ann_idx);
1800
/* "bzrlib/_annotator_pyx.pyx":211
1801
* ann_idx = lines_idx + idx
1802
* ann_temp = PyList_GET_ITEM(annotations, ann_idx)
1803
* par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx) # <<<<<<<<<<<<<<
1804
* if (ann_temp == par_temp):
1805
* # This is parent, do nothing
1807
__pyx_v_par_temp = PyList_GET_ITEM(__pyx_v_parent_annotations, (__pyx_v_parent_idx + __pyx_v_idx));
1809
/* "bzrlib/_annotator_pyx.pyx":212
1810
* ann_temp = PyList_GET_ITEM(annotations, ann_idx)
1811
* par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx)
1812
* if (ann_temp == par_temp): # <<<<<<<<<<<<<<
1813
* # This is parent, do nothing
1814
* # Pointer comparison is fine here. Value comparison would
1816
__pyx_t_12 = (__pyx_v_ann_temp == __pyx_v_par_temp);
1819
/* "bzrlib/_annotator_pyx.pyx":220
1820
* # PyObject_RichCompareBool using pointer comparison drops
1821
* # timing from 215ms => 125ms
1822
* continue # <<<<<<<<<<<<<<
1823
* par_ann = <object>par_temp
1824
* ann = <object>ann_temp
1826
goto __pyx_L5_continue;
1831
/* "bzrlib/_annotator_pyx.pyx":221
1832
* # timing from 215ms => 125ms
1834
* par_ann = <object>par_temp # <<<<<<<<<<<<<<
1835
* ann = <object>ann_temp
1836
* if (ann is this_annotation):
1838
__Pyx_INCREF(((PyObject *)__pyx_v_par_temp));
1839
__Pyx_DECREF(__pyx_v_par_ann);
1840
__pyx_v_par_ann = ((PyObject *)__pyx_v_par_temp);
1842
/* "bzrlib/_annotator_pyx.pyx":222
1844
* par_ann = <object>par_temp
1845
* ann = <object>ann_temp # <<<<<<<<<<<<<<
1846
* if (ann is this_annotation):
1847
* # Originally claimed 'this', but it was really in this
1849
__Pyx_INCREF(((PyObject *)__pyx_v_ann_temp));
1850
__Pyx_DECREF(__pyx_v_ann);
1851
__pyx_v_ann = ((PyObject *)__pyx_v_ann_temp);
1853
/* "bzrlib/_annotator_pyx.pyx":223
1854
* par_ann = <object>par_temp
1855
* ann = <object>ann_temp
1856
* if (ann is this_annotation): # <<<<<<<<<<<<<<
1857
* # Originally claimed 'this', but it was really in this
1860
__pyx_t_12 = (__pyx_v_ann == __pyx_v_this_annotation);
1863
/* "bzrlib/_annotator_pyx.pyx":226
1864
* # Originally claimed 'this', but it was really in this
1866
* Py_INCREF(par_ann) # <<<<<<<<<<<<<<
1867
* PyList_SetItem(annotations, ann_idx, par_ann)
1870
Py_INCREF(__pyx_v_par_ann);
1872
/* "bzrlib/_annotator_pyx.pyx":227
1874
* Py_INCREF(par_ann)
1875
* PyList_SetItem(annotations, ann_idx, par_ann) # <<<<<<<<<<<<<<
1877
* # Resolve the fact that both sides have a different value for
1879
__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;}
1881
/* "bzrlib/_annotator_pyx.pyx":228
1882
* Py_INCREF(par_ann)
1883
* PyList_SetItem(annotations, ann_idx, par_ann)
1884
* continue # <<<<<<<<<<<<<<
1885
* # Resolve the fact that both sides have a different value for
1888
goto __pyx_L5_continue;
1893
/* "bzrlib/_annotator_pyx.pyx":231
1894
* # Resolve the fact that both sides have a different value for
1896
* if (ann is last_ann and par_ann is last_parent): # <<<<<<<<<<<<<<
1897
* Py_INCREF(last_res)
1898
* PyList_SetItem(annotations, ann_idx, last_res)
1900
__pyx_t_12 = (__pyx_v_ann == __pyx_v_last_ann);
1902
__pyx_t_13 = (__pyx_v_par_ann == __pyx_v_last_parent);
1903
__pyx_t_14 = __pyx_t_13;
1905
__pyx_t_14 = __pyx_t_12;
1909
/* "bzrlib/_annotator_pyx.pyx":232
1911
* if (ann is last_ann and par_ann is last_parent):
1912
* Py_INCREF(last_res) # <<<<<<<<<<<<<<
1913
* PyList_SetItem(annotations, ann_idx, last_res)
1916
Py_INCREF(__pyx_v_last_res);
1918
/* "bzrlib/_annotator_pyx.pyx":233
1919
* if (ann is last_ann and par_ann is last_parent):
1920
* Py_INCREF(last_res)
1921
* PyList_SetItem(annotations, ann_idx, last_res) # <<<<<<<<<<<<<<
1923
* new_ann = _combine_annotations(ann, par_ann, ann_cache)
1925
__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;}
1930
/* "bzrlib/_annotator_pyx.pyx":235
1931
* PyList_SetItem(annotations, ann_idx, last_res)
1933
* new_ann = _combine_annotations(ann, par_ann, ann_cache) # <<<<<<<<<<<<<<
1934
* Py_INCREF(new_ann)
1935
* PyList_SetItem(annotations, ann_idx, new_ann)
1937
__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;}
1938
__Pyx_GOTREF(__pyx_t_4);
1939
__Pyx_DECREF(__pyx_v_new_ann);
1940
__pyx_v_new_ann = __pyx_t_4;
1943
/* "bzrlib/_annotator_pyx.pyx":236
1945
* new_ann = _combine_annotations(ann, par_ann, ann_cache)
1946
* Py_INCREF(new_ann) # <<<<<<<<<<<<<<
1947
* PyList_SetItem(annotations, ann_idx, new_ann)
1950
Py_INCREF(__pyx_v_new_ann);
1952
/* "bzrlib/_annotator_pyx.pyx":237
1953
* new_ann = _combine_annotations(ann, par_ann, ann_cache)
1954
* Py_INCREF(new_ann)
1955
* PyList_SetItem(annotations, ann_idx, new_ann) # <<<<<<<<<<<<<<
1957
* last_parent = par_ann
1959
__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;}
1961
/* "bzrlib/_annotator_pyx.pyx":238
1962
* Py_INCREF(new_ann)
1963
* PyList_SetItem(annotations, ann_idx, new_ann)
1964
* last_ann = ann # <<<<<<<<<<<<<<
1965
* last_parent = par_ann
1966
* last_res = new_ann
1968
__Pyx_INCREF(__pyx_v_ann);
1969
__Pyx_DECREF(__pyx_v_last_ann);
1970
__pyx_v_last_ann = __pyx_v_ann;
1972
/* "bzrlib/_annotator_pyx.pyx":239
1973
* PyList_SetItem(annotations, ann_idx, new_ann)
1975
* last_parent = par_ann # <<<<<<<<<<<<<<
1976
* last_res = new_ann
1979
__Pyx_INCREF(__pyx_v_par_ann);
1980
__Pyx_DECREF(__pyx_v_last_parent);
1981
__pyx_v_last_parent = __pyx_v_par_ann;
1983
/* "bzrlib/_annotator_pyx.pyx":240
1985
* last_parent = par_ann
1986
* last_res = new_ann # <<<<<<<<<<<<<<
1990
__Pyx_INCREF(__pyx_v_new_ann);
1991
__Pyx_DECREF(__pyx_v_last_res);
1992
__pyx_v_last_res = __pyx_v_new_ann;
1998
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2000
/* "bzrlib/_annotator_pyx.pyx":241
2001
* last_parent = par_ann
2002
* last_res = new_ann
2003
* return 0 # <<<<<<<<<<<<<<
2013
__Pyx_XDECREF(__pyx_t_3);
2014
__Pyx_XDECREF(__pyx_t_4);
2015
__Pyx_XDECREF(__pyx_t_5);
2016
__Pyx_XDECREF(__pyx_t_6);
2017
__Pyx_XDECREF(__pyx_t_7);
2018
__Pyx_XDECREF(__pyx_t_11);
2019
__Pyx_AddTraceback("bzrlib._annotator_pyx._merge_annotations");
2022
__Pyx_DECREF(__pyx_v_last_ann);
2023
__Pyx_DECREF(__pyx_v_last_parent);
2024
__Pyx_DECREF(__pyx_v_last_res);
2025
__Pyx_DECREF(__pyx_v_par_ann);
2026
__Pyx_DECREF(__pyx_v_ann);
2027
__Pyx_DECREF(__pyx_v_new_ann);
2028
__Pyx_RefNannyFinishContext();
2032
/* "bzrlib/_annotator_pyx.pyx":247
2033
* """Class that drives performing annotations."""
2035
* def _update_from_first_parent(self, key, annotations, lines, parent_key): # <<<<<<<<<<<<<<
2036
* """Reannotate this text relative to its first parent."""
2037
* (parent_annotations,
2040
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2041
static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent[] = "Reannotate this text relative to its first parent.";
2042
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)};
2043
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2044
PyObject *__pyx_v_self = 0;
2045
PyObject *__pyx_v_key = 0;
2046
PyObject *__pyx_v_annotations = 0;
2047
PyObject *__pyx_v_lines = 0;
2048
PyObject *__pyx_v_parent_key = 0;
2049
PyObject *__pyx_v_parent_annotations;
2050
PyObject *__pyx_v_matching_blocks;
2051
PyObject *__pyx_r = NULL;
2052
PyObject *__pyx_t_1 = NULL;
2053
PyObject *__pyx_t_2 = NULL;
2054
PyObject *__pyx_t_3 = NULL;
2055
PyObject *__pyx_t_4 = NULL;
2057
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};
2058
__Pyx_RefNannySetupContext("_update_from_first_parent");
2059
__pyx_self = __pyx_self;
2060
if (unlikely(__pyx_kwds)) {
2061
Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2062
PyObject* values[5] = {0,0,0,0,0};
2063
switch (PyTuple_GET_SIZE(__pyx_args)) {
2064
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2065
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2066
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2067
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2068
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2070
default: goto __pyx_L5_argtuple_error;
2072
switch (PyTuple_GET_SIZE(__pyx_args)) {
2074
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
2075
if (likely(values[0])) kw_args--;
2076
else goto __pyx_L5_argtuple_error;
2078
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
2079
if (likely(values[1])) kw_args--;
2081
__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;}
2084
values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__annotations);
2085
if (likely(values[2])) kw_args--;
2087
__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;}
2090
values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lines);
2091
if (likely(values[3])) kw_args--;
2093
__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;}
2096
values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parent_key);
2097
if (likely(values[4])) kw_args--;
2099
__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;}
2102
if (unlikely(kw_args > 0)) {
2103
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;}
2105
__pyx_v_self = values[0];
2106
__pyx_v_key = values[1];
2107
__pyx_v_annotations = values[2];
2108
__pyx_v_lines = values[3];
2109
__pyx_v_parent_key = values[4];
2110
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
2111
goto __pyx_L5_argtuple_error;
2113
__pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
2114
__pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1);
2115
__pyx_v_annotations = PyTuple_GET_ITEM(__pyx_args, 2);
2116
__pyx_v_lines = PyTuple_GET_ITEM(__pyx_args, 3);
2117
__pyx_v_parent_key = PyTuple_GET_ITEM(__pyx_args, 4);
2119
goto __pyx_L4_argument_unpacking_done;
2120
__pyx_L5_argtuple_error:;
2121
__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;}
2123
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_first_parent");
2124
__Pyx_RefNannyFinishContext();
2126
__pyx_L4_argument_unpacking_done:;
2127
__pyx_v_parent_annotations = Py_None; __Pyx_INCREF(Py_None);
2128
__pyx_v_matching_blocks = Py_None; __Pyx_INCREF(Py_None);
2130
/* "bzrlib/_annotator_pyx.pyx":250
2131
* """Reannotate this text relative to its first parent."""
2132
* (parent_annotations,
2133
* matching_blocks) = self._get_parent_annotations_and_matches( # <<<<<<<<<<<<<<
2134
* key, lines, parent_key)
2137
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2138
__Pyx_GOTREF(__pyx_t_1);
2140
/* "bzrlib/_annotator_pyx.pyx":251
2141
* (parent_annotations,
2142
* matching_blocks) = self._get_parent_annotations_and_matches(
2143
* key, lines, parent_key) # <<<<<<<<<<<<<<
2145
* _apply_parent_annotations(annotations, parent_annotations,
2147
__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;}
2148
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
2149
__Pyx_INCREF(__pyx_v_key);
2150
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
2151
__Pyx_GIVEREF(__pyx_v_key);
2152
__Pyx_INCREF(__pyx_v_lines);
2153
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_lines);
2154
__Pyx_GIVEREF(__pyx_v_lines);
2155
__Pyx_INCREF(__pyx_v_parent_key);
2156
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_parent_key);
2157
__Pyx_GIVEREF(__pyx_v_parent_key);
2158
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2159
__Pyx_GOTREF(__pyx_t_3);
2160
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2161
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
2162
if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
2163
PyObject* tuple = __pyx_t_3;
2164
__pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
2165
__pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
2167
/* "bzrlib/_annotator_pyx.pyx":249
2168
* def _update_from_first_parent(self, key, annotations, lines, parent_key):
2169
* """Reannotate this text relative to its first parent."""
2170
* (parent_annotations, # <<<<<<<<<<<<<<
2171
* matching_blocks) = self._get_parent_annotations_and_matches(
2172
* key, lines, parent_key)
2174
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2175
__Pyx_DECREF(__pyx_v_parent_annotations);
2176
__pyx_v_parent_annotations = __pyx_t_2;
2178
__Pyx_DECREF(__pyx_v_matching_blocks);
2179
__pyx_v_matching_blocks = __pyx_t_1;
2182
__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;}
2183
__Pyx_GOTREF(__pyx_t_4);
2184
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2185
__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;}
2186
__Pyx_GOTREF(__pyx_t_2);
2187
__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;}
2188
__Pyx_GOTREF(__pyx_t_1);
2189
if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2190
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2191
__Pyx_DECREF(__pyx_v_parent_annotations);
2192
__pyx_v_parent_annotations = __pyx_t_2;
2194
__Pyx_DECREF(__pyx_v_matching_blocks);
2195
__pyx_v_matching_blocks = __pyx_t_1;
2199
/* "bzrlib/_annotator_pyx.pyx":254
2201
* _apply_parent_annotations(annotations, parent_annotations,
2202
* matching_blocks) # <<<<<<<<<<<<<<
2204
* def _update_from_other_parents(self, key, annotations, lines,
2206
__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;}
2208
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
2211
__Pyx_XDECREF(__pyx_t_1);
2212
__Pyx_XDECREF(__pyx_t_2);
2213
__Pyx_XDECREF(__pyx_t_3);
2214
__Pyx_XDECREF(__pyx_t_4);
2215
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_first_parent");
2218
__Pyx_DECREF(__pyx_v_parent_annotations);
2219
__Pyx_DECREF(__pyx_v_matching_blocks);
2220
__Pyx_XGIVEREF(__pyx_r);
2221
__Pyx_RefNannyFinishContext();
2225
/* "bzrlib/_annotator_pyx.pyx":256
2228
* def _update_from_other_parents(self, key, annotations, lines, # <<<<<<<<<<<<<<
2229
* this_annotation, parent_key):
2230
* """Reannotate this text relative to a second (or more) parent."""
2233
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2234
static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents[] = "Reannotate this text relative to a second (or more) parent.";
2235
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents = {__Pyx_NAMESTR("_update_from_other_parents"), (PyCFunction)__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents)};
2236
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2237
PyObject *__pyx_v_self = 0;
2238
PyObject *__pyx_v_key = 0;
2239
PyObject *__pyx_v_annotations = 0;
2240
PyObject *__pyx_v_lines = 0;
2241
PyObject *__pyx_v_this_annotation = 0;
2242
PyObject *__pyx_v_parent_key = 0;
2243
PyObject *__pyx_v_parent_annotations;
2244
PyObject *__pyx_v_matching_blocks;
2245
PyObject *__pyx_r = NULL;
2246
PyObject *__pyx_t_1 = NULL;
2247
PyObject *__pyx_t_2 = NULL;
2248
PyObject *__pyx_t_3 = NULL;
2249
PyObject *__pyx_t_4 = NULL;
2251
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};
2252
__Pyx_RefNannySetupContext("_update_from_other_parents");
2253
__pyx_self = __pyx_self;
2254
if (unlikely(__pyx_kwds)) {
2255
Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2256
PyObject* values[6] = {0,0,0,0,0,0};
2257
switch (PyTuple_GET_SIZE(__pyx_args)) {
2258
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2259
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2260
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2261
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2262
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2263
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2265
default: goto __pyx_L5_argtuple_error;
2267
switch (PyTuple_GET_SIZE(__pyx_args)) {
2269
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
2270
if (likely(values[0])) kw_args--;
2271
else goto __pyx_L5_argtuple_error;
2273
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
2274
if (likely(values[1])) kw_args--;
2276
__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;}
2279
values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__annotations);
2280
if (likely(values[2])) kw_args--;
2282
__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;}
2285
values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lines);
2286
if (likely(values[3])) kw_args--;
2288
__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;}
2291
values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__this_annotation);
2292
if (likely(values[4])) kw_args--;
2294
__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;}
2297
values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parent_key);
2298
if (likely(values[5])) kw_args--;
2300
__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;}
2303
if (unlikely(kw_args > 0)) {
2304
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;}
2306
__pyx_v_self = values[0];
2307
__pyx_v_key = values[1];
2308
__pyx_v_annotations = values[2];
2309
__pyx_v_lines = values[3];
2310
__pyx_v_this_annotation = values[4];
2311
__pyx_v_parent_key = values[5];
2312
} else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
2313
goto __pyx_L5_argtuple_error;
2315
__pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
2316
__pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1);
2317
__pyx_v_annotations = PyTuple_GET_ITEM(__pyx_args, 2);
2318
__pyx_v_lines = PyTuple_GET_ITEM(__pyx_args, 3);
2319
__pyx_v_this_annotation = PyTuple_GET_ITEM(__pyx_args, 4);
2320
__pyx_v_parent_key = PyTuple_GET_ITEM(__pyx_args, 5);
2322
goto __pyx_L4_argument_unpacking_done;
2323
__pyx_L5_argtuple_error:;
2324
__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;}
2326
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_other_parents");
2327
__Pyx_RefNannyFinishContext();
2329
__pyx_L4_argument_unpacking_done:;
2330
__pyx_v_parent_annotations = Py_None; __Pyx_INCREF(Py_None);
2331
__pyx_v_matching_blocks = Py_None; __Pyx_INCREF(Py_None);
2333
/* "bzrlib/_annotator_pyx.pyx":260
2334
* """Reannotate this text relative to a second (or more) parent."""
2335
* (parent_annotations,
2336
* matching_blocks) = self._get_parent_annotations_and_matches( # <<<<<<<<<<<<<<
2337
* key, lines, parent_key)
2338
* _merge_annotations(this_annotation, annotations, parent_annotations,
2340
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2341
__Pyx_GOTREF(__pyx_t_1);
2343
/* "bzrlib/_annotator_pyx.pyx":261
2344
* (parent_annotations,
2345
* matching_blocks) = self._get_parent_annotations_and_matches(
2346
* key, lines, parent_key) # <<<<<<<<<<<<<<
2347
* _merge_annotations(this_annotation, annotations, parent_annotations,
2348
* matching_blocks, self._ann_tuple_cache)
2350
__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;}
2351
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
2352
__Pyx_INCREF(__pyx_v_key);
2353
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
2354
__Pyx_GIVEREF(__pyx_v_key);
2355
__Pyx_INCREF(__pyx_v_lines);
2356
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_lines);
2357
__Pyx_GIVEREF(__pyx_v_lines);
2358
__Pyx_INCREF(__pyx_v_parent_key);
2359
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_parent_key);
2360
__Pyx_GIVEREF(__pyx_v_parent_key);
2361
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2362
__Pyx_GOTREF(__pyx_t_3);
2363
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2364
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
2365
if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
2366
PyObject* tuple = __pyx_t_3;
2367
__pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
2368
__pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
2370
/* "bzrlib/_annotator_pyx.pyx":259
2371
* this_annotation, parent_key):
2372
* """Reannotate this text relative to a second (or more) parent."""
2373
* (parent_annotations, # <<<<<<<<<<<<<<
2374
* matching_blocks) = self._get_parent_annotations_and_matches(
2375
* key, lines, parent_key)
2377
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2378
__Pyx_DECREF(__pyx_v_parent_annotations);
2379
__pyx_v_parent_annotations = __pyx_t_2;
2381
__Pyx_DECREF(__pyx_v_matching_blocks);
2382
__pyx_v_matching_blocks = __pyx_t_1;
2385
__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;}
2386
__Pyx_GOTREF(__pyx_t_4);
2387
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2388
__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;}
2389
__Pyx_GOTREF(__pyx_t_2);
2390
__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;}
2391
__Pyx_GOTREF(__pyx_t_1);
2392
if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2393
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2394
__Pyx_DECREF(__pyx_v_parent_annotations);
2395
__pyx_v_parent_annotations = __pyx_t_2;
2397
__Pyx_DECREF(__pyx_v_matching_blocks);
2398
__pyx_v_matching_blocks = __pyx_t_1;
2402
/* "bzrlib/_annotator_pyx.pyx":263
2403
* key, lines, parent_key)
2404
* _merge_annotations(this_annotation, annotations, parent_annotations,
2405
* matching_blocks, self._ann_tuple_cache) # <<<<<<<<<<<<<<
2407
* def annotate_flat(self, key):
2409
__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;}
2410
__Pyx_GOTREF(__pyx_t_3);
2411
__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;}
2412
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2414
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
2417
__Pyx_XDECREF(__pyx_t_1);
2418
__Pyx_XDECREF(__pyx_t_2);
2419
__Pyx_XDECREF(__pyx_t_3);
2420
__Pyx_XDECREF(__pyx_t_4);
2421
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_other_parents");
2424
__Pyx_DECREF(__pyx_v_parent_annotations);
2425
__Pyx_DECREF(__pyx_v_matching_blocks);
2426
__Pyx_XGIVEREF(__pyx_r);
2427
__Pyx_RefNannyFinishContext();
2431
/* "bzrlib/_annotator_pyx.pyx":265
2432
* matching_blocks, self._ann_tuple_cache)
2434
* def annotate_flat(self, key): # <<<<<<<<<<<<<<
2435
* """Determine the single-best-revision to source for each line.
2439
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2440
static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_2annotate_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 ";
2441
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat = {__Pyx_NAMESTR("annotate_flat"), (PyCFunction)__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat)};
2442
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2443
PyObject *__pyx_v_self = 0;
2444
PyObject *__pyx_v_key = 0;
2445
Py_ssize_t __pyx_v_pos;
2446
Py_ssize_t __pyx_v_num_lines;
2447
PyObject *__pyx_v_annotate;
2448
PyObject *__pyx_v_custom_tiebreaker;
2449
PyObject *__pyx_v_annotations;
2450
PyObject *__pyx_v_lines;
2451
PyObject *__pyx_v_out;
2452
PyObject *__pyx_v_heads;
2453
PyObject *__pyx_v_annotation;
2454
PyObject *__pyx_v_line;
2455
PyObject *__pyx_v_head;
2456
PyObject *__pyx_v_the_heads;
2457
PyObject *__pyx_r = NULL;
2458
PyObject *__pyx_t_1 = NULL;
2459
PyObject *__pyx_t_2 = NULL;
2460
PyObject *__pyx_t_3 = NULL;
2461
PyObject *__pyx_t_4 = NULL;
2462
Py_ssize_t __pyx_t_5;
2463
Py_ssize_t __pyx_t_6;
2466
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__key,0};
2467
__Pyx_RefNannySetupContext("annotate_flat");
2468
__pyx_self = __pyx_self;
2469
if (unlikely(__pyx_kwds)) {
2470
Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2471
PyObject* values[2] = {0,0};
2472
switch (PyTuple_GET_SIZE(__pyx_args)) {
2473
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2474
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2476
default: goto __pyx_L5_argtuple_error;
2478
switch (PyTuple_GET_SIZE(__pyx_args)) {
2480
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
2481
if (likely(values[0])) kw_args--;
2482
else goto __pyx_L5_argtuple_error;
2484
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
2485
if (likely(values[1])) kw_args--;
2487
__Pyx_RaiseArgtupleInvalid("annotate_flat", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2490
if (unlikely(kw_args > 0)) {
2491
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;}
2493
__pyx_v_self = values[0];
2494
__pyx_v_key = values[1];
2495
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2496
goto __pyx_L5_argtuple_error;
2498
__pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
2499
__pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1);
2501
goto __pyx_L4_argument_unpacking_done;
2502
__pyx_L5_argtuple_error:;
2503
__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;}
2505
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator.annotate_flat");
2506
__Pyx_RefNannyFinishContext();
2508
__pyx_L4_argument_unpacking_done:;
2509
__pyx_v_annotate = Py_None; __Pyx_INCREF(Py_None);
2510
__pyx_v_custom_tiebreaker = Py_None; __Pyx_INCREF(Py_None);
2511
__pyx_v_annotations = Py_None; __Pyx_INCREF(Py_None);
2512
__pyx_v_lines = Py_None; __Pyx_INCREF(Py_None);
2513
__pyx_v_out = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
2514
__pyx_v_heads = Py_None; __Pyx_INCREF(Py_None);
2515
__pyx_v_annotation = Py_None; __Pyx_INCREF(Py_None);
2516
__pyx_v_line = Py_None; __Pyx_INCREF(Py_None);
2517
__pyx_v_head = Py_None; __Pyx_INCREF(Py_None);
2518
__pyx_v_the_heads = Py_None; __Pyx_INCREF(Py_None);
2520
/* "bzrlib/_annotator_pyx.pyx":272
2521
* cdef Py_ssize_t pos, num_lines
2523
* from bzrlib import annotate # <<<<<<<<<<<<<<
2525
* custom_tiebreaker = annotate._break_annotation_tie
2527
__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;}
2528
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
2529
__Pyx_INCREF(((PyObject *)__pyx_n_s__annotate));
2530
PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__annotate));
2531
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__annotate));
2532
__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;}
2533
__Pyx_GOTREF(__pyx_t_2);
2534
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2535
__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;}
2536
__Pyx_GOTREF(__pyx_t_1);
2537
__Pyx_INCREF(__pyx_t_1);
2538
__Pyx_DECREF(__pyx_v_annotate);
2539
__pyx_v_annotate = __pyx_t_1;
2540
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2541
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2543
/* "bzrlib/_annotator_pyx.pyx":274
2544
* from bzrlib import annotate
2546
* custom_tiebreaker = annotate._break_annotation_tie # <<<<<<<<<<<<<<
2547
* annotations, lines = self.annotate(key)
2548
* num_lines = len(lines)
2550
__pyx_t_2 = PyObject_GetAttr(__pyx_v_annotate, __pyx_n_s_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2551
__Pyx_GOTREF(__pyx_t_2);
2552
__Pyx_DECREF(__pyx_v_custom_tiebreaker);
2553
__pyx_v_custom_tiebreaker = __pyx_t_2;
2556
/* "bzrlib/_annotator_pyx.pyx":275
2558
* custom_tiebreaker = annotate._break_annotation_tie
2559
* annotations, lines = self.annotate(key) # <<<<<<<<<<<<<<
2560
* num_lines = len(lines)
2563
__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;}
2564
__Pyx_GOTREF(__pyx_t_2);
2565
__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;}
2566
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
2567
__Pyx_INCREF(__pyx_v_key);
2568
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
2569
__Pyx_GIVEREF(__pyx_v_key);
2570
__pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2571
__Pyx_GOTREF(__pyx_t_3);
2572
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2573
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2574
if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
2575
PyObject* tuple = __pyx_t_3;
2576
__pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
2577
__pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2);
2578
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2579
__Pyx_DECREF(__pyx_v_annotations);
2580
__pyx_v_annotations = __pyx_t_1;
2582
__Pyx_DECREF(__pyx_v_lines);
2583
__pyx_v_lines = __pyx_t_2;
2586
__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;}
2587
__Pyx_GOTREF(__pyx_t_4);
2588
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2589
__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;}
2590
__Pyx_GOTREF(__pyx_t_1);
2591
__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;}
2592
__Pyx_GOTREF(__pyx_t_2);
2593
if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2594
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2595
__Pyx_DECREF(__pyx_v_annotations);
2596
__pyx_v_annotations = __pyx_t_1;
2598
__Pyx_DECREF(__pyx_v_lines);
2599
__pyx_v_lines = __pyx_t_2;
2603
/* "bzrlib/_annotator_pyx.pyx":276
2604
* custom_tiebreaker = annotate._break_annotation_tie
2605
* annotations, lines = self.annotate(key)
2606
* num_lines = len(lines) # <<<<<<<<<<<<<<
2608
* heads = self._get_heads_provider().heads
2610
__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;}
2611
__pyx_v_num_lines = __pyx_t_5;
2613
/* "bzrlib/_annotator_pyx.pyx":277
2614
* annotations, lines = self.annotate(key)
2615
* num_lines = len(lines)
2616
* out = [] # <<<<<<<<<<<<<<
2617
* heads = self._get_heads_provider().heads
2618
* for pos from 0 <= pos < num_lines:
2620
__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;}
2621
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
2622
__Pyx_DECREF(((PyObject *)__pyx_v_out));
2623
__pyx_v_out = __pyx_t_3;
2626
/* "bzrlib/_annotator_pyx.pyx":278
2627
* num_lines = len(lines)
2629
* heads = self._get_heads_provider().heads # <<<<<<<<<<<<<<
2630
* for pos from 0 <= pos < num_lines:
2631
* annotation = annotations[pos]
2633
__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;}
2634
__Pyx_GOTREF(__pyx_t_3);
2635
__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;}
2636
__Pyx_GOTREF(__pyx_t_2);
2637
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2638
__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;}
2639
__Pyx_GOTREF(__pyx_t_3);
2640
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2641
__Pyx_DECREF(__pyx_v_heads);
2642
__pyx_v_heads = __pyx_t_3;
2645
/* "bzrlib/_annotator_pyx.pyx":279
2647
* heads = self._get_heads_provider().heads
2648
* for pos from 0 <= pos < num_lines: # <<<<<<<<<<<<<<
2649
* annotation = annotations[pos]
2652
__pyx_t_5 = __pyx_v_num_lines;
2653
for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_t_5; __pyx_v_pos++) {
2655
/* "bzrlib/_annotator_pyx.pyx":280
2656
* heads = self._get_heads_provider().heads
2657
* for pos from 0 <= pos < num_lines:
2658
* annotation = annotations[pos] # <<<<<<<<<<<<<<
2660
* if len(annotation) == 1:
2662
__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;}
2663
__Pyx_GOTREF(__pyx_t_3);
2664
__Pyx_DECREF(__pyx_v_annotation);
2665
__pyx_v_annotation = __pyx_t_3;
2668
/* "bzrlib/_annotator_pyx.pyx":281
2669
* for pos from 0 <= pos < num_lines:
2670
* annotation = annotations[pos]
2671
* line = lines[pos] # <<<<<<<<<<<<<<
2672
* if len(annotation) == 1:
2673
* head = annotation[0]
2675
__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;}
2676
__Pyx_GOTREF(__pyx_t_3);
2677
__Pyx_DECREF(__pyx_v_line);
2678
__pyx_v_line = __pyx_t_3;
2681
/* "bzrlib/_annotator_pyx.pyx":282
2682
* annotation = annotations[pos]
2684
* if len(annotation) == 1: # <<<<<<<<<<<<<<
2685
* head = annotation[0]
2688
__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;}
2689
__pyx_t_7 = (__pyx_t_6 == 1);
2692
/* "bzrlib/_annotator_pyx.pyx":283
2694
* if len(annotation) == 1:
2695
* head = annotation[0] # <<<<<<<<<<<<<<
2697
* the_heads = heads(annotation)
2699
__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;}
2700
__Pyx_GOTREF(__pyx_t_3);
2701
__Pyx_DECREF(__pyx_v_head);
2702
__pyx_v_head = __pyx_t_3;
2708
/* "bzrlib/_annotator_pyx.pyx":285
2709
* head = annotation[0]
2711
* the_heads = heads(annotation) # <<<<<<<<<<<<<<
2712
* if len(the_heads) == 1:
2713
* for head in the_heads: break # get the item out of the set
2715
__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;}
2716
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
2717
__Pyx_INCREF(__pyx_v_annotation);
2718
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_annotation);
2719
__Pyx_GIVEREF(__pyx_v_annotation);
2720
__pyx_t_2 = PyObject_Call(__pyx_v_heads, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2721
__Pyx_GOTREF(__pyx_t_2);
2722
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
2723
__Pyx_DECREF(__pyx_v_the_heads);
2724
__pyx_v_the_heads = __pyx_t_2;
2727
/* "bzrlib/_annotator_pyx.pyx":286
2729
* the_heads = heads(annotation)
2730
* if len(the_heads) == 1: # <<<<<<<<<<<<<<
2731
* for head in the_heads: break # get the item out of the set
2734
__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;}
2735
__pyx_t_7 = (__pyx_t_6 == 1);
2738
/* "bzrlib/_annotator_pyx.pyx":287
2739
* the_heads = heads(annotation)
2740
* if len(the_heads) == 1:
2741
* for head in the_heads: break # get the item out of the set # <<<<<<<<<<<<<<
2743
* # We need to resolve the ambiguity, for now just pick the
2745
if (PyList_CheckExact(__pyx_v_the_heads) || PyTuple_CheckExact(__pyx_v_the_heads)) {
2746
__pyx_t_6 = 0; __pyx_t_2 = __pyx_v_the_heads; __Pyx_INCREF(__pyx_t_2);
2748
__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;}
2749
__Pyx_GOTREF(__pyx_t_2);
2752
if (likely(PyList_CheckExact(__pyx_t_2))) {
2753
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
2754
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++;
2755
} else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
2756
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
2757
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++;
2759
__pyx_t_3 = PyIter_Next(__pyx_t_2);
2761
if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2764
__Pyx_GOTREF(__pyx_t_3);
2766
__Pyx_DECREF(__pyx_v_head);
2767
__pyx_v_head = __pyx_t_3;
2769
goto __pyx_L11_break;
2772
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2777
/* "bzrlib/_annotator_pyx.pyx":291
2778
* # We need to resolve the ambiguity, for now just pick the
2780
* head = self._resolve_annotation_tie(the_heads, line, # <<<<<<<<<<<<<<
2781
* custom_tiebreaker)
2782
* PyList_Append(out, (head, line))
2784
__pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2785
__Pyx_GOTREF(__pyx_t_2);
2787
/* "bzrlib/_annotator_pyx.pyx":292
2789
* head = self._resolve_annotation_tie(the_heads, line,
2790
* custom_tiebreaker) # <<<<<<<<<<<<<<
2791
* PyList_Append(out, (head, line))
2794
__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;}
2795
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
2796
__Pyx_INCREF(__pyx_v_the_heads);
2797
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_the_heads);
2798
__Pyx_GIVEREF(__pyx_v_the_heads);
2799
__Pyx_INCREF(__pyx_v_line);
2800
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_line);
2801
__Pyx_GIVEREF(__pyx_v_line);
2802
__Pyx_INCREF(__pyx_v_custom_tiebreaker);
2803
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_custom_tiebreaker);
2804
__Pyx_GIVEREF(__pyx_v_custom_tiebreaker);
2805
__pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2806
__Pyx_GOTREF(__pyx_t_1);
2807
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2808
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
2809
__Pyx_DECREF(__pyx_v_head);
2810
__pyx_v_head = __pyx_t_1;
2817
/* "bzrlib/_annotator_pyx.pyx":293
2818
* head = self._resolve_annotation_tie(the_heads, line,
2819
* custom_tiebreaker)
2820
* PyList_Append(out, (head, line)) # <<<<<<<<<<<<<<
2823
__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;}
2824
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
2825
__Pyx_INCREF(__pyx_v_head);
2826
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_head);
2827
__Pyx_GIVEREF(__pyx_v_head);
2828
__Pyx_INCREF(__pyx_v_line);
2829
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_line);
2830
__Pyx_GIVEREF(__pyx_v_line);
2831
__pyx_t_8 = PyList_Append(((PyObject *)__pyx_v_out), ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2832
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2835
/* "bzrlib/_annotator_pyx.pyx":294
2836
* custom_tiebreaker)
2837
* PyList_Append(out, (head, line))
2838
* return out # <<<<<<<<<<<<<<
2840
__Pyx_XDECREF(__pyx_r);
2841
__Pyx_INCREF(((PyObject *)__pyx_v_out));
2842
__pyx_r = ((PyObject *)__pyx_v_out);
2845
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
2848
__Pyx_XDECREF(__pyx_t_1);
2849
__Pyx_XDECREF(__pyx_t_2);
2850
__Pyx_XDECREF(__pyx_t_3);
2851
__Pyx_XDECREF(__pyx_t_4);
2852
__Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator.annotate_flat");
2855
__Pyx_DECREF(__pyx_v_annotate);
2856
__Pyx_DECREF(__pyx_v_custom_tiebreaker);
2857
__Pyx_DECREF(__pyx_v_annotations);
2858
__Pyx_DECREF(__pyx_v_lines);
2859
__Pyx_DECREF(__pyx_v_out);
2860
__Pyx_DECREF(__pyx_v_heads);
2861
__Pyx_DECREF(__pyx_v_annotation);
2862
__Pyx_DECREF(__pyx_v_line);
2863
__Pyx_DECREF(__pyx_v_head);
2864
__Pyx_DECREF(__pyx_v_the_heads);
2865
__Pyx_XGIVEREF(__pyx_r);
2866
__Pyx_RefNannyFinishContext();
2870
static PyMethodDef __pyx_methods[] = {
2874
#if PY_MAJOR_VERSION >= 3
2875
static struct PyModuleDef __pyx_moduledef = {
2876
PyModuleDef_HEAD_INIT,
2877
__Pyx_NAMESTR("_annotator_pyx"),
2878
__Pyx_DOCSTR(__pyx_k_12), /* m_doc */
2880
__pyx_methods /* m_methods */,
2881
NULL, /* m_reload */
2882
NULL, /* m_traverse */
2888
static __Pyx_StringTabEntry __pyx_string_tab[] = {
2889
{&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
2890
{&__pyx_n_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 1},
2891
{&__pyx_n_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 1},
2892
{&__pyx_n_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 1},
2893
{&__pyx_n_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 1},
2894
{&__pyx_n_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 1},
2895
{&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
2896
{&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
2897
{&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
2898
{&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
2899
{&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
2900
{&__pyx_n_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 1},
2901
{&__pyx_n_s__Annotator, __pyx_k__Annotator, sizeof(__pyx_k__Annotator), 0, 0, 1, 1},
2902
{&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
2903
{&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
2904
{&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
2905
{&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
2906
{&__pyx_n_s___ann_tuple_cache, __pyx_k___ann_tuple_cache, sizeof(__pyx_k___ann_tuple_cache), 0, 0, 1, 1},
2907
{&__pyx_n_s___annotator_py, __pyx_k___annotator_py, sizeof(__pyx_k___annotator_py), 0, 0, 1, 1},
2908
{&__pyx_n_s___get_heads_provider, __pyx_k___get_heads_provider, sizeof(__pyx_k___get_heads_provider), 0, 0, 1, 1},
2909
{&__pyx_n_s__annotate, __pyx_k__annotate, sizeof(__pyx_k__annotate), 0, 0, 1, 1},
2910
{&__pyx_n_s__annotate_flat, __pyx_k__annotate_flat, sizeof(__pyx_k__annotate_flat), 0, 0, 1, 1},
2911
{&__pyx_n_s__annotations, __pyx_k__annotations, sizeof(__pyx_k__annotations), 0, 0, 1, 1},
2912
{&__pyx_n_s__bzrlib, __pyx_k__bzrlib, sizeof(__pyx_k__bzrlib), 0, 0, 1, 1},
2913
{&__pyx_n_s__heads, __pyx_k__heads, sizeof(__pyx_k__heads), 0, 0, 1, 1},
2914
{&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1},
2915
{&__pyx_n_s__lines, __pyx_k__lines, sizeof(__pyx_k__lines), 0, 0, 1, 1},
2916
{&__pyx_n_s__ob_item, __pyx_k__ob_item, sizeof(__pyx_k__ob_item), 0, 0, 1, 1},
2917
{&__pyx_n_s__parent_key, __pyx_k__parent_key, sizeof(__pyx_k__parent_key), 0, 0, 1, 1},
2918
{&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
2919
{&__pyx_n_s__this_annotation, __pyx_k__this_annotation, sizeof(__pyx_k__this_annotation), 0, 0, 1, 1},
2920
{0, 0, 0, 0, 0, 0, 0}
2922
static int __Pyx_InitCachedBuiltins(void) {
2923
__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;}
2924
__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;}
2930
static int __Pyx_InitCachedConstants(void) {
2931
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");
2933
/* "bzrlib/_annotator_pyx.pyx":64
2934
* parent_annotations) except -1:
2935
* if not PyList_CheckExact(annotations):
2936
* raise TypeError('annotations must be a list') # <<<<<<<<<<<<<<
2937
* if not PyList_CheckExact(parent_annotations):
2938
* raise TypeError('parent_annotations must be a list')
2940
__pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2941
__Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2));
2942
__Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
2943
PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_kp_s_1));
2944
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
2945
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
2947
/* "bzrlib/_annotator_pyx.pyx":66
2948
* raise TypeError('annotations must be a list')
2949
* if not PyList_CheckExact(parent_annotations):
2950
* raise TypeError('parent_annotations must be a list') # <<<<<<<<<<<<<<
2954
__pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2955
__Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4));
2956
__Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
2957
PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_3));
2958
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
2959
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
2961
/* "bzrlib/_annotator_pyx.pyx":115
2963
* if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two):
2964
* raise TypeError('annotations must be tuples') # <<<<<<<<<<<<<<
2965
* # We know that annotations are tuples, and that both sides are already
2966
* # sorted, so we can just walk and update a new list.
2968
__pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2969
__Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8));
2970
__Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
2971
PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_7));
2972
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7));
2973
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));
2974
__Pyx_RefNannyFinishContext();
2977
__Pyx_RefNannyFinishContext();
2981
static int __Pyx_InitGlobals(void) {
2982
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
2988
#if PY_MAJOR_VERSION < 3
2989
PyMODINIT_FUNC init_annotator_pyx(void); /*proto*/
2990
PyMODINIT_FUNC init_annotator_pyx(void)
2992
PyMODINIT_FUNC PyInit__annotator_pyx(void); /*proto*/
2993
PyMODINIT_FUNC PyInit__annotator_pyx(void)
2996
PyObject *__pyx_t_1 = NULL;
2997
PyObject *__pyx_t_2 = NULL;
2998
PyObject *__pyx_t_3 = NULL;
3000
void* __pyx_refnanny = NULL;
3001
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3002
if (!__Pyx_RefNanny) {
3004
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3005
if (!__Pyx_RefNanny)
3006
Py_FatalError("failed to import 'refnanny' module");
3008
__pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__annotator_pyx(void)", __LINE__, __FILE__);
3010
__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;}
3011
__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;}
3012
#ifdef __pyx_binding_PyCFunctionType_USED
3013
if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3015
/*--- Library function declarations ---*/
3016
/*--- Threads initialization code ---*/
3017
#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
3018
#ifdef WITH_THREAD /* Python build with threading support? */
3019
PyEval_InitThreads();
3022
/*--- Module creation code ---*/
3023
#if PY_MAJOR_VERSION < 3
3024
__pyx_m = Py_InitModule4(__Pyx_NAMESTR("_annotator_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_12), 0, PYTHON_API_VERSION);
3026
__pyx_m = PyModule_Create(&__pyx_moduledef);
3028
if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
3029
#if PY_MAJOR_VERSION < 3
3032
__pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
3033
if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
3034
if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
3035
/*--- Initialize various global constants etc. ---*/
3036
if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3037
if (__pyx_module_is_main_bzrlib___annotator_pyx) {
3038
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;};
3040
/*--- Builtin init code ---*/
3041
if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3042
/*--- Constants init code ---*/
3043
if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3044
/*--- Global init code ---*/
3045
/*--- Function export code ---*/
3046
/*--- Type init code ---*/
3047
/*--- Type import code ---*/
3048
/*--- Function import code ---*/
3049
/*--- Execution code ---*/
3051
/* "bzrlib/_annotator_pyx.pyx":58
3054
* from bzrlib import _annotator_py # <<<<<<<<<<<<<<
3058
__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;}
3059
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
3060
__Pyx_INCREF(((PyObject *)__pyx_n_s___annotator_py));
3061
PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s___annotator_py));
3062
__Pyx_GIVEREF(((PyObject *)__pyx_n_s___annotator_py));
3063
__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;}
3064
__Pyx_GOTREF(__pyx_t_2);
3065
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3066
__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;}
3067
__Pyx_GOTREF(__pyx_t_1);
3068
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;}
3069
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3070
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3072
/* "bzrlib/_annotator_pyx.pyx":244
3075
* class Annotator(_annotator_py.Annotator): # <<<<<<<<<<<<<<
3076
* """Class that drives performing annotations."""
3079
__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;}
3080
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
3082
/* "bzrlib/_annotator_pyx.pyx":247
3083
* """Class that drives performing annotations."""
3085
* def _update_from_first_parent(self, key, annotations, lines, parent_key): # <<<<<<<<<<<<<<
3086
* """Reannotate this text relative to its first parent."""
3087
* (parent_annotations,
3089
__pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent, NULL, __pyx_n_s_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3090
__Pyx_GOTREF(__pyx_t_1);
3091
if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_14, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3092
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3094
/* "bzrlib/_annotator_pyx.pyx":256
3097
* def _update_from_other_parents(self, key, annotations, lines, # <<<<<<<<<<<<<<
3098
* this_annotation, parent_key):
3099
* """Reannotate this text relative to a second (or more) parent."""
3101
__pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents, NULL, __pyx_n_s_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3102
__Pyx_GOTREF(__pyx_t_1);
3103
if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_15, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3104
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3106
/* "bzrlib/_annotator_pyx.pyx":265
3107
* matching_blocks, self._ann_tuple_cache)
3109
* def annotate_flat(self, key): # <<<<<<<<<<<<<<
3110
* """Determine the single-best-revision to source for each line.
3113
__pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat, NULL, __pyx_n_s_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3114
__Pyx_GOTREF(__pyx_t_1);
3115
if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__annotate_flat, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3116
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3118
/* "bzrlib/_annotator_pyx.pyx":244
3121
* class Annotator(_annotator_py.Annotator): # <<<<<<<<<<<<<<
3122
* """Class that drives performing annotations."""
3125
__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;}
3126
__Pyx_GOTREF(__pyx_t_1);
3127
__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;}
3128
__Pyx_GOTREF(__pyx_t_3);
3129
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3130
__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;}
3131
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
3132
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
3133
__Pyx_GIVEREF(__pyx_t_3);
3135
if (PyDict_SetItemString(((PyObject *)__pyx_t_2), "__doc__", ((PyObject *)__pyx_kp_s_16)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3136
__pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2), __pyx_n_s__Annotator, __pyx_n_s_13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3137
__Pyx_GOTREF(__pyx_t_3);
3138
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3139
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;}
3140
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3141
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3143
/* "bzrlib/_annotator_pyx.pyx":1
3144
* # Copyright (C) 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<<
3146
* # This program is free software; you can redistribute it and/or modify
3148
__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;}
3149
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
3150
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;}
3151
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3154
__Pyx_XDECREF(__pyx_t_1);
3155
__Pyx_XDECREF(__pyx_t_2);
3156
__Pyx_XDECREF(__pyx_t_3);
3158
__Pyx_AddTraceback("init bzrlib._annotator_pyx");
3159
Py_DECREF(__pyx_m); __pyx_m = 0;
3160
} else if (!PyErr_Occurred()) {
3161
PyErr_SetString(PyExc_ImportError, "init bzrlib._annotator_pyx");
3164
__Pyx_RefNannyFinishContext();
3165
#if PY_MAJOR_VERSION < 3
3172
/* Runtime support code */
3174
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
3176
result = PyObject_GetAttr(dict, name);
3178
PyErr_SetObject(PyExc_NameError, name);
3182
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
3183
PyObject *tmp_type, *tmp_value, *tmp_tb;
3184
PyThreadState *tstate = PyThreadState_GET();
3186
tmp_type = tstate->curexc_type;
3187
tmp_value = tstate->curexc_value;
3188
tmp_tb = tstate->curexc_traceback;
3189
tstate->curexc_type = type;
3190
tstate->curexc_value = value;
3191
tstate->curexc_traceback = tb;
3192
Py_XDECREF(tmp_type);
3193
Py_XDECREF(tmp_value);
3197
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
3198
PyThreadState *tstate = PyThreadState_GET();
3199
*type = tstate->curexc_type;
3200
*value = tstate->curexc_value;
3201
*tb = tstate->curexc_traceback;
3203
tstate->curexc_type = 0;
3204
tstate->curexc_value = 0;
3205
tstate->curexc_traceback = 0;
3209
#if PY_MAJOR_VERSION < 3
3210
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
3214
/* First, check the traceback argument, replacing None with NULL. */
3215
if (tb == Py_None) {
3219
else if (tb != NULL && !PyTraceBack_Check(tb)) {
3220
PyErr_SetString(PyExc_TypeError,
3221
"raise: arg 3 must be a traceback or None");
3224
/* Next, replace a missing value with None */
3225
if (value == NULL) {
3229
#if PY_VERSION_HEX < 0x02050000
3230
if (!PyClass_Check(type))
3232
if (!PyType_Check(type))
3235
/* Raising an instance. The value should be a dummy. */
3236
if (value != Py_None) {
3237
PyErr_SetString(PyExc_TypeError,
3238
"instance exception may not have a separate value");
3241
/* Normalize to raise <class>, <instance> */
3244
#if PY_VERSION_HEX < 0x02050000
3245
if (PyInstance_Check(type)) {
3246
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
3251
PyErr_SetString(PyExc_TypeError,
3252
"raise: exception must be an old-style class or instance");
3256
type = (PyObject*) Py_TYPE(type);
3258
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
3259
PyErr_SetString(PyExc_TypeError,
3260
"raise: exception class must be a subclass of BaseException");
3266
__Pyx_ErrRestore(type, value, tb);
3275
#else /* Python 3+ */
3277
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
3278
if (tb == Py_None) {
3280
} else if (tb && !PyTraceBack_Check(tb)) {
3281
PyErr_SetString(PyExc_TypeError,
3282
"raise: arg 3 must be a traceback or None");
3285
if (value == Py_None)
3288
if (PyExceptionInstance_Check(type)) {
3290
PyErr_SetString(PyExc_TypeError,
3291
"instance exception may not have a separate value");
3295
type = (PyObject*) Py_TYPE(value);
3296
} else if (!PyExceptionClass_Check(type)) {
3297
PyErr_SetString(PyExc_TypeError,
3298
"raise: exception class must be a subclass of BaseException");
3302
PyErr_SetObject(type, value);
3305
PyThreadState *tstate = PyThreadState_GET();
3306
PyObject* tmp_tb = tstate->curexc_traceback;
3309
tstate->curexc_traceback = tb;
3319
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
3320
PyErr_Format(PyExc_ValueError,
3321
#if PY_VERSION_HEX < 0x02050000
3322
"need more than %d value%s to unpack", (int)index,
3324
"need more than %zd value%s to unpack", index,
3326
(index == 1) ? "" : "s");
3329
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
3330
PyErr_Format(PyExc_ValueError,
3331
#if PY_VERSION_HEX < 0x02050000
3332
"too many values to unpack (expected %d)", (int)expected);
3334
"too many values to unpack (expected %zd)", expected);
3338
static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
3340
if (!(item = PyIter_Next(iter))) {
3341
if (!PyErr_Occurred()) {
3342
__Pyx_RaiseNeedMoreValuesError(index);
3348
static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) {
3350
if ((item = PyIter_Next(iter))) {
3352
__Pyx_RaiseTooManyValuesError(expected);
3355
else if (!PyErr_Occurred())
3361
static void __Pyx_RaiseArgtupleInvalid(
3362
const char* func_name,
3366
Py_ssize_t num_found)
3368
Py_ssize_t num_expected;
3369
const char *number, *more_or_less;
3371
if (num_found < num_min) {
3372
num_expected = num_min;
3373
more_or_less = "at least";
3375
num_expected = num_max;
3376
more_or_less = "at most";
3379
more_or_less = "exactly";
3381
number = (num_expected == 1) ? "" : "s";
3382
PyErr_Format(PyExc_TypeError,
3383
#if PY_VERSION_HEX < 0x02050000
3384
"%s() takes %s %d positional argument%s (%d given)",
3386
"%s() takes %s %zd positional argument%s (%zd given)",
3388
func_name, more_or_less, num_expected, number, num_found);
3391
static void __Pyx_RaiseDoubleKeywordsError(
3392
const char* func_name,
3395
PyErr_Format(PyExc_TypeError,
3396
#if PY_MAJOR_VERSION >= 3
3397
"%s() got multiple values for keyword argument '%U'", func_name, kw_name);
3399
"%s() got multiple values for keyword argument '%s'", func_name,
3400
PyString_AS_STRING(kw_name));
3404
static int __Pyx_ParseOptionalKeywords(
3406
PyObject **argnames[],
3409
Py_ssize_t num_pos_args,
3410
const char* function_name)
3412
PyObject *key = 0, *value = 0;
3415
PyObject*** first_kw_arg = argnames + num_pos_args;
3417
while (PyDict_Next(kwds, &pos, &key, &value)) {
3418
name = first_kw_arg;
3419
while (*name && (**name != key)) name++;
3421
values[name-argnames] = value;
3423
#if PY_MAJOR_VERSION < 3
3424
if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
3426
if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
3428
goto invalid_keyword_type;
3430
for (name = first_kw_arg; *name; name++) {
3431
#if PY_MAJOR_VERSION >= 3
3432
if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
3433
PyUnicode_Compare(**name, key) == 0) break;
3435
if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
3436
_PyString_Eq(**name, key)) break;
3440
values[name-argnames] = value;
3442
/* unexpected keyword found */
3443
for (name=argnames; name != first_kw_arg; name++) {
3444
if (**name == key) goto arg_passed_twice;
3445
#if PY_MAJOR_VERSION >= 3
3446
if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
3447
PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
3449
if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
3450
_PyString_Eq(**name, key)) goto arg_passed_twice;
3454
if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
3456
goto invalid_keyword;
3464
__Pyx_RaiseDoubleKeywordsError(function_name, **name);
3466
invalid_keyword_type:
3467
PyErr_Format(PyExc_TypeError,
3468
"%s() keywords must be strings", function_name);
3471
PyErr_Format(PyExc_TypeError,
3472
#if PY_MAJOR_VERSION < 3
3473
"%s() got an unexpected keyword argument '%s'",
3474
function_name, PyString_AsString(key));
3476
"%s() got an unexpected keyword argument '%U'",
3477
function_name, key);
3484
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
3485
PyObject *py_import = 0;
3486
PyObject *empty_list = 0;
3487
PyObject *module = 0;
3488
PyObject *global_dict = 0;
3489
PyObject *empty_dict = 0;
3491
py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
3497
empty_list = PyList_New(0);
3502
global_dict = PyModule_GetDict(__pyx_m);
3505
empty_dict = PyDict_New();
3508
module = PyObject_CallFunctionObjArgs(py_import,
3509
name, global_dict, empty_dict, list, NULL);
3511
Py_XDECREF(empty_list);
3512
Py_XDECREF(py_import);
3513
Py_XDECREF(empty_dict);
3517
static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
3518
PyObject *metaclass;
3519
/* Default metaclass */
3520
#if PY_MAJOR_VERSION < 3
3521
if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
3522
PyObject *base = PyTuple_GET_ITEM(bases, 0);
3523
metaclass = PyObject_GetAttrString(base, "__class__");
3526
metaclass = (PyObject*) Py_TYPE(base);
3529
metaclass = (PyObject *) &PyClass_Type;
3532
if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
3533
PyObject *base = PyTuple_GET_ITEM(bases, 0);
3534
metaclass = (PyObject*) Py_TYPE(base);
3536
metaclass = (PyObject *) &PyType_Type;
3539
Py_INCREF(metaclass);
3543
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
3544
PyObject *modname) {
3546
PyObject *metaclass;
3548
if (PyDict_SetItemString(dict, "__module__", modname) < 0)
3551
/* Python2 __metaclass__ */
3552
metaclass = PyDict_GetItemString(dict, "__metaclass__");
3554
Py_INCREF(metaclass);
3556
metaclass = __Pyx_FindPy2Metaclass(bases);
3558
result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
3559
Py_DECREF(metaclass);
3564
static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) {
3565
__pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType);
3570
op->func.m_self = self;
3572
op->func.m_module = module;
3573
PyObject_GC_Track(op);
3574
return (PyObject *)op;
3577
static void __pyx_binding_PyCFunctionType_dealloc(__pyx_binding_PyCFunctionType_object *m) {
3578
PyObject_GC_UnTrack(m);
3579
Py_XDECREF(m->func.m_self);
3580
Py_XDECREF(m->func.m_module);
3584
static PyObject *__pyx_binding_PyCFunctionType_descr_get(PyObject *func, PyObject *obj, PyObject *type) {
3587
return PyMethod_New(func, obj, type);
3590
static int __pyx_binding_PyCFunctionType_init(void) {
3591
__pyx_binding_PyCFunctionType_type = PyCFunction_Type;
3592
__pyx_binding_PyCFunctionType_type.tp_name = __Pyx_NAMESTR("cython_binding_builtin_function_or_method");
3593
__pyx_binding_PyCFunctionType_type.tp_dealloc = (destructor)__pyx_binding_PyCFunctionType_dealloc;
3594
__pyx_binding_PyCFunctionType_type.tp_descr_get = __pyx_binding_PyCFunctionType_descr_get;
3595
if (PyType_Ready(&__pyx_binding_PyCFunctionType_type) < 0) {
3598
__pyx_binding_PyCFunctionType = &__pyx_binding_PyCFunctionType_type;
3603
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
3604
const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
3605
const int is_unsigned = neg_one > const_zero;
3606
if (sizeof(unsigned char) < sizeof(long)) {
3607
long val = __Pyx_PyInt_AsLong(x);
3608
if (unlikely(val != (long)(unsigned char)val)) {
3609
if (!unlikely(val == -1 && PyErr_Occurred())) {
3610
PyErr_SetString(PyExc_OverflowError,
3611
(is_unsigned && unlikely(val < 0)) ?
3612
"can't convert negative value to unsigned char" :
3613
"value too large to convert to unsigned char");
3615
return (unsigned char)-1;
3617
return (unsigned char)val;
3619
return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
3622
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
3623
const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
3624
const int is_unsigned = neg_one > const_zero;
3625
if (sizeof(unsigned short) < sizeof(long)) {
3626
long val = __Pyx_PyInt_AsLong(x);
3627
if (unlikely(val != (long)(unsigned short)val)) {
3628
if (!unlikely(val == -1 && PyErr_Occurred())) {
3629
PyErr_SetString(PyExc_OverflowError,
3630
(is_unsigned && unlikely(val < 0)) ?
3631
"can't convert negative value to unsigned short" :
3632
"value too large to convert to unsigned short");
3634
return (unsigned short)-1;
3636
return (unsigned short)val;
3638
return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
3641
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
3642
const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
3643
const int is_unsigned = neg_one > const_zero;
3644
if (sizeof(unsigned int) < sizeof(long)) {
3645
long val = __Pyx_PyInt_AsLong(x);
3646
if (unlikely(val != (long)(unsigned int)val)) {
3647
if (!unlikely(val == -1 && PyErr_Occurred())) {
3648
PyErr_SetString(PyExc_OverflowError,
3649
(is_unsigned && unlikely(val < 0)) ?
3650
"can't convert negative value to unsigned int" :
3651
"value too large to convert to unsigned int");
3653
return (unsigned int)-1;
3655
return (unsigned int)val;
3657
return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
3660
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
3661
const char neg_one = (char)-1, const_zero = 0;
3662
const int is_unsigned = neg_one > const_zero;
3663
if (sizeof(char) < sizeof(long)) {
3664
long val = __Pyx_PyInt_AsLong(x);
3665
if (unlikely(val != (long)(char)val)) {
3666
if (!unlikely(val == -1 && PyErr_Occurred())) {
3667
PyErr_SetString(PyExc_OverflowError,
3668
(is_unsigned && unlikely(val < 0)) ?
3669
"can't convert negative value to char" :
3670
"value too large to convert to char");
3676
return (char)__Pyx_PyInt_AsLong(x);
3679
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
3680
const short neg_one = (short)-1, const_zero = 0;
3681
const int is_unsigned = neg_one > const_zero;
3682
if (sizeof(short) < sizeof(long)) {
3683
long val = __Pyx_PyInt_AsLong(x);
3684
if (unlikely(val != (long)(short)val)) {
3685
if (!unlikely(val == -1 && PyErr_Occurred())) {
3686
PyErr_SetString(PyExc_OverflowError,
3687
(is_unsigned && unlikely(val < 0)) ?
3688
"can't convert negative value to short" :
3689
"value too large to convert to short");
3695
return (short)__Pyx_PyInt_AsLong(x);
3698
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
3699
const int neg_one = (int)-1, const_zero = 0;
3700
const int is_unsigned = neg_one > const_zero;
3701
if (sizeof(int) < sizeof(long)) {
3702
long val = __Pyx_PyInt_AsLong(x);
3703
if (unlikely(val != (long)(int)val)) {
3704
if (!unlikely(val == -1 && PyErr_Occurred())) {
3705
PyErr_SetString(PyExc_OverflowError,
3706
(is_unsigned && unlikely(val < 0)) ?
3707
"can't convert negative value to int" :
3708
"value too large to convert to int");
3714
return (int)__Pyx_PyInt_AsLong(x);
3717
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
3718
const signed char neg_one = (signed char)-1, const_zero = 0;
3719
const int is_unsigned = neg_one > const_zero;
3720
if (sizeof(signed char) < sizeof(long)) {
3721
long val = __Pyx_PyInt_AsLong(x);
3722
if (unlikely(val != (long)(signed char)val)) {
3723
if (!unlikely(val == -1 && PyErr_Occurred())) {
3724
PyErr_SetString(PyExc_OverflowError,
3725
(is_unsigned && unlikely(val < 0)) ?
3726
"can't convert negative value to signed char" :
3727
"value too large to convert to signed char");
3729
return (signed char)-1;
3731
return (signed char)val;
3733
return (signed char)__Pyx_PyInt_AsSignedLong(x);
3736
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
3737
const signed short neg_one = (signed short)-1, const_zero = 0;
3738
const int is_unsigned = neg_one > const_zero;
3739
if (sizeof(signed short) < sizeof(long)) {
3740
long val = __Pyx_PyInt_AsLong(x);
3741
if (unlikely(val != (long)(signed short)val)) {
3742
if (!unlikely(val == -1 && PyErr_Occurred())) {
3743
PyErr_SetString(PyExc_OverflowError,
3744
(is_unsigned && unlikely(val < 0)) ?
3745
"can't convert negative value to signed short" :
3746
"value too large to convert to signed short");
3748
return (signed short)-1;
3750
return (signed short)val;
3752
return (signed short)__Pyx_PyInt_AsSignedLong(x);
3755
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
3756
const signed int neg_one = (signed int)-1, const_zero = 0;
3757
const int is_unsigned = neg_one > const_zero;
3758
if (sizeof(signed int) < sizeof(long)) {
3759
long val = __Pyx_PyInt_AsLong(x);
3760
if (unlikely(val != (long)(signed int)val)) {
3761
if (!unlikely(val == -1 && PyErr_Occurred())) {
3762
PyErr_SetString(PyExc_OverflowError,
3763
(is_unsigned && unlikely(val < 0)) ?
3764
"can't convert negative value to signed int" :
3765
"value too large to convert to signed int");
3767
return (signed int)-1;
3769
return (signed int)val;
3771
return (signed int)__Pyx_PyInt_AsSignedLong(x);
3774
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
3775
const int neg_one = (int)-1, const_zero = 0;
3776
const int is_unsigned = neg_one > const_zero;
3777
if (sizeof(int) < sizeof(long)) {
3778
long val = __Pyx_PyInt_AsLong(x);
3779
if (unlikely(val != (long)(int)val)) {
3780
if (!unlikely(val == -1 && PyErr_Occurred())) {
3781
PyErr_SetString(PyExc_OverflowError,
3782
(is_unsigned && unlikely(val < 0)) ?
3783
"can't convert negative value to int" :
3784
"value too large to convert to int");
3790
return (int)__Pyx_PyInt_AsLong(x);
3793
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
3794
const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
3795
const int is_unsigned = neg_one > const_zero;
3796
#if PY_VERSION_HEX < 0x03000000
3797
if (likely(PyInt_Check(x))) {
3798
long val = PyInt_AS_LONG(x);
3799
if (is_unsigned && unlikely(val < 0)) {
3800
PyErr_SetString(PyExc_OverflowError,
3801
"can't convert negative value to unsigned long");
3802
return (unsigned long)-1;
3804
return (unsigned long)val;
3807
if (likely(PyLong_Check(x))) {
3809
if (unlikely(Py_SIZE(x) < 0)) {
3810
PyErr_SetString(PyExc_OverflowError,
3811
"can't convert negative value to unsigned long");
3812
return (unsigned long)-1;
3814
return PyLong_AsUnsignedLong(x);
3816
return PyLong_AsLong(x);
3820
PyObject *tmp = __Pyx_PyNumber_Int(x);
3821
if (!tmp) return (unsigned long)-1;
3822
val = __Pyx_PyInt_AsUnsignedLong(tmp);
3828
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
3829
const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
3830
const int is_unsigned = neg_one > const_zero;
3831
#if PY_VERSION_HEX < 0x03000000
3832
if (likely(PyInt_Check(x))) {
3833
long val = PyInt_AS_LONG(x);
3834
if (is_unsigned && unlikely(val < 0)) {
3835
PyErr_SetString(PyExc_OverflowError,
3836
"can't convert negative value to unsigned PY_LONG_LONG");
3837
return (unsigned PY_LONG_LONG)-1;
3839
return (unsigned PY_LONG_LONG)val;
3842
if (likely(PyLong_Check(x))) {
3844
if (unlikely(Py_SIZE(x) < 0)) {
3845
PyErr_SetString(PyExc_OverflowError,
3846
"can't convert negative value to unsigned PY_LONG_LONG");
3847
return (unsigned PY_LONG_LONG)-1;
3849
return PyLong_AsUnsignedLongLong(x);
3851
return PyLong_AsLongLong(x);
3854
unsigned PY_LONG_LONG val;
3855
PyObject *tmp = __Pyx_PyNumber_Int(x);
3856
if (!tmp) return (unsigned PY_LONG_LONG)-1;
3857
val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
3863
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
3864
const long neg_one = (long)-1, const_zero = 0;
3865
const int is_unsigned = neg_one > const_zero;
3866
#if PY_VERSION_HEX < 0x03000000
3867
if (likely(PyInt_Check(x))) {
3868
long val = PyInt_AS_LONG(x);
3869
if (is_unsigned && unlikely(val < 0)) {
3870
PyErr_SetString(PyExc_OverflowError,
3871
"can't convert negative value to long");
3877
if (likely(PyLong_Check(x))) {
3879
if (unlikely(Py_SIZE(x) < 0)) {
3880
PyErr_SetString(PyExc_OverflowError,
3881
"can't convert negative value to long");
3884
return PyLong_AsUnsignedLong(x);
3886
return PyLong_AsLong(x);
3890
PyObject *tmp = __Pyx_PyNumber_Int(x);
3891
if (!tmp) return (long)-1;
3892
val = __Pyx_PyInt_AsLong(tmp);
3898
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
3899
const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
3900
const int is_unsigned = neg_one > const_zero;
3901
#if PY_VERSION_HEX < 0x03000000
3902
if (likely(PyInt_Check(x))) {
3903
long val = PyInt_AS_LONG(x);
3904
if (is_unsigned && unlikely(val < 0)) {
3905
PyErr_SetString(PyExc_OverflowError,
3906
"can't convert negative value to PY_LONG_LONG");
3907
return (PY_LONG_LONG)-1;
3909
return (PY_LONG_LONG)val;
3912
if (likely(PyLong_Check(x))) {
3914
if (unlikely(Py_SIZE(x) < 0)) {
3915
PyErr_SetString(PyExc_OverflowError,
3916
"can't convert negative value to PY_LONG_LONG");
3917
return (PY_LONG_LONG)-1;
3919
return PyLong_AsUnsignedLongLong(x);
3921
return PyLong_AsLongLong(x);
3925
PyObject *tmp = __Pyx_PyNumber_Int(x);
3926
if (!tmp) return (PY_LONG_LONG)-1;
3927
val = __Pyx_PyInt_AsLongLong(tmp);
3933
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
3934
const signed long neg_one = (signed long)-1, const_zero = 0;
3935
const int is_unsigned = neg_one > const_zero;
3936
#if PY_VERSION_HEX < 0x03000000
3937
if (likely(PyInt_Check(x))) {
3938
long val = PyInt_AS_LONG(x);
3939
if (is_unsigned && unlikely(val < 0)) {
3940
PyErr_SetString(PyExc_OverflowError,
3941
"can't convert negative value to signed long");
3942
return (signed long)-1;
3944
return (signed long)val;
3947
if (likely(PyLong_Check(x))) {
3949
if (unlikely(Py_SIZE(x) < 0)) {
3950
PyErr_SetString(PyExc_OverflowError,
3951
"can't convert negative value to signed long");
3952
return (signed long)-1;
3954
return PyLong_AsUnsignedLong(x);
3956
return PyLong_AsLong(x);
3960
PyObject *tmp = __Pyx_PyNumber_Int(x);
3961
if (!tmp) return (signed long)-1;
3962
val = __Pyx_PyInt_AsSignedLong(tmp);
3968
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
3969
const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
3970
const int is_unsigned = neg_one > const_zero;
3971
#if PY_VERSION_HEX < 0x03000000
3972
if (likely(PyInt_Check(x))) {
3973
long val = PyInt_AS_LONG(x);
3974
if (is_unsigned && unlikely(val < 0)) {
3975
PyErr_SetString(PyExc_OverflowError,
3976
"can't convert negative value to signed PY_LONG_LONG");
3977
return (signed PY_LONG_LONG)-1;
3979
return (signed PY_LONG_LONG)val;
3982
if (likely(PyLong_Check(x))) {
3984
if (unlikely(Py_SIZE(x) < 0)) {
3985
PyErr_SetString(PyExc_OverflowError,
3986
"can't convert negative value to signed PY_LONG_LONG");
3987
return (signed PY_LONG_LONG)-1;
3989
return PyLong_AsUnsignedLongLong(x);
3991
return PyLong_AsLongLong(x);
3994
signed PY_LONG_LONG val;
3995
PyObject *tmp = __Pyx_PyNumber_Int(x);
3996
if (!tmp) return (signed PY_LONG_LONG)-1;
3997
val = __Pyx_PyInt_AsSignedLongLong(tmp);
4003
#include "compile.h"
4004
#include "frameobject.h"
4005
#include "traceback.h"
4007
static void __Pyx_AddTraceback(const char *funcname) {
4008
PyObject *py_srcfile = 0;
4009
PyObject *py_funcname = 0;
4010
PyObject *py_globals = 0;
4011
PyCodeObject *py_code = 0;
4012
PyFrameObject *py_frame = 0;
4014
#if PY_MAJOR_VERSION < 3
4015
py_srcfile = PyString_FromString(__pyx_filename);
4017
py_srcfile = PyUnicode_FromString(__pyx_filename);
4019
if (!py_srcfile) goto bad;
4020
if (__pyx_clineno) {
4021
#if PY_MAJOR_VERSION < 3
4022
py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
4024
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
4028
#if PY_MAJOR_VERSION < 3
4029
py_funcname = PyString_FromString(funcname);
4031
py_funcname = PyUnicode_FromString(funcname);
4034
if (!py_funcname) goto bad;
4035
py_globals = PyModule_GetDict(__pyx_m);
4036
if (!py_globals) goto bad;
4037
py_code = PyCode_New(
4038
0, /*int argcount,*/
4039
#if PY_MAJOR_VERSION >= 3
4040
0, /*int kwonlyargcount,*/
4043
0, /*int stacksize,*/
4045
__pyx_empty_bytes, /*PyObject *code,*/
4046
__pyx_empty_tuple, /*PyObject *consts,*/
4047
__pyx_empty_tuple, /*PyObject *names,*/
4048
__pyx_empty_tuple, /*PyObject *varnames,*/
4049
__pyx_empty_tuple, /*PyObject *freevars,*/
4050
__pyx_empty_tuple, /*PyObject *cellvars,*/
4051
py_srcfile, /*PyObject *filename,*/
4052
py_funcname, /*PyObject *name,*/
4053
__pyx_lineno, /*int firstlineno,*/
4054
__pyx_empty_bytes /*PyObject *lnotab*/
4056
if (!py_code) goto bad;
4057
py_frame = PyFrame_New(
4058
PyThreadState_GET(), /*PyThreadState *tstate,*/
4059
py_code, /*PyCodeObject *code,*/
4060
py_globals, /*PyObject *globals,*/
4061
0 /*PyObject *locals*/
4063
if (!py_frame) goto bad;
4064
py_frame->f_lineno = __pyx_lineno;
4065
PyTraceBack_Here(py_frame);
4067
Py_XDECREF(py_srcfile);
4068
Py_XDECREF(py_funcname);
4069
Py_XDECREF(py_code);
4070
Py_XDECREF(py_frame);
4073
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
4075
#if PY_MAJOR_VERSION < 3
4076
if (t->is_unicode) {
4077
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
4078
} else if (t->intern) {
4079
*t->p = PyString_InternFromString(t->s);
4081
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
4083
#else /* Python 3+ has unicode identifiers */
4084
if (t->is_unicode | t->is_str) {
4086
*t->p = PyUnicode_InternFromString(t->s);
4087
} else if (t->encoding) {
4088
*t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
4090
*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
4093
*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
4103
/* Type Conversion Functions */
4105
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
4106
int is_true = x == Py_True;
4107
if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
4108
else return PyObject_IsTrue(x);
4111
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
4113
const char *name = NULL;
4114
PyObject *res = NULL;
4115
#if PY_VERSION_HEX < 0x03000000
4116
if (PyInt_Check(x) || PyLong_Check(x))
4118
if (PyLong_Check(x))
4120
return Py_INCREF(x), x;
4121
m = Py_TYPE(x)->tp_as_number;
4122
#if PY_VERSION_HEX < 0x03000000
4123
if (m && m->nb_int) {
4125
res = PyNumber_Int(x);
4127
else if (m && m->nb_long) {
4129
res = PyNumber_Long(x);
4132
if (m && m->nb_int) {
4134
res = PyNumber_Long(x);
4138
#if PY_VERSION_HEX < 0x03000000
4139
if (!PyInt_Check(res) && !PyLong_Check(res)) {
4141
if (!PyLong_Check(res)) {
4143
PyErr_Format(PyExc_TypeError,
4144
"__%s__ returned non-%s (type %.200s)",
4145
name, name, Py_TYPE(res)->tp_name);
4150
else if (!PyErr_Occurred()) {
4151
PyErr_SetString(PyExc_TypeError,
4152
"an integer is required");
4157
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
4159
PyObject* x = PyNumber_Index(b);
4161
ival = PyInt_AsSsize_t(x);
4166
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
4167
#if PY_VERSION_HEX < 0x02050000
4168
if (ival <= LONG_MAX)
4169
return PyInt_FromLong((long)ival);
4171
unsigned char *bytes = (unsigned char *) &ival;
4172
int one = 1; int little = (int)*(unsigned char*)&one;
4173
return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
4176
return PyInt_FromSize_t(ival);
4180
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
4181
unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
4182
if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
4184
} else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
4185
PyErr_SetString(PyExc_OverflowError,
4186
"value too large to convert to size_t");
4193
#endif /* Py_PYTHON_H */