~debian-bazaar/bzr/2.4

« back to all changes in this revision

Viewing changes to bzrlib/_annotator_pyx.c

  • Committer: Jelmer Vernooij
  • Date: 2011-08-13 21:53:50 UTC
  • mfrom: (3815.2547.116 upstream)
  • Revision ID: jelmer@samba.org-20110813215350-7frai9mod24c1te1
* New upstream release.
 + Suggest python-gpgme and build-depend on python-gpgme-dbg for new
   signatures features.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Generated by Pyrex 0.9.8.5 on Fri Oct  8 14:00:55 2010 */
 
1
/* Generated by Cython 0.13 on Thu Aug 11 09:45:13 2011 */
2
2
 
3
3
#define PY_SSIZE_T_CLEAN
4
4
#include "Python.h"
5
 
#include "structmember.h"
 
5
#ifndef Py_PYTHON_H
 
6
    #error Python headers needed to compile C extensions, please install development version of Python.
 
7
#else
 
8
 
 
9
#include <stddef.h> /* For offsetof */
 
10
#ifndef offsetof
 
11
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 
12
#endif
 
13
 
 
14
#if !defined(WIN32) && !defined(MS_WINDOWS)
 
15
  #ifndef __stdcall
 
16
    #define __stdcall
 
17
  #endif
 
18
  #ifndef __cdecl
 
19
    #define __cdecl
 
20
  #endif
 
21
  #ifndef __fastcall
 
22
    #define __fastcall
 
23
  #endif
 
24
#endif
 
25
 
 
26
#ifndef DL_IMPORT
 
27
  #define DL_IMPORT(t) t
 
28
#endif
 
29
#ifndef DL_EXPORT
 
30
  #define DL_EXPORT(t) t
 
31
#endif
 
32
 
6
33
#ifndef PY_LONG_LONG
7
34
  #define PY_LONG_LONG LONG_LONG
8
35
#endif
 
36
 
 
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)
 
41
#endif
 
42
 
9
43
#if PY_VERSION_HEX < 0x02050000
10
44
  typedef int Py_ssize_t;
11
45
  #define PY_SSIZE_T_MAX INT_MAX
12
46
  #define PY_SSIZE_T_MIN INT_MIN
 
47
  #define PY_FORMAT_SIZE_T ""
13
48
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
14
 
  #define PyInt_AsSsize_t(o)    PyInt_AsLong(o)
15
 
#endif
16
 
#if !defined(WIN32) && !defined(MS_WINDOWS)
17
 
  #ifndef __stdcall
18
 
    #define __stdcall
19
 
  #endif
20
 
  #ifndef __cdecl
21
 
    #define __cdecl
22
 
  #endif
23
 
#endif
 
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)
 
53
#endif
 
54
 
 
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)
 
62
 
 
63
  typedef struct {
 
64
     void *buf;
 
65
     PyObject *obj;
 
66
     Py_ssize_t len;
 
67
     Py_ssize_t itemsize;
 
68
     int readonly;
 
69
     int ndim;
 
70
     char *format;
 
71
     Py_ssize_t *shape;
 
72
     Py_ssize_t *strides;
 
73
     Py_ssize_t *suboffsets;
 
74
     void *internal;
 
75
  } Py_buffer;
 
76
 
 
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)
 
86
 
 
87
#endif
 
88
 
 
89
#if PY_MAJOR_VERSION < 3
 
90
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
 
91
#else
 
92
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
 
93
#endif
 
94
 
 
95
#if PY_MAJOR_VERSION >= 3
 
96
  #define Py_TPFLAGS_CHECKTYPES 0
 
97
  #define Py_TPFLAGS_HAVE_INDEX 0
 
98
#endif
 
99
 
 
100
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
 
101
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 
102
#endif
 
103
 
 
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
 
110
#endif
 
111
 
 
112
#if PY_VERSION_HEX < 0x02060000
 
113
  #define PyBytesObject                PyStringObject
 
114
  #define PyBytes_Type                 PyString_Type
 
115
  #define PyBytes_Check                PyString_Check
 
116
  #define PyBytes_CheckExact           PyString_CheckExact
 
117
  #define PyBytes_FromString           PyString_FromString
 
118
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
 
119
  #define PyBytes_FromFormat           PyString_FromFormat
 
120
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
 
121
  #define PyBytes_AsString             PyString_AsString
 
122
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
 
123
  #define PyBytes_Size                 PyString_Size
 
124
  #define PyBytes_AS_STRING            PyString_AS_STRING
 
125
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
 
126
  #define PyBytes_Repr                 PyString_Repr
 
127
  #define PyBytes_Concat               PyString_Concat
 
128
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
 
129
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
 
130
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
 
131
#endif
 
132
 
 
133
#ifndef PySet_CheckExact
 
134
#  define PySet_CheckExact(obj)          (Py_TYPE(obj) == &PySet_Type)
 
135
#endif
 
136
 
 
137
#if PY_MAJOR_VERSION >= 3
 
138
  #define PyInt_Type                   PyLong_Type
 
139
  #define PyInt_Check(op)              PyLong_Check(op)
 
140
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
 
141
  #define PyInt_FromString             PyLong_FromString
 
142
  #define PyInt_FromUnicode            PyLong_FromUnicode
 
143
  #define PyInt_FromLong               PyLong_FromLong
 
144
  #define PyInt_FromSize_t             PyLong_FromSize_t
 
145
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
 
146
  #define PyInt_AsLong                 PyLong_AsLong
 
147
  #define PyInt_AS_LONG                PyLong_AS_LONG
 
148
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
 
149
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
 
150
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
 
151
#endif
 
152
 
 
153
#if PY_MAJOR_VERSION >= 3
 
154
  #define PyBoolObject PyLongObject
 
155
#endif
 
156
 
 
157
 
 
158
#if PY_MAJOR_VERSION >= 3
 
159
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
 
160
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
 
161
#else
 
162
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
 
163
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
 
164
#endif
 
165
 
 
166
#if PY_MAJOR_VERSION >= 3
 
167
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 
168
#endif
 
169
 
 
170
#if PY_VERSION_HEX < 0x02050000
 
171
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
 
172
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
 
173
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
 
174
#else
 
175
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
 
176
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
 
177
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
 
178
#endif
 
179
 
 
180
#if PY_VERSION_HEX < 0x02050000
 
181
  #define __Pyx_NAMESTR(n) ((char *)(n))
 
182
  #define __Pyx_DOCSTR(n)  ((char *)(n))
 
183
#else
 
184
  #define __Pyx_NAMESTR(n) (n)
 
185
  #define __Pyx_DOCSTR(n)  (n)
 
186
#endif
 
187
 
24
188
#ifdef __cplusplus
25
189
#define __PYX_EXTERN_C extern "C"
26
190
#else
27
191
#define __PYX_EXTERN_C extern
28
192
#endif
 
193
 
 
194
#if defined(WIN32) || defined(MS_WINDOWS)
 
195
#define _USE_MATH_DEFINES
 
196
#endif
29
197
#include <math.h>
 
198
#define __PYX_HAVE_API__bzrlib___annotator_pyx
30
199
#include "python-compat.h"
31
200
 
32
 
 
33
 
typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
34
 
 
 
201
/* inline attribute */
 
202
#ifndef CYTHON_INLINE
 
203
  #if defined(__GNUC__)
 
204
    #define CYTHON_INLINE __inline__
 
205
  #elif defined(_MSC_VER)
 
206
    #define CYTHON_INLINE __inline
 
207
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
208
    #define CYTHON_INLINE inline
 
209
  #else
 
210
    #define CYTHON_INLINE 
 
211
  #endif
 
212
#endif
 
213
 
 
214
/* unused attribute */
 
215
#ifndef CYTHON_UNUSED
 
216
# if defined(__GNUC__)
 
217
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
 
218
#     define CYTHON_UNUSED __attribute__ ((__unused__)) 
 
219
#   else
 
220
#     define CYTHON_UNUSED
 
221
#   endif
 
222
# elif defined(__ICC) || defined(__INTEL_COMPILER)
 
223
#   define CYTHON_UNUSED __attribute__ ((__unused__)) 
 
224
# else
 
225
#   define CYTHON_UNUSED 
 
226
# endif
 
227
#endif
 
228
 
 
229
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
 
230
 
 
231
 
 
232
/* Type Conversion Predeclarations */
 
233
 
 
234
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
 
235
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
 
236
 
 
237
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 
238
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 
239
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 
240
 
 
241
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 
242
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
 
243
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 
244
 
 
245
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 
246
 
 
247
 
 
248
#ifdef __GNUC__
 
249
/* Test for GCC > 2.95 */
 
250
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
 
251
#define likely(x)   __builtin_expect(!!(x), 1)
 
252
#define unlikely(x) __builtin_expect(!!(x), 0)
 
253
#else /* __GNUC__ > 2 ... */
 
254
#define likely(x)   (x)
 
255
#define unlikely(x) (x)
 
256
#endif /* __GNUC__ > 2 ... */
 
257
#else /* __GNUC__ */
 
258
#define likely(x)   (x)
 
259
#define unlikely(x) (x)
 
260
#endif /* __GNUC__ */
 
261
    
35
262
static PyObject *__pyx_m;
36
263
static PyObject *__pyx_b;
 
264
static PyObject *__pyx_empty_tuple;
 
265
static PyObject *__pyx_empty_bytes;
37
266
static int __pyx_lineno;
38
 
static char *__pyx_filename;
39
 
static char **__pyx_f;
40
 
 
41
 
static char __pyx_mdoc[] = "Functionality for doing annotations in the \'optimal\' way";
 
267
static int __pyx_clineno = 0;
 
268
static const char * __pyx_cfilenm= __FILE__;
 
269
static const char *__pyx_filename;
 
270
 
 
271
 
 
272
static const char *__pyx_f[] = {
 
273
  "_annotator_pyx.pyx",
 
274
};
 
275
 
 
276
/* Type declarations */
 
277
 
 
278
#ifndef CYTHON_REFNANNY
 
279
  #define CYTHON_REFNANNY 0
 
280
#endif
 
281
 
 
282
#if CYTHON_REFNANNY
 
283
  typedef struct {
 
284
    void (*INCREF)(void*, PyObject*, int);
 
285
    void (*DECREF)(void*, PyObject*, int);
 
286
    void (*GOTREF)(void*, PyObject*, int);
 
287
    void (*GIVEREF)(void*, PyObject*, int);
 
288
    void* (*SetupContext)(const char*, int, const char*);
 
289
    void (*FinishContext)(void**);
 
290
  } __Pyx_RefNannyAPIStruct;
 
291
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
 
292
  static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
 
293
    PyObject *m = NULL, *p = NULL;
 
294
    void *r = NULL;
 
295
    m = PyImport_ImportModule((char *)modname);
 
296
    if (!m) goto end;
 
297
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
 
298
    if (!p) goto end;
 
299
    r = PyLong_AsVoidPtr(p);
 
300
  end:
 
301
    Py_XDECREF(p);
 
302
    Py_XDECREF(m);
 
303
    return (__Pyx_RefNannyAPIStruct *)r;
 
304
  }
 
305
  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
 
306
  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
 
307
  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
308
  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
309
  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
310
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
311
  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
 
312
#else
 
313
  #define __Pyx_RefNannySetupContext(name)
 
314
  #define __Pyx_RefNannyFinishContext()
 
315
  #define __Pyx_INCREF(r) Py_INCREF(r)
 
316
  #define __Pyx_DECREF(r) Py_DECREF(r)
 
317
  #define __Pyx_GOTREF(r)
 
318
  #define __Pyx_GIVEREF(r)
 
319
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
 
320
#endif /* CYTHON_REFNANNY */
 
321
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
 
322
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
 
323
 
 
324
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
325
 
 
326
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
327
 
 
328
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
 
329
 
 
330
static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
 
331
static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/
 
332
 
 
333
static void __Pyx_RaiseDoubleKeywordsError(
 
334
    const char* func_name, PyObject* kw_name); /*proto*/
 
335
 
 
336
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
 
337
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
 
338
 
 
339
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
 
340
 
 
341
 
 
342
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
 
343
    PyObject *r;
 
344
    if (!j) return NULL;
 
345
    r = PyObject_GetItem(o, j);
 
346
    Py_DECREF(j);
 
347
    return r;
 
348
}
 
349
 
 
350
 
 
351
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
 
352
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
 
353
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
 
354
 
 
355
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
 
356
    if (likely(o != Py_None)) {
 
357
        if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
 
358
            PyObject *r = PyList_GET_ITEM(o, i);
 
359
            Py_INCREF(r);
 
360
            return r;
 
361
        }
 
362
        else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
 
363
            PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
 
364
            Py_INCREF(r);
 
365
            return r;
 
366
        }
 
367
    }
 
368
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
 
369
}
 
370
 
 
371
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
 
372
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
 
373
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
 
374
 
 
375
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
 
376
    if (likely(o != Py_None)) {
 
377
        if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
 
378
            PyObject *r = PyTuple_GET_ITEM(o, i);
 
379
            Py_INCREF(r);
 
380
            return r;
 
381
        }
 
382
        else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
 
383
            PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
 
384
            Py_INCREF(r);
 
385
            return r;
 
386
        }
 
387
    }
 
388
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
 
389
}
 
390
 
 
391
 
 
392
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
 
393
                                                    __Pyx_GetItemInt_Fast(o, i) : \
 
394
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
 
395
 
 
396
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
 
397
    PyObject *r;
 
398
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
 
399
        r = PyList_GET_ITEM(o, i);
 
400
        Py_INCREF(r);
 
401
    }
 
402
    else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
 
403
        r = PyTuple_GET_ITEM(o, i);
 
404
        Py_INCREF(r);
 
405
    }
 
406
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
 
407
        r = PySequence_GetItem(o, i);
 
408
    }
 
409
    else {
 
410
        r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
 
411
    }
 
412
    return r;
 
413
}
 
414
 
 
415
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
 
416
 
 
417
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/
 
418
 
 
419
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
420
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
42
421
 
43
422
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
44
423
 
45
 
static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/
46
 
static int __Pyx_EndUnpack(PyObject *); /*proto*/
47
 
 
48
 
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
49
 
 
50
 
static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i); /*proto*/
 
424
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
 
425
 
 
426
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
 
427
 
 
428
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
 
429
 
 
430
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
 
431
 
 
432
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
 
433
 
 
434
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
 
435
 
 
436
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
 
437
 
 
438
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
 
439
 
 
440
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
 
441
 
 
442
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
 
443
 
 
444
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
 
445
 
 
446
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
 
447
 
 
448
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
 
449
 
 
450
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
 
451
 
 
452
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
 
453
 
 
454
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
 
455
 
 
456
static void __Pyx_AddTraceback(const char *funcname); /*proto*/
51
457
 
52
458
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
53
 
 
54
 
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
55
 
 
56
 
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
57
 
 
58
 
static void __Pyx_AddTraceback(char *funcname); /*proto*/
59
 
 
60
 
/* Declarations from bzrlib._annotator_pyx */
61
 
 
62
 
 
63
 
/* Declarations from implementation of bzrlib._annotator_pyx */
64
 
 
65
 
static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *,PyObject *); /*proto*/
66
 
static int __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(PyObject *,PyObject *,Py_ssize_t,Py_ssize_t,Py_ssize_t); /*proto*/
67
 
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *,Py_ssize_t *); /*proto*/
68
 
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *,PyObject *,PyObject *); /*proto*/
69
 
static int __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(PyObject *,PyObject *,PyObject *); /*proto*/
70
 
static int __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(PyObject *,PyObject *,PyObject *,PyObject *,PyObject *); /*proto*/
71
 
 
72
 
static char __pyx_k1[] = "annotations must be a list";
73
 
static char __pyx_k2[] = "parent_annotations must be a list";
74
 
static char __pyx_k3[] = "Match length exceeds len of parent_annotations %s > %s";
75
 
static char __pyx_k4[] = "Match length exceeds len of annotations %s > %s";
76
 
static char __pyx_k5[] = "annotations must be tuples";
77
 
static char __pyx_k6[] = "_get_parent_annotations_and_matches";
78
 
static char __pyx_k7[] = "_ann_tuple_cache";
79
 
static char __pyx_k8[] = "bzrlib";
80
 
static char __pyx_k9[] = "annotate";
81
 
static char __pyx_k10[] = "_break_annotation_tie";
82
 
static char __pyx_k11[] = "_get_heads_provider";
83
 
static char __pyx_k12[] = "heads";
84
 
static char __pyx_k13[] = "_resolve_annotation_tie";
85
 
static char __pyx_k14[] = "_annotator_py";
86
 
static char __pyx_k15[] = "Annotator";
87
 
static char __pyx_k16[] = "Class that drives performing annotations.";
88
 
static char __pyx_k17[] = "_update_from_first_parent";
89
 
static char __pyx_k18[] = "_update_from_other_parents";
90
 
static char __pyx_k19[] = "annotate_flat";
91
 
 
92
 
static PyObject *__pyx_n_Annotator;
93
 
static PyObject *__pyx_n__ann_tuple_cache;
94
 
static PyObject *__pyx_n__annotator_py;
95
 
static PyObject *__pyx_n__break_annotation_tie;
96
 
static PyObject *__pyx_n__get_heads_provider;
97
 
static PyObject *__pyx_n__resolve_annotation_tie;
98
 
static PyObject *__pyx_n__update_from_first_parent;
99
 
static PyObject *__pyx_n__update_from_other_parents;
100
 
static PyObject *__pyx_n_annotate;
101
 
static PyObject *__pyx_n_annotate_flat;
102
 
static PyObject *__pyx_n_bzrlib;
103
 
static PyObject *__pyx_n_heads;
104
 
 
105
 
static PyObject *__pyx_k1p;
106
 
static PyObject *__pyx_k2p;
107
 
static PyObject *__pyx_k3p;
108
 
static PyObject *__pyx_k4p;
109
 
static PyObject *__pyx_k5p;
110
 
static PyObject *__pyx_k6p;
111
 
static PyObject *__pyx_k16p;
112
 
 
113
 
static __Pyx_StringTabEntry __pyx_string_tab[] = {
114
 
  {&__pyx_n_Annotator, 1, __pyx_k15, sizeof(__pyx_k15)},
115
 
  {&__pyx_n__ann_tuple_cache, 1, __pyx_k7, sizeof(__pyx_k7)},
116
 
  {&__pyx_n__annotator_py, 1, __pyx_k14, sizeof(__pyx_k14)},
117
 
  {&__pyx_n__break_annotation_tie, 1, __pyx_k10, sizeof(__pyx_k10)},
118
 
  {&__pyx_n__get_heads_provider, 1, __pyx_k11, sizeof(__pyx_k11)},
119
 
  {&__pyx_n__resolve_annotation_tie, 1, __pyx_k13, sizeof(__pyx_k13)},
120
 
  {&__pyx_n__update_from_first_parent, 1, __pyx_k17, sizeof(__pyx_k17)},
121
 
  {&__pyx_n__update_from_other_parents, 1, __pyx_k18, sizeof(__pyx_k18)},
122
 
  {&__pyx_n_annotate, 1, __pyx_k9, sizeof(__pyx_k9)},
123
 
  {&__pyx_n_annotate_flat, 1, __pyx_k19, sizeof(__pyx_k19)},
124
 
  {&__pyx_n_bzrlib, 1, __pyx_k8, sizeof(__pyx_k8)},
125
 
  {&__pyx_n_heads, 1, __pyx_k12, sizeof(__pyx_k12)},
126
 
  {&__pyx_k1p, 0, __pyx_k1, sizeof(__pyx_k1)},
127
 
  {&__pyx_k2p, 0, __pyx_k2, sizeof(__pyx_k2)},
128
 
  {&__pyx_k3p, 0, __pyx_k3, sizeof(__pyx_k3)},
129
 
  {&__pyx_k4p, 0, __pyx_k4, sizeof(__pyx_k4)},
130
 
  {&__pyx_k5p, 0, __pyx_k5, sizeof(__pyx_k5)},
131
 
  {&__pyx_k6p, 0, __pyx_k6, sizeof(__pyx_k6)},
132
 
  {&__pyx_k16p, 0, __pyx_k16, sizeof(__pyx_k16)},
133
 
  {0, 0, 0, 0}
134
 
};
135
 
 
136
 
 
 
459
/* Module declarations from bzrlib._annotator_pyx */
 
460
 
 
461
static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *, PyObject *); /*proto*/
 
462
static int __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(PyObject *, PyObject *, Py_ssize_t, Py_ssize_t, Py_ssize_t); /*proto*/
 
463
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *, Py_ssize_t *); /*proto*/
 
464
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *, PyObject *, PyObject *); /*proto*/
 
465
static int __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(PyObject *, PyObject *, PyObject *); /*proto*/
 
466
static int __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
 
467
#define __Pyx_MODULE_NAME "bzrlib._annotator_pyx"
 
468
int __pyx_module_is_main_bzrlib___annotator_pyx = 0;
137
469
 
138
470
/* Implementation of bzrlib._annotator_pyx */
139
 
 
140
 
static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *__pyx_v_annotations,PyObject *__pyx_v_parent_annotations) {
 
471
static PyObject *__pyx_builtin_TypeError;
 
472
static PyObject *__pyx_builtin_ValueError;
 
473
static char __pyx_k_1[] = "annotations must be a list";
 
474
static char __pyx_k_2[] = "parent_annotations must be a list";
 
475
static char __pyx_k_3[] = "Match length exceeds len of parent_annotations %s > %s";
 
476
static char __pyx_k_4[] = "Match length exceeds len of annotations %s > %s";
 
477
static char __pyx_k_5[] = "annotations must be tuples";
 
478
static char __pyx_k_6[] = "_get_parent_annotations_and_matches";
 
479
static char __pyx_k_7[] = "_break_annotation_tie";
 
480
static char __pyx_k_8[] = "_resolve_annotation_tie";
 
481
static char __pyx_k_9[] = "Functionality for doing annotations in the 'optimal' way";
 
482
static char __pyx_k_10[] = "Class that drives performing annotations.";
 
483
static char __pyx_k_11[] = "_update_from_first_parent";
 
484
static char __pyx_k_12[] = "_update_from_other_parents";
 
485
static char __pyx_k_13[] = "Annotator._update_from_first_parent (line 247)";
 
486
static char __pyx_k_14[] = "Annotator._update_from_other_parents (line 256)";
 
487
static char __pyx_k_15[] = "Annotator.annotate_flat (line 265)";
 
488
static char __pyx_k__key[] = "key";
 
489
static char __pyx_k__self[] = "self";
 
490
static char __pyx_k__heads[] = "heads";
 
491
static char __pyx_k__lines[] = "lines";
 
492
static char __pyx_k__bzrlib[] = "bzrlib";
 
493
static char __pyx_k__ob_item[] = "ob_item";
 
494
static char __pyx_k____main__[] = "__main__";
 
495
static char __pyx_k____test__[] = "__test__";
 
496
static char __pyx_k__annotate[] = "annotate";
 
497
static char __pyx_k__Annotator[] = "Annotator";
 
498
static char __pyx_k__TypeError[] = "TypeError";
 
499
static char __pyx_k__ValueError[] = "ValueError";
 
500
static char __pyx_k__parent_key[] = "parent_key";
 
501
static char __pyx_k__annotations[] = "annotations";
 
502
static char __pyx_k___annotator_py[] = "_annotator_py";
 
503
static char __pyx_k__annotate_flat[] = "annotate_flat";
 
504
static char __pyx_k__this_annotation[] = "this_annotation";
 
505
static char __pyx_k___ann_tuple_cache[] = "_ann_tuple_cache";
 
506
static char __pyx_k___get_heads_provider[] = "_get_heads_provider";
 
507
static PyObject *__pyx_kp_s_1;
 
508
static PyObject *__pyx_kp_s_10;
 
509
static PyObject *__pyx_n_s_11;
 
510
static PyObject *__pyx_n_s_12;
 
511
static PyObject *__pyx_kp_u_13;
 
512
static PyObject *__pyx_kp_u_14;
 
513
static PyObject *__pyx_kp_u_15;
 
514
static PyObject *__pyx_kp_s_2;
 
515
static PyObject *__pyx_kp_s_3;
 
516
static PyObject *__pyx_kp_s_4;
 
517
static PyObject *__pyx_kp_s_5;
 
518
static PyObject *__pyx_n_s_6;
 
519
static PyObject *__pyx_n_s_7;
 
520
static PyObject *__pyx_n_s_8;
 
521
static PyObject *__pyx_n_s__Annotator;
 
522
static PyObject *__pyx_n_s__TypeError;
 
523
static PyObject *__pyx_n_s__ValueError;
 
524
static PyObject *__pyx_n_s____main__;
 
525
static PyObject *__pyx_n_s____test__;
 
526
static PyObject *__pyx_n_s___ann_tuple_cache;
 
527
static PyObject *__pyx_n_s___annotator_py;
 
528
static PyObject *__pyx_n_s___get_heads_provider;
 
529
static PyObject *__pyx_n_s__annotate;
 
530
static PyObject *__pyx_n_s__annotate_flat;
 
531
static PyObject *__pyx_n_s__annotations;
 
532
static PyObject *__pyx_n_s__bzrlib;
 
533
static PyObject *__pyx_n_s__heads;
 
534
static PyObject *__pyx_n_s__key;
 
535
static PyObject *__pyx_n_s__lines;
 
536
static PyObject *__pyx_n_s__ob_item;
 
537
static PyObject *__pyx_n_s__parent_key;
 
538
static PyObject *__pyx_n_s__self;
 
539
static PyObject *__pyx_n_s__this_annotation;
 
540
 
 
541
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":61
 
542
 * 
 
543
 * 
 
544
 * cdef int _check_annotations_are_lists(annotations,             # <<<<<<<<<<<<<<
 
545
 *                                       parent_annotations) except -1:
 
546
 *     if not PyList_CheckExact(annotations):
 
547
 */
 
548
 
 
549
static  int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *__pyx_v_annotations, PyObject *__pyx_v_parent_annotations) {
141
550
  int __pyx_r;
142
 
  int __pyx_1;
143
 
  PyObject *__pyx_2 = 0;
144
 
  PyObject *__pyx_3 = 0;
145
 
  Py_INCREF(__pyx_v_annotations);
146
 
  Py_INCREF(__pyx_v_parent_annotations);
147
 
 
148
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":63 */
149
 
  __pyx_1 = (!PyList_CheckExact(__pyx_v_annotations));
150
 
  if (__pyx_1) {
151
 
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
152
 
    Py_INCREF(__pyx_k1p);
153
 
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k1p);
154
 
    __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
155
 
    Py_DECREF(__pyx_2); __pyx_2 = 0;
156
 
    __Pyx_Raise(__pyx_3, 0, 0);
157
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
158
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
159
 
    goto __pyx_L2;
160
 
  }
161
 
  __pyx_L2:;
162
 
 
163
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":65 */
164
 
  __pyx_1 = (!PyList_CheckExact(__pyx_v_parent_annotations));
165
 
  if (__pyx_1) {
166
 
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
167
 
    Py_INCREF(__pyx_k2p);
168
 
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k2p);
169
 
    __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
170
 
    Py_DECREF(__pyx_2); __pyx_2 = 0;
171
 
    __Pyx_Raise(__pyx_3, 0, 0);
172
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
173
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
 
551
  int __pyx_t_1;
 
552
  PyObject *__pyx_t_2 = NULL;
 
553
  PyObject *__pyx_t_3 = NULL;
 
554
  __Pyx_RefNannySetupContext("_check_annotations_are_lists");
 
555
 
 
556
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":63
 
557
 * cdef int _check_annotations_are_lists(annotations,
 
558
 *                                       parent_annotations) except -1:
 
559
 *     if not PyList_CheckExact(annotations):             # <<<<<<<<<<<<<<
 
560
 *         raise TypeError('annotations must be a list')
 
561
 *     if not PyList_CheckExact(parent_annotations):
 
562
 */
 
563
  __pyx_t_1 = (!PyList_CheckExact(__pyx_v_annotations));
 
564
  if (__pyx_t_1) {
 
565
 
 
566
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":64
 
567
 *                                       parent_annotations) except -1:
 
568
 *     if not PyList_CheckExact(annotations):
 
569
 *         raise TypeError('annotations must be a list')             # <<<<<<<<<<<<<<
 
570
 *     if not PyList_CheckExact(parent_annotations):
 
571
 *         raise TypeError('parent_annotations must be a list')
 
572
 */
 
573
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
574
    __Pyx_GOTREF(__pyx_t_2);
 
575
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
 
576
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_1));
 
577
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
 
578
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
579
    __Pyx_GOTREF(__pyx_t_3);
 
580
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
581
    __Pyx_Raise(__pyx_t_3, 0, 0);
 
582
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
583
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
174
584
    goto __pyx_L3;
175
585
  }
176
586
  __pyx_L3:;
177
587
 
178
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":67 */
179
 
  __pyx_r = 0;
180
 
  goto __pyx_L0;
181
 
 
182
 
  __pyx_r = 0;
183
 
  goto __pyx_L0;
184
 
  __pyx_L1:;
185
 
  Py_XDECREF(__pyx_2);
186
 
  Py_XDECREF(__pyx_3);
 
588
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":65
 
589
 *     if not PyList_CheckExact(annotations):
 
590
 *         raise TypeError('annotations must be a list')
 
591
 *     if not PyList_CheckExact(parent_annotations):             # <<<<<<<<<<<<<<
 
592
 *         raise TypeError('parent_annotations must be a list')
 
593
 *     return 0
 
594
 */
 
595
  __pyx_t_1 = (!PyList_CheckExact(__pyx_v_parent_annotations));
 
596
  if (__pyx_t_1) {
 
597
 
 
598
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":66
 
599
 *         raise TypeError('annotations must be a list')
 
600
 *     if not PyList_CheckExact(parent_annotations):
 
601
 *         raise TypeError('parent_annotations must be a list')             # <<<<<<<<<<<<<<
 
602
 *     return 0
 
603
 * 
 
604
 */
 
605
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
606
    __Pyx_GOTREF(__pyx_t_3);
 
607
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
 
608
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2));
 
609
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
 
610
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
611
    __Pyx_GOTREF(__pyx_t_2);
 
612
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
613
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
614
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
615
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
616
    goto __pyx_L4;
 
617
  }
 
618
  __pyx_L4:;
 
619
 
 
620
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":67
 
621
 *     if not PyList_CheckExact(parent_annotations):
 
622
 *         raise TypeError('parent_annotations must be a list')
 
623
 *     return 0             # <<<<<<<<<<<<<<
 
624
 * 
 
625
 * 
 
626
 */
 
627
  __pyx_r = 0;
 
628
  goto __pyx_L0;
 
629
 
 
630
  __pyx_r = 0;
 
631
  goto __pyx_L0;
 
632
  __pyx_L1_error:;
 
633
  __Pyx_XDECREF(__pyx_t_2);
 
634
  __Pyx_XDECREF(__pyx_t_3);
187
635
  __Pyx_AddTraceback("bzrlib._annotator_pyx._check_annotations_are_lists");
188
 
  __pyx_r = (-1);
 
636
  __pyx_r = -1;
189
637
  __pyx_L0:;
190
 
  Py_DECREF(__pyx_v_annotations);
191
 
  Py_DECREF(__pyx_v_parent_annotations);
 
638
  __Pyx_RefNannyFinishContext();
192
639
  return __pyx_r;
193
640
}
194
641
 
195
 
static int __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(PyObject *__pyx_v_parent_annotations,PyObject *__pyx_v_annotations,Py_ssize_t __pyx_v_parent_idx,Py_ssize_t __pyx_v_lines_idx,Py_ssize_t __pyx_v_match_len) {
 
642
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":70
 
643
 * 
 
644
 * 
 
645
 * cdef int _check_match_ranges(parent_annotations, annotations,             # <<<<<<<<<<<<<<
 
646
 *                              Py_ssize_t parent_idx, Py_ssize_t lines_idx,
 
647
 *                              Py_ssize_t match_len) except -1:
 
648
 */
 
649
 
 
650
static  int __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(PyObject *__pyx_v_parent_annotations, PyObject *__pyx_v_annotations, Py_ssize_t __pyx_v_parent_idx, Py_ssize_t __pyx_v_lines_idx, Py_ssize_t __pyx_v_match_len) {
196
651
  int __pyx_r;
197
 
  int __pyx_1;
198
 
  PyObject *__pyx_2 = 0;
199
 
  PyObject *__pyx_3 = 0;
200
 
  PyObject *__pyx_4 = 0;
201
 
  Py_INCREF(__pyx_v_parent_annotations);
202
 
  Py_INCREF(__pyx_v_annotations);
203
 
 
204
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":73 */
205
 
  __pyx_1 = ((__pyx_v_parent_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_parent_annotations));
206
 
  if (__pyx_1) {
207
 
    __pyx_2 = PyInt_FromSsize_t((__pyx_v_parent_idx + __pyx_v_match_len)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}
208
 
    __pyx_3 = PyInt_FromSsize_t(PyList_GET_SIZE(__pyx_v_parent_annotations)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;}
209
 
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}
210
 
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
211
 
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
212
 
    __pyx_2 = 0;
213
 
    __pyx_3 = 0;
214
 
    __pyx_2 = PyNumber_Remainder(__pyx_k3p, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}
215
 
    Py_DECREF(__pyx_4); __pyx_4 = 0;
216
 
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
217
 
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
218
 
    __pyx_2 = 0;
219
 
    __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
220
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
221
 
    __Pyx_Raise(__pyx_4, 0, 0);
222
 
    Py_DECREF(__pyx_4); __pyx_4 = 0;
223
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
224
 
    goto __pyx_L2;
225
 
  }
226
 
  __pyx_L2:;
227
 
 
228
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":78 */
229
 
  __pyx_1 = ((__pyx_v_lines_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_annotations));
230
 
  if (__pyx_1) {
231
 
    __pyx_2 = PyInt_FromSsize_t((__pyx_v_lines_idx + __pyx_v_match_len)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
232
 
    __pyx_3 = PyInt_FromSsize_t(PyList_GET_SIZE(__pyx_v_annotations)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;}
233
 
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
234
 
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
235
 
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
236
 
    __pyx_2 = 0;
237
 
    __pyx_3 = 0;
238
 
    __pyx_2 = PyNumber_Remainder(__pyx_k4p, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
239
 
    Py_DECREF(__pyx_4); __pyx_4 = 0;
240
 
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
241
 
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
242
 
    __pyx_2 = 0;
243
 
    __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
244
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
245
 
    __Pyx_Raise(__pyx_4, 0, 0);
246
 
    Py_DECREF(__pyx_4); __pyx_4 = 0;
247
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
 
652
  int __pyx_t_1;
 
653
  PyObject *__pyx_t_2 = NULL;
 
654
  PyObject *__pyx_t_3 = NULL;
 
655
  PyObject *__pyx_t_4 = NULL;
 
656
  __Pyx_RefNannySetupContext("_check_match_ranges");
 
657
 
 
658
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":73
 
659
 *                              Py_ssize_t parent_idx, Py_ssize_t lines_idx,
 
660
 *                              Py_ssize_t match_len) except -1:
 
661
 *     if parent_idx + match_len > PyList_GET_SIZE(parent_annotations):             # <<<<<<<<<<<<<<
 
662
 *         raise ValueError('Match length exceeds len of'
 
663
 *                          ' parent_annotations %s > %s'
 
664
 */
 
665
  __pyx_t_1 = ((__pyx_v_parent_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_parent_annotations));
 
666
  if (__pyx_t_1) {
 
667
 
 
668
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":76
 
669
 *         raise ValueError('Match length exceeds len of'
 
670
 *                          ' parent_annotations %s > %s'
 
671
 *                          % (parent_idx + match_len,             # <<<<<<<<<<<<<<
 
672
 *                             PyList_GET_SIZE(parent_annotations)))
 
673
 *     if lines_idx + match_len > PyList_GET_SIZE(annotations):
 
674
 */
 
675
    __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_parent_idx + __pyx_v_match_len)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
676
    __Pyx_GOTREF(__pyx_t_2);
 
677
 
 
678
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":77
 
679
 *                          ' parent_annotations %s > %s'
 
680
 *                          % (parent_idx + match_len,
 
681
 *                             PyList_GET_SIZE(parent_annotations)))             # <<<<<<<<<<<<<<
 
682
 *     if lines_idx + match_len > PyList_GET_SIZE(annotations):
 
683
 *         raise ValueError('Match length exceeds len of'
 
684
 */
 
685
    __pyx_t_3 = PyInt_FromSsize_t(PyList_GET_SIZE(__pyx_v_parent_annotations)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
686
    __Pyx_GOTREF(__pyx_t_3);
 
687
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
688
    __Pyx_GOTREF(__pyx_t_4);
 
689
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
 
690
    __Pyx_GIVEREF(__pyx_t_2);
 
691
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
 
692
    __Pyx_GIVEREF(__pyx_t_3);
 
693
    __pyx_t_2 = 0;
 
694
    __pyx_t_3 = 0;
 
695
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
696
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
697
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
698
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
699
    __Pyx_GOTREF(__pyx_t_4);
 
700
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
 
701
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
 
702
    __pyx_t_3 = 0;
 
703
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
704
    __Pyx_GOTREF(__pyx_t_3);
 
705
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
706
    __Pyx_Raise(__pyx_t_3, 0, 0);
 
707
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
708
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
248
709
    goto __pyx_L3;
249
710
  }
250
711
  __pyx_L3:;
251
712
 
252
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":83 */
253
 
  __pyx_r = 0;
254
 
  goto __pyx_L0;
255
 
 
256
 
  __pyx_r = 0;
257
 
  goto __pyx_L0;
258
 
  __pyx_L1:;
259
 
  Py_XDECREF(__pyx_2);
260
 
  Py_XDECREF(__pyx_3);
261
 
  Py_XDECREF(__pyx_4);
 
713
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":78
 
714
 *                          % (parent_idx + match_len,
 
715
 *                             PyList_GET_SIZE(parent_annotations)))
 
716
 *     if lines_idx + match_len > PyList_GET_SIZE(annotations):             # <<<<<<<<<<<<<<
 
717
 *         raise ValueError('Match length exceeds len of'
 
718
 *                          ' annotations %s > %s'
 
719
 */
 
720
  __pyx_t_1 = ((__pyx_v_lines_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_annotations));
 
721
  if (__pyx_t_1) {
 
722
 
 
723
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":81
 
724
 *         raise ValueError('Match length exceeds len of'
 
725
 *                          ' annotations %s > %s'
 
726
 *                          % (lines_idx + match_len,             # <<<<<<<<<<<<<<
 
727
 *                             PyList_GET_SIZE(annotations)))
 
728
 *     return 0
 
729
 */
 
730
    __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_lines_idx + __pyx_v_match_len)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
731
    __Pyx_GOTREF(__pyx_t_3);
 
732
 
 
733
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":82
 
734
 *                          ' annotations %s > %s'
 
735
 *                          % (lines_idx + match_len,
 
736
 *                             PyList_GET_SIZE(annotations)))             # <<<<<<<<<<<<<<
 
737
 *     return 0
 
738
 * 
 
739
 */
 
740
    __pyx_t_4 = PyInt_FromSsize_t(PyList_GET_SIZE(__pyx_v_annotations)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
741
    __Pyx_GOTREF(__pyx_t_4);
 
742
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
743
    __Pyx_GOTREF(__pyx_t_2);
 
744
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
 
745
    __Pyx_GIVEREF(__pyx_t_3);
 
746
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
 
747
    __Pyx_GIVEREF(__pyx_t_4);
 
748
    __pyx_t_3 = 0;
 
749
    __pyx_t_4 = 0;
 
750
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
751
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
752
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
753
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
754
    __Pyx_GOTREF(__pyx_t_2);
 
755
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
 
756
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
 
757
    __pyx_t_4 = 0;
 
758
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
759
    __Pyx_GOTREF(__pyx_t_4);
 
760
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
761
    __Pyx_Raise(__pyx_t_4, 0, 0);
 
762
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
763
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
764
    goto __pyx_L4;
 
765
  }
 
766
  __pyx_L4:;
 
767
 
 
768
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":83
 
769
 *                          % (lines_idx + match_len,
 
770
 *                             PyList_GET_SIZE(annotations)))
 
771
 *     return 0             # <<<<<<<<<<<<<<
 
772
 * 
 
773
 * 
 
774
 */
 
775
  __pyx_r = 0;
 
776
  goto __pyx_L0;
 
777
 
 
778
  __pyx_r = 0;
 
779
  goto __pyx_L0;
 
780
  __pyx_L1_error:;
 
781
  __Pyx_XDECREF(__pyx_t_2);
 
782
  __Pyx_XDECREF(__pyx_t_3);
 
783
  __Pyx_XDECREF(__pyx_t_4);
262
784
  __Pyx_AddTraceback("bzrlib._annotator_pyx._check_match_ranges");
263
 
  __pyx_r = (-1);
 
785
  __pyx_r = -1;
264
786
  __pyx_L0:;
265
 
  Py_DECREF(__pyx_v_parent_annotations);
266
 
  Py_DECREF(__pyx_v_annotations);
 
787
  __Pyx_RefNannyFinishContext();
267
788
  return __pyx_r;
268
789
}
269
790
 
270
 
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *__pyx_v_tpl,Py_ssize_t *__pyx_v_pos) {
 
791
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":86
 
792
 * 
 
793
 * 
 
794
 * cdef PyObject *_next_tuple_entry(object tpl, Py_ssize_t *pos): # cannot_raise             # <<<<<<<<<<<<<<
 
795
 *     """Return the next entry from this tuple.
 
796
 * 
 
797
 */
 
798
 
 
799
static  PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *__pyx_v_tpl, Py_ssize_t *__pyx_v_pos) {
271
800
  PyObject *__pyx_r;
272
 
  int __pyx_1;
273
 
  Py_INCREF(__pyx_v_tpl);
 
801
  int __pyx_t_1;
 
802
  __Pyx_RefNannySetupContext("_next_tuple_entry");
274
803
 
275
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":94 */
 
804
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":94
 
805
 *     This cannot raise an exception, as it does no error checking.
 
806
 *     """
 
807
 *     pos[0] = pos[0] + 1             # <<<<<<<<<<<<<<
 
808
 *     if pos[0] >= PyTuple_GET_SIZE(tpl):
 
809
 *         return NULL
 
810
 */
276
811
  (__pyx_v_pos[0]) = ((__pyx_v_pos[0]) + 1);
277
812
 
278
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":95 */
279
 
  __pyx_1 = ((__pyx_v_pos[0]) >= PyTuple_GET_SIZE(__pyx_v_tpl));
280
 
  if (__pyx_1) {
 
813
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":95
 
814
 *     """
 
815
 *     pos[0] = pos[0] + 1
 
816
 *     if pos[0] >= PyTuple_GET_SIZE(tpl):             # <<<<<<<<<<<<<<
 
817
 *         return NULL
 
818
 *     return PyTuple_GET_ITEM(tpl, pos[0])
 
819
 */
 
820
  __pyx_t_1 = ((__pyx_v_pos[0]) >= PyTuple_GET_SIZE(__pyx_v_tpl));
 
821
  if (__pyx_t_1) {
 
822
 
 
823
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":96
 
824
 *     pos[0] = pos[0] + 1
 
825
 *     if pos[0] >= PyTuple_GET_SIZE(tpl):
 
826
 *         return NULL             # <<<<<<<<<<<<<<
 
827
 *     return PyTuple_GET_ITEM(tpl, pos[0])
 
828
 * 
 
829
 */
281
830
    __pyx_r = NULL;
282
831
    goto __pyx_L0;
283
 
    goto __pyx_L2;
 
832
    goto __pyx_L3;
284
833
  }
285
 
  __pyx_L2:;
 
834
  __pyx_L3:;
286
835
 
287
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":97 */
288
 
  __pyx_r = PyTuple_GET_ITEM(__pyx_v_tpl,(__pyx_v_pos[0]));
 
836
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":97
 
837
 *     if pos[0] >= PyTuple_GET_SIZE(tpl):
 
838
 *         return NULL
 
839
 *     return PyTuple_GET_ITEM(tpl, pos[0])             # <<<<<<<<<<<<<<
 
840
 * 
 
841
 * 
 
842
 */
 
843
  __pyx_r = PyTuple_GET_ITEM(__pyx_v_tpl, (__pyx_v_pos[0]));
289
844
  goto __pyx_L0;
290
845
 
291
846
  __pyx_r = 0;
292
847
  __pyx_L0:;
293
 
  Py_DECREF(__pyx_v_tpl);
 
848
  __Pyx_RefNannyFinishContext();
294
849
  return __pyx_r;
295
850
}
296
851
 
297
 
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *__pyx_v_ann_one,PyObject *__pyx_v_ann_two,PyObject *__pyx_v_cache) {
 
852
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":100
 
853
 * 
 
854
 * 
 
855
 * cdef object _combine_annotations(ann_one, ann_two, cache):             # <<<<<<<<<<<<<<
 
856
 *     """Combine the annotations from both sides."""
 
857
 *     cdef Py_ssize_t pos_one, pos_two, len_one, len_two
 
858
 */
 
859
 
 
860
static  PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *__pyx_v_ann_one, PyObject *__pyx_v_ann_two, PyObject *__pyx_v_cache) {
298
861
  Py_ssize_t __pyx_v_pos_one;
299
862
  Py_ssize_t __pyx_v_pos_two;
300
863
  Py_ssize_t __pyx_v_out_pos;
303
866
  PyObject *__pyx_v_right;
304
867
  PyObject *__pyx_v_cache_key;
305
868
  PyObject *__pyx_v_new_ann;
306
 
  PyObject *__pyx_r;
307
 
  int __pyx_1;
308
 
  PyObject *__pyx_2 = 0;
309
 
  PyObject *__pyx_3 = 0;
310
 
  Py_INCREF(__pyx_v_ann_one);
311
 
  Py_INCREF(__pyx_v_ann_two);
312
 
  Py_INCREF(__pyx_v_cache);
313
 
  __pyx_v_cache_key = Py_None; Py_INCREF(Py_None);
314
 
  __pyx_v_new_ann = Py_None; Py_INCREF(Py_None);
315
 
 
316
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":106 */
317
 
  __pyx_1 = PyObject_RichCompareBool(__pyx_v_ann_one,__pyx_v_ann_two,Py_LT); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;}
318
 
  if (__pyx_1) {
319
 
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
320
 
    Py_INCREF(__pyx_v_ann_one);
321
 
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ann_one);
322
 
    Py_INCREF(__pyx_v_ann_two);
323
 
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_ann_two);
324
 
    Py_DECREF(__pyx_v_cache_key);
325
 
    __pyx_v_cache_key = __pyx_2;
326
 
    __pyx_2 = 0;
327
 
    goto __pyx_L2;
 
869
  PyObject *__pyx_r = NULL;
 
870
  int __pyx_t_1;
 
871
  PyObject *__pyx_t_2 = NULL;
 
872
  int __pyx_t_3;
 
873
  int __pyx_t_4;
 
874
  int __pyx_t_5;
 
875
  PyObject *__pyx_t_6 = NULL;
 
876
  __Pyx_RefNannySetupContext("_combine_annotations");
 
877
  __pyx_v_cache_key = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
 
878
  __pyx_v_new_ann = Py_None; __Pyx_INCREF(Py_None);
 
879
 
 
880
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":106
 
881
 *     cdef PyObject *temp, *left, *right
 
882
 * 
 
883
 *     if (PyObject_RichCompareBool(ann_one, ann_two, Py_LT)):             # <<<<<<<<<<<<<<
 
884
 *         cache_key = (ann_one, ann_two)
 
885
 *     else:
 
886
 */
 
887
  __pyx_t_1 = PyObject_RichCompareBool(__pyx_v_ann_one, __pyx_v_ann_two, Py_LT); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
888
  if (__pyx_t_1) {
 
889
 
 
890
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":107
 
891
 * 
 
892
 *     if (PyObject_RichCompareBool(ann_one, ann_two, Py_LT)):
 
893
 *         cache_key = (ann_one, ann_two)             # <<<<<<<<<<<<<<
 
894
 *     else:
 
895
 *         cache_key = (ann_two, ann_one)
 
896
 */
 
897
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
898
    __Pyx_GOTREF(__pyx_t_2);
 
899
    __Pyx_INCREF(__pyx_v_ann_one);
 
900
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ann_one);
 
901
    __Pyx_GIVEREF(__pyx_v_ann_one);
 
902
    __Pyx_INCREF(__pyx_v_ann_two);
 
903
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ann_two);
 
904
    __Pyx_GIVEREF(__pyx_v_ann_two);
 
905
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
906
    __Pyx_DECREF(((PyObject *)__pyx_v_cache_key));
 
907
    __pyx_v_cache_key = ((PyObject *)__pyx_t_2);
 
908
    __pyx_t_2 = 0;
 
909
    goto __pyx_L3;
328
910
  }
329
911
  /*else*/ {
330
 
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;}
331
 
    Py_INCREF(__pyx_v_ann_two);
332
 
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ann_two);
333
 
    Py_INCREF(__pyx_v_ann_one);
334
 
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_ann_one);
335
 
    Py_DECREF(__pyx_v_cache_key);
336
 
    __pyx_v_cache_key = __pyx_2;
337
 
    __pyx_2 = 0;
 
912
 
 
913
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":109
 
914
 *         cache_key = (ann_one, ann_two)
 
915
 *     else:
 
916
 *         cache_key = (ann_two, ann_one)             # <<<<<<<<<<<<<<
 
917
 *     temp = PyDict_GetItem(cache, cache_key)
 
918
 *     if temp != NULL:
 
919
 */
 
920
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
921
    __Pyx_GOTREF(__pyx_t_2);
 
922
    __Pyx_INCREF(__pyx_v_ann_two);
 
923
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ann_two);
 
924
    __Pyx_GIVEREF(__pyx_v_ann_two);
 
925
    __Pyx_INCREF(__pyx_v_ann_one);
 
926
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ann_one);
 
927
    __Pyx_GIVEREF(__pyx_v_ann_one);
 
928
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
929
    __Pyx_DECREF(((PyObject *)__pyx_v_cache_key));
 
930
    __pyx_v_cache_key = ((PyObject *)__pyx_t_2);
 
931
    __pyx_t_2 = 0;
338
932
  }
339
 
  __pyx_L2:;
340
 
 
341
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":110 */
342
 
  __pyx_v_temp = PyDict_GetItem(__pyx_v_cache,__pyx_v_cache_key);
343
 
 
344
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":111 */
345
 
  __pyx_1 = (__pyx_v_temp != NULL);
346
 
  if (__pyx_1) {
347
 
    Py_INCREF(((PyObject *)__pyx_v_temp));
 
933
  __pyx_L3:;
 
934
 
 
935
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":110
 
936
 *     else:
 
937
 *         cache_key = (ann_two, ann_one)
 
938
 *     temp = PyDict_GetItem(cache, cache_key)             # <<<<<<<<<<<<<<
 
939
 *     if temp != NULL:
 
940
 *         return <object>temp
 
941
 */
 
942
  __pyx_v_temp = PyDict_GetItem(__pyx_v_cache, ((PyObject *)__pyx_v_cache_key));
 
943
 
 
944
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":111
 
945
 *         cache_key = (ann_two, ann_one)
 
946
 *     temp = PyDict_GetItem(cache, cache_key)
 
947
 *     if temp != NULL:             # <<<<<<<<<<<<<<
 
948
 *         return <object>temp
 
949
 * 
 
950
 */
 
951
  __pyx_t_3 = (__pyx_v_temp != NULL);
 
952
  if (__pyx_t_3) {
 
953
 
 
954
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":112
 
955
 *     temp = PyDict_GetItem(cache, cache_key)
 
956
 *     if temp != NULL:
 
957
 *         return <object>temp             # <<<<<<<<<<<<<<
 
958
 * 
 
959
 *     if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two):
 
960
 */
 
961
    __Pyx_XDECREF(__pyx_r);
 
962
    __Pyx_INCREF(((PyObject *)__pyx_v_temp));
348
963
    __pyx_r = ((PyObject *)__pyx_v_temp);
349
964
    goto __pyx_L0;
350
 
    goto __pyx_L3;
351
 
  }
352
 
  __pyx_L3:;
353
 
 
354
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":114 */
355
 
  __pyx_1 = (!PyTuple_CheckExact(__pyx_v_ann_one));
356
 
  if (!__pyx_1) {
357
 
    __pyx_1 = (!PyTuple_CheckExact(__pyx_v_ann_two));
358
 
  }
359
 
  if (__pyx_1) {
360
 
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
361
 
    Py_INCREF(__pyx_k5p);
362
 
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k5p);
363
 
    __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
364
 
    Py_DECREF(__pyx_2); __pyx_2 = 0;
365
 
    __Pyx_Raise(__pyx_3, 0, 0);
366
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
367
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
368
965
    goto __pyx_L4;
369
966
  }
370
967
  __pyx_L4:;
371
968
 
372
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":118 */
373
 
  __pyx_v_pos_one = (-1);
374
 
 
375
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":119 */
376
 
  __pyx_v_pos_two = (-1);
377
 
 
378
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":120 */
 
969
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":114
 
970
 *         return <object>temp
 
971
 * 
 
972
 *     if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two):             # <<<<<<<<<<<<<<
 
973
 *         raise TypeError('annotations must be tuples')
 
974
 *     # We know that annotations are tuples, and that both sides are already
 
975
 */
 
976
  __pyx_t_3 = (!PyTuple_CheckExact(__pyx_v_ann_one));
 
977
  if (!__pyx_t_3) {
 
978
    __pyx_t_4 = (!PyTuple_CheckExact(__pyx_v_ann_two));
 
979
    __pyx_t_5 = __pyx_t_4;
 
980
  } else {
 
981
    __pyx_t_5 = __pyx_t_3;
 
982
  }
 
983
  if (__pyx_t_5) {
 
984
 
 
985
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":115
 
986
 * 
 
987
 *     if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two):
 
988
 *         raise TypeError('annotations must be tuples')             # <<<<<<<<<<<<<<
 
989
 *     # We know that annotations are tuples, and that both sides are already
 
990
 *     # sorted, so we can just walk and update a new list.
 
991
 */
 
992
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
993
    __Pyx_GOTREF(__pyx_t_2);
 
994
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
 
995
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
 
996
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
 
997
    __pyx_t_6 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
998
    __Pyx_GOTREF(__pyx_t_6);
 
999
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
1000
    __Pyx_Raise(__pyx_t_6, 0, 0);
 
1001
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
1002
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1003
    goto __pyx_L5;
 
1004
  }
 
1005
  __pyx_L5:;
 
1006
 
 
1007
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":118
 
1008
 *     # We know that annotations are tuples, and that both sides are already
 
1009
 *     # sorted, so we can just walk and update a new list.
 
1010
 *     pos_one = -1             # <<<<<<<<<<<<<<
 
1011
 *     pos_two = -1
 
1012
 *     out_pos = 0
 
1013
 */
 
1014
  __pyx_v_pos_one = -1;
 
1015
 
 
1016
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":119
 
1017
 *     # sorted, so we can just walk and update a new list.
 
1018
 *     pos_one = -1
 
1019
 *     pos_two = -1             # <<<<<<<<<<<<<<
 
1020
 *     out_pos = 0
 
1021
 *     left = _next_tuple_entry(ann_one, &pos_one)
 
1022
 */
 
1023
  __pyx_v_pos_two = -1;
 
1024
 
 
1025
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":120
 
1026
 *     pos_one = -1
 
1027
 *     pos_two = -1
 
1028
 *     out_pos = 0             # <<<<<<<<<<<<<<
 
1029
 *     left = _next_tuple_entry(ann_one, &pos_one)
 
1030
 *     right = _next_tuple_entry(ann_two, &pos_two)
 
1031
 */
379
1032
  __pyx_v_out_pos = 0;
380
1033
 
381
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":121 */
382
 
  __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one));
383
 
 
384
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":122 */
385
 
  __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two));
386
 
 
387
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":123 */
388
 
  __pyx_2 = PyTuple_New((PyTuple_GET_SIZE(__pyx_v_ann_one) + PyTuple_GET_SIZE(__pyx_v_ann_two))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
389
 
  Py_DECREF(__pyx_v_new_ann);
390
 
  __pyx_v_new_ann = __pyx_2;
391
 
  __pyx_2 = 0;
392
 
 
393
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":125 */
 
1034
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":121
 
1035
 *     pos_two = -1
 
1036
 *     out_pos = 0
 
1037
 *     left = _next_tuple_entry(ann_one, &pos_one)             # <<<<<<<<<<<<<<
 
1038
 *     right = _next_tuple_entry(ann_two, &pos_two)
 
1039
 *     new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
 
1040
 */
 
1041
  __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
 
1042
 
 
1043
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":122
 
1044
 *     out_pos = 0
 
1045
 *     left = _next_tuple_entry(ann_one, &pos_one)
 
1046
 *     right = _next_tuple_entry(ann_two, &pos_two)             # <<<<<<<<<<<<<<
 
1047
 *     new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
 
1048
 *                           + PyTuple_GET_SIZE(ann_two))
 
1049
 */
 
1050
  __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
 
1051
 
 
1052
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":124
 
1053
 *     right = _next_tuple_entry(ann_two, &pos_two)
 
1054
 *     new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
 
1055
 *                           + PyTuple_GET_SIZE(ann_two))             # <<<<<<<<<<<<<<
 
1056
 *     while left != NULL and right != NULL:
 
1057
 *         # left == right is done by PyObject_RichCompareBool_ptr, however it
 
1058
 */
 
1059
  __pyx_t_6 = PyTuple_New((PyTuple_GET_SIZE(__pyx_v_ann_one) + PyTuple_GET_SIZE(__pyx_v_ann_two))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1060
  __Pyx_GOTREF(__pyx_t_6);
 
1061
  __Pyx_DECREF(__pyx_v_new_ann);
 
1062
  __pyx_v_new_ann = __pyx_t_6;
 
1063
  __pyx_t_6 = 0;
 
1064
 
 
1065
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":125
 
1066
 *     new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
 
1067
 *                           + PyTuple_GET_SIZE(ann_two))
 
1068
 *     while left != NULL and right != NULL:             # <<<<<<<<<<<<<<
 
1069
 *         # left == right is done by PyObject_RichCompareBool_ptr, however it
 
1070
 *         # avoids a function call for a very common case. Drops 'time bzr
 
1071
 */
394
1072
  while (1) {
395
 
    __pyx_1 = (__pyx_v_left != NULL);
396
 
    if (__pyx_1) {
397
 
      __pyx_1 = (__pyx_v_right != NULL);
398
 
    }
399
 
    if (!__pyx_1) break;
400
 
 
401
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":129 */
402
 
    __pyx_1 = (__pyx_v_left == __pyx_v_right);
403
 
    if (!__pyx_1) {
404
 
      __pyx_1 = PyObject_RichCompareBool(__pyx_v_left,__pyx_v_right,Py_EQ);
405
 
    }
406
 
    if (__pyx_1) {
407
 
 
408
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":132 */
409
 
      Py_INCREF(__pyx_v_left);
410
 
 
411
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":133 */
412
 
      PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left);
413
 
 
414
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":134 */
415
 
      __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one));
416
 
 
417
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":135 */
418
 
      __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two));
419
 
      goto __pyx_L7;
420
 
    }
421
 
    __pyx_1 = PyObject_RichCompareBool(__pyx_v_left,__pyx_v_right,Py_LT);
422
 
    if (__pyx_1) {
423
 
 
424
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":138 */
425
 
      Py_INCREF(__pyx_v_left);
426
 
 
427
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":139 */
428
 
      PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left);
429
 
 
430
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":140 */
431
 
      __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one));
432
 
      goto __pyx_L7;
 
1073
    __pyx_t_5 = (__pyx_v_left != NULL);
 
1074
    if (__pyx_t_5) {
 
1075
      __pyx_t_3 = (__pyx_v_right != NULL);
 
1076
      __pyx_t_4 = __pyx_t_3;
 
1077
    } else {
 
1078
      __pyx_t_4 = __pyx_t_5;
 
1079
    }
 
1080
    if (!__pyx_t_4) break;
 
1081
 
 
1082
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":130
 
1083
 *         # annotate NEWS' from 7.25s to 7.16s, so it *is* a visible impact.
 
1084
 *         if (left == right
 
1085
 *             or PyObject_RichCompareBool_ptr(left, right, Py_EQ)):             # <<<<<<<<<<<<<<
 
1086
 *             # Identical values, step both
 
1087
 *             Py_INCREF_ptr(left)
 
1088
 */
 
1089
    __pyx_t_4 = (__pyx_v_left == __pyx_v_right);
 
1090
    if (!__pyx_t_4) {
 
1091
      __pyx_t_5 = PyObject_RichCompareBool(__pyx_v_left, __pyx_v_right, Py_EQ);
 
1092
    } else {
 
1093
      __pyx_t_5 = __pyx_t_4;
 
1094
    }
 
1095
    if (__pyx_t_5) {
 
1096
 
 
1097
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":132
 
1098
 *             or PyObject_RichCompareBool_ptr(left, right, Py_EQ)):
 
1099
 *             # Identical values, step both
 
1100
 *             Py_INCREF_ptr(left)             # <<<<<<<<<<<<<<
 
1101
 *             PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
 
1102
 *             left = _next_tuple_entry(ann_one, &pos_one)
 
1103
 */
 
1104
      Py_INCREF(__pyx_v_left);
 
1105
 
 
1106
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":133
 
1107
 *             # Identical values, step both
 
1108
 *             Py_INCREF_ptr(left)
 
1109
 *             PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)             # <<<<<<<<<<<<<<
 
1110
 *             left = _next_tuple_entry(ann_one, &pos_one)
 
1111
 *             right = _next_tuple_entry(ann_two, &pos_two)
 
1112
 */
 
1113
      PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left);
 
1114
 
 
1115
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":134
 
1116
 *             Py_INCREF_ptr(left)
 
1117
 *             PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
 
1118
 *             left = _next_tuple_entry(ann_one, &pos_one)             # <<<<<<<<<<<<<<
 
1119
 *             right = _next_tuple_entry(ann_two, &pos_two)
 
1120
 *         elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)):
 
1121
 */
 
1122
      __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
 
1123
 
 
1124
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":135
 
1125
 *             PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
 
1126
 *             left = _next_tuple_entry(ann_one, &pos_one)
 
1127
 *             right = _next_tuple_entry(ann_two, &pos_two)             # <<<<<<<<<<<<<<
 
1128
 *         elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)):
 
1129
 *             # left < right or right == NULL
 
1130
 */
 
1131
      __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
 
1132
      goto __pyx_L8;
 
1133
    }
 
1134
 
 
1135
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":136
 
1136
 *             left = _next_tuple_entry(ann_one, &pos_one)
 
1137
 *             right = _next_tuple_entry(ann_two, &pos_two)
 
1138
 *         elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)):             # <<<<<<<<<<<<<<
 
1139
 *             # left < right or right == NULL
 
1140
 *             Py_INCREF_ptr(left)
 
1141
 */
 
1142
    __pyx_t_1 = PyObject_RichCompareBool(__pyx_v_left, __pyx_v_right, Py_LT);
 
1143
    if (__pyx_t_1) {
 
1144
 
 
1145
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":138
 
1146
 *         elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)):
 
1147
 *             # left < right or right == NULL
 
1148
 *             Py_INCREF_ptr(left)             # <<<<<<<<<<<<<<
 
1149
 *             PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
 
1150
 *             left = _next_tuple_entry(ann_one, &pos_one)
 
1151
 */
 
1152
      Py_INCREF(__pyx_v_left);
 
1153
 
 
1154
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":139
 
1155
 *             # left < right or right == NULL
 
1156
 *             Py_INCREF_ptr(left)
 
1157
 *             PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)             # <<<<<<<<<<<<<<
 
1158
 *             left = _next_tuple_entry(ann_one, &pos_one)
 
1159
 *         else: # right < left or left == NULL
 
1160
 */
 
1161
      PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left);
 
1162
 
 
1163
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":140
 
1164
 *             Py_INCREF_ptr(left)
 
1165
 *             PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
 
1166
 *             left = _next_tuple_entry(ann_one, &pos_one)             # <<<<<<<<<<<<<<
 
1167
 *         else: # right < left or left == NULL
 
1168
 *             Py_INCREF_ptr(right)
 
1169
 */
 
1170
      __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
 
1171
      goto __pyx_L8;
433
1172
    }
434
1173
    /*else*/ {
435
1174
 
436
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":142 */
 
1175
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":142
 
1176
 *             left = _next_tuple_entry(ann_one, &pos_one)
 
1177
 *         else: # right < left or left == NULL
 
1178
 *             Py_INCREF_ptr(right)             # <<<<<<<<<<<<<<
 
1179
 *             PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
 
1180
 *             right = _next_tuple_entry(ann_two, &pos_two)
 
1181
 */
437
1182
      Py_INCREF(__pyx_v_right);
438
1183
 
439
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":143 */
440
 
      PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_right);
 
1184
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":143
 
1185
 *         else: # right < left or left == NULL
 
1186
 *             Py_INCREF_ptr(right)
 
1187
 *             PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)             # <<<<<<<<<<<<<<
 
1188
 *             right = _next_tuple_entry(ann_two, &pos_two)
 
1189
 *         out_pos = out_pos + 1
 
1190
 */
 
1191
      PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_right);
441
1192
 
442
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":144 */
443
 
      __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two));
 
1193
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":144
 
1194
 *             Py_INCREF_ptr(right)
 
1195
 *             PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
 
1196
 *             right = _next_tuple_entry(ann_two, &pos_two)             # <<<<<<<<<<<<<<
 
1197
 *         out_pos = out_pos + 1
 
1198
 *     while left != NULL:
 
1199
 */
 
1200
      __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
444
1201
    }
445
 
    __pyx_L7:;
 
1202
    __pyx_L8:;
446
1203
 
447
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":145 */
 
1204
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":145
 
1205
 *             PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
 
1206
 *             right = _next_tuple_entry(ann_two, &pos_two)
 
1207
 *         out_pos = out_pos + 1             # <<<<<<<<<<<<<<
 
1208
 *     while left != NULL:
 
1209
 *         Py_INCREF_ptr(left)
 
1210
 */
448
1211
    __pyx_v_out_pos = (__pyx_v_out_pos + 1);
449
1212
  }
450
1213
 
451
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":146 */
 
1214
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":146
 
1215
 *             right = _next_tuple_entry(ann_two, &pos_two)
 
1216
 *         out_pos = out_pos + 1
 
1217
 *     while left != NULL:             # <<<<<<<<<<<<<<
 
1218
 *         Py_INCREF_ptr(left)
 
1219
 *         PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
 
1220
 */
452
1221
  while (1) {
453
 
    __pyx_1 = (__pyx_v_left != NULL);
454
 
    if (!__pyx_1) break;
 
1222
    __pyx_t_5 = (__pyx_v_left != NULL);
 
1223
    if (!__pyx_t_5) break;
455
1224
 
456
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":147 */
 
1225
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":147
 
1226
 *         out_pos = out_pos + 1
 
1227
 *     while left != NULL:
 
1228
 *         Py_INCREF_ptr(left)             # <<<<<<<<<<<<<<
 
1229
 *         PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
 
1230
 *         left = _next_tuple_entry(ann_one, &pos_one)
 
1231
 */
457
1232
    Py_INCREF(__pyx_v_left);
458
1233
 
459
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":148 */
460
 
    PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left);
461
 
 
462
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":149 */
463
 
    __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one));
464
 
 
465
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":150 */
 
1234
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":148
 
1235
 *     while left != NULL:
 
1236
 *         Py_INCREF_ptr(left)
 
1237
 *         PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)             # <<<<<<<<<<<<<<
 
1238
 *         left = _next_tuple_entry(ann_one, &pos_one)
 
1239
 *         out_pos = out_pos + 1
 
1240
 */
 
1241
    PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left);
 
1242
 
 
1243
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":149
 
1244
 *         Py_INCREF_ptr(left)
 
1245
 *         PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
 
1246
 *         left = _next_tuple_entry(ann_one, &pos_one)             # <<<<<<<<<<<<<<
 
1247
 *         out_pos = out_pos + 1
 
1248
 *     while right != NULL:
 
1249
 */
 
1250
    __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one));
 
1251
 
 
1252
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":150
 
1253
 *         PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)
 
1254
 *         left = _next_tuple_entry(ann_one, &pos_one)
 
1255
 *         out_pos = out_pos + 1             # <<<<<<<<<<<<<<
 
1256
 *     while right != NULL:
 
1257
 *         Py_INCREF_ptr(right)
 
1258
 */
466
1259
    __pyx_v_out_pos = (__pyx_v_out_pos + 1);
467
1260
  }
468
1261
 
469
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":151 */
 
1262
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":151
 
1263
 *         left = _next_tuple_entry(ann_one, &pos_one)
 
1264
 *         out_pos = out_pos + 1
 
1265
 *     while right != NULL:             # <<<<<<<<<<<<<<
 
1266
 *         Py_INCREF_ptr(right)
 
1267
 *         PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
 
1268
 */
470
1269
  while (1) {
471
 
    __pyx_1 = (__pyx_v_right != NULL);
472
 
    if (!__pyx_1) break;
 
1270
    __pyx_t_5 = (__pyx_v_right != NULL);
 
1271
    if (!__pyx_t_5) break;
473
1272
 
474
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":152 */
 
1273
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":152
 
1274
 *         out_pos = out_pos + 1
 
1275
 *     while right != NULL:
 
1276
 *         Py_INCREF_ptr(right)             # <<<<<<<<<<<<<<
 
1277
 *         PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
 
1278
 *         right = _next_tuple_entry(ann_two, &pos_two)
 
1279
 */
475
1280
    Py_INCREF(__pyx_v_right);
476
1281
 
477
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":153 */
478
 
    PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_right);
479
 
 
480
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":154 */
481
 
    __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two));
482
 
 
483
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":155 */
 
1282
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":153
 
1283
 *     while right != NULL:
 
1284
 *         Py_INCREF_ptr(right)
 
1285
 *         PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)             # <<<<<<<<<<<<<<
 
1286
 *         right = _next_tuple_entry(ann_two, &pos_two)
 
1287
 *         out_pos = out_pos + 1
 
1288
 */
 
1289
    PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_right);
 
1290
 
 
1291
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":154
 
1292
 *         Py_INCREF_ptr(right)
 
1293
 *         PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
 
1294
 *         right = _next_tuple_entry(ann_two, &pos_two)             # <<<<<<<<<<<<<<
 
1295
 *         out_pos = out_pos + 1
 
1296
 *     if out_pos != PyTuple_GET_SIZE(new_ann):
 
1297
 */
 
1298
    __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two));
 
1299
 
 
1300
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":155
 
1301
 *         PyTuple_SET_ITEM_ptr(new_ann, out_pos, right)
 
1302
 *         right = _next_tuple_entry(ann_two, &pos_two)
 
1303
 *         out_pos = out_pos + 1             # <<<<<<<<<<<<<<
 
1304
 *     if out_pos != PyTuple_GET_SIZE(new_ann):
 
1305
 *         # Timing _PyTuple_Resize was not significantly faster that slicing
 
1306
 */
484
1307
    __pyx_v_out_pos = (__pyx_v_out_pos + 1);
485
1308
  }
486
1309
 
487
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":156 */
488
 
  __pyx_1 = (__pyx_v_out_pos != PyTuple_GET_SIZE(__pyx_v_new_ann));
489
 
  if (__pyx_1) {
490
 
    __pyx_3 = PySequence_GetSlice(__pyx_v_new_ann, 0, __pyx_v_out_pos); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L1;}
491
 
    Py_DECREF(__pyx_v_new_ann);
492
 
    __pyx_v_new_ann = __pyx_3;
493
 
    __pyx_3 = 0;
494
 
    goto __pyx_L12;
 
1310
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":156
 
1311
 *         right = _next_tuple_entry(ann_two, &pos_two)
 
1312
 *         out_pos = out_pos + 1
 
1313
 *     if out_pos != PyTuple_GET_SIZE(new_ann):             # <<<<<<<<<<<<<<
 
1314
 *         # Timing _PyTuple_Resize was not significantly faster that slicing
 
1315
 *         # PyTuple_Resize((<PyObject **>new_ann), out_pos)
 
1316
 */
 
1317
  __pyx_t_5 = (__pyx_v_out_pos != PyTuple_GET_SIZE(__pyx_v_new_ann));
 
1318
  if (__pyx_t_5) {
 
1319
 
 
1320
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":159
 
1321
 *         # Timing _PyTuple_Resize was not significantly faster that slicing
 
1322
 *         # PyTuple_Resize((<PyObject **>new_ann), out_pos)
 
1323
 *         new_ann = new_ann[0:out_pos]             # <<<<<<<<<<<<<<
 
1324
 *     PyDict_SetItem(cache, cache_key, new_ann)
 
1325
 *     return new_ann
 
1326
 */
 
1327
    __pyx_t_6 = PySequence_GetSlice(__pyx_v_new_ann, 0, __pyx_v_out_pos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1328
    __Pyx_GOTREF(__pyx_t_6);
 
1329
    __Pyx_DECREF(__pyx_v_new_ann);
 
1330
    __pyx_v_new_ann = __pyx_t_6;
 
1331
    __pyx_t_6 = 0;
 
1332
    goto __pyx_L13;
495
1333
  }
496
 
  __pyx_L12:;
497
 
 
498
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":160 */
499
 
  __pyx_1 = PyDict_SetItem(__pyx_v_cache,__pyx_v_cache_key,__pyx_v_new_ann); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}
500
 
 
501
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":161 */
502
 
  Py_INCREF(__pyx_v_new_ann);
 
1334
  __pyx_L13:;
 
1335
 
 
1336
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":160
 
1337
 *         # PyTuple_Resize((<PyObject **>new_ann), out_pos)
 
1338
 *         new_ann = new_ann[0:out_pos]
 
1339
 *     PyDict_SetItem(cache, cache_key, new_ann)             # <<<<<<<<<<<<<<
 
1340
 *     return new_ann
 
1341
 * 
 
1342
 */
 
1343
  __pyx_t_1 = PyDict_SetItem(__pyx_v_cache, ((PyObject *)__pyx_v_cache_key), __pyx_v_new_ann); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1344
 
 
1345
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":161
 
1346
 *         new_ann = new_ann[0:out_pos]
 
1347
 *     PyDict_SetItem(cache, cache_key, new_ann)
 
1348
 *     return new_ann             # <<<<<<<<<<<<<<
 
1349
 * 
 
1350
 * 
 
1351
 */
 
1352
  __Pyx_XDECREF(__pyx_r);
 
1353
  __Pyx_INCREF(__pyx_v_new_ann);
503
1354
  __pyx_r = __pyx_v_new_ann;
504
1355
  goto __pyx_L0;
505
1356
 
506
 
  __pyx_r = Py_None; Py_INCREF(Py_None);
 
1357
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
507
1358
  goto __pyx_L0;
508
 
  __pyx_L1:;
509
 
  Py_XDECREF(__pyx_2);
510
 
  Py_XDECREF(__pyx_3);
 
1359
  __pyx_L1_error:;
 
1360
  __Pyx_XDECREF(__pyx_t_2);
 
1361
  __Pyx_XDECREF(__pyx_t_6);
511
1362
  __Pyx_AddTraceback("bzrlib._annotator_pyx._combine_annotations");
512
1363
  __pyx_r = 0;
513
1364
  __pyx_L0:;
514
 
  Py_DECREF(__pyx_v_cache_key);
515
 
  Py_DECREF(__pyx_v_new_ann);
516
 
  Py_DECREF(__pyx_v_ann_one);
517
 
  Py_DECREF(__pyx_v_ann_two);
518
 
  Py_DECREF(__pyx_v_cache);
 
1365
  __Pyx_DECREF(__pyx_v_cache_key);
 
1366
  __Pyx_DECREF(__pyx_v_new_ann);
 
1367
  __Pyx_XGIVEREF(__pyx_r);
 
1368
  __Pyx_RefNannyFinishContext();
519
1369
  return __pyx_r;
520
1370
}
521
1371
 
522
 
static int __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(PyObject *__pyx_v_annotations,PyObject *__pyx_v_parent_annotations,PyObject *__pyx_v_matching_blocks) {
 
1372
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":164
 
1373
 * 
 
1374
 * 
 
1375
 * cdef int _apply_parent_annotations(annotations, parent_annotations,             # <<<<<<<<<<<<<<
 
1376
 *                                    matching_blocks) except -1:
 
1377
 *     """Apply the annotations from parent_annotations into annotations.
 
1378
 */
 
1379
 
 
1380
static  int __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(PyObject *__pyx_v_annotations, PyObject *__pyx_v_parent_annotations, PyObject *__pyx_v_matching_blocks) {
523
1381
  Py_ssize_t __pyx_v_parent_idx;
524
1382
  Py_ssize_t __pyx_v_lines_idx;
525
1383
  Py_ssize_t __pyx_v_match_len;
529
1387
  PyObject **__pyx_v_par_temp;
530
1388
  PyObject **__pyx_v_ann_temp;
531
1389
  int __pyx_r;
532
 
  int __pyx_1;
533
 
  PyObject *__pyx_2 = 0;
534
 
  PyObject *__pyx_3 = 0;
535
 
  PyObject *__pyx_4 = 0;
536
 
  Py_ssize_t __pyx_5;
537
 
  Py_INCREF(__pyx_v_annotations);
538
 
  Py_INCREF(__pyx_v_parent_annotations);
539
 
  Py_INCREF(__pyx_v_matching_blocks);
540
 
 
541
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":174 */
542
 
  __pyx_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(__pyx_v_annotations,__pyx_v_parent_annotations); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
543
 
 
544
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":175 */
 
1390
  int __pyx_t_1;
 
1391
  Py_ssize_t __pyx_t_2;
 
1392
  PyObject *__pyx_t_3 = NULL;
 
1393
  PyObject *__pyx_t_4 = NULL;
 
1394
  PyObject *__pyx_t_5 = NULL;
 
1395
  PyObject *__pyx_t_6 = NULL;
 
1396
  PyObject *__pyx_t_7 = NULL;
 
1397
  Py_ssize_t __pyx_t_8;
 
1398
  Py_ssize_t __pyx_t_9;
 
1399
  Py_ssize_t __pyx_t_10;
 
1400
  PyObject *__pyx_t_11 = NULL;
 
1401
  __Pyx_RefNannySetupContext("_apply_parent_annotations");
 
1402
 
 
1403
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":174
 
1404
 *     cdef PyObject **par_temp, **ann_temp
 
1405
 * 
 
1406
 *     _check_annotations_are_lists(annotations, parent_annotations)             # <<<<<<<<<<<<<<
 
1407
 *     par_list = <PyListObject *>parent_annotations
 
1408
 *     ann_list = <PyListObject *>annotations
 
1409
 */
 
1410
  __pyx_t_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(__pyx_v_annotations, __pyx_v_parent_annotations); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1411
 
 
1412
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":175
 
1413
 * 
 
1414
 *     _check_annotations_are_lists(annotations, parent_annotations)
 
1415
 *     par_list = <PyListObject *>parent_annotations             # <<<<<<<<<<<<<<
 
1416
 *     ann_list = <PyListObject *>annotations
 
1417
 *     # For NEWS and bzrlib/builtins.py, over 99% of the lines are simply copied
 
1418
 */
545
1419
  __pyx_v_par_list = ((PyListObject *)__pyx_v_parent_annotations);
546
1420
 
547
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":176 */
 
1421
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":176
 
1422
 *     _check_annotations_are_lists(annotations, parent_annotations)
 
1423
 *     par_list = <PyListObject *>parent_annotations
 
1424
 *     ann_list = <PyListObject *>annotations             # <<<<<<<<<<<<<<
 
1425
 *     # For NEWS and bzrlib/builtins.py, over 99% of the lines are simply copied
 
1426
 *     # across from the parent entry. So this routine is heavily optimized for
 
1427
 */
548
1428
  __pyx_v_ann_list = ((PyListObject *)__pyx_v_annotations);
549
1429
 
550
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":181 */
551
 
  __pyx_2 = PyObject_GetIter(__pyx_v_matching_blocks); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
 
1430
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":181
 
1431
 *     # that. Would be interesting if we could use memcpy() but we have to incref
 
1432
 *     # and decref
 
1433
 *     for parent_idx, lines_idx, match_len in matching_blocks:             # <<<<<<<<<<<<<<
 
1434
 *         _check_match_ranges(parent_annotations, annotations,
 
1435
 *                             parent_idx, lines_idx, match_len)
 
1436
 */
 
1437
  if (PyList_CheckExact(__pyx_v_matching_blocks) || PyTuple_CheckExact(__pyx_v_matching_blocks)) {
 
1438
    __pyx_t_2 = 0; __pyx_t_3 = __pyx_v_matching_blocks; __Pyx_INCREF(__pyx_t_3);
 
1439
  } else {
 
1440
    __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_matching_blocks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1441
    __Pyx_GOTREF(__pyx_t_3);
 
1442
  }
552
1443
  for (;;) {
553
 
    __pyx_3 = PyIter_Next(__pyx_2);
554
 
    if (!__pyx_3) {
555
 
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
556
 
      break;
557
 
    }
558
 
    __pyx_4 = PyObject_GetIter(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
559
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
560
 
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
561
 
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
562
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
563
 
    __pyx_v_parent_idx = __pyx_5;
564
 
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
565
 
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
566
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
567
 
    __pyx_v_lines_idx = __pyx_5;
568
 
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
569
 
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
570
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
571
 
    __pyx_v_match_len = __pyx_5;
572
 
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
573
 
    Py_DECREF(__pyx_4); __pyx_4 = 0;
574
 
 
575
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":182 */
576
 
    __pyx_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(__pyx_v_parent_annotations,__pyx_v_annotations,__pyx_v_parent_idx,__pyx_v_lines_idx,__pyx_v_match_len); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
577
 
 
578
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":184 */
 
1444
    if (likely(PyList_CheckExact(__pyx_t_3))) {
 
1445
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
 
1446
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
 
1447
    } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
 
1448
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
 
1449
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
 
1450
    } else {
 
1451
      __pyx_t_4 = PyIter_Next(__pyx_t_3);
 
1452
      if (!__pyx_t_4) {
 
1453
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1454
        break;
 
1455
      }
 
1456
      __Pyx_GOTREF(__pyx_t_4);
 
1457
    }
 
1458
    if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 3)) {
 
1459
      PyObject* tuple = __pyx_t_4;
 
1460
      __pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5);
 
1461
      __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1462
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
1463
      __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
 
1464
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1465
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
1466
      __pyx_t_7 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_7);
 
1467
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1468
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
1469
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
1470
      __pyx_v_parent_idx = __pyx_t_8;
 
1471
      __pyx_v_lines_idx = __pyx_t_9;
 
1472
      __pyx_v_match_len = __pyx_t_10;
 
1473
    } else {
 
1474
      __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1475
      __Pyx_GOTREF(__pyx_t_11);
 
1476
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
1477
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_11, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1478
      __Pyx_GOTREF(__pyx_t_5);
 
1479
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1480
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
1481
      __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_11, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1482
      __Pyx_GOTREF(__pyx_t_6);
 
1483
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1484
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
1485
      __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_11, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1486
      __Pyx_GOTREF(__pyx_t_7);
 
1487
      __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1488
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
1489
      if (__Pyx_EndUnpack(__pyx_t_11, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1490
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
1491
      __pyx_v_parent_idx = __pyx_t_10;
 
1492
      __pyx_v_lines_idx = __pyx_t_9;
 
1493
      __pyx_v_match_len = __pyx_t_8;
 
1494
    }
 
1495
 
 
1496
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":183
 
1497
 *     for parent_idx, lines_idx, match_len in matching_blocks:
 
1498
 *         _check_match_ranges(parent_annotations, annotations,
 
1499
 *                             parent_idx, lines_idx, match_len)             # <<<<<<<<<<<<<<
 
1500
 *         par_temp = par_list.ob_item + parent_idx
 
1501
 *         ann_temp = ann_list.ob_item + lines_idx
 
1502
 */
 
1503
    __pyx_t_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(__pyx_v_parent_annotations, __pyx_v_annotations, __pyx_v_parent_idx, __pyx_v_lines_idx, __pyx_v_match_len); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1504
 
 
1505
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":184
 
1506
 *         _check_match_ranges(parent_annotations, annotations,
 
1507
 *                             parent_idx, lines_idx, match_len)
 
1508
 *         par_temp = par_list.ob_item + parent_idx             # <<<<<<<<<<<<<<
 
1509
 *         ann_temp = ann_list.ob_item + lines_idx
 
1510
 *         for idx from 0 <= idx < match_len:
 
1511
 */
579
1512
    __pyx_v_par_temp = (__pyx_v_par_list->ob_item + __pyx_v_parent_idx);
580
1513
 
581
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":185 */
 
1514
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":185
 
1515
 *                             parent_idx, lines_idx, match_len)
 
1516
 *         par_temp = par_list.ob_item + parent_idx
 
1517
 *         ann_temp = ann_list.ob_item + lines_idx             # <<<<<<<<<<<<<<
 
1518
 *         for idx from 0 <= idx < match_len:
 
1519
 *             Py_INCREF_ptr(par_temp[idx])
 
1520
 */
582
1521
    __pyx_v_ann_temp = (__pyx_v_ann_list->ob_item + __pyx_v_lines_idx);
583
1522
 
584
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":186 */
585
 
    for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_v_match_len; ++__pyx_v_idx) {
 
1523
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":186
 
1524
 *         par_temp = par_list.ob_item + parent_idx
 
1525
 *         ann_temp = ann_list.ob_item + lines_idx
 
1526
 *         for idx from 0 <= idx < match_len:             # <<<<<<<<<<<<<<
 
1527
 *             Py_INCREF_ptr(par_temp[idx])
 
1528
 *             Py_DECREF_ptr(ann_temp[idx])
 
1529
 */
 
1530
    __pyx_t_8 = __pyx_v_match_len;
 
1531
    for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_8; __pyx_v_idx++) {
586
1532
 
587
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":187 */
 
1533
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":187
 
1534
 *         ann_temp = ann_list.ob_item + lines_idx
 
1535
 *         for idx from 0 <= idx < match_len:
 
1536
 *             Py_INCREF_ptr(par_temp[idx])             # <<<<<<<<<<<<<<
 
1537
 *             Py_DECREF_ptr(ann_temp[idx])
 
1538
 *             ann_temp[idx] = par_temp[idx]
 
1539
 */
588
1540
      Py_INCREF((__pyx_v_par_temp[__pyx_v_idx]));
589
1541
 
590
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":188 */
 
1542
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":188
 
1543
 *         for idx from 0 <= idx < match_len:
 
1544
 *             Py_INCREF_ptr(par_temp[idx])
 
1545
 *             Py_DECREF_ptr(ann_temp[idx])             # <<<<<<<<<<<<<<
 
1546
 *             ann_temp[idx] = par_temp[idx]
 
1547
 *     return 0
 
1548
 */
591
1549
      Py_DECREF((__pyx_v_ann_temp[__pyx_v_idx]));
592
1550
 
593
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":189 */
 
1551
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":189
 
1552
 *             Py_INCREF_ptr(par_temp[idx])
 
1553
 *             Py_DECREF_ptr(ann_temp[idx])
 
1554
 *             ann_temp[idx] = par_temp[idx]             # <<<<<<<<<<<<<<
 
1555
 *     return 0
 
1556
 * 
 
1557
 */
594
1558
      (__pyx_v_ann_temp[__pyx_v_idx]) = (__pyx_v_par_temp[__pyx_v_idx]);
595
1559
    }
596
1560
  }
597
 
  Py_DECREF(__pyx_2); __pyx_2 = 0;
598
 
 
599
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":190 */
600
 
  __pyx_r = 0;
601
 
  goto __pyx_L0;
602
 
 
603
 
  __pyx_r = 0;
604
 
  goto __pyx_L0;
605
 
  __pyx_L1:;
606
 
  Py_XDECREF(__pyx_2);
607
 
  Py_XDECREF(__pyx_3);
608
 
  Py_XDECREF(__pyx_4);
 
1561
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
1562
 
 
1563
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":190
 
1564
 *             Py_DECREF_ptr(ann_temp[idx])
 
1565
 *             ann_temp[idx] = par_temp[idx]
 
1566
 *     return 0             # <<<<<<<<<<<<<<
 
1567
 * 
 
1568
 * 
 
1569
 */
 
1570
  __pyx_r = 0;
 
1571
  goto __pyx_L0;
 
1572
 
 
1573
  __pyx_r = 0;
 
1574
  goto __pyx_L0;
 
1575
  __pyx_L1_error:;
 
1576
  __Pyx_XDECREF(__pyx_t_3);
 
1577
  __Pyx_XDECREF(__pyx_t_4);
 
1578
  __Pyx_XDECREF(__pyx_t_5);
 
1579
  __Pyx_XDECREF(__pyx_t_6);
 
1580
  __Pyx_XDECREF(__pyx_t_7);
 
1581
  __Pyx_XDECREF(__pyx_t_11);
609
1582
  __Pyx_AddTraceback("bzrlib._annotator_pyx._apply_parent_annotations");
610
 
  __pyx_r = (-1);
 
1583
  __pyx_r = -1;
611
1584
  __pyx_L0:;
612
 
  Py_DECREF(__pyx_v_annotations);
613
 
  Py_DECREF(__pyx_v_parent_annotations);
614
 
  Py_DECREF(__pyx_v_matching_blocks);
 
1585
  __Pyx_RefNannyFinishContext();
615
1586
  return __pyx_r;
616
1587
}
617
1588
 
618
 
static int __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(PyObject *__pyx_v_this_annotation,PyObject *__pyx_v_annotations,PyObject *__pyx_v_parent_annotations,PyObject *__pyx_v_matching_blocks,PyObject *__pyx_v_ann_cache) {
 
1589
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":193
 
1590
 * 
 
1591
 * 
 
1592
 * cdef int _merge_annotations(this_annotation, annotations, parent_annotations,             # <<<<<<<<<<<<<<
 
1593
 *                             matching_blocks, ann_cache) except -1:
 
1594
 *     cdef Py_ssize_t parent_idx, ann_idx, lines_idx, match_len, idx
 
1595
 */
 
1596
 
 
1597
static  int __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(PyObject *__pyx_v_this_annotation, PyObject *__pyx_v_annotations, PyObject *__pyx_v_parent_annotations, PyObject *__pyx_v_matching_blocks, PyObject *__pyx_v_ann_cache) {
619
1598
  Py_ssize_t __pyx_v_parent_idx;
620
1599
  Py_ssize_t __pyx_v_ann_idx;
621
1600
  Py_ssize_t __pyx_v_lines_idx;
630
1609
  PyObject *__pyx_v_ann;
631
1610
  PyObject *__pyx_v_new_ann;
632
1611
  int __pyx_r;
633
 
  int __pyx_1;
634
 
  PyObject *__pyx_2 = 0;
635
 
  PyObject *__pyx_3 = 0;
636
 
  PyObject *__pyx_4 = 0;
637
 
  Py_ssize_t __pyx_5;
638
 
  Py_INCREF(__pyx_v_this_annotation);
639
 
  Py_INCREF(__pyx_v_annotations);
640
 
  Py_INCREF(__pyx_v_parent_annotations);
641
 
  Py_INCREF(__pyx_v_matching_blocks);
642
 
  Py_INCREF(__pyx_v_ann_cache);
643
 
  __pyx_v_last_ann = Py_None; Py_INCREF(Py_None);
644
 
  __pyx_v_last_parent = Py_None; Py_INCREF(Py_None);
645
 
  __pyx_v_last_res = Py_None; Py_INCREF(Py_None);
646
 
  __pyx_v_par_ann = Py_None; Py_INCREF(Py_None);
647
 
  __pyx_v_ann = Py_None; Py_INCREF(Py_None);
648
 
  __pyx_v_new_ann = Py_None; Py_INCREF(Py_None);
649
 
 
650
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":199 */
651
 
  __pyx_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(__pyx_v_annotations,__pyx_v_parent_annotations); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
652
 
 
653
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":200 */
654
 
  Py_INCREF(Py_None);
655
 
  Py_DECREF(__pyx_v_last_ann);
 
1612
  int __pyx_t_1;
 
1613
  Py_ssize_t __pyx_t_2;
 
1614
  PyObject *__pyx_t_3 = NULL;
 
1615
  PyObject *__pyx_t_4 = NULL;
 
1616
  PyObject *__pyx_t_5 = NULL;
 
1617
  PyObject *__pyx_t_6 = NULL;
 
1618
  PyObject *__pyx_t_7 = NULL;
 
1619
  Py_ssize_t __pyx_t_8;
 
1620
  Py_ssize_t __pyx_t_9;
 
1621
  Py_ssize_t __pyx_t_10;
 
1622
  PyObject *__pyx_t_11 = NULL;
 
1623
  int __pyx_t_12;
 
1624
  int __pyx_t_13;
 
1625
  int __pyx_t_14;
 
1626
  __Pyx_RefNannySetupContext("_merge_annotations");
 
1627
  __pyx_v_last_ann = Py_None; __Pyx_INCREF(Py_None);
 
1628
  __pyx_v_last_parent = Py_None; __Pyx_INCREF(Py_None);
 
1629
  __pyx_v_last_res = Py_None; __Pyx_INCREF(Py_None);
 
1630
  __pyx_v_par_ann = Py_None; __Pyx_INCREF(Py_None);
 
1631
  __pyx_v_ann = Py_None; __Pyx_INCREF(Py_None);
 
1632
  __pyx_v_new_ann = Py_None; __Pyx_INCREF(Py_None);
 
1633
 
 
1634
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":199
 
1635
 *     cdef PyObject *ann_temp, *par_temp
 
1636
 * 
 
1637
 *     _check_annotations_are_lists(annotations, parent_annotations)             # <<<<<<<<<<<<<<
 
1638
 *     last_ann = None
 
1639
 *     last_parent = None
 
1640
 */
 
1641
  __pyx_t_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(__pyx_v_annotations, __pyx_v_parent_annotations); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1642
 
 
1643
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":200
 
1644
 * 
 
1645
 *     _check_annotations_are_lists(annotations, parent_annotations)
 
1646
 *     last_ann = None             # <<<<<<<<<<<<<<
 
1647
 *     last_parent = None
 
1648
 *     last_res = None
 
1649
 */
 
1650
  __Pyx_INCREF(Py_None);
 
1651
  __Pyx_DECREF(__pyx_v_last_ann);
656
1652
  __pyx_v_last_ann = Py_None;
657
1653
 
658
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":201 */
659
 
  Py_INCREF(Py_None);
660
 
  Py_DECREF(__pyx_v_last_parent);
 
1654
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":201
 
1655
 *     _check_annotations_are_lists(annotations, parent_annotations)
 
1656
 *     last_ann = None
 
1657
 *     last_parent = None             # <<<<<<<<<<<<<<
 
1658
 *     last_res = None
 
1659
 *     for parent_idx, lines_idx, match_len in matching_blocks:
 
1660
 */
 
1661
  __Pyx_INCREF(Py_None);
 
1662
  __Pyx_DECREF(__pyx_v_last_parent);
661
1663
  __pyx_v_last_parent = Py_None;
662
1664
 
663
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":202 */
664
 
  Py_INCREF(Py_None);
665
 
  Py_DECREF(__pyx_v_last_res);
 
1665
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":202
 
1666
 *     last_ann = None
 
1667
 *     last_parent = None
 
1668
 *     last_res = None             # <<<<<<<<<<<<<<
 
1669
 *     for parent_idx, lines_idx, match_len in matching_blocks:
 
1670
 *         _check_match_ranges(parent_annotations, annotations,
 
1671
 */
 
1672
  __Pyx_INCREF(Py_None);
 
1673
  __Pyx_DECREF(__pyx_v_last_res);
666
1674
  __pyx_v_last_res = Py_None;
667
1675
 
668
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":203 */
669
 
  __pyx_2 = PyObject_GetIter(__pyx_v_matching_blocks); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
 
1676
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":203
 
1677
 *     last_parent = None
 
1678
 *     last_res = None
 
1679
 *     for parent_idx, lines_idx, match_len in matching_blocks:             # <<<<<<<<<<<<<<
 
1680
 *         _check_match_ranges(parent_annotations, annotations,
 
1681
 *                             parent_idx, lines_idx, match_len)
 
1682
 */
 
1683
  if (PyList_CheckExact(__pyx_v_matching_blocks) || PyTuple_CheckExact(__pyx_v_matching_blocks)) {
 
1684
    __pyx_t_2 = 0; __pyx_t_3 = __pyx_v_matching_blocks; __Pyx_INCREF(__pyx_t_3);
 
1685
  } else {
 
1686
    __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_matching_blocks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1687
    __Pyx_GOTREF(__pyx_t_3);
 
1688
  }
670
1689
  for (;;) {
671
 
    __pyx_3 = PyIter_Next(__pyx_2);
672
 
    if (!__pyx_3) {
673
 
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
674
 
      break;
675
 
    }
676
 
    __pyx_4 = PyObject_GetIter(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
677
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
678
 
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
679
 
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
680
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
681
 
    __pyx_v_parent_idx = __pyx_5;
682
 
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
683
 
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
684
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
685
 
    __pyx_v_lines_idx = __pyx_5;
686
 
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
687
 
    __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
688
 
    Py_DECREF(__pyx_3); __pyx_3 = 0;
689
 
    __pyx_v_match_len = __pyx_5;
690
 
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;}
691
 
    Py_DECREF(__pyx_4); __pyx_4 = 0;
692
 
 
693
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":204 */
694
 
    __pyx_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(__pyx_v_parent_annotations,__pyx_v_annotations,__pyx_v_parent_idx,__pyx_v_lines_idx,__pyx_v_match_len); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;}
695
 
 
696
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":208 */
697
 
    for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_v_match_len; ++__pyx_v_idx) {
698
 
 
699
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":209 */
 
1690
    if (likely(PyList_CheckExact(__pyx_t_3))) {
 
1691
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
 
1692
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
 
1693
    } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
 
1694
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
 
1695
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
 
1696
    } else {
 
1697
      __pyx_t_4 = PyIter_Next(__pyx_t_3);
 
1698
      if (!__pyx_t_4) {
 
1699
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1700
        break;
 
1701
      }
 
1702
      __Pyx_GOTREF(__pyx_t_4);
 
1703
    }
 
1704
    if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 3)) {
 
1705
      PyObject* tuple = __pyx_t_4;
 
1706
      __pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5);
 
1707
      __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1708
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
1709
      __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
 
1710
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1711
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
1712
      __pyx_t_7 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_7);
 
1713
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1714
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
1715
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
1716
      __pyx_v_parent_idx = __pyx_t_8;
 
1717
      __pyx_v_lines_idx = __pyx_t_9;
 
1718
      __pyx_v_match_len = __pyx_t_10;
 
1719
    } else {
 
1720
      __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1721
      __Pyx_GOTREF(__pyx_t_11);
 
1722
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
1723
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_11, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1724
      __Pyx_GOTREF(__pyx_t_5);
 
1725
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1726
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
1727
      __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_11, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1728
      __Pyx_GOTREF(__pyx_t_6);
 
1729
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1730
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
1731
      __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_11, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1732
      __Pyx_GOTREF(__pyx_t_7);
 
1733
      __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1734
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
1735
      if (__Pyx_EndUnpack(__pyx_t_11, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1736
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
1737
      __pyx_v_parent_idx = __pyx_t_10;
 
1738
      __pyx_v_lines_idx = __pyx_t_9;
 
1739
      __pyx_v_match_len = __pyx_t_8;
 
1740
    }
 
1741
 
 
1742
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":205
 
1743
 *     for parent_idx, lines_idx, match_len in matching_blocks:
 
1744
 *         _check_match_ranges(parent_annotations, annotations,
 
1745
 *                             parent_idx, lines_idx, match_len)             # <<<<<<<<<<<<<<
 
1746
 *         # For lines which match this parent, we will now resolve whether
 
1747
 *         # this parent wins over the current annotation
 
1748
 */
 
1749
    __pyx_t_1 = __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(__pyx_v_parent_annotations, __pyx_v_annotations, __pyx_v_parent_idx, __pyx_v_lines_idx, __pyx_v_match_len); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1750
 
 
1751
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":208
 
1752
 *         # For lines which match this parent, we will now resolve whether
 
1753
 *         # this parent wins over the current annotation
 
1754
 *         for idx from 0 <= idx < match_len:             # <<<<<<<<<<<<<<
 
1755
 *             ann_idx = lines_idx + idx
 
1756
 *             ann_temp = PyList_GET_ITEM(annotations, ann_idx)
 
1757
 */
 
1758
    __pyx_t_8 = __pyx_v_match_len;
 
1759
    for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_8; __pyx_v_idx++) {
 
1760
 
 
1761
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":209
 
1762
 *         # this parent wins over the current annotation
 
1763
 *         for idx from 0 <= idx < match_len:
 
1764
 *             ann_idx = lines_idx + idx             # <<<<<<<<<<<<<<
 
1765
 *             ann_temp = PyList_GET_ITEM(annotations, ann_idx)
 
1766
 *             par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx)
 
1767
 */
700
1768
      __pyx_v_ann_idx = (__pyx_v_lines_idx + __pyx_v_idx);
701
1769
 
702
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":210 */
703
 
      __pyx_v_ann_temp = PyList_GET_ITEM(__pyx_v_annotations,__pyx_v_ann_idx);
704
 
 
705
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":211 */
706
 
      __pyx_v_par_temp = PyList_GET_ITEM(__pyx_v_parent_annotations,(__pyx_v_parent_idx + __pyx_v_idx));
707
 
 
708
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":212 */
709
 
      __pyx_1 = (__pyx_v_ann_temp == __pyx_v_par_temp);
710
 
      if (__pyx_1) {
711
 
        goto __pyx_L4;
712
 
        goto __pyx_L6;
 
1770
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":210
 
1771
 *         for idx from 0 <= idx < match_len:
 
1772
 *             ann_idx = lines_idx + idx
 
1773
 *             ann_temp = PyList_GET_ITEM(annotations, ann_idx)             # <<<<<<<<<<<<<<
 
1774
 *             par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx)
 
1775
 *             if (ann_temp == par_temp):
 
1776
 */
 
1777
      __pyx_v_ann_temp = PyList_GET_ITEM(__pyx_v_annotations, __pyx_v_ann_idx);
 
1778
 
 
1779
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":211
 
1780
 *             ann_idx = lines_idx + idx
 
1781
 *             ann_temp = PyList_GET_ITEM(annotations, ann_idx)
 
1782
 *             par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx)             # <<<<<<<<<<<<<<
 
1783
 *             if (ann_temp == par_temp):
 
1784
 *                 # This is parent, do nothing
 
1785
 */
 
1786
      __pyx_v_par_temp = PyList_GET_ITEM(__pyx_v_parent_annotations, (__pyx_v_parent_idx + __pyx_v_idx));
 
1787
 
 
1788
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":212
 
1789
 *             ann_temp = PyList_GET_ITEM(annotations, ann_idx)
 
1790
 *             par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx)
 
1791
 *             if (ann_temp == par_temp):             # <<<<<<<<<<<<<<
 
1792
 *                 # This is parent, do nothing
 
1793
 *                 # Pointer comparison is fine here. Value comparison would
 
1794
 */
 
1795
      __pyx_t_12 = (__pyx_v_ann_temp == __pyx_v_par_temp);
 
1796
      if (__pyx_t_12) {
 
1797
 
 
1798
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":220
 
1799
 *                 # PyObject_RichCompareBool using pointer comparison drops
 
1800
 *                 # timing from 215ms => 125ms
 
1801
 *                 continue             # <<<<<<<<<<<<<<
 
1802
 *             par_ann = <object>par_temp
 
1803
 *             ann = <object>ann_temp
 
1804
 */
 
1805
        goto __pyx_L5_continue;
 
1806
        goto __pyx_L7;
713
1807
      }
714
 
      __pyx_L6:;
 
1808
      __pyx_L7:;
715
1809
 
716
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":221 */
717
 
      Py_INCREF(((PyObject *)__pyx_v_par_temp));
718
 
      Py_DECREF(__pyx_v_par_ann);
 
1810
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":221
 
1811
 *                 # timing from 215ms => 125ms
 
1812
 *                 continue
 
1813
 *             par_ann = <object>par_temp             # <<<<<<<<<<<<<<
 
1814
 *             ann = <object>ann_temp
 
1815
 *             if (ann is this_annotation):
 
1816
 */
 
1817
      __Pyx_INCREF(((PyObject *)__pyx_v_par_temp));
 
1818
      __Pyx_DECREF(__pyx_v_par_ann);
719
1819
      __pyx_v_par_ann = ((PyObject *)__pyx_v_par_temp);
720
1820
 
721
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":222 */
722
 
      Py_INCREF(((PyObject *)__pyx_v_ann_temp));
723
 
      Py_DECREF(__pyx_v_ann);
 
1821
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":222
 
1822
 *                 continue
 
1823
 *             par_ann = <object>par_temp
 
1824
 *             ann = <object>ann_temp             # <<<<<<<<<<<<<<
 
1825
 *             if (ann is this_annotation):
 
1826
 *                 # Originally claimed 'this', but it was really in this
 
1827
 */
 
1828
      __Pyx_INCREF(((PyObject *)__pyx_v_ann_temp));
 
1829
      __Pyx_DECREF(__pyx_v_ann);
724
1830
      __pyx_v_ann = ((PyObject *)__pyx_v_ann_temp);
725
1831
 
726
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":223 */
727
 
      __pyx_1 = __pyx_v_ann == __pyx_v_this_annotation;
728
 
      if (__pyx_1) {
 
1832
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":223
 
1833
 *             par_ann = <object>par_temp
 
1834
 *             ann = <object>ann_temp
 
1835
 *             if (ann is this_annotation):             # <<<<<<<<<<<<<<
 
1836
 *                 # Originally claimed 'this', but it was really in this
 
1837
 *                 # parent
 
1838
 */
 
1839
      __pyx_t_12 = (__pyx_v_ann == __pyx_v_this_annotation);
 
1840
      if (__pyx_t_12) {
729
1841
 
730
 
        /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":226 */
 
1842
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":226
 
1843
 *                 # Originally claimed 'this', but it was really in this
 
1844
 *                 # parent
 
1845
 *                 Py_INCREF(par_ann)             # <<<<<<<<<<<<<<
 
1846
 *                 PyList_SetItem(annotations, ann_idx, par_ann)
 
1847
 *                 continue
 
1848
 */
731
1849
        Py_INCREF(__pyx_v_par_ann);
732
1850
 
733
 
        /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":227 */
734
 
        __pyx_1 = PyList_SetItem(__pyx_v_annotations,__pyx_v_ann_idx,__pyx_v_par_ann); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}
735
 
 
736
 
        /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":228 */
737
 
        goto __pyx_L4;
738
 
        goto __pyx_L7;
739
 
      }
740
 
      __pyx_L7:;
741
 
 
742
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":231 */
743
 
      __pyx_1 = __pyx_v_ann == __pyx_v_last_ann;
744
 
      if (__pyx_1) {
745
 
        __pyx_1 = __pyx_v_par_ann == __pyx_v_last_parent;
746
 
      }
747
 
      if (__pyx_1) {
748
 
 
749
 
        /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":232 */
 
1851
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":227
 
1852
 *                 # parent
 
1853
 *                 Py_INCREF(par_ann)
 
1854
 *                 PyList_SetItem(annotations, ann_idx, par_ann)             # <<<<<<<<<<<<<<
 
1855
 *                 continue
 
1856
 *             # Resolve the fact that both sides have a different value for
 
1857
 */
 
1858
        __pyx_t_1 = PyList_SetItem(__pyx_v_annotations, __pyx_v_ann_idx, __pyx_v_par_ann); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1859
 
 
1860
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":228
 
1861
 *                 Py_INCREF(par_ann)
 
1862
 *                 PyList_SetItem(annotations, ann_idx, par_ann)
 
1863
 *                 continue             # <<<<<<<<<<<<<<
 
1864
 *             # Resolve the fact that both sides have a different value for
 
1865
 *             # last modified
 
1866
 */
 
1867
        goto __pyx_L5_continue;
 
1868
        goto __pyx_L8;
 
1869
      }
 
1870
      __pyx_L8:;
 
1871
 
 
1872
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":231
 
1873
 *             # Resolve the fact that both sides have a different value for
 
1874
 *             # last modified
 
1875
 *             if (ann is last_ann and par_ann is last_parent):             # <<<<<<<<<<<<<<
 
1876
 *                 Py_INCREF(last_res)
 
1877
 *                 PyList_SetItem(annotations, ann_idx, last_res)
 
1878
 */
 
1879
      __pyx_t_12 = (__pyx_v_ann == __pyx_v_last_ann);
 
1880
      if (__pyx_t_12) {
 
1881
        __pyx_t_13 = (__pyx_v_par_ann == __pyx_v_last_parent);
 
1882
        __pyx_t_14 = __pyx_t_13;
 
1883
      } else {
 
1884
        __pyx_t_14 = __pyx_t_12;
 
1885
      }
 
1886
      if (__pyx_t_14) {
 
1887
 
 
1888
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":232
 
1889
 *             # last modified
 
1890
 *             if (ann is last_ann and par_ann is last_parent):
 
1891
 *                 Py_INCREF(last_res)             # <<<<<<<<<<<<<<
 
1892
 *                 PyList_SetItem(annotations, ann_idx, last_res)
 
1893
 *             else:
 
1894
 */
750
1895
        Py_INCREF(__pyx_v_last_res);
751
1896
 
752
 
        /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":233 */
753
 
        __pyx_1 = PyList_SetItem(__pyx_v_annotations,__pyx_v_ann_idx,__pyx_v_last_res); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;}
754
 
        goto __pyx_L8;
 
1897
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":233
 
1898
 *             if (ann is last_ann and par_ann is last_parent):
 
1899
 *                 Py_INCREF(last_res)
 
1900
 *                 PyList_SetItem(annotations, ann_idx, last_res)             # <<<<<<<<<<<<<<
 
1901
 *             else:
 
1902
 *                 new_ann = _combine_annotations(ann, par_ann, ann_cache)
 
1903
 */
 
1904
        __pyx_t_1 = PyList_SetItem(__pyx_v_annotations, __pyx_v_ann_idx, __pyx_v_last_res); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1905
        goto __pyx_L9;
755
1906
      }
756
1907
      /*else*/ {
757
1908
 
758
 
        /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":235 */
759
 
        __pyx_3 = __pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(__pyx_v_ann,__pyx_v_par_ann,__pyx_v_ann_cache); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;}
760
 
        Py_DECREF(__pyx_v_new_ann);
761
 
        __pyx_v_new_ann = __pyx_3;
762
 
        __pyx_3 = 0;
 
1909
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":235
 
1910
 *                 PyList_SetItem(annotations, ann_idx, last_res)
 
1911
 *             else:
 
1912
 *                 new_ann = _combine_annotations(ann, par_ann, ann_cache)             # <<<<<<<<<<<<<<
 
1913
 *                 Py_INCREF(new_ann)
 
1914
 *                 PyList_SetItem(annotations, ann_idx, new_ann)
 
1915
 */
 
1916
        __pyx_t_4 = __pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(__pyx_v_ann, __pyx_v_par_ann, __pyx_v_ann_cache); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1917
        __Pyx_GOTREF(__pyx_t_4);
 
1918
        __Pyx_DECREF(__pyx_v_new_ann);
 
1919
        __pyx_v_new_ann = __pyx_t_4;
 
1920
        __pyx_t_4 = 0;
763
1921
 
764
 
        /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":236 */
 
1922
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":236
 
1923
 *             else:
 
1924
 *                 new_ann = _combine_annotations(ann, par_ann, ann_cache)
 
1925
 *                 Py_INCREF(new_ann)             # <<<<<<<<<<<<<<
 
1926
 *                 PyList_SetItem(annotations, ann_idx, new_ann)
 
1927
 *                 last_ann = ann
 
1928
 */
765
1929
        Py_INCREF(__pyx_v_new_ann);
766
1930
 
767
 
        /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":237 */
768
 
        __pyx_1 = PyList_SetItem(__pyx_v_annotations,__pyx_v_ann_idx,__pyx_v_new_ann); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
 
1931
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":237
 
1932
 *                 new_ann = _combine_annotations(ann, par_ann, ann_cache)
 
1933
 *                 Py_INCREF(new_ann)
 
1934
 *                 PyList_SetItem(annotations, ann_idx, new_ann)             # <<<<<<<<<<<<<<
 
1935
 *                 last_ann = ann
 
1936
 *                 last_parent = par_ann
 
1937
 */
 
1938
        __pyx_t_1 = PyList_SetItem(__pyx_v_annotations, __pyx_v_ann_idx, __pyx_v_new_ann); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
769
1939
 
770
 
        /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":238 */
771
 
        Py_INCREF(__pyx_v_ann);
772
 
        Py_DECREF(__pyx_v_last_ann);
 
1940
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":238
 
1941
 *                 Py_INCREF(new_ann)
 
1942
 *                 PyList_SetItem(annotations, ann_idx, new_ann)
 
1943
 *                 last_ann = ann             # <<<<<<<<<<<<<<
 
1944
 *                 last_parent = par_ann
 
1945
 *                 last_res = new_ann
 
1946
 */
 
1947
        __Pyx_INCREF(__pyx_v_ann);
 
1948
        __Pyx_DECREF(__pyx_v_last_ann);
773
1949
        __pyx_v_last_ann = __pyx_v_ann;
774
1950
 
775
 
        /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":239 */
776
 
        Py_INCREF(__pyx_v_par_ann);
777
 
        Py_DECREF(__pyx_v_last_parent);
 
1951
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":239
 
1952
 *                 PyList_SetItem(annotations, ann_idx, new_ann)
 
1953
 *                 last_ann = ann
 
1954
 *                 last_parent = par_ann             # <<<<<<<<<<<<<<
 
1955
 *                 last_res = new_ann
 
1956
 *     return 0
 
1957
 */
 
1958
        __Pyx_INCREF(__pyx_v_par_ann);
 
1959
        __Pyx_DECREF(__pyx_v_last_parent);
778
1960
        __pyx_v_last_parent = __pyx_v_par_ann;
779
1961
 
780
 
        /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":240 */
781
 
        Py_INCREF(__pyx_v_new_ann);
782
 
        Py_DECREF(__pyx_v_last_res);
 
1962
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":240
 
1963
 *                 last_ann = ann
 
1964
 *                 last_parent = par_ann
 
1965
 *                 last_res = new_ann             # <<<<<<<<<<<<<<
 
1966
 *     return 0
 
1967
 * 
 
1968
 */
 
1969
        __Pyx_INCREF(__pyx_v_new_ann);
 
1970
        __Pyx_DECREF(__pyx_v_last_res);
783
1971
        __pyx_v_last_res = __pyx_v_new_ann;
784
1972
      }
785
 
      __pyx_L8:;
786
 
      __pyx_L4:;
 
1973
      __pyx_L9:;
 
1974
      __pyx_L5_continue:;
787
1975
    }
788
1976
  }
789
 
  Py_DECREF(__pyx_2); __pyx_2 = 0;
790
 
 
791
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":241 */
792
 
  __pyx_r = 0;
793
 
  goto __pyx_L0;
794
 
 
795
 
  __pyx_r = 0;
796
 
  goto __pyx_L0;
797
 
  __pyx_L1:;
798
 
  Py_XDECREF(__pyx_2);
799
 
  Py_XDECREF(__pyx_3);
800
 
  Py_XDECREF(__pyx_4);
 
1977
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
1978
 
 
1979
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":241
 
1980
 *                 last_parent = par_ann
 
1981
 *                 last_res = new_ann
 
1982
 *     return 0             # <<<<<<<<<<<<<<
 
1983
 * 
 
1984
 * 
 
1985
 */
 
1986
  __pyx_r = 0;
 
1987
  goto __pyx_L0;
 
1988
 
 
1989
  __pyx_r = 0;
 
1990
  goto __pyx_L0;
 
1991
  __pyx_L1_error:;
 
1992
  __Pyx_XDECREF(__pyx_t_3);
 
1993
  __Pyx_XDECREF(__pyx_t_4);
 
1994
  __Pyx_XDECREF(__pyx_t_5);
 
1995
  __Pyx_XDECREF(__pyx_t_6);
 
1996
  __Pyx_XDECREF(__pyx_t_7);
 
1997
  __Pyx_XDECREF(__pyx_t_11);
801
1998
  __Pyx_AddTraceback("bzrlib._annotator_pyx._merge_annotations");
802
 
  __pyx_r = (-1);
 
1999
  __pyx_r = -1;
803
2000
  __pyx_L0:;
804
 
  Py_DECREF(__pyx_v_last_ann);
805
 
  Py_DECREF(__pyx_v_last_parent);
806
 
  Py_DECREF(__pyx_v_last_res);
807
 
  Py_DECREF(__pyx_v_par_ann);
808
 
  Py_DECREF(__pyx_v_ann);
809
 
  Py_DECREF(__pyx_v_new_ann);
810
 
  Py_DECREF(__pyx_v_this_annotation);
811
 
  Py_DECREF(__pyx_v_annotations);
812
 
  Py_DECREF(__pyx_v_parent_annotations);
813
 
  Py_DECREF(__pyx_v_matching_blocks);
814
 
  Py_DECREF(__pyx_v_ann_cache);
 
2001
  __Pyx_DECREF(__pyx_v_last_ann);
 
2002
  __Pyx_DECREF(__pyx_v_last_parent);
 
2003
  __Pyx_DECREF(__pyx_v_last_res);
 
2004
  __Pyx_DECREF(__pyx_v_par_ann);
 
2005
  __Pyx_DECREF(__pyx_v_ann);
 
2006
  __Pyx_DECREF(__pyx_v_new_ann);
 
2007
  __Pyx_RefNannyFinishContext();
815
2008
  return __pyx_r;
816
2009
}
817
2010
 
818
 
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
2011
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":247
 
2012
 *     """Class that drives performing annotations."""
 
2013
 * 
 
2014
 *     def _update_from_first_parent(self, key, annotations, lines, parent_key):             # <<<<<<<<<<<<<<
 
2015
 *         """Reannotate this text relative to its first parent."""
 
2016
 *         (parent_annotations,
 
2017
 */
 
2018
 
 
2019
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
819
2020
static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent[] = "Reannotate this text relative to its first parent.";
820
 
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent = {"_update_from_first_parent", (PyCFunction)__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent};
821
 
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
2021
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent = {__Pyx_NAMESTR("_update_from_first_parent"), (PyCFunction)__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent)};
 
2022
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
822
2023
  PyObject *__pyx_v_self = 0;
823
2024
  PyObject *__pyx_v_key = 0;
824
2025
  PyObject *__pyx_v_annotations = 0;
826
2027
  PyObject *__pyx_v_parent_key = 0;
827
2028
  PyObject *__pyx_v_parent_annotations;
828
2029
  PyObject *__pyx_v_matching_blocks;
829
 
  PyObject *__pyx_r;
830
 
  PyObject *__pyx_1 = 0;
831
 
  PyObject *__pyx_2 = 0;
832
 
  PyObject *__pyx_3 = 0;
833
 
  int __pyx_4;
834
 
  static char *__pyx_argnames[] = {"self","key","annotations","lines","parent_key",0};
835
 
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOO", __pyx_argnames, &__pyx_v_self, &__pyx_v_key, &__pyx_v_annotations, &__pyx_v_lines, &__pyx_v_parent_key)) return 0;
836
 
  Py_INCREF(__pyx_v_self);
837
 
  Py_INCREF(__pyx_v_key);
838
 
  Py_INCREF(__pyx_v_annotations);
839
 
  Py_INCREF(__pyx_v_lines);
840
 
  Py_INCREF(__pyx_v_parent_key);
841
 
  __pyx_v_parent_annotations = Py_None; Py_INCREF(Py_None);
842
 
  __pyx_v_matching_blocks = Py_None; Py_INCREF(Py_None);
843
 
 
844
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":250 */
845
 
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_k6p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
846
 
  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
847
 
  Py_INCREF(__pyx_v_key);
848
 
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_key);
849
 
  Py_INCREF(__pyx_v_lines);
850
 
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_lines);
851
 
  Py_INCREF(__pyx_v_parent_key);
852
 
  PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_parent_key);
853
 
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
854
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
855
 
  Py_DECREF(__pyx_2); __pyx_2 = 0;
856
 
  __pyx_1 = PyObject_GetIter(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
857
 
  Py_DECREF(__pyx_3); __pyx_3 = 0;
858
 
  __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
859
 
  Py_DECREF(__pyx_v_parent_annotations);
860
 
  __pyx_v_parent_annotations = __pyx_2;
861
 
  __pyx_2 = 0;
862
 
  __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
863
 
  Py_DECREF(__pyx_v_matching_blocks);
864
 
  __pyx_v_matching_blocks = __pyx_3;
865
 
  __pyx_3 = 0;
866
 
  if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
867
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
868
 
 
869
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":253 */
870
 
  __pyx_4 = __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(__pyx_v_annotations,__pyx_v_parent_annotations,__pyx_v_matching_blocks); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;}
871
 
 
872
 
  __pyx_r = Py_None; Py_INCREF(Py_None);
 
2030
  PyObject *__pyx_r = NULL;
 
2031
  PyObject *__pyx_t_1 = NULL;
 
2032
  PyObject *__pyx_t_2 = NULL;
 
2033
  PyObject *__pyx_t_3 = NULL;
 
2034
  PyObject *__pyx_t_4 = NULL;
 
2035
  int __pyx_t_5;
 
2036
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__key,&__pyx_n_s__annotations,&__pyx_n_s__lines,&__pyx_n_s__parent_key,0};
 
2037
  __Pyx_RefNannySetupContext("_update_from_first_parent");
 
2038
  __pyx_self = __pyx_self;
 
2039
  if (unlikely(__pyx_kwds)) {
 
2040
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
 
2041
    PyObject* values[5] = {0,0,0,0,0};
 
2042
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
2043
      case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
 
2044
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
 
2045
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
 
2046
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
 
2047
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
 
2048
      case  0: break;
 
2049
      default: goto __pyx_L5_argtuple_error;
 
2050
    }
 
2051
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
2052
      case  0:
 
2053
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
 
2054
      if (likely(values[0])) kw_args--;
 
2055
      else goto __pyx_L5_argtuple_error;
 
2056
      case  1:
 
2057
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
 
2058
      if (likely(values[1])) kw_args--;
 
2059
      else {
 
2060
        __Pyx_RaiseArgtupleInvalid("_update_from_first_parent", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2061
      }
 
2062
      case  2:
 
2063
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__annotations);
 
2064
      if (likely(values[2])) kw_args--;
 
2065
      else {
 
2066
        __Pyx_RaiseArgtupleInvalid("_update_from_first_parent", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2067
      }
 
2068
      case  3:
 
2069
      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lines);
 
2070
      if (likely(values[3])) kw_args--;
 
2071
      else {
 
2072
        __Pyx_RaiseArgtupleInvalid("_update_from_first_parent", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2073
      }
 
2074
      case  4:
 
2075
      values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parent_key);
 
2076
      if (likely(values[4])) kw_args--;
 
2077
      else {
 
2078
        __Pyx_RaiseArgtupleInvalid("_update_from_first_parent", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2079
      }
 
2080
    }
 
2081
    if (unlikely(kw_args > 0)) {
 
2082
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_update_from_first_parent") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2083
    }
 
2084
    __pyx_v_self = values[0];
 
2085
    __pyx_v_key = values[1];
 
2086
    __pyx_v_annotations = values[2];
 
2087
    __pyx_v_lines = values[3];
 
2088
    __pyx_v_parent_key = values[4];
 
2089
  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
 
2090
    goto __pyx_L5_argtuple_error;
 
2091
  } else {
 
2092
    __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
 
2093
    __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1);
 
2094
    __pyx_v_annotations = PyTuple_GET_ITEM(__pyx_args, 2);
 
2095
    __pyx_v_lines = PyTuple_GET_ITEM(__pyx_args, 3);
 
2096
    __pyx_v_parent_key = PyTuple_GET_ITEM(__pyx_args, 4);
 
2097
  }
 
2098
  goto __pyx_L4_argument_unpacking_done;
 
2099
  __pyx_L5_argtuple_error:;
 
2100
  __Pyx_RaiseArgtupleInvalid("_update_from_first_parent", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2101
  __pyx_L3_error:;
 
2102
  __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_first_parent");
 
2103
  __Pyx_RefNannyFinishContext();
 
2104
  return NULL;
 
2105
  __pyx_L4_argument_unpacking_done:;
 
2106
  __pyx_v_parent_annotations = Py_None; __Pyx_INCREF(Py_None);
 
2107
  __pyx_v_matching_blocks = Py_None; __Pyx_INCREF(Py_None);
 
2108
 
 
2109
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":250
 
2110
 *         """Reannotate this text relative to its first parent."""
 
2111
 *         (parent_annotations,
 
2112
 *          matching_blocks) = self._get_parent_annotations_and_matches(             # <<<<<<<<<<<<<<
 
2113
 *                                 key, lines, parent_key)
 
2114
 * 
 
2115
 */
 
2116
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2117
  __Pyx_GOTREF(__pyx_t_1);
 
2118
 
 
2119
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":251
 
2120
 *         (parent_annotations,
 
2121
 *          matching_blocks) = self._get_parent_annotations_and_matches(
 
2122
 *                                 key, lines, parent_key)             # <<<<<<<<<<<<<<
 
2123
 * 
 
2124
 *         _apply_parent_annotations(annotations, parent_annotations,
 
2125
 */
 
2126
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2127
  __Pyx_GOTREF(__pyx_t_2);
 
2128
  __Pyx_INCREF(__pyx_v_key);
 
2129
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
 
2130
  __Pyx_GIVEREF(__pyx_v_key);
 
2131
  __Pyx_INCREF(__pyx_v_lines);
 
2132
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_lines);
 
2133
  __Pyx_GIVEREF(__pyx_v_lines);
 
2134
  __Pyx_INCREF(__pyx_v_parent_key);
 
2135
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_parent_key);
 
2136
  __Pyx_GIVEREF(__pyx_v_parent_key);
 
2137
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2138
  __Pyx_GOTREF(__pyx_t_3);
 
2139
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
2140
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
2141
  if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
 
2142
    PyObject* tuple = __pyx_t_3;
 
2143
    __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
 
2144
    __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
 
2145
 
 
2146
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":249
 
2147
 *     def _update_from_first_parent(self, key, annotations, lines, parent_key):
 
2148
 *         """Reannotate this text relative to its first parent."""
 
2149
 *         (parent_annotations,             # <<<<<<<<<<<<<<
 
2150
 *          matching_blocks) = self._get_parent_annotations_and_matches(
 
2151
 *                                 key, lines, parent_key)
 
2152
 */
 
2153
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
2154
    __Pyx_DECREF(__pyx_v_parent_annotations);
 
2155
    __pyx_v_parent_annotations = __pyx_t_2;
 
2156
    __pyx_t_2 = 0;
 
2157
    __Pyx_DECREF(__pyx_v_matching_blocks);
 
2158
    __pyx_v_matching_blocks = __pyx_t_1;
 
2159
    __pyx_t_1 = 0;
 
2160
  } else {
 
2161
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2162
    __Pyx_GOTREF(__pyx_t_4);
 
2163
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
2164
    __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2165
    __Pyx_GOTREF(__pyx_t_2);
 
2166
    __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2167
    __Pyx_GOTREF(__pyx_t_1);
 
2168
    if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2169
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
2170
    __Pyx_DECREF(__pyx_v_parent_annotations);
 
2171
    __pyx_v_parent_annotations = __pyx_t_2;
 
2172
    __pyx_t_2 = 0;
 
2173
    __Pyx_DECREF(__pyx_v_matching_blocks);
 
2174
    __pyx_v_matching_blocks = __pyx_t_1;
 
2175
    __pyx_t_1 = 0;
 
2176
  }
 
2177
 
 
2178
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":254
 
2179
 * 
 
2180
 *         _apply_parent_annotations(annotations, parent_annotations,
 
2181
 *                                   matching_blocks)             # <<<<<<<<<<<<<<
 
2182
 * 
 
2183
 *     def _update_from_other_parents(self, key, annotations, lines,
 
2184
 */
 
2185
  __pyx_t_5 = __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(__pyx_v_annotations, __pyx_v_parent_annotations, __pyx_v_matching_blocks); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2186
 
 
2187
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
873
2188
  goto __pyx_L0;
874
 
  __pyx_L1:;
875
 
  Py_XDECREF(__pyx_1);
876
 
  Py_XDECREF(__pyx_2);
877
 
  Py_XDECREF(__pyx_3);
 
2189
  __pyx_L1_error:;
 
2190
  __Pyx_XDECREF(__pyx_t_1);
 
2191
  __Pyx_XDECREF(__pyx_t_2);
 
2192
  __Pyx_XDECREF(__pyx_t_3);
 
2193
  __Pyx_XDECREF(__pyx_t_4);
878
2194
  __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_first_parent");
879
 
  __pyx_r = 0;
 
2195
  __pyx_r = NULL;
880
2196
  __pyx_L0:;
881
 
  Py_DECREF(__pyx_v_parent_annotations);
882
 
  Py_DECREF(__pyx_v_matching_blocks);
883
 
  Py_DECREF(__pyx_v_self);
884
 
  Py_DECREF(__pyx_v_key);
885
 
  Py_DECREF(__pyx_v_annotations);
886
 
  Py_DECREF(__pyx_v_lines);
887
 
  Py_DECREF(__pyx_v_parent_key);
 
2197
  __Pyx_DECREF(__pyx_v_parent_annotations);
 
2198
  __Pyx_DECREF(__pyx_v_matching_blocks);
 
2199
  __Pyx_XGIVEREF(__pyx_r);
 
2200
  __Pyx_RefNannyFinishContext();
888
2201
  return __pyx_r;
889
2202
}
890
2203
 
891
 
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
2204
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":256
 
2205
 *                                   matching_blocks)
 
2206
 * 
 
2207
 *     def _update_from_other_parents(self, key, annotations, lines,             # <<<<<<<<<<<<<<
 
2208
 *                                    this_annotation, parent_key):
 
2209
 *         """Reannotate this text relative to a second (or more) parent."""
 
2210
 */
 
2211
 
 
2212
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
892
2213
static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents[] = "Reannotate this text relative to a second (or more) parent.";
893
 
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents = {"_update_from_other_parents", (PyCFunction)__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents};
894
 
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
2214
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents = {__Pyx_NAMESTR("_update_from_other_parents"), (PyCFunction)__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents)};
 
2215
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
895
2216
  PyObject *__pyx_v_self = 0;
896
2217
  PyObject *__pyx_v_key = 0;
897
2218
  PyObject *__pyx_v_annotations = 0;
900
2221
  PyObject *__pyx_v_parent_key = 0;
901
2222
  PyObject *__pyx_v_parent_annotations;
902
2223
  PyObject *__pyx_v_matching_blocks;
903
 
  PyObject *__pyx_r;
904
 
  PyObject *__pyx_1 = 0;
905
 
  PyObject *__pyx_2 = 0;
906
 
  PyObject *__pyx_3 = 0;
907
 
  int __pyx_4;
908
 
  static char *__pyx_argnames[] = {"self","key","annotations","lines","this_annotation","parent_key",0};
909
 
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOOO", __pyx_argnames, &__pyx_v_self, &__pyx_v_key, &__pyx_v_annotations, &__pyx_v_lines, &__pyx_v_this_annotation, &__pyx_v_parent_key)) return 0;
910
 
  Py_INCREF(__pyx_v_self);
911
 
  Py_INCREF(__pyx_v_key);
912
 
  Py_INCREF(__pyx_v_annotations);
913
 
  Py_INCREF(__pyx_v_lines);
914
 
  Py_INCREF(__pyx_v_this_annotation);
915
 
  Py_INCREF(__pyx_v_parent_key);
916
 
  __pyx_v_parent_annotations = Py_None; Py_INCREF(Py_None);
917
 
  __pyx_v_matching_blocks = Py_None; Py_INCREF(Py_None);
918
 
 
919
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":260 */
920
 
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_k6p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;}
921
 
  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;}
922
 
  Py_INCREF(__pyx_v_key);
923
 
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_key);
924
 
  Py_INCREF(__pyx_v_lines);
925
 
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_lines);
926
 
  Py_INCREF(__pyx_v_parent_key);
927
 
  PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_parent_key);
928
 
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;}
929
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
930
 
  Py_DECREF(__pyx_2); __pyx_2 = 0;
931
 
  __pyx_1 = PyObject_GetIter(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;}
932
 
  Py_DECREF(__pyx_3); __pyx_3 = 0;
933
 
  __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;}
934
 
  Py_DECREF(__pyx_v_parent_annotations);
935
 
  __pyx_v_parent_annotations = __pyx_2;
936
 
  __pyx_2 = 0;
937
 
  __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;}
938
 
  Py_DECREF(__pyx_v_matching_blocks);
939
 
  __pyx_v_matching_blocks = __pyx_3;
940
 
  __pyx_3 = 0;
941
 
  if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;}
942
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
943
 
 
944
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":262 */
945
 
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n__ann_tuple_cache); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;}
946
 
  __pyx_4 = __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(__pyx_v_this_annotation,__pyx_v_annotations,__pyx_v_parent_annotations,__pyx_v_matching_blocks,__pyx_2); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}
947
 
  Py_DECREF(__pyx_2); __pyx_2 = 0;
948
 
 
949
 
  __pyx_r = Py_None; Py_INCREF(Py_None);
 
2224
  PyObject *__pyx_r = NULL;
 
2225
  PyObject *__pyx_t_1 = NULL;
 
2226
  PyObject *__pyx_t_2 = NULL;
 
2227
  PyObject *__pyx_t_3 = NULL;
 
2228
  PyObject *__pyx_t_4 = NULL;
 
2229
  int __pyx_t_5;
 
2230
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__key,&__pyx_n_s__annotations,&__pyx_n_s__lines,&__pyx_n_s__this_annotation,&__pyx_n_s__parent_key,0};
 
2231
  __Pyx_RefNannySetupContext("_update_from_other_parents");
 
2232
  __pyx_self = __pyx_self;
 
2233
  if (unlikely(__pyx_kwds)) {
 
2234
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
 
2235
    PyObject* values[6] = {0,0,0,0,0,0};
 
2236
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
2237
      case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
 
2238
      case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
 
2239
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
 
2240
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
 
2241
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
 
2242
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
 
2243
      case  0: break;
 
2244
      default: goto __pyx_L5_argtuple_error;
 
2245
    }
 
2246
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
2247
      case  0:
 
2248
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
 
2249
      if (likely(values[0])) kw_args--;
 
2250
      else goto __pyx_L5_argtuple_error;
 
2251
      case  1:
 
2252
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
 
2253
      if (likely(values[1])) kw_args--;
 
2254
      else {
 
2255
        __Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2256
      }
 
2257
      case  2:
 
2258
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__annotations);
 
2259
      if (likely(values[2])) kw_args--;
 
2260
      else {
 
2261
        __Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2262
      }
 
2263
      case  3:
 
2264
      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lines);
 
2265
      if (likely(values[3])) kw_args--;
 
2266
      else {
 
2267
        __Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2268
      }
 
2269
      case  4:
 
2270
      values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__this_annotation);
 
2271
      if (likely(values[4])) kw_args--;
 
2272
      else {
 
2273
        __Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2274
      }
 
2275
      case  5:
 
2276
      values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parent_key);
 
2277
      if (likely(values[5])) kw_args--;
 
2278
      else {
 
2279
        __Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2280
      }
 
2281
    }
 
2282
    if (unlikely(kw_args > 0)) {
 
2283
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_update_from_other_parents") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2284
    }
 
2285
    __pyx_v_self = values[0];
 
2286
    __pyx_v_key = values[1];
 
2287
    __pyx_v_annotations = values[2];
 
2288
    __pyx_v_lines = values[3];
 
2289
    __pyx_v_this_annotation = values[4];
 
2290
    __pyx_v_parent_key = values[5];
 
2291
  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
 
2292
    goto __pyx_L5_argtuple_error;
 
2293
  } else {
 
2294
    __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
 
2295
    __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1);
 
2296
    __pyx_v_annotations = PyTuple_GET_ITEM(__pyx_args, 2);
 
2297
    __pyx_v_lines = PyTuple_GET_ITEM(__pyx_args, 3);
 
2298
    __pyx_v_this_annotation = PyTuple_GET_ITEM(__pyx_args, 4);
 
2299
    __pyx_v_parent_key = PyTuple_GET_ITEM(__pyx_args, 5);
 
2300
  }
 
2301
  goto __pyx_L4_argument_unpacking_done;
 
2302
  __pyx_L5_argtuple_error:;
 
2303
  __Pyx_RaiseArgtupleInvalid("_update_from_other_parents", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2304
  __pyx_L3_error:;
 
2305
  __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_other_parents");
 
2306
  __Pyx_RefNannyFinishContext();
 
2307
  return NULL;
 
2308
  __pyx_L4_argument_unpacking_done:;
 
2309
  __pyx_v_parent_annotations = Py_None; __Pyx_INCREF(Py_None);
 
2310
  __pyx_v_matching_blocks = Py_None; __Pyx_INCREF(Py_None);
 
2311
 
 
2312
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":260
 
2313
 *         """Reannotate this text relative to a second (or more) parent."""
 
2314
 *         (parent_annotations,
 
2315
 *          matching_blocks) = self._get_parent_annotations_and_matches(             # <<<<<<<<<<<<<<
 
2316
 *                                 key, lines, parent_key)
 
2317
 *         _merge_annotations(this_annotation, annotations, parent_annotations,
 
2318
 */
 
2319
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2320
  __Pyx_GOTREF(__pyx_t_1);
 
2321
 
 
2322
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":261
 
2323
 *         (parent_annotations,
 
2324
 *          matching_blocks) = self._get_parent_annotations_and_matches(
 
2325
 *                                 key, lines, parent_key)             # <<<<<<<<<<<<<<
 
2326
 *         _merge_annotations(this_annotation, annotations, parent_annotations,
 
2327
 *                            matching_blocks, self._ann_tuple_cache)
 
2328
 */
 
2329
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2330
  __Pyx_GOTREF(__pyx_t_2);
 
2331
  __Pyx_INCREF(__pyx_v_key);
 
2332
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
 
2333
  __Pyx_GIVEREF(__pyx_v_key);
 
2334
  __Pyx_INCREF(__pyx_v_lines);
 
2335
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_lines);
 
2336
  __Pyx_GIVEREF(__pyx_v_lines);
 
2337
  __Pyx_INCREF(__pyx_v_parent_key);
 
2338
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_parent_key);
 
2339
  __Pyx_GIVEREF(__pyx_v_parent_key);
 
2340
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2341
  __Pyx_GOTREF(__pyx_t_3);
 
2342
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
2343
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
2344
  if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
 
2345
    PyObject* tuple = __pyx_t_3;
 
2346
    __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
 
2347
    __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
 
2348
 
 
2349
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":259
 
2350
 *                                    this_annotation, parent_key):
 
2351
 *         """Reannotate this text relative to a second (or more) parent."""
 
2352
 *         (parent_annotations,             # <<<<<<<<<<<<<<
 
2353
 *          matching_blocks) = self._get_parent_annotations_and_matches(
 
2354
 *                                 key, lines, parent_key)
 
2355
 */
 
2356
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
2357
    __Pyx_DECREF(__pyx_v_parent_annotations);
 
2358
    __pyx_v_parent_annotations = __pyx_t_2;
 
2359
    __pyx_t_2 = 0;
 
2360
    __Pyx_DECREF(__pyx_v_matching_blocks);
 
2361
    __pyx_v_matching_blocks = __pyx_t_1;
 
2362
    __pyx_t_1 = 0;
 
2363
  } else {
 
2364
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2365
    __Pyx_GOTREF(__pyx_t_4);
 
2366
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
2367
    __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2368
    __Pyx_GOTREF(__pyx_t_2);
 
2369
    __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2370
    __Pyx_GOTREF(__pyx_t_1);
 
2371
    if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2372
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
2373
    __Pyx_DECREF(__pyx_v_parent_annotations);
 
2374
    __pyx_v_parent_annotations = __pyx_t_2;
 
2375
    __pyx_t_2 = 0;
 
2376
    __Pyx_DECREF(__pyx_v_matching_blocks);
 
2377
    __pyx_v_matching_blocks = __pyx_t_1;
 
2378
    __pyx_t_1 = 0;
 
2379
  }
 
2380
 
 
2381
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":263
 
2382
 *                                 key, lines, parent_key)
 
2383
 *         _merge_annotations(this_annotation, annotations, parent_annotations,
 
2384
 *                            matching_blocks, self._ann_tuple_cache)             # <<<<<<<<<<<<<<
 
2385
 * 
 
2386
 *     def annotate_flat(self, key):
 
2387
 */
 
2388
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___ann_tuple_cache); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2389
  __Pyx_GOTREF(__pyx_t_3);
 
2390
  __pyx_t_5 = __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(__pyx_v_this_annotation, __pyx_v_annotations, __pyx_v_parent_annotations, __pyx_v_matching_blocks, __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2391
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
2392
 
 
2393
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
950
2394
  goto __pyx_L0;
951
 
  __pyx_L1:;
952
 
  Py_XDECREF(__pyx_1);
953
 
  Py_XDECREF(__pyx_2);
954
 
  Py_XDECREF(__pyx_3);
 
2395
  __pyx_L1_error:;
 
2396
  __Pyx_XDECREF(__pyx_t_1);
 
2397
  __Pyx_XDECREF(__pyx_t_2);
 
2398
  __Pyx_XDECREF(__pyx_t_3);
 
2399
  __Pyx_XDECREF(__pyx_t_4);
955
2400
  __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_other_parents");
956
 
  __pyx_r = 0;
 
2401
  __pyx_r = NULL;
957
2402
  __pyx_L0:;
958
 
  Py_DECREF(__pyx_v_parent_annotations);
959
 
  Py_DECREF(__pyx_v_matching_blocks);
960
 
  Py_DECREF(__pyx_v_self);
961
 
  Py_DECREF(__pyx_v_key);
962
 
  Py_DECREF(__pyx_v_annotations);
963
 
  Py_DECREF(__pyx_v_lines);
964
 
  Py_DECREF(__pyx_v_this_annotation);
965
 
  Py_DECREF(__pyx_v_parent_key);
 
2403
  __Pyx_DECREF(__pyx_v_parent_annotations);
 
2404
  __Pyx_DECREF(__pyx_v_matching_blocks);
 
2405
  __Pyx_XGIVEREF(__pyx_r);
 
2406
  __Pyx_RefNannyFinishContext();
966
2407
  return __pyx_r;
967
2408
}
968
2409
 
969
 
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
2410
/* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":265
 
2411
 *                            matching_blocks, self._ann_tuple_cache)
 
2412
 * 
 
2413
 *     def annotate_flat(self, key):             # <<<<<<<<<<<<<<
 
2414
 *         """Determine the single-best-revision to source for each line.
 
2415
 * 
 
2416
 */
 
2417
 
 
2418
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
970
2419
static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat[] = "Determine the single-best-revision to source for each line.\n\n        This is meant as a compatibility thunk to how annotate() used to work.\n        ";
971
 
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat = {"annotate_flat", (PyCFunction)__pyx_f_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat};
972
 
static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
2420
static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat = {__Pyx_NAMESTR("annotate_flat"), (PyCFunction)__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat)};
 
2421
static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
973
2422
  PyObject *__pyx_v_self = 0;
974
2423
  PyObject *__pyx_v_key = 0;
975
2424
  Py_ssize_t __pyx_v_pos;
984
2433
  PyObject *__pyx_v_line;
985
2434
  PyObject *__pyx_v_head;
986
2435
  PyObject *__pyx_v_the_heads;
987
 
  PyObject *__pyx_r;
988
 
  PyObject *__pyx_1 = 0;
989
 
  PyObject *__pyx_2 = 0;
990
 
  PyObject *__pyx_3 = 0;
991
 
  Py_ssize_t __pyx_4;
992
 
  int __pyx_5;
993
 
  static char *__pyx_argnames[] = {"self","key",0};
994
 
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_self, &__pyx_v_key)) return 0;
995
 
  Py_INCREF(__pyx_v_self);
996
 
  Py_INCREF(__pyx_v_key);
997
 
  __pyx_v_annotate = Py_None; Py_INCREF(Py_None);
998
 
  __pyx_v_custom_tiebreaker = Py_None; Py_INCREF(Py_None);
999
 
  __pyx_v_annotations = Py_None; Py_INCREF(Py_None);
1000
 
  __pyx_v_lines = Py_None; Py_INCREF(Py_None);
1001
 
  __pyx_v_out = Py_None; Py_INCREF(Py_None);
1002
 
  __pyx_v_heads = Py_None; Py_INCREF(Py_None);
1003
 
  __pyx_v_annotation = Py_None; Py_INCREF(Py_None);
1004
 
  __pyx_v_line = Py_None; Py_INCREF(Py_None);
1005
 
  __pyx_v_head = Py_None; Py_INCREF(Py_None);
1006
 
  __pyx_v_the_heads = Py_None; Py_INCREF(Py_None);
1007
 
 
1008
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":272 */
1009
 
  __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;}
1010
 
  Py_INCREF(__pyx_n_annotate);
1011
 
  PyList_SET_ITEM(__pyx_1, 0, __pyx_n_annotate);
1012
 
  __pyx_2 = __Pyx_Import(__pyx_n_bzrlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;}
1013
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
1014
 
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_annotate); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;}
1015
 
  Py_DECREF(__pyx_v_annotate);
1016
 
  __pyx_v_annotate = __pyx_1;
1017
 
  __pyx_1 = 0;
1018
 
  Py_DECREF(__pyx_2); __pyx_2 = 0;
1019
 
 
1020
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":274 */
1021
 
  __pyx_2 = PyObject_GetAttr(__pyx_v_annotate, __pyx_n__break_annotation_tie); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; goto __pyx_L1;}
1022
 
  Py_DECREF(__pyx_v_custom_tiebreaker);
1023
 
  __pyx_v_custom_tiebreaker = __pyx_2;
1024
 
  __pyx_2 = 0;
1025
 
 
1026
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":275 */
1027
 
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_annotate); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
1028
 
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
1029
 
  Py_INCREF(__pyx_v_key);
1030
 
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_key);
1031
 
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
1032
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
1033
 
  Py_DECREF(__pyx_2); __pyx_2 = 0;
1034
 
  __pyx_1 = PyObject_GetIter(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
1035
 
  Py_DECREF(__pyx_3); __pyx_3 = 0;
1036
 
  __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
1037
 
  Py_DECREF(__pyx_v_annotations);
1038
 
  __pyx_v_annotations = __pyx_2;
1039
 
  __pyx_2 = 0;
1040
 
  __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
1041
 
  Py_DECREF(__pyx_v_lines);
1042
 
  __pyx_v_lines = __pyx_3;
1043
 
  __pyx_3 = 0;
1044
 
  if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
1045
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
1046
 
 
1047
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":276 */
1048
 
  __pyx_4 = PyObject_Length(__pyx_v_lines); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;}
1049
 
  __pyx_v_num_lines = __pyx_4;
1050
 
 
1051
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":277 */
1052
 
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; goto __pyx_L1;}
1053
 
  Py_DECREF(__pyx_v_out);
1054
 
  __pyx_v_out = __pyx_2;
1055
 
  __pyx_2 = 0;
1056
 
 
1057
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":278 */
1058
 
  __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n__get_heads_provider); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
1059
 
  __pyx_1 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
1060
 
  Py_DECREF(__pyx_3); __pyx_3 = 0;
1061
 
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_heads); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
1062
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
1063
 
  Py_DECREF(__pyx_v_heads);
1064
 
  __pyx_v_heads = __pyx_2;
1065
 
  __pyx_2 = 0;
1066
 
 
1067
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":279 */
1068
 
  for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_v_num_lines; ++__pyx_v_pos) {
1069
 
 
1070
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":280 */
1071
 
    __pyx_3 = __Pyx_GetItemInt(__pyx_v_annotations, __pyx_v_pos); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
1072
 
    Py_DECREF(__pyx_v_annotation);
1073
 
    __pyx_v_annotation = __pyx_3;
1074
 
    __pyx_3 = 0;
1075
 
 
1076
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":281 */
1077
 
    __pyx_1 = __Pyx_GetItemInt(__pyx_v_lines, __pyx_v_pos); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
1078
 
    Py_DECREF(__pyx_v_line);
1079
 
    __pyx_v_line = __pyx_1;
1080
 
    __pyx_1 = 0;
1081
 
 
1082
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":282 */
1083
 
    __pyx_4 = PyObject_Length(__pyx_v_annotation); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;}
1084
 
    __pyx_5 = (__pyx_4 == 1);
1085
 
    if (__pyx_5) {
1086
 
      __pyx_2 = __Pyx_GetItemInt(__pyx_v_annotation, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;}
1087
 
      Py_DECREF(__pyx_v_head);
1088
 
      __pyx_v_head = __pyx_2;
1089
 
      __pyx_2 = 0;
1090
 
      goto __pyx_L4;
 
2436
  PyObject *__pyx_r = NULL;
 
2437
  PyObject *__pyx_t_1 = NULL;
 
2438
  PyObject *__pyx_t_2 = NULL;
 
2439
  PyObject *__pyx_t_3 = NULL;
 
2440
  PyObject *__pyx_t_4 = NULL;
 
2441
  Py_ssize_t __pyx_t_5;
 
2442
  Py_ssize_t __pyx_t_6;
 
2443
  int __pyx_t_7;
 
2444
  int __pyx_t_8;
 
2445
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__key,0};
 
2446
  __Pyx_RefNannySetupContext("annotate_flat");
 
2447
  __pyx_self = __pyx_self;
 
2448
  if (unlikely(__pyx_kwds)) {
 
2449
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
 
2450
    PyObject* values[2] = {0,0};
 
2451
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
2452
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
 
2453
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
 
2454
      case  0: break;
 
2455
      default: goto __pyx_L5_argtuple_error;
 
2456
    }
 
2457
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
2458
      case  0:
 
2459
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
 
2460
      if (likely(values[0])) kw_args--;
 
2461
      else goto __pyx_L5_argtuple_error;
 
2462
      case  1:
 
2463
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
 
2464
      if (likely(values[1])) kw_args--;
 
2465
      else {
 
2466
        __Pyx_RaiseArgtupleInvalid("annotate_flat", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2467
      }
 
2468
    }
 
2469
    if (unlikely(kw_args > 0)) {
 
2470
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "annotate_flat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2471
    }
 
2472
    __pyx_v_self = values[0];
 
2473
    __pyx_v_key = values[1];
 
2474
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
 
2475
    goto __pyx_L5_argtuple_error;
 
2476
  } else {
 
2477
    __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
 
2478
    __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1);
 
2479
  }
 
2480
  goto __pyx_L4_argument_unpacking_done;
 
2481
  __pyx_L5_argtuple_error:;
 
2482
  __Pyx_RaiseArgtupleInvalid("annotate_flat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2483
  __pyx_L3_error:;
 
2484
  __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator.annotate_flat");
 
2485
  __Pyx_RefNannyFinishContext();
 
2486
  return NULL;
 
2487
  __pyx_L4_argument_unpacking_done:;
 
2488
  __pyx_v_annotate = Py_None; __Pyx_INCREF(Py_None);
 
2489
  __pyx_v_custom_tiebreaker = Py_None; __Pyx_INCREF(Py_None);
 
2490
  __pyx_v_annotations = Py_None; __Pyx_INCREF(Py_None);
 
2491
  __pyx_v_lines = Py_None; __Pyx_INCREF(Py_None);
 
2492
  __pyx_v_out = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
 
2493
  __pyx_v_heads = Py_None; __Pyx_INCREF(Py_None);
 
2494
  __pyx_v_annotation = Py_None; __Pyx_INCREF(Py_None);
 
2495
  __pyx_v_line = Py_None; __Pyx_INCREF(Py_None);
 
2496
  __pyx_v_head = Py_None; __Pyx_INCREF(Py_None);
 
2497
  __pyx_v_the_heads = Py_None; __Pyx_INCREF(Py_None);
 
2498
 
 
2499
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":272
 
2500
 *         cdef Py_ssize_t pos, num_lines
 
2501
 * 
 
2502
 *         from bzrlib import annotate             # <<<<<<<<<<<<<<
 
2503
 * 
 
2504
 *         custom_tiebreaker = annotate._break_annotation_tie
 
2505
 */
 
2506
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2507
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
2508
  __Pyx_INCREF(((PyObject *)__pyx_n_s__annotate));
 
2509
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__annotate));
 
2510
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__annotate));
 
2511
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__bzrlib), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2512
  __Pyx_GOTREF(__pyx_t_2);
 
2513
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
2514
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__annotate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2515
  __Pyx_GOTREF(__pyx_t_1);
 
2516
  __Pyx_INCREF(__pyx_t_1);
 
2517
  __Pyx_DECREF(__pyx_v_annotate);
 
2518
  __pyx_v_annotate = __pyx_t_1;
 
2519
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
2520
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
2521
 
 
2522
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":274
 
2523
 *         from bzrlib import annotate
 
2524
 * 
 
2525
 *         custom_tiebreaker = annotate._break_annotation_tie             # <<<<<<<<<<<<<<
 
2526
 *         annotations, lines = self.annotate(key)
 
2527
 *         num_lines = len(lines)
 
2528
 */
 
2529
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_annotate, __pyx_n_s_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2530
  __Pyx_GOTREF(__pyx_t_2);
 
2531
  __Pyx_DECREF(__pyx_v_custom_tiebreaker);
 
2532
  __pyx_v_custom_tiebreaker = __pyx_t_2;
 
2533
  __pyx_t_2 = 0;
 
2534
 
 
2535
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":275
 
2536
 * 
 
2537
 *         custom_tiebreaker = annotate._break_annotation_tie
 
2538
 *         annotations, lines = self.annotate(key)             # <<<<<<<<<<<<<<
 
2539
 *         num_lines = len(lines)
 
2540
 *         out = []
 
2541
 */
 
2542
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__annotate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2543
  __Pyx_GOTREF(__pyx_t_2);
 
2544
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2545
  __Pyx_GOTREF(__pyx_t_1);
 
2546
  __Pyx_INCREF(__pyx_v_key);
 
2547
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
 
2548
  __Pyx_GIVEREF(__pyx_v_key);
 
2549
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2550
  __Pyx_GOTREF(__pyx_t_3);
 
2551
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
2552
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
2553
  if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
 
2554
    PyObject* tuple = __pyx_t_3;
 
2555
    __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
 
2556
    __pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2);
 
2557
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
2558
    __Pyx_DECREF(__pyx_v_annotations);
 
2559
    __pyx_v_annotations = __pyx_t_1;
 
2560
    __pyx_t_1 = 0;
 
2561
    __Pyx_DECREF(__pyx_v_lines);
 
2562
    __pyx_v_lines = __pyx_t_2;
 
2563
    __pyx_t_2 = 0;
 
2564
  } else {
 
2565
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2566
    __Pyx_GOTREF(__pyx_t_4);
 
2567
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
2568
    __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2569
    __Pyx_GOTREF(__pyx_t_1);
 
2570
    __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2571
    __Pyx_GOTREF(__pyx_t_2);
 
2572
    if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2573
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
2574
    __Pyx_DECREF(__pyx_v_annotations);
 
2575
    __pyx_v_annotations = __pyx_t_1;
 
2576
    __pyx_t_1 = 0;
 
2577
    __Pyx_DECREF(__pyx_v_lines);
 
2578
    __pyx_v_lines = __pyx_t_2;
 
2579
    __pyx_t_2 = 0;
 
2580
  }
 
2581
 
 
2582
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":276
 
2583
 *         custom_tiebreaker = annotate._break_annotation_tie
 
2584
 *         annotations, lines = self.annotate(key)
 
2585
 *         num_lines = len(lines)             # <<<<<<<<<<<<<<
 
2586
 *         out = []
 
2587
 *         heads = self._get_heads_provider().heads
 
2588
 */
 
2589
  __pyx_t_5 = PyObject_Length(__pyx_v_lines); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2590
  __pyx_v_num_lines = __pyx_t_5;
 
2591
 
 
2592
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":277
 
2593
 *         annotations, lines = self.annotate(key)
 
2594
 *         num_lines = len(lines)
 
2595
 *         out = []             # <<<<<<<<<<<<<<
 
2596
 *         heads = self._get_heads_provider().heads
 
2597
 *         for pos from 0 <= pos < num_lines:
 
2598
 */
 
2599
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2600
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
2601
  __Pyx_DECREF(((PyObject *)__pyx_v_out));
 
2602
  __pyx_v_out = __pyx_t_3;
 
2603
  __pyx_t_3 = 0;
 
2604
 
 
2605
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":278
 
2606
 *         num_lines = len(lines)
 
2607
 *         out = []
 
2608
 *         heads = self._get_heads_provider().heads             # <<<<<<<<<<<<<<
 
2609
 *         for pos from 0 <= pos < num_lines:
 
2610
 *             annotation = annotations[pos]
 
2611
 */
 
2612
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___get_heads_provider); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2613
  __Pyx_GOTREF(__pyx_t_3);
 
2614
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2615
  __Pyx_GOTREF(__pyx_t_2);
 
2616
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
2617
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__heads); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2618
  __Pyx_GOTREF(__pyx_t_3);
 
2619
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
2620
  __Pyx_DECREF(__pyx_v_heads);
 
2621
  __pyx_v_heads = __pyx_t_3;
 
2622
  __pyx_t_3 = 0;
 
2623
 
 
2624
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":279
 
2625
 *         out = []
 
2626
 *         heads = self._get_heads_provider().heads
 
2627
 *         for pos from 0 <= pos < num_lines:             # <<<<<<<<<<<<<<
 
2628
 *             annotation = annotations[pos]
 
2629
 *             line = lines[pos]
 
2630
 */
 
2631
  __pyx_t_5 = __pyx_v_num_lines;
 
2632
  for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_t_5; __pyx_v_pos++) {
 
2633
 
 
2634
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":280
 
2635
 *         heads = self._get_heads_provider().heads
 
2636
 *         for pos from 0 <= pos < num_lines:
 
2637
 *             annotation = annotations[pos]             # <<<<<<<<<<<<<<
 
2638
 *             line = lines[pos]
 
2639
 *             if len(annotation) == 1:
 
2640
 */
 
2641
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_annotations, __pyx_v_pos, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2642
    __Pyx_GOTREF(__pyx_t_3);
 
2643
    __Pyx_DECREF(__pyx_v_annotation);
 
2644
    __pyx_v_annotation = __pyx_t_3;
 
2645
    __pyx_t_3 = 0;
 
2646
 
 
2647
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":281
 
2648
 *         for pos from 0 <= pos < num_lines:
 
2649
 *             annotation = annotations[pos]
 
2650
 *             line = lines[pos]             # <<<<<<<<<<<<<<
 
2651
 *             if len(annotation) == 1:
 
2652
 *                 head = annotation[0]
 
2653
 */
 
2654
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_lines, __pyx_v_pos, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2655
    __Pyx_GOTREF(__pyx_t_3);
 
2656
    __Pyx_DECREF(__pyx_v_line);
 
2657
    __pyx_v_line = __pyx_t_3;
 
2658
    __pyx_t_3 = 0;
 
2659
 
 
2660
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":282
 
2661
 *             annotation = annotations[pos]
 
2662
 *             line = lines[pos]
 
2663
 *             if len(annotation) == 1:             # <<<<<<<<<<<<<<
 
2664
 *                 head = annotation[0]
 
2665
 *             else:
 
2666
 */
 
2667
    __pyx_t_6 = PyObject_Length(__pyx_v_annotation); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2668
    __pyx_t_7 = (__pyx_t_6 == 1);
 
2669
    if (__pyx_t_7) {
 
2670
 
 
2671
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":283
 
2672
 *             line = lines[pos]
 
2673
 *             if len(annotation) == 1:
 
2674
 *                 head = annotation[0]             # <<<<<<<<<<<<<<
 
2675
 *             else:
 
2676
 *                 the_heads = heads(annotation)
 
2677
 */
 
2678
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_annotation, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2679
      __Pyx_GOTREF(__pyx_t_3);
 
2680
      __Pyx_DECREF(__pyx_v_head);
 
2681
      __pyx_v_head = __pyx_t_3;
 
2682
      __pyx_t_3 = 0;
 
2683
      goto __pyx_L8;
1091
2684
    }
1092
2685
    /*else*/ {
1093
2686
 
1094
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":285 */
1095
 
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}
1096
 
      Py_INCREF(__pyx_v_annotation);
1097
 
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_annotation);
1098
 
      __pyx_1 = PyObject_CallObject(__pyx_v_heads, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}
1099
 
      Py_DECREF(__pyx_3); __pyx_3 = 0;
1100
 
      Py_DECREF(__pyx_v_the_heads);
1101
 
      __pyx_v_the_heads = __pyx_1;
1102
 
      __pyx_1 = 0;
1103
 
 
1104
 
      /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":286 */
1105
 
      __pyx_4 = PyObject_Length(__pyx_v_the_heads); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; goto __pyx_L1;}
1106
 
      __pyx_5 = (__pyx_4 == 1);
1107
 
      if (__pyx_5) {
1108
 
        __pyx_2 = PyObject_GetIter(__pyx_v_the_heads); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
 
2687
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":285
 
2688
 *                 head = annotation[0]
 
2689
 *             else:
 
2690
 *                 the_heads = heads(annotation)             # <<<<<<<<<<<<<<
 
2691
 *                 if len(the_heads) == 1:
 
2692
 *                     for head in the_heads: break # get the item out of the set
 
2693
 */
 
2694
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2695
      __Pyx_GOTREF(__pyx_t_3);
 
2696
      __Pyx_INCREF(__pyx_v_annotation);
 
2697
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_annotation);
 
2698
      __Pyx_GIVEREF(__pyx_v_annotation);
 
2699
      __pyx_t_2 = PyObject_Call(__pyx_v_heads, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2700
      __Pyx_GOTREF(__pyx_t_2);
 
2701
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
2702
      __Pyx_DECREF(__pyx_v_the_heads);
 
2703
      __pyx_v_the_heads = __pyx_t_2;
 
2704
      __pyx_t_2 = 0;
 
2705
 
 
2706
      /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":286
 
2707
 *             else:
 
2708
 *                 the_heads = heads(annotation)
 
2709
 *                 if len(the_heads) == 1:             # <<<<<<<<<<<<<<
 
2710
 *                     for head in the_heads: break # get the item out of the set
 
2711
 *                 else:
 
2712
 */
 
2713
      __pyx_t_6 = PyObject_Length(__pyx_v_the_heads); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2714
      __pyx_t_7 = (__pyx_t_6 == 1);
 
2715
      if (__pyx_t_7) {
 
2716
 
 
2717
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":287
 
2718
 *                 the_heads = heads(annotation)
 
2719
 *                 if len(the_heads) == 1:
 
2720
 *                     for head in the_heads: break # get the item out of the set             # <<<<<<<<<<<<<<
 
2721
 *                 else:
 
2722
 *                     # We need to resolve the ambiguity, for now just pick the
 
2723
 */
 
2724
        if (PyList_CheckExact(__pyx_v_the_heads) || PyTuple_CheckExact(__pyx_v_the_heads)) {
 
2725
          __pyx_t_6 = 0; __pyx_t_2 = __pyx_v_the_heads; __Pyx_INCREF(__pyx_t_2);
 
2726
        } else {
 
2727
          __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_the_heads); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2728
          __Pyx_GOTREF(__pyx_t_2);
 
2729
        }
1109
2730
        for (;;) {
1110
 
          __pyx_3 = PyIter_Next(__pyx_2);
1111
 
          if (!__pyx_3) {
1112
 
            if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
1113
 
            break;
 
2731
          if (likely(PyList_CheckExact(__pyx_t_2))) {
 
2732
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
 
2733
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++;
 
2734
          } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
 
2735
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
 
2736
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++;
 
2737
          } else {
 
2738
            __pyx_t_3 = PyIter_Next(__pyx_t_2);
 
2739
            if (!__pyx_t_3) {
 
2740
              if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2741
              break;
 
2742
            }
 
2743
            __Pyx_GOTREF(__pyx_t_3);
1114
2744
          }
1115
 
          Py_DECREF(__pyx_v_head);
1116
 
          __pyx_v_head = __pyx_3;
1117
 
          __pyx_3 = 0;
1118
 
          goto __pyx_L7;
 
2745
          __Pyx_DECREF(__pyx_v_head);
 
2746
          __pyx_v_head = __pyx_t_3;
 
2747
          __pyx_t_3 = 0;
 
2748
          goto __pyx_L11_break;
1119
2749
        }
1120
 
        __pyx_L7:;
1121
 
        Py_DECREF(__pyx_2); __pyx_2 = 0;
1122
 
        goto __pyx_L5;
 
2750
        __pyx_L11_break:;
 
2751
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
2752
        goto __pyx_L9;
1123
2753
      }
1124
2754
      /*else*/ {
1125
 
        __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n__resolve_annotation_tie); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;}
1126
 
        __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;}
1127
 
        Py_INCREF(__pyx_v_the_heads);
1128
 
        PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_the_heads);
1129
 
        Py_INCREF(__pyx_v_line);
1130
 
        PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_line);
1131
 
        Py_INCREF(__pyx_v_custom_tiebreaker);
1132
 
        PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_custom_tiebreaker);
1133
 
        __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;}
1134
 
        Py_DECREF(__pyx_1); __pyx_1 = 0;
1135
 
        Py_DECREF(__pyx_3); __pyx_3 = 0;
1136
 
        Py_DECREF(__pyx_v_head);
1137
 
        __pyx_v_head = __pyx_2;
1138
 
        __pyx_2 = 0;
 
2755
 
 
2756
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":291
 
2757
 *                     # We need to resolve the ambiguity, for now just pick the
 
2758
 *                     # sorted smallest
 
2759
 *                     head = self._resolve_annotation_tie(the_heads, line,             # <<<<<<<<<<<<<<
 
2760
 *                                                         custom_tiebreaker)
 
2761
 *             PyList_Append(out, (head, line))
 
2762
 */
 
2763
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2764
        __Pyx_GOTREF(__pyx_t_2);
 
2765
 
 
2766
        /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":292
 
2767
 *                     # sorted smallest
 
2768
 *                     head = self._resolve_annotation_tie(the_heads, line,
 
2769
 *                                                         custom_tiebreaker)             # <<<<<<<<<<<<<<
 
2770
 *             PyList_Append(out, (head, line))
 
2771
 *         return out
 
2772
 */
 
2773
        __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2774
        __Pyx_GOTREF(__pyx_t_3);
 
2775
        __Pyx_INCREF(__pyx_v_the_heads);
 
2776
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_the_heads);
 
2777
        __Pyx_GIVEREF(__pyx_v_the_heads);
 
2778
        __Pyx_INCREF(__pyx_v_line);
 
2779
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_line);
 
2780
        __Pyx_GIVEREF(__pyx_v_line);
 
2781
        __Pyx_INCREF(__pyx_v_custom_tiebreaker);
 
2782
        PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_custom_tiebreaker);
 
2783
        __Pyx_GIVEREF(__pyx_v_custom_tiebreaker);
 
2784
        __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2785
        __Pyx_GOTREF(__pyx_t_1);
 
2786
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
2787
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
2788
        __Pyx_DECREF(__pyx_v_head);
 
2789
        __pyx_v_head = __pyx_t_1;
 
2790
        __pyx_t_1 = 0;
1139
2791
      }
1140
 
      __pyx_L5:;
 
2792
      __pyx_L9:;
1141
2793
    }
1142
 
    __pyx_L4:;
 
2794
    __pyx_L8:;
1143
2795
 
1144
 
    /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":293 */
1145
 
    __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; goto __pyx_L1;}
1146
 
    Py_INCREF(__pyx_v_head);
1147
 
    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_head);
1148
 
    Py_INCREF(__pyx_v_line);
1149
 
    PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_line);
1150
 
    __pyx_5 = PyList_Append(__pyx_v_out,__pyx_1); if (__pyx_5 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; goto __pyx_L1;}
1151
 
    Py_DECREF(__pyx_1); __pyx_1 = 0;
 
2796
    /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":293
 
2797
 *                     head = self._resolve_annotation_tie(the_heads, line,
 
2798
 *                                                         custom_tiebreaker)
 
2799
 *             PyList_Append(out, (head, line))             # <<<<<<<<<<<<<<
 
2800
 *         return out
 
2801
 */
 
2802
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2803
    __Pyx_GOTREF(__pyx_t_1);
 
2804
    __Pyx_INCREF(__pyx_v_head);
 
2805
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_head);
 
2806
    __Pyx_GIVEREF(__pyx_v_head);
 
2807
    __Pyx_INCREF(__pyx_v_line);
 
2808
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_line);
 
2809
    __Pyx_GIVEREF(__pyx_v_line);
 
2810
    __pyx_t_8 = PyList_Append(((PyObject *)__pyx_v_out), __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2811
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1152
2812
  }
1153
2813
 
1154
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":294 */
1155
 
  Py_INCREF(__pyx_v_out);
1156
 
  __pyx_r = __pyx_v_out;
 
2814
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":294
 
2815
 *                                                         custom_tiebreaker)
 
2816
 *             PyList_Append(out, (head, line))
 
2817
 *         return out             # <<<<<<<<<<<<<<
 
2818
 */
 
2819
  __Pyx_XDECREF(__pyx_r);
 
2820
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
 
2821
  __pyx_r = ((PyObject *)__pyx_v_out);
1157
2822
  goto __pyx_L0;
1158
2823
 
1159
 
  __pyx_r = Py_None; Py_INCREF(Py_None);
 
2824
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1160
2825
  goto __pyx_L0;
1161
 
  __pyx_L1:;
1162
 
  Py_XDECREF(__pyx_1);
1163
 
  Py_XDECREF(__pyx_2);
1164
 
  Py_XDECREF(__pyx_3);
 
2826
  __pyx_L1_error:;
 
2827
  __Pyx_XDECREF(__pyx_t_1);
 
2828
  __Pyx_XDECREF(__pyx_t_2);
 
2829
  __Pyx_XDECREF(__pyx_t_3);
 
2830
  __Pyx_XDECREF(__pyx_t_4);
1165
2831
  __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator.annotate_flat");
1166
 
  __pyx_r = 0;
 
2832
  __pyx_r = NULL;
1167
2833
  __pyx_L0:;
1168
 
  Py_DECREF(__pyx_v_annotate);
1169
 
  Py_DECREF(__pyx_v_custom_tiebreaker);
1170
 
  Py_DECREF(__pyx_v_annotations);
1171
 
  Py_DECREF(__pyx_v_lines);
1172
 
  Py_DECREF(__pyx_v_out);
1173
 
  Py_DECREF(__pyx_v_heads);
1174
 
  Py_DECREF(__pyx_v_annotation);
1175
 
  Py_DECREF(__pyx_v_line);
1176
 
  Py_DECREF(__pyx_v_head);
1177
 
  Py_DECREF(__pyx_v_the_heads);
1178
 
  Py_DECREF(__pyx_v_self);
1179
 
  Py_DECREF(__pyx_v_key);
 
2834
  __Pyx_DECREF(__pyx_v_annotate);
 
2835
  __Pyx_DECREF(__pyx_v_custom_tiebreaker);
 
2836
  __Pyx_DECREF(__pyx_v_annotations);
 
2837
  __Pyx_DECREF(__pyx_v_lines);
 
2838
  __Pyx_DECREF(__pyx_v_out);
 
2839
  __Pyx_DECREF(__pyx_v_heads);
 
2840
  __Pyx_DECREF(__pyx_v_annotation);
 
2841
  __Pyx_DECREF(__pyx_v_line);
 
2842
  __Pyx_DECREF(__pyx_v_head);
 
2843
  __Pyx_DECREF(__pyx_v_the_heads);
 
2844
  __Pyx_XGIVEREF(__pyx_r);
 
2845
  __Pyx_RefNannyFinishContext();
1180
2846
  return __pyx_r;
1181
2847
}
1182
2848
 
1183
 
static struct PyMethodDef __pyx_methods[] = {
 
2849
static PyMethodDef __pyx_methods[] = {
1184
2850
  {0, 0, 0, 0}
1185
2851
};
1186
2852
 
1187
 
static void __pyx_init_filenames(void); /*proto*/
1188
 
 
 
2853
#if PY_MAJOR_VERSION >= 3
 
2854
static struct PyModuleDef __pyx_moduledef = {
 
2855
    PyModuleDef_HEAD_INIT,
 
2856
    __Pyx_NAMESTR("_annotator_pyx"),
 
2857
    __Pyx_DOCSTR(__pyx_k_9), /* m_doc */
 
2858
    -1, /* m_size */
 
2859
    __pyx_methods /* m_methods */,
 
2860
    NULL, /* m_reload */
 
2861
    NULL, /* m_traverse */
 
2862
    NULL, /* m_clear */
 
2863
    NULL /* m_free */
 
2864
};
 
2865
#endif
 
2866
 
 
2867
static __Pyx_StringTabEntry __pyx_string_tab[] = {
 
2868
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
 
2869
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
 
2870
  {&__pyx_n_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 1},
 
2871
  {&__pyx_n_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 1},
 
2872
  {&__pyx_kp_u_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 1, 0, 0},
 
2873
  {&__pyx_kp_u_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 1, 0, 0},
 
2874
  {&__pyx_kp_u_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 1, 0, 0},
 
2875
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
 
2876
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
 
2877
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
 
2878
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
 
2879
  {&__pyx_n_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 1},
 
2880
  {&__pyx_n_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 1},
 
2881
  {&__pyx_n_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 1},
 
2882
  {&__pyx_n_s__Annotator, __pyx_k__Annotator, sizeof(__pyx_k__Annotator), 0, 0, 1, 1},
 
2883
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
 
2884
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
 
2885
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
 
2886
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
 
2887
  {&__pyx_n_s___ann_tuple_cache, __pyx_k___ann_tuple_cache, sizeof(__pyx_k___ann_tuple_cache), 0, 0, 1, 1},
 
2888
  {&__pyx_n_s___annotator_py, __pyx_k___annotator_py, sizeof(__pyx_k___annotator_py), 0, 0, 1, 1},
 
2889
  {&__pyx_n_s___get_heads_provider, __pyx_k___get_heads_provider, sizeof(__pyx_k___get_heads_provider), 0, 0, 1, 1},
 
2890
  {&__pyx_n_s__annotate, __pyx_k__annotate, sizeof(__pyx_k__annotate), 0, 0, 1, 1},
 
2891
  {&__pyx_n_s__annotate_flat, __pyx_k__annotate_flat, sizeof(__pyx_k__annotate_flat), 0, 0, 1, 1},
 
2892
  {&__pyx_n_s__annotations, __pyx_k__annotations, sizeof(__pyx_k__annotations), 0, 0, 1, 1},
 
2893
  {&__pyx_n_s__bzrlib, __pyx_k__bzrlib, sizeof(__pyx_k__bzrlib), 0, 0, 1, 1},
 
2894
  {&__pyx_n_s__heads, __pyx_k__heads, sizeof(__pyx_k__heads), 0, 0, 1, 1},
 
2895
  {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1},
 
2896
  {&__pyx_n_s__lines, __pyx_k__lines, sizeof(__pyx_k__lines), 0, 0, 1, 1},
 
2897
  {&__pyx_n_s__ob_item, __pyx_k__ob_item, sizeof(__pyx_k__ob_item), 0, 0, 1, 1},
 
2898
  {&__pyx_n_s__parent_key, __pyx_k__parent_key, sizeof(__pyx_k__parent_key), 0, 0, 1, 1},
 
2899
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
 
2900
  {&__pyx_n_s__this_annotation, __pyx_k__this_annotation, sizeof(__pyx_k__this_annotation), 0, 0, 1, 1},
 
2901
  {0, 0, 0, 0, 0, 0, 0}
 
2902
};
 
2903
static int __Pyx_InitCachedBuiltins(void) {
 
2904
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2905
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2906
  return 0;
 
2907
  __pyx_L1_error:;
 
2908
  return -1;
 
2909
}
 
2910
 
 
2911
static int __Pyx_InitGlobals(void) {
 
2912
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
2913
  return 0;
 
2914
  __pyx_L1_error:;
 
2915
  return -1;
 
2916
}
 
2917
 
 
2918
#if PY_MAJOR_VERSION < 3
1189
2919
PyMODINIT_FUNC init_annotator_pyx(void); /*proto*/
1190
 
PyMODINIT_FUNC init_annotator_pyx(void) {
1191
 
  PyObject *__pyx_1 = 0;
1192
 
  PyObject *__pyx_2 = 0;
1193
 
  PyObject *__pyx_3 = 0;
1194
 
  PyObject *__pyx_4 = 0;
1195
 
  __pyx_init_filenames();
1196
 
  __pyx_m = Py_InitModule4("_annotator_pyx", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
1197
 
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
 
2920
PyMODINIT_FUNC init_annotator_pyx(void)
 
2921
#else
 
2922
PyMODINIT_FUNC PyInit__annotator_pyx(void); /*proto*/
 
2923
PyMODINIT_FUNC PyInit__annotator_pyx(void)
 
2924
#endif
 
2925
{
 
2926
  PyObject *__pyx_t_1 = NULL;
 
2927
  PyObject *__pyx_t_2 = NULL;
 
2928
  PyObject *__pyx_t_3 = NULL;
 
2929
  PyObject *__pyx_t_4 = NULL;
 
2930
  #if CYTHON_REFNANNY
 
2931
  void* __pyx_refnanny = NULL;
 
2932
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
 
2933
  if (!__Pyx_RefNanny) {
 
2934
      PyErr_Clear();
 
2935
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
 
2936
      if (!__Pyx_RefNanny)
 
2937
          Py_FatalError("failed to import 'refnanny' module");
 
2938
  }
 
2939
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__annotator_pyx(void)", __LINE__, __FILE__);
 
2940
  #endif
 
2941
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2942
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2943
  #ifdef __pyx_binding_PyCFunctionType_USED
 
2944
  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2945
  #endif
 
2946
  /*--- Library function declarations ---*/
 
2947
  /*--- Threads initialization code ---*/
 
2948
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
 
2949
  #ifdef WITH_THREAD /* Python build with threading support? */
 
2950
  PyEval_InitThreads();
 
2951
  #endif
 
2952
  #endif
 
2953
  /*--- Module creation code ---*/
 
2954
  #if PY_MAJOR_VERSION < 3
 
2955
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_annotator_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_9), 0, PYTHON_API_VERSION);
 
2956
  #else
 
2957
  __pyx_m = PyModule_Create(&__pyx_moduledef);
 
2958
  #endif
 
2959
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
2960
  #if PY_MAJOR_VERSION < 3
1198
2961
  Py_INCREF(__pyx_m);
1199
 
  __pyx_b = PyImport_AddModule("__builtin__");
1200
 
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
1201
 
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
1202
 
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
1203
 
 
1204
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":58 */
1205
 
  __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
1206
 
  Py_INCREF(__pyx_n__annotator_py);
1207
 
  PyList_SET_ITEM(__pyx_1, 0, __pyx_n__annotator_py);
1208
 
  __pyx_2 = __Pyx_Import(__pyx_n_bzrlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
1209
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
1210
 
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n__annotator_py); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
1211
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n__annotator_py, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
1212
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
1213
 
  Py_DECREF(__pyx_2); __pyx_2 = 0;
1214
 
 
1215
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":244 */
1216
 
  __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
1217
 
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__annotator_py); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
1218
 
  __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_Annotator); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
1219
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
1220
 
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
1221
 
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
1222
 
  __pyx_3 = 0;
1223
 
  if (PyDict_SetItemString(__pyx_2, "__doc__", __pyx_k16p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
1224
 
  __pyx_3 = __Pyx_CreateClass(__pyx_1, __pyx_2, __pyx_n_Annotator, "bzrlib._annotator_pyx"); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
1225
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
1226
 
 
1227
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":247 */
1228
 
  __pyx_1 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
1229
 
  __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
1230
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
1231
 
  if (PyObject_SetAttr(__pyx_3, __pyx_n__update_from_first_parent, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
1232
 
  Py_DECREF(__pyx_4); __pyx_4 = 0;
1233
 
 
1234
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":256 */
1235
 
  __pyx_1 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;}
1236
 
  __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;}
1237
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
1238
 
  if (PyObject_SetAttr(__pyx_3, __pyx_n__update_from_other_parents, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;}
1239
 
  Py_DECREF(__pyx_4); __pyx_4 = 0;
1240
 
 
1241
 
  /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":265 */
1242
 
  __pyx_1 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;}
1243
 
  __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;}
1244
 
  Py_DECREF(__pyx_1); __pyx_1 = 0;
1245
 
  if (PyObject_SetAttr(__pyx_3, __pyx_n_annotate_flat, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;}
1246
 
  Py_DECREF(__pyx_4); __pyx_4 = 0;
1247
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_Annotator, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
1248
 
  Py_DECREF(__pyx_3); __pyx_3 = 0;
1249
 
  Py_DECREF(__pyx_2); __pyx_2 = 0;
 
2962
  #endif
 
2963
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
 
2964
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
2965
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
2966
  /*--- Initialize various global constants etc. ---*/
 
2967
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2968
  if (__pyx_module_is_main_bzrlib___annotator_pyx) {
 
2969
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
2970
  }
 
2971
  /*--- Builtin init code ---*/
 
2972
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2973
  /*--- Global init code ---*/
 
2974
  /*--- Function export code ---*/
 
2975
  /*--- Type init code ---*/
 
2976
  /*--- Type import code ---*/
 
2977
  /*--- Function import code ---*/
 
2978
  /*--- Execution code ---*/
 
2979
 
 
2980
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":58
 
2981
 * 
 
2982
 * 
 
2983
 * from bzrlib import _annotator_py             # <<<<<<<<<<<<<<
 
2984
 * 
 
2985
 * 
 
2986
 */
 
2987
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2988
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
2989
  __Pyx_INCREF(((PyObject *)__pyx_n_s___annotator_py));
 
2990
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s___annotator_py));
 
2991
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___annotator_py));
 
2992
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__bzrlib), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2993
  __Pyx_GOTREF(__pyx_t_2);
 
2994
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
2995
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___annotator_py); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2996
  __Pyx_GOTREF(__pyx_t_1);
 
2997
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___annotator_py, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2998
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
2999
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
3000
 
 
3001
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":244
 
3002
 * 
 
3003
 * 
 
3004
 * class Annotator(_annotator_py.Annotator):             # <<<<<<<<<<<<<<
 
3005
 *     """Class that drives performing annotations."""
 
3006
 * 
 
3007
 */
 
3008
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3009
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
 
3010
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___annotator_py); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3011
  __Pyx_GOTREF(__pyx_t_1);
 
3012
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__Annotator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3013
  __Pyx_GOTREF(__pyx_t_3);
 
3014
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
3015
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3016
  __Pyx_GOTREF(__pyx_t_1);
 
3017
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
 
3018
  __Pyx_GIVEREF(__pyx_t_3);
 
3019
  __pyx_t_3 = 0;
 
3020
  if (PyDict_SetItemString(((PyObject *)__pyx_t_2), "__doc__", ((PyObject *)__pyx_kp_s_10)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3021
  __pyx_t_3 = __Pyx_CreateClass(__pyx_t_1, ((PyObject *)__pyx_t_2), __pyx_n_s__Annotator, "bzrlib._annotator_pyx"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3022
  __Pyx_GOTREF(__pyx_t_3);
 
3023
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
3024
 
 
3025
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":247
 
3026
 *     """Class that drives performing annotations."""
 
3027
 * 
 
3028
 *     def _update_from_first_parent(self, key, annotations, lines, parent_key):             # <<<<<<<<<<<<<<
 
3029
 *         """Reannotate this text relative to its first parent."""
 
3030
 *         (parent_annotations,
 
3031
 */
 
3032
  __pyx_t_1 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3033
  __Pyx_GOTREF(__pyx_t_1);
 
3034
  __pyx_t_4 = PyMethod_New(__pyx_t_1, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3035
  __Pyx_GOTREF(__pyx_t_4);
 
3036
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
3037
  if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s_11, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3038
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
3039
 
 
3040
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":256
 
3041
 *                                   matching_blocks)
 
3042
 * 
 
3043
 *     def _update_from_other_parents(self, key, annotations, lines,             # <<<<<<<<<<<<<<
 
3044
 *                                    this_annotation, parent_key):
 
3045
 *         """Reannotate this text relative to a second (or more) parent."""
 
3046
 */
 
3047
  __pyx_t_4 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3048
  __Pyx_GOTREF(__pyx_t_4);
 
3049
  __pyx_t_1 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3050
  __Pyx_GOTREF(__pyx_t_1);
 
3051
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
3052
  if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s_12, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3053
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
3054
 
 
3055
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":265
 
3056
 *                            matching_blocks, self._ann_tuple_cache)
 
3057
 * 
 
3058
 *     def annotate_flat(self, key):             # <<<<<<<<<<<<<<
 
3059
 *         """Determine the single-best-revision to source for each line.
 
3060
 * 
 
3061
 */
 
3062
  __pyx_t_1 = PyCFunction_New(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3063
  __Pyx_GOTREF(__pyx_t_1);
 
3064
  __pyx_t_4 = PyMethod_New(__pyx_t_1, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3065
  __Pyx_GOTREF(__pyx_t_4);
 
3066
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
3067
  if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__annotate_flat, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3068
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
3069
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Annotator, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3070
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
3071
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 
3072
 
 
3073
  /* "/home/vila/src/bzr/integration/2.4.0-dev/bzrlib/_annotator_pyx.pyx":1
 
3074
 * # Copyright (C) 2009, 2010 Canonical Ltd             # <<<<<<<<<<<<<<
 
3075
 * #
 
3076
 * # This program is free software; you can redistribute it and/or modify
 
3077
 */
 
3078
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3079
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
 
3080
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Annotator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3081
  __Pyx_GOTREF(__pyx_t_3);
 
3082
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3083
  __Pyx_GOTREF(__pyx_t_4);
 
3084
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
3085
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3086
  __Pyx_GOTREF(__pyx_t_3);
 
3087
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
3088
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_13), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3089
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
3090
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Annotator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3091
  __Pyx_GOTREF(__pyx_t_3);
 
3092
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s_12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3093
  __Pyx_GOTREF(__pyx_t_4);
 
3094
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
3095
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3096
  __Pyx_GOTREF(__pyx_t_3);
 
3097
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
3098
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_14), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3099
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
3100
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Annotator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3101
  __Pyx_GOTREF(__pyx_t_3);
 
3102
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__annotate_flat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3103
  __Pyx_GOTREF(__pyx_t_4);
 
3104
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
3105
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3106
  __Pyx_GOTREF(__pyx_t_3);
 
3107
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
3108
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_15), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3109
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
3110
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3111
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 
3112
  goto __pyx_L0;
 
3113
  __pyx_L1_error:;
 
3114
  __Pyx_XDECREF(__pyx_t_1);
 
3115
  __Pyx_XDECREF(__pyx_t_2);
 
3116
  __Pyx_XDECREF(__pyx_t_3);
 
3117
  __Pyx_XDECREF(__pyx_t_4);
 
3118
  if (__pyx_m) {
 
3119
    __Pyx_AddTraceback("init bzrlib._annotator_pyx");
 
3120
    Py_DECREF(__pyx_m); __pyx_m = 0;
 
3121
  } else if (!PyErr_Occurred()) {
 
3122
    PyErr_SetString(PyExc_ImportError, "init bzrlib._annotator_pyx");
 
3123
  }
 
3124
  __pyx_L0:;
 
3125
  __Pyx_RefNannyFinishContext();
 
3126
  #if PY_MAJOR_VERSION < 3
1250
3127
  return;
1251
 
  __pyx_L1:;
1252
 
  Py_XDECREF(__pyx_1);
1253
 
  Py_XDECREF(__pyx_2);
1254
 
  Py_XDECREF(__pyx_3);
1255
 
  Py_XDECREF(__pyx_4);
1256
 
  __Pyx_AddTraceback("bzrlib._annotator_pyx");
 
3128
  #else
 
3129
  return __pyx_m;
 
3130
  #endif
1257
3131
}
1258
3132
 
1259
 
static char *__pyx_filenames[] = {
1260
 
  "_annotator_pyx.pyx",
1261
 
};
1262
 
 
1263
3133
/* Runtime support code */
1264
3134
 
1265
 
static void __pyx_init_filenames(void) {
1266
 
  __pyx_f = __pyx_filenames;
1267
 
}
1268
 
 
1269
 
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
1270
 
    Py_XINCREF(type);
1271
 
    Py_XINCREF(value);
1272
 
    Py_XINCREF(tb);
1273
 
    /* First, check the traceback argument, replacing None with NULL. */
1274
 
    if (tb == Py_None) {
1275
 
        Py_DECREF(tb);
1276
 
        tb = 0;
1277
 
    }
1278
 
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
1279
 
        PyErr_SetString(PyExc_TypeError,
1280
 
            "raise: arg 3 must be a traceback or None");
1281
 
        goto raise_error;
1282
 
    }
1283
 
    /* Next, replace a missing value with None */
1284
 
    if (value == NULL) {
1285
 
        value = Py_None;
1286
 
        Py_INCREF(value);
1287
 
    }
1288
 
    #if PY_VERSION_HEX < 0x02050000
1289
 
    if (!PyClass_Check(type))
1290
 
    #else
1291
 
    if (!PyType_Check(type))
1292
 
    #endif
1293
 
    {
1294
 
        /* Raising an instance.  The value should be a dummy. */
1295
 
        if (value != Py_None) {
1296
 
            PyErr_SetString(PyExc_TypeError,
1297
 
                "instance exception may not have a separate value");
1298
 
            goto raise_error;
1299
 
        }
1300
 
        /* Normalize to raise <class>, <instance> */
1301
 
        Py_DECREF(value);
1302
 
        value = type;
1303
 
        #if PY_VERSION_HEX < 0x02050000
1304
 
            if (PyInstance_Check(type)) {
1305
 
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
1306
 
                Py_INCREF(type);
1307
 
            }
1308
 
            else {
1309
 
                PyErr_SetString(PyExc_TypeError,
1310
 
                    "raise: exception must be an old-style class or instance");
1311
 
                goto raise_error;
1312
 
            }
1313
 
        #else
1314
 
            type = (PyObject*) type->ob_type;
1315
 
            Py_INCREF(type);
1316
 
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
1317
 
                PyErr_SetString(PyExc_TypeError,
1318
 
                    "raise: exception class must be a subclass of BaseException");
1319
 
                goto raise_error;
1320
 
            }
1321
 
        #endif
1322
 
    }
1323
 
    PyErr_Restore(type, value, tb);
1324
 
    return;
1325
 
raise_error:
1326
 
    Py_XDECREF(value);
1327
 
    Py_XDECREF(type);
1328
 
    Py_XDECREF(tb);
1329
 
    return;
1330
 
}
1331
 
 
1332
 
static void __Pyx_UnpackError(void) {
1333
 
    PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size");
1334
 
}
1335
 
 
1336
 
static PyObject *__Pyx_UnpackItem(PyObject *iter) {
 
3135
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
 
3136
    PyObject *result;
 
3137
    result = PyObject_GetAttr(dict, name);
 
3138
    if (!result)
 
3139
        PyErr_SetObject(PyExc_NameError, name);
 
3140
    return result;
 
3141
}
 
3142
 
 
3143
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
 
3144
    PyErr_Format(PyExc_ValueError,
 
3145
        #if PY_VERSION_HEX < 0x02050000
 
3146
                 "need more than %d value%s to unpack", (int)index,
 
3147
        #else
 
3148
                 "need more than %zd value%s to unpack", index,
 
3149
        #endif
 
3150
                 (index == 1) ? "" : "s");
 
3151
}
 
3152
 
 
3153
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
 
3154
    PyErr_Format(PyExc_ValueError,
 
3155
        #if PY_VERSION_HEX < 0x02050000
 
3156
            "too many values to unpack (expected %d)", (int)expected);
 
3157
        #else
 
3158
            "too many values to unpack (expected %zd)", expected);
 
3159
        #endif
 
3160
}
 
3161
 
 
3162
static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
1337
3163
    PyObject *item;
1338
3164
    if (!(item = PyIter_Next(iter))) {
1339
 
        if (!PyErr_Occurred())
1340
 
            __Pyx_UnpackError();
 
3165
        if (!PyErr_Occurred()) {
 
3166
            __Pyx_RaiseNeedMoreValuesError(index);
 
3167
        }
1341
3168
    }
1342
3169
    return item;
1343
3170
}
1344
3171
 
1345
 
static int __Pyx_EndUnpack(PyObject *iter) {
 
3172
static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) {
1346
3173
    PyObject *item;
1347
3174
    if ((item = PyIter_Next(iter))) {
1348
3175
        Py_DECREF(item);
1349
 
        __Pyx_UnpackError();
 
3176
        __Pyx_RaiseTooManyValuesError(expected);
1350
3177
        return -1;
1351
3178
    }
1352
3179
    else if (!PyErr_Occurred())
1355
3182
        return -1;
1356
3183
}
1357
3184
 
 
3185
static void __Pyx_RaiseDoubleKeywordsError(
 
3186
    const char* func_name,
 
3187
    PyObject* kw_name)
 
3188
{
 
3189
    PyErr_Format(PyExc_TypeError,
 
3190
        #if PY_MAJOR_VERSION >= 3
 
3191
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
 
3192
        #else
 
3193
        "%s() got multiple values for keyword argument '%s'", func_name,
 
3194
        PyString_AS_STRING(kw_name));
 
3195
        #endif
 
3196
}
 
3197
 
 
3198
static void __Pyx_RaiseArgtupleInvalid(
 
3199
    const char* func_name,
 
3200
    int exact,
 
3201
    Py_ssize_t num_min,
 
3202
    Py_ssize_t num_max,
 
3203
    Py_ssize_t num_found)
 
3204
{
 
3205
    Py_ssize_t num_expected;
 
3206
    const char *number, *more_or_less;
 
3207
 
 
3208
    if (num_found < num_min) {
 
3209
        num_expected = num_min;
 
3210
        more_or_less = "at least";
 
3211
    } else {
 
3212
        num_expected = num_max;
 
3213
        more_or_less = "at most";
 
3214
    }
 
3215
    if (exact) {
 
3216
        more_or_less = "exactly";
 
3217
    }
 
3218
    number = (num_expected == 1) ? "" : "s";
 
3219
    PyErr_Format(PyExc_TypeError,
 
3220
        #if PY_VERSION_HEX < 0x02050000
 
3221
            "%s() takes %s %d positional argument%s (%d given)",
 
3222
        #else
 
3223
            "%s() takes %s %zd positional argument%s (%zd given)",
 
3224
        #endif
 
3225
        func_name, more_or_less, num_expected, number, num_found);
 
3226
}
 
3227
 
 
3228
static int __Pyx_ParseOptionalKeywords(
 
3229
    PyObject *kwds,
 
3230
    PyObject **argnames[],
 
3231
    PyObject *kwds2,
 
3232
    PyObject *values[],
 
3233
    Py_ssize_t num_pos_args,
 
3234
    const char* function_name)
 
3235
{
 
3236
    PyObject *key = 0, *value = 0;
 
3237
    Py_ssize_t pos = 0;
 
3238
    PyObject*** name;
 
3239
    PyObject*** first_kw_arg = argnames + num_pos_args;
 
3240
 
 
3241
    while (PyDict_Next(kwds, &pos, &key, &value)) {
 
3242
        name = first_kw_arg;
 
3243
        while (*name && (**name != key)) name++;
 
3244
        if (*name) {
 
3245
            values[name-argnames] = value;
 
3246
        } else {
 
3247
            #if PY_MAJOR_VERSION < 3
 
3248
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
 
3249
            #else
 
3250
            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
 
3251
            #endif
 
3252
                goto invalid_keyword_type;
 
3253
            } else {
 
3254
                for (name = first_kw_arg; *name; name++) {
 
3255
                    #if PY_MAJOR_VERSION >= 3
 
3256
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
 
3257
                        PyUnicode_Compare(**name, key) == 0) break;
 
3258
                    #else
 
3259
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
 
3260
                        _PyString_Eq(**name, key)) break;
 
3261
                    #endif
 
3262
                }
 
3263
                if (*name) {
 
3264
                    values[name-argnames] = value;
 
3265
                } else {
 
3266
                    /* unexpected keyword found */
 
3267
                    for (name=argnames; name != first_kw_arg; name++) {
 
3268
                        if (**name == key) goto arg_passed_twice;
 
3269
                        #if PY_MAJOR_VERSION >= 3
 
3270
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
 
3271
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
 
3272
                        #else
 
3273
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
 
3274
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
 
3275
                        #endif
 
3276
                    }
 
3277
                    if (kwds2) {
 
3278
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
 
3279
                    } else {
 
3280
                        goto invalid_keyword;
 
3281
                    }
 
3282
                }
 
3283
            }
 
3284
        }
 
3285
    }
 
3286
    return 0;
 
3287
arg_passed_twice:
 
3288
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
 
3289
    goto bad;
 
3290
invalid_keyword_type:
 
3291
    PyErr_Format(PyExc_TypeError,
 
3292
        "%s() keywords must be strings", function_name);
 
3293
    goto bad;
 
3294
invalid_keyword:
 
3295
    PyErr_Format(PyExc_TypeError,
 
3296
    #if PY_MAJOR_VERSION < 3
 
3297
        "%s() got an unexpected keyword argument '%s'",
 
3298
        function_name, PyString_AsString(key));
 
3299
    #else
 
3300
        "%s() got an unexpected keyword argument '%U'",
 
3301
        function_name, key);
 
3302
    #endif
 
3303
bad:
 
3304
    return -1;
 
3305
}
 
3306
 
 
3307
 
1358
3308
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
1359
 
    PyObject *__import__ = 0;
 
3309
    PyObject *py_import = 0;
1360
3310
    PyObject *empty_list = 0;
1361
3311
    PyObject *module = 0;
1362
3312
    PyObject *global_dict = 0;
1363
3313
    PyObject *empty_dict = 0;
1364
3314
    PyObject *list;
1365
 
    __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
1366
 
    if (!__import__)
 
3315
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
 
3316
    if (!py_import)
1367
3317
        goto bad;
1368
3318
    if (from_list)
1369
3319
        list = from_list;
1379
3329
    empty_dict = PyDict_New();
1380
3330
    if (!empty_dict)
1381
3331
        goto bad;
1382
 
    module = PyObject_CallFunction(__import__, "OOOO",
1383
 
        name, global_dict, empty_dict, list);
 
3332
    module = PyObject_CallFunctionObjArgs(py_import,
 
3333
        name, global_dict, empty_dict, list, NULL);
1384
3334
bad:
1385
3335
    Py_XDECREF(empty_list);
1386
 
    Py_XDECREF(__import__);
 
3336
    Py_XDECREF(py_import);
1387
3337
    Py_XDECREF(empty_dict);
1388
3338
    return module;
1389
3339
}
1390
3340
 
1391
 
static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i) {
1392
 
    PyTypeObject *t = o->ob_type;
1393
 
    PyObject *r;
1394
 
    if (t->tp_as_sequence && t->tp_as_sequence->sq_item)
1395
 
        r = PySequence_GetItem(o, i);
1396
 
    else {
1397
 
        PyObject *j = PyInt_FromLong(i);
1398
 
        if (!j)
1399
 
            return 0;
1400
 
        r = PyObject_GetItem(o, j);
1401
 
        Py_DECREF(j);
1402
 
    }
1403
 
    return r;
1404
 
}
1405
 
 
1406
 
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1407
 
    while (t->p) {
1408
 
        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
1409
 
        if (!*t->p)
1410
 
            return -1;
1411
 
        if (t->i)
1412
 
            PyString_InternInPlace(t->p);
1413
 
        ++t;
1414
 
    }
1415
 
    return 0;
1416
 
}
1417
 
 
1418
 
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
1419
 
    PyObject *result;
1420
 
    result = PyObject_GetAttr(dict, name);
1421
 
    if (!result)
1422
 
        PyErr_SetObject(PyExc_NameError, name);
1423
 
    return result;
1424
 
}
1425
 
 
1426
3341
static PyObject *__Pyx_CreateClass(
1427
 
    PyObject *bases, PyObject *dict, PyObject *name, char *modname)
 
3342
    PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
1428
3343
{
1429
3344
    PyObject *py_modname;
1430
3345
    PyObject *result = 0;
1431
 
    
 
3346
 
 
3347
    #if PY_MAJOR_VERSION < 3
1432
3348
    py_modname = PyString_FromString(modname);
 
3349
    #else
 
3350
    py_modname = PyUnicode_FromString(modname);
 
3351
    #endif
1433
3352
    if (!py_modname)
1434
3353
        goto bad;
1435
3354
    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
1436
3355
        goto bad;
 
3356
    #if PY_MAJOR_VERSION < 3
1437
3357
    result = PyClass_New(bases, dict, name);
 
3358
    #else
 
3359
    result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL);
 
3360
    #endif
1438
3361
bad:
1439
3362
    Py_XDECREF(py_modname);
1440
3363
    return result;
1441
3364
}
1442
3365
 
 
3366
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
 
3367
    PyObject *tmp_type, *tmp_value, *tmp_tb;
 
3368
    PyThreadState *tstate = PyThreadState_GET();
 
3369
 
 
3370
    tmp_type = tstate->curexc_type;
 
3371
    tmp_value = tstate->curexc_value;
 
3372
    tmp_tb = tstate->curexc_traceback;
 
3373
    tstate->curexc_type = type;
 
3374
    tstate->curexc_value = value;
 
3375
    tstate->curexc_traceback = tb;
 
3376
    Py_XDECREF(tmp_type);
 
3377
    Py_XDECREF(tmp_value);
 
3378
    Py_XDECREF(tmp_tb);
 
3379
}
 
3380
 
 
3381
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
 
3382
    PyThreadState *tstate = PyThreadState_GET();
 
3383
    *type = tstate->curexc_type;
 
3384
    *value = tstate->curexc_value;
 
3385
    *tb = tstate->curexc_traceback;
 
3386
 
 
3387
    tstate->curexc_type = 0;
 
3388
    tstate->curexc_value = 0;
 
3389
    tstate->curexc_traceback = 0;
 
3390
}
 
3391
 
 
3392
 
 
3393
#if PY_MAJOR_VERSION < 3
 
3394
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
 
3395
    Py_XINCREF(type);
 
3396
    Py_XINCREF(value);
 
3397
    Py_XINCREF(tb);
 
3398
    /* First, check the traceback argument, replacing None with NULL. */
 
3399
    if (tb == Py_None) {
 
3400
        Py_DECREF(tb);
 
3401
        tb = 0;
 
3402
    }
 
3403
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
 
3404
        PyErr_SetString(PyExc_TypeError,
 
3405
            "raise: arg 3 must be a traceback or None");
 
3406
        goto raise_error;
 
3407
    }
 
3408
    /* Next, replace a missing value with None */
 
3409
    if (value == NULL) {
 
3410
        value = Py_None;
 
3411
        Py_INCREF(value);
 
3412
    }
 
3413
    #if PY_VERSION_HEX < 0x02050000
 
3414
    if (!PyClass_Check(type))
 
3415
    #else
 
3416
    if (!PyType_Check(type))
 
3417
    #endif
 
3418
    {
 
3419
        /* Raising an instance.  The value should be a dummy. */
 
3420
        if (value != Py_None) {
 
3421
            PyErr_SetString(PyExc_TypeError,
 
3422
                "instance exception may not have a separate value");
 
3423
            goto raise_error;
 
3424
        }
 
3425
        /* Normalize to raise <class>, <instance> */
 
3426
        Py_DECREF(value);
 
3427
        value = type;
 
3428
        #if PY_VERSION_HEX < 0x02050000
 
3429
            if (PyInstance_Check(type)) {
 
3430
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
 
3431
                Py_INCREF(type);
 
3432
            }
 
3433
            else {
 
3434
                type = 0;
 
3435
                PyErr_SetString(PyExc_TypeError,
 
3436
                    "raise: exception must be an old-style class or instance");
 
3437
                goto raise_error;
 
3438
            }
 
3439
        #else
 
3440
            type = (PyObject*) Py_TYPE(type);
 
3441
            Py_INCREF(type);
 
3442
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
 
3443
                PyErr_SetString(PyExc_TypeError,
 
3444
                    "raise: exception class must be a subclass of BaseException");
 
3445
                goto raise_error;
 
3446
            }
 
3447
        #endif
 
3448
    }
 
3449
 
 
3450
    __Pyx_ErrRestore(type, value, tb);
 
3451
    return;
 
3452
raise_error:
 
3453
    Py_XDECREF(value);
 
3454
    Py_XDECREF(type);
 
3455
    Py_XDECREF(tb);
 
3456
    return;
 
3457
}
 
3458
 
 
3459
#else /* Python 3+ */
 
3460
 
 
3461
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
 
3462
    if (tb == Py_None) {
 
3463
        tb = 0;
 
3464
    } else if (tb && !PyTraceBack_Check(tb)) {
 
3465
        PyErr_SetString(PyExc_TypeError,
 
3466
            "raise: arg 3 must be a traceback or None");
 
3467
        goto bad;
 
3468
    }
 
3469
    if (value == Py_None)
 
3470
        value = 0;
 
3471
 
 
3472
    if (PyExceptionInstance_Check(type)) {
 
3473
        if (value) {
 
3474
            PyErr_SetString(PyExc_TypeError,
 
3475
                "instance exception may not have a separate value");
 
3476
            goto bad;
 
3477
        }
 
3478
        value = type;
 
3479
        type = (PyObject*) Py_TYPE(value);
 
3480
    } else if (!PyExceptionClass_Check(type)) {
 
3481
        PyErr_SetString(PyExc_TypeError,
 
3482
            "raise: exception class must be a subclass of BaseException");
 
3483
        goto bad;
 
3484
    }
 
3485
 
 
3486
    PyErr_SetObject(type, value);
 
3487
 
 
3488
    if (tb) {
 
3489
        PyThreadState *tstate = PyThreadState_GET();
 
3490
        PyObject* tmp_tb = tstate->curexc_traceback;
 
3491
        if (tb != tmp_tb) {
 
3492
            Py_INCREF(tb);
 
3493
            tstate->curexc_traceback = tb;
 
3494
            Py_XDECREF(tmp_tb);
 
3495
        }
 
3496
    }
 
3497
 
 
3498
bad:
 
3499
    return;
 
3500
}
 
3501
#endif
 
3502
 
 
3503
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
 
3504
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
 
3505
    const int is_unsigned = neg_one > const_zero;
 
3506
    if (sizeof(unsigned char) < sizeof(long)) {
 
3507
        long val = __Pyx_PyInt_AsLong(x);
 
3508
        if (unlikely(val != (long)(unsigned char)val)) {
 
3509
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
3510
                PyErr_SetString(PyExc_OverflowError,
 
3511
                    (is_unsigned && unlikely(val < 0)) ?
 
3512
                    "can't convert negative value to unsigned char" :
 
3513
                    "value too large to convert to unsigned char");
 
3514
            }
 
3515
            return (unsigned char)-1;
 
3516
        }
 
3517
        return (unsigned char)val;
 
3518
    }
 
3519
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
 
3520
}
 
3521
 
 
3522
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
 
3523
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
 
3524
    const int is_unsigned = neg_one > const_zero;
 
3525
    if (sizeof(unsigned short) < sizeof(long)) {
 
3526
        long val = __Pyx_PyInt_AsLong(x);
 
3527
        if (unlikely(val != (long)(unsigned short)val)) {
 
3528
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
3529
                PyErr_SetString(PyExc_OverflowError,
 
3530
                    (is_unsigned && unlikely(val < 0)) ?
 
3531
                    "can't convert negative value to unsigned short" :
 
3532
                    "value too large to convert to unsigned short");
 
3533
            }
 
3534
            return (unsigned short)-1;
 
3535
        }
 
3536
        return (unsigned short)val;
 
3537
    }
 
3538
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
 
3539
}
 
3540
 
 
3541
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
 
3542
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
 
3543
    const int is_unsigned = neg_one > const_zero;
 
3544
    if (sizeof(unsigned int) < sizeof(long)) {
 
3545
        long val = __Pyx_PyInt_AsLong(x);
 
3546
        if (unlikely(val != (long)(unsigned int)val)) {
 
3547
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
3548
                PyErr_SetString(PyExc_OverflowError,
 
3549
                    (is_unsigned && unlikely(val < 0)) ?
 
3550
                    "can't convert negative value to unsigned int" :
 
3551
                    "value too large to convert to unsigned int");
 
3552
            }
 
3553
            return (unsigned int)-1;
 
3554
        }
 
3555
        return (unsigned int)val;
 
3556
    }
 
3557
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
 
3558
}
 
3559
 
 
3560
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
 
3561
    const char neg_one = (char)-1, const_zero = 0;
 
3562
    const int is_unsigned = neg_one > const_zero;
 
3563
    if (sizeof(char) < sizeof(long)) {
 
3564
        long val = __Pyx_PyInt_AsLong(x);
 
3565
        if (unlikely(val != (long)(char)val)) {
 
3566
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
3567
                PyErr_SetString(PyExc_OverflowError,
 
3568
                    (is_unsigned && unlikely(val < 0)) ?
 
3569
                    "can't convert negative value to char" :
 
3570
                    "value too large to convert to char");
 
3571
            }
 
3572
            return (char)-1;
 
3573
        }
 
3574
        return (char)val;
 
3575
    }
 
3576
    return (char)__Pyx_PyInt_AsLong(x);
 
3577
}
 
3578
 
 
3579
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
 
3580
    const short neg_one = (short)-1, const_zero = 0;
 
3581
    const int is_unsigned = neg_one > const_zero;
 
3582
    if (sizeof(short) < sizeof(long)) {
 
3583
        long val = __Pyx_PyInt_AsLong(x);
 
3584
        if (unlikely(val != (long)(short)val)) {
 
3585
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
3586
                PyErr_SetString(PyExc_OverflowError,
 
3587
                    (is_unsigned && unlikely(val < 0)) ?
 
3588
                    "can't convert negative value to short" :
 
3589
                    "value too large to convert to short");
 
3590
            }
 
3591
            return (short)-1;
 
3592
        }
 
3593
        return (short)val;
 
3594
    }
 
3595
    return (short)__Pyx_PyInt_AsLong(x);
 
3596
}
 
3597
 
 
3598
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
 
3599
    const int neg_one = (int)-1, const_zero = 0;
 
3600
    const int is_unsigned = neg_one > const_zero;
 
3601
    if (sizeof(int) < sizeof(long)) {
 
3602
        long val = __Pyx_PyInt_AsLong(x);
 
3603
        if (unlikely(val != (long)(int)val)) {
 
3604
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
3605
                PyErr_SetString(PyExc_OverflowError,
 
3606
                    (is_unsigned && unlikely(val < 0)) ?
 
3607
                    "can't convert negative value to int" :
 
3608
                    "value too large to convert to int");
 
3609
            }
 
3610
            return (int)-1;
 
3611
        }
 
3612
        return (int)val;
 
3613
    }
 
3614
    return (int)__Pyx_PyInt_AsLong(x);
 
3615
}
 
3616
 
 
3617
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
 
3618
    const signed char neg_one = (signed char)-1, const_zero = 0;
 
3619
    const int is_unsigned = neg_one > const_zero;
 
3620
    if (sizeof(signed char) < sizeof(long)) {
 
3621
        long val = __Pyx_PyInt_AsLong(x);
 
3622
        if (unlikely(val != (long)(signed char)val)) {
 
3623
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
3624
                PyErr_SetString(PyExc_OverflowError,
 
3625
                    (is_unsigned && unlikely(val < 0)) ?
 
3626
                    "can't convert negative value to signed char" :
 
3627
                    "value too large to convert to signed char");
 
3628
            }
 
3629
            return (signed char)-1;
 
3630
        }
 
3631
        return (signed char)val;
 
3632
    }
 
3633
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
 
3634
}
 
3635
 
 
3636
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
 
3637
    const signed short neg_one = (signed short)-1, const_zero = 0;
 
3638
    const int is_unsigned = neg_one > const_zero;
 
3639
    if (sizeof(signed short) < sizeof(long)) {
 
3640
        long val = __Pyx_PyInt_AsLong(x);
 
3641
        if (unlikely(val != (long)(signed short)val)) {
 
3642
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
3643
                PyErr_SetString(PyExc_OverflowError,
 
3644
                    (is_unsigned && unlikely(val < 0)) ?
 
3645
                    "can't convert negative value to signed short" :
 
3646
                    "value too large to convert to signed short");
 
3647
            }
 
3648
            return (signed short)-1;
 
3649
        }
 
3650
        return (signed short)val;
 
3651
    }
 
3652
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
 
3653
}
 
3654
 
 
3655
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
 
3656
    const signed int neg_one = (signed int)-1, const_zero = 0;
 
3657
    const int is_unsigned = neg_one > const_zero;
 
3658
    if (sizeof(signed int) < sizeof(long)) {
 
3659
        long val = __Pyx_PyInt_AsLong(x);
 
3660
        if (unlikely(val != (long)(signed int)val)) {
 
3661
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
3662
                PyErr_SetString(PyExc_OverflowError,
 
3663
                    (is_unsigned && unlikely(val < 0)) ?
 
3664
                    "can't convert negative value to signed int" :
 
3665
                    "value too large to convert to signed int");
 
3666
            }
 
3667
            return (signed int)-1;
 
3668
        }
 
3669
        return (signed int)val;
 
3670
    }
 
3671
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
 
3672
}
 
3673
 
 
3674
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
 
3675
    const int neg_one = (int)-1, const_zero = 0;
 
3676
    const int is_unsigned = neg_one > const_zero;
 
3677
    if (sizeof(int) < sizeof(long)) {
 
3678
        long val = __Pyx_PyInt_AsLong(x);
 
3679
        if (unlikely(val != (long)(int)val)) {
 
3680
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
3681
                PyErr_SetString(PyExc_OverflowError,
 
3682
                    (is_unsigned && unlikely(val < 0)) ?
 
3683
                    "can't convert negative value to int" :
 
3684
                    "value too large to convert to int");
 
3685
            }
 
3686
            return (int)-1;
 
3687
        }
 
3688
        return (int)val;
 
3689
    }
 
3690
    return (int)__Pyx_PyInt_AsLong(x);
 
3691
}
 
3692
 
 
3693
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
 
3694
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
 
3695
    const int is_unsigned = neg_one > const_zero;
 
3696
#if PY_VERSION_HEX < 0x03000000
 
3697
    if (likely(PyInt_Check(x))) {
 
3698
        long val = PyInt_AS_LONG(x);
 
3699
        if (is_unsigned && unlikely(val < 0)) {
 
3700
            PyErr_SetString(PyExc_OverflowError,
 
3701
                            "can't convert negative value to unsigned long");
 
3702
            return (unsigned long)-1;
 
3703
        }
 
3704
        return (unsigned long)val;
 
3705
    } else
 
3706
#endif
 
3707
    if (likely(PyLong_Check(x))) {
 
3708
        if (is_unsigned) {
 
3709
            if (unlikely(Py_SIZE(x) < 0)) {
 
3710
                PyErr_SetString(PyExc_OverflowError,
 
3711
                                "can't convert negative value to unsigned long");
 
3712
                return (unsigned long)-1;
 
3713
            }
 
3714
            return PyLong_AsUnsignedLong(x);
 
3715
        } else {
 
3716
            return PyLong_AsLong(x);
 
3717
        }
 
3718
    } else {
 
3719
        unsigned long val;
 
3720
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
3721
        if (!tmp) return (unsigned long)-1;
 
3722
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
 
3723
        Py_DECREF(tmp);
 
3724
        return val;
 
3725
    }
 
3726
}
 
3727
 
 
3728
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
 
3729
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
 
3730
    const int is_unsigned = neg_one > const_zero;
 
3731
#if PY_VERSION_HEX < 0x03000000
 
3732
    if (likely(PyInt_Check(x))) {
 
3733
        long val = PyInt_AS_LONG(x);
 
3734
        if (is_unsigned && unlikely(val < 0)) {
 
3735
            PyErr_SetString(PyExc_OverflowError,
 
3736
                            "can't convert negative value to unsigned PY_LONG_LONG");
 
3737
            return (unsigned PY_LONG_LONG)-1;
 
3738
        }
 
3739
        return (unsigned PY_LONG_LONG)val;
 
3740
    } else
 
3741
#endif
 
3742
    if (likely(PyLong_Check(x))) {
 
3743
        if (is_unsigned) {
 
3744
            if (unlikely(Py_SIZE(x) < 0)) {
 
3745
                PyErr_SetString(PyExc_OverflowError,
 
3746
                                "can't convert negative value to unsigned PY_LONG_LONG");
 
3747
                return (unsigned PY_LONG_LONG)-1;
 
3748
            }
 
3749
            return PyLong_AsUnsignedLongLong(x);
 
3750
        } else {
 
3751
            return PyLong_AsLongLong(x);
 
3752
        }
 
3753
    } else {
 
3754
        unsigned PY_LONG_LONG val;
 
3755
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
3756
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
 
3757
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
 
3758
        Py_DECREF(tmp);
 
3759
        return val;
 
3760
    }
 
3761
}
 
3762
 
 
3763
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
 
3764
    const long neg_one = (long)-1, const_zero = 0;
 
3765
    const int is_unsigned = neg_one > const_zero;
 
3766
#if PY_VERSION_HEX < 0x03000000
 
3767
    if (likely(PyInt_Check(x))) {
 
3768
        long val = PyInt_AS_LONG(x);
 
3769
        if (is_unsigned && unlikely(val < 0)) {
 
3770
            PyErr_SetString(PyExc_OverflowError,
 
3771
                            "can't convert negative value to long");
 
3772
            return (long)-1;
 
3773
        }
 
3774
        return (long)val;
 
3775
    } else
 
3776
#endif
 
3777
    if (likely(PyLong_Check(x))) {
 
3778
        if (is_unsigned) {
 
3779
            if (unlikely(Py_SIZE(x) < 0)) {
 
3780
                PyErr_SetString(PyExc_OverflowError,
 
3781
                                "can't convert negative value to long");
 
3782
                return (long)-1;
 
3783
            }
 
3784
            return PyLong_AsUnsignedLong(x);
 
3785
        } else {
 
3786
            return PyLong_AsLong(x);
 
3787
        }
 
3788
    } else {
 
3789
        long val;
 
3790
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
3791
        if (!tmp) return (long)-1;
 
3792
        val = __Pyx_PyInt_AsLong(tmp);
 
3793
        Py_DECREF(tmp);
 
3794
        return val;
 
3795
    }
 
3796
}
 
3797
 
 
3798
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
 
3799
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
 
3800
    const int is_unsigned = neg_one > const_zero;
 
3801
#if PY_VERSION_HEX < 0x03000000
 
3802
    if (likely(PyInt_Check(x))) {
 
3803
        long val = PyInt_AS_LONG(x);
 
3804
        if (is_unsigned && unlikely(val < 0)) {
 
3805
            PyErr_SetString(PyExc_OverflowError,
 
3806
                            "can't convert negative value to PY_LONG_LONG");
 
3807
            return (PY_LONG_LONG)-1;
 
3808
        }
 
3809
        return (PY_LONG_LONG)val;
 
3810
    } else
 
3811
#endif
 
3812
    if (likely(PyLong_Check(x))) {
 
3813
        if (is_unsigned) {
 
3814
            if (unlikely(Py_SIZE(x) < 0)) {
 
3815
                PyErr_SetString(PyExc_OverflowError,
 
3816
                                "can't convert negative value to PY_LONG_LONG");
 
3817
                return (PY_LONG_LONG)-1;
 
3818
            }
 
3819
            return PyLong_AsUnsignedLongLong(x);
 
3820
        } else {
 
3821
            return PyLong_AsLongLong(x);
 
3822
        }
 
3823
    } else {
 
3824
        PY_LONG_LONG val;
 
3825
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
3826
        if (!tmp) return (PY_LONG_LONG)-1;
 
3827
        val = __Pyx_PyInt_AsLongLong(tmp);
 
3828
        Py_DECREF(tmp);
 
3829
        return val;
 
3830
    }
 
3831
}
 
3832
 
 
3833
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
 
3834
    const signed long neg_one = (signed long)-1, const_zero = 0;
 
3835
    const int is_unsigned = neg_one > const_zero;
 
3836
#if PY_VERSION_HEX < 0x03000000
 
3837
    if (likely(PyInt_Check(x))) {
 
3838
        long val = PyInt_AS_LONG(x);
 
3839
        if (is_unsigned && unlikely(val < 0)) {
 
3840
            PyErr_SetString(PyExc_OverflowError,
 
3841
                            "can't convert negative value to signed long");
 
3842
            return (signed long)-1;
 
3843
        }
 
3844
        return (signed long)val;
 
3845
    } else
 
3846
#endif
 
3847
    if (likely(PyLong_Check(x))) {
 
3848
        if (is_unsigned) {
 
3849
            if (unlikely(Py_SIZE(x) < 0)) {
 
3850
                PyErr_SetString(PyExc_OverflowError,
 
3851
                                "can't convert negative value to signed long");
 
3852
                return (signed long)-1;
 
3853
            }
 
3854
            return PyLong_AsUnsignedLong(x);
 
3855
        } else {
 
3856
            return PyLong_AsLong(x);
 
3857
        }
 
3858
    } else {
 
3859
        signed long val;
 
3860
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
3861
        if (!tmp) return (signed long)-1;
 
3862
        val = __Pyx_PyInt_AsSignedLong(tmp);
 
3863
        Py_DECREF(tmp);
 
3864
        return val;
 
3865
    }
 
3866
}
 
3867
 
 
3868
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
 
3869
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
 
3870
    const int is_unsigned = neg_one > const_zero;
 
3871
#if PY_VERSION_HEX < 0x03000000
 
3872
    if (likely(PyInt_Check(x))) {
 
3873
        long val = PyInt_AS_LONG(x);
 
3874
        if (is_unsigned && unlikely(val < 0)) {
 
3875
            PyErr_SetString(PyExc_OverflowError,
 
3876
                            "can't convert negative value to signed PY_LONG_LONG");
 
3877
            return (signed PY_LONG_LONG)-1;
 
3878
        }
 
3879
        return (signed PY_LONG_LONG)val;
 
3880
    } else
 
3881
#endif
 
3882
    if (likely(PyLong_Check(x))) {
 
3883
        if (is_unsigned) {
 
3884
            if (unlikely(Py_SIZE(x) < 0)) {
 
3885
                PyErr_SetString(PyExc_OverflowError,
 
3886
                                "can't convert negative value to signed PY_LONG_LONG");
 
3887
                return (signed PY_LONG_LONG)-1;
 
3888
            }
 
3889
            return PyLong_AsUnsignedLongLong(x);
 
3890
        } else {
 
3891
            return PyLong_AsLongLong(x);
 
3892
        }
 
3893
    } else {
 
3894
        signed PY_LONG_LONG val;
 
3895
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
3896
        if (!tmp) return (signed PY_LONG_LONG)-1;
 
3897
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
 
3898
        Py_DECREF(tmp);
 
3899
        return val;
 
3900
    }
 
3901
}
 
3902
 
1443
3903
#include "compile.h"
1444
3904
#include "frameobject.h"
1445
3905
#include "traceback.h"
1446
3906
 
1447
 
static void __Pyx_AddTraceback(char *funcname) {
 
3907
static void __Pyx_AddTraceback(const char *funcname) {
1448
3908
    PyObject *py_srcfile = 0;
1449
3909
    PyObject *py_funcname = 0;
1450
3910
    PyObject *py_globals = 0;
1451
 
    PyObject *empty_tuple = 0;
1452
 
    PyObject *empty_string = 0;
1453
3911
    PyCodeObject *py_code = 0;
1454
3912
    PyFrameObject *py_frame = 0;
1455
 
    
 
3913
 
 
3914
    #if PY_MAJOR_VERSION < 3
1456
3915
    py_srcfile = PyString_FromString(__pyx_filename);
 
3916
    #else
 
3917
    py_srcfile = PyUnicode_FromString(__pyx_filename);
 
3918
    #endif
1457
3919
    if (!py_srcfile) goto bad;
1458
 
    py_funcname = PyString_FromString(funcname);
 
3920
    if (__pyx_clineno) {
 
3921
        #if PY_MAJOR_VERSION < 3
 
3922
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
 
3923
        #else
 
3924
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
 
3925
        #endif
 
3926
    }
 
3927
    else {
 
3928
        #if PY_MAJOR_VERSION < 3
 
3929
        py_funcname = PyString_FromString(funcname);
 
3930
        #else
 
3931
        py_funcname = PyUnicode_FromString(funcname);
 
3932
        #endif
 
3933
    }
1459
3934
    if (!py_funcname) goto bad;
1460
3935
    py_globals = PyModule_GetDict(__pyx_m);
1461
3936
    if (!py_globals) goto bad;
1462
 
    empty_tuple = PyTuple_New(0);
1463
 
    if (!empty_tuple) goto bad;
1464
 
    empty_string = PyString_FromString("");
1465
 
    if (!empty_string) goto bad;
1466
3937
    py_code = PyCode_New(
1467
3938
        0,            /*int argcount,*/
 
3939
        #if PY_MAJOR_VERSION >= 3
 
3940
        0,            /*int kwonlyargcount,*/
 
3941
        #endif
1468
3942
        0,            /*int nlocals,*/
1469
3943
        0,            /*int stacksize,*/
1470
3944
        0,            /*int flags,*/
1471
 
        empty_string, /*PyObject *code,*/
1472
 
        empty_tuple,  /*PyObject *consts,*/
1473
 
        empty_tuple,  /*PyObject *names,*/
1474
 
        empty_tuple,  /*PyObject *varnames,*/
1475
 
        empty_tuple,  /*PyObject *freevars,*/
1476
 
        empty_tuple,  /*PyObject *cellvars,*/
 
3945
        __pyx_empty_bytes, /*PyObject *code,*/
 
3946
        __pyx_empty_tuple,  /*PyObject *consts,*/
 
3947
        __pyx_empty_tuple,  /*PyObject *names,*/
 
3948
        __pyx_empty_tuple,  /*PyObject *varnames,*/
 
3949
        __pyx_empty_tuple,  /*PyObject *freevars,*/
 
3950
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
1477
3951
        py_srcfile,   /*PyObject *filename,*/
1478
3952
        py_funcname,  /*PyObject *name,*/
1479
3953
        __pyx_lineno,   /*int firstlineno,*/
1480
 
        empty_string  /*PyObject *lnotab*/
 
3954
        __pyx_empty_bytes  /*PyObject *lnotab*/
1481
3955
    );
1482
3956
    if (!py_code) goto bad;
1483
3957
    py_frame = PyFrame_New(
1484
 
        PyThreadState_Get(), /*PyThreadState *tstate,*/
 
3958
        PyThreadState_GET(), /*PyThreadState *tstate,*/
1485
3959
        py_code,             /*PyCodeObject *code,*/
1486
3960
        py_globals,          /*PyObject *globals,*/
1487
3961
        0                    /*PyObject *locals*/
1492
3966
bad:
1493
3967
    Py_XDECREF(py_srcfile);
1494
3968
    Py_XDECREF(py_funcname);
1495
 
    Py_XDECREF(empty_tuple);
1496
 
    Py_XDECREF(empty_string);
1497
3969
    Py_XDECREF(py_code);
1498
3970
    Py_XDECREF(py_frame);
1499
3971
}
 
3972
 
 
3973
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
 
3974
    while (t->p) {
 
3975
        #if PY_MAJOR_VERSION < 3
 
3976
        if (t->is_unicode) {
 
3977
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
 
3978
        } else if (t->intern) {
 
3979
            *t->p = PyString_InternFromString(t->s);
 
3980
        } else {
 
3981
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
 
3982
        }
 
3983
        #else  /* Python 3+ has unicode identifiers */
 
3984
        if (t->is_unicode | t->is_str) {
 
3985
            if (t->intern) {
 
3986
                *t->p = PyUnicode_InternFromString(t->s);
 
3987
            } else if (t->encoding) {
 
3988
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
 
3989
            } else {
 
3990
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
 
3991
            }
 
3992
        } else {
 
3993
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
 
3994
        }
 
3995
        #endif
 
3996
        if (!*t->p)
 
3997
            return -1;
 
3998
        ++t;
 
3999
    }
 
4000
    return 0;
 
4001
}
 
4002
 
 
4003
/* Type Conversion Functions */
 
4004
 
 
4005
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
 
4006
   int is_true = x == Py_True;
 
4007
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
 
4008
   else return PyObject_IsTrue(x);
 
4009
}
 
4010
 
 
4011
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
 
4012
  PyNumberMethods *m;
 
4013
  const char *name = NULL;
 
4014
  PyObject *res = NULL;
 
4015
#if PY_VERSION_HEX < 0x03000000
 
4016
  if (PyInt_Check(x) || PyLong_Check(x))
 
4017
#else
 
4018
  if (PyLong_Check(x))
 
4019
#endif
 
4020
    return Py_INCREF(x), x;
 
4021
  m = Py_TYPE(x)->tp_as_number;
 
4022
#if PY_VERSION_HEX < 0x03000000
 
4023
  if (m && m->nb_int) {
 
4024
    name = "int";
 
4025
    res = PyNumber_Int(x);
 
4026
  }
 
4027
  else if (m && m->nb_long) {
 
4028
    name = "long";
 
4029
    res = PyNumber_Long(x);
 
4030
  }
 
4031
#else
 
4032
  if (m && m->nb_int) {
 
4033
    name = "int";
 
4034
    res = PyNumber_Long(x);
 
4035
  }
 
4036
#endif
 
4037
  if (res) {
 
4038
#if PY_VERSION_HEX < 0x03000000
 
4039
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
 
4040
#else
 
4041
    if (!PyLong_Check(res)) {
 
4042
#endif
 
4043
      PyErr_Format(PyExc_TypeError,
 
4044
                   "__%s__ returned non-%s (type %.200s)",
 
4045
                   name, name, Py_TYPE(res)->tp_name);
 
4046
      Py_DECREF(res);
 
4047
      return NULL;
 
4048
    }
 
4049
  }
 
4050
  else if (!PyErr_Occurred()) {
 
4051
    PyErr_SetString(PyExc_TypeError,
 
4052
                    "an integer is required");
 
4053
  }
 
4054
  return res;
 
4055
}
 
4056
 
 
4057
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
 
4058
  Py_ssize_t ival;
 
4059
  PyObject* x = PyNumber_Index(b);
 
4060
  if (!x) return -1;
 
4061
  ival = PyInt_AsSsize_t(x);
 
4062
  Py_DECREF(x);
 
4063
  return ival;
 
4064
}
 
4065
 
 
4066
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
 
4067
#if PY_VERSION_HEX < 0x02050000
 
4068
   if (ival <= LONG_MAX)
 
4069
       return PyInt_FromLong((long)ival);
 
4070
   else {
 
4071
       unsigned char *bytes = (unsigned char *) &ival;
 
4072
       int one = 1; int little = (int)*(unsigned char*)&one;
 
4073
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
 
4074
   }
 
4075
#else
 
4076
   return PyInt_FromSize_t(ival);
 
4077
#endif
 
4078
}
 
4079
 
 
4080
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
 
4081
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
 
4082
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
 
4083
       return (size_t)-1;
 
4084
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
 
4085
       PyErr_SetString(PyExc_OverflowError,
 
4086
                       "value too large to convert to size_t");
 
4087
       return (size_t)-1;
 
4088
   }
 
4089
   return (size_t)val;
 
4090
}
 
4091
 
 
4092
 
 
4093
#endif /* Py_PYTHON_H */